AgentSkillsCN

reset

重置工作流相关工件(.otto/ 目录)。清除文档、会话、任务及规格说明等文件。适合在需要重新起步时使用。此操作具有破坏性,需经确认后方可执行。

SKILL.md
--- frontmatter
name: reset
description: Resets workflow artifacts (.otto/ directory). Removes docs, sessions, tasks, and specs. Use when starting over. Destructive - requires confirmation.
model: opus
model-invokable: false
arguments:
  - name: targets
    description: "Subdirectories to clear: tasks, specs, docs, sessions, or all (default: all)"
    required: false

Reset workflow data. Selectively or fully clears the .otto/ directory.

Available Targets

TargetDirectoryContents
tasks.otto/tasks/Task lists
specs.otto/specs/Specifications
docs.otto/docs/Changelogs
sessions.otto/sessions/Browser sessions
all.otto/Everything (default)

Usage Examples

  • /reset - Clear everything (prompts for confirmation)
  • /reset tasks - Clear only task lists
  • /reset specs tasks - Clear specs and tasks
  • /reset sessions - Clear browser sessions only
  • /reset all - Explicit full reset

Workflow

1. Check for .otto/

bash
if [[ ! -d ".otto" ]]; then
  echo "No .otto/ directory found. Nothing to reset."
  exit 0
fi

If no .otto/ exists, report and stop.

2. Parse Arguments

Map targets to directories:

code
tasks    -> .otto/tasks/
specs    -> .otto/specs/
docs     -> .otto/docs/
sessions -> .otto/sessions/
all      -> .otto/

If no arguments or all specified, target entire .otto/ directory.

3. Kill Active Processes (if sessions targeted or all)

bash
for pid_file in .otto/sessions/*/browser.pid .otto/otto/sessions/*/browser.pid; do
  [ -f "$pid_file" ] && kill $(cat "$pid_file") 2>/dev/null || true
done

4. Preview Removal

Show what will be removed with sizes:

bash
du -sh <target_dirs> 2>/dev/null

Display to user:

code
Will remove:
  .otto/tasks/ (4K)
  .otto/specs/ (8K)

5. Confirm

Use AskUserQuestion:

"This will delete the selected workflow data. Continue?" Options: "Yes, reset" / "Cancel"

6. Remove

After confirmation, remove only the targeted directories:

bash
rm -rf <target_dirs>

For all, remove entire .otto/:

bash
rm -rf .otto

7. Report

code
Reset complete. Cleared: tasks, specs
Run /otto or /spec to continue.