/ai-cli-task plan — Plan Generation & Annotation Review
Two modes: generate an implementation plan from .target.md, or process annotations from the Plan panel.
Usage
# Generate mode (no annotations) /ai-cli-task plan <task_module> --generate # Annotation mode (with annotation file) /ai-cli-task plan <task_file_path> <annotation_file_path> [--silent]
Mode A: Generate (no annotations)
When called without annotation_file or with --generate:
- •Read
.target.mdfor requirements - •Determine task type: Analyze
.target.mdcontent to identify the task domain (see Task-Type-Aware Planning below). Validate type value matches[a-zA-Z0-9_:-]+. Settypefield in.index.md - •Read
.summary.mdif exists (condensed context from prior runs — primary context source) - •Read
.analysis/latest file only if exists (address check feedback from NEEDS_REVISION) - •Read
.bugfix/latest file only if exists (address most recent mid-exec issue from REPLAN) - •Read
.test/latest criteria and results files if exists (incorporate lessons learned) - •Read
AiTasks/.experience/<type>.mdif exists — cross-task experience from completed tasks of the same domain type (lessons learned, patterns, tool choices) - •Read project codebase for context (relevant files, CLAUDE.md conventions)
- •Read
.notes/latest file only if exists (prior research findings and experience) - •Research domain best practices: Based on the determined task type, use shell commands (curl, web search, npm info, etc.) to find established methodologies, tools, and patterns for that domain. Do not rely solely on internal knowledge
- •If re-planning (status is
re-planningorreview/executingtransitioning to re-plan): archive existing user plan files — rename each non-dot.mdfile in the module to dot-prefixed (e.g.,plan.md→.plan-superseded.md). This preventsexecfrom reading outdated steps alongside the new plan - •Generate implementation plan using domain-appropriate methodology (incorporating check feedback, bugfix history, prior notes, cross-task experience, and researched best practices)
- •Write plan to a new
.mdfile in the task module (e.g.,plan.md) - •Write
.test/<YYYY-MM-DD>-plan-criteria.mdwith domain-appropriate verification criteria: acceptance criteria from.target.md+ per-step test cases using methods standard in the task domain. On re-plan, write.test/<YYYY-MM-DD>-replan-criteria.mdincorporating lessons from previous.test/results files - •Update
.test/summary.md— overwrite with condensed summary of ALL criteria & results files in.test/ - •Create
.notes/<YYYY-MM-DD>-<summary>-plan.mdwith research findings and key decisions - •Update
.notes/summary.md— overwrite with condensed summary of ALL notes files in.notes/ - •Write task-level
.summary.mdwith condensed context: plan overview, key decisions, requirements summary, known constraints (integrate from directory summaries) - •Update
.index.md: settypefield (if not already set or if task nature changed), status →planning(fromdraft/planning/blocked) orre-planning(fromreview/executing/re-planning), update timestamp. If the new status isre-planning, setphase: needs-check. For all other new statuses, clearphaseto"". Resetcompleted_stepsto0(new/revised plan invalidates prior progress) - •Git commit:
-- ai-cli-task(<module>):plan generate implementation plan - •Write
.auto-signal:{ step: "plan", result: "(generated)", next: "check", checkpoint: "post-plan" } - •Report plan summary to user
Context management: When .summary.md exists, read it as the primary context source instead of reading all files from .analysis/, .bugfix/, .notes/. Only read the latest (last by filename sort) file from each directory for detailed info on the most recent assessment/issue/note.
Mode B: Annotation (with annotation_file)
Process .tmp-annotations.json from the Plan panel. Supports 4 annotation types: Insert, Delete, Replace, Comment. Each is triaged for cross-impact and conflict before execution.
See
references/annotation-processing.mdfor the full annotation file format, processing logic (triage rules, cross-impact assessment, conflict detection), and execution report format.
Annotation Execution Steps
- •Read the task file at the given absolute path
- •Read
.index.md— validate status is notcompleteorcancelled. If either, REJECT with error: tasks in terminal status cannot be modified - •Read the annotation file (
.tmp-annotations.json) - •Read
.target.md+ sibling plan files +.test/(latest criteria) for full context - •Parse all annotation arrays
- •Triage each annotation by type and condition
- •Assess cross-impacts and conflicts against ALL files in the module
- •Execute changes per severity level
- •Update the task file with resolved changes and inline markers for pending items
- •Update
.index.mdin the task module:- •Update
statusper State Transitions table:draft→planning,review/executing→re-planning,blocked→planning, others keep current - •If status transitions to
re-planning, setphase: needs-check - •Update
updatedtimestamp
- •Update
- •Write
.summary.mdwith condensed context reflecting annotation changes - •Clean up the
.tmp-annotations.jsonfile (delete after processing) - •Git commit:
-- ai-cli-task(<module>):plan annotations processed - •Write
.auto-signal:{ step: "plan", result: "(annotations)", next: "check", checkpoint: "post-plan" } - •Generate execution report (print to screen or append to file per mode)
State Transitions
| Current Status | After Plan | Condition |
|---|---|---|
draft | planning | First annotation processing |
planning | planning | Additional annotations |
review | re-planning | Revisions after assessment |
executing | re-planning | Mid-execution changes |
re-planning | re-planning | Further revisions |
blocked | planning | Unblocking changes |
complete | REJECT | Completed tasks cannot be re-planned |
cancelled | REJECT | Cancelled tasks cannot be re-planned |
Git
- •Generate mode:
-- ai-cli-task(<module>):plan generate implementation plan - •Annotation mode:
-- ai-cli-task(<module>):plan annotations processed
.auto-signal
Both modes write .auto-signal on completion:
| Mode | Signal |
|---|---|
| Generate | { "step": "plan", "result": "(generated)", "next": "check", "checkpoint": "post-plan", "timestamp": "..." } |
| Annotation | { "step": "plan", "result": "(annotations)", "next": "check", "checkpoint": "post-plan", "timestamp": "..." } |
Task-Type-Aware Planning
Plan methodology MUST adapt to the task domain. Different domains require different design approaches, tool choices, and milestones.
See
references/task-type-planning.mdfor the full domain planning table, type determination rules, and requirements.
Notes
- •The
.tmp-annotations.jsonis ephemeral — created by frontend, consumed and deleted by this skill - •All plan research should consider the full context of the task module (read
.target.mdand sibling plan files) - •When researching implementation plans, use the project codebase as context (read relevant project files)
- •Cross-impact assessment should check ALL files in the task module, not just the current file
- •No mental math: When planning involves calculations (performance estimates, size limits, capacity, etc.), write a script and run it in shell instead of computing mentally
- •Evidence-based decisions: Actively use shell commands to fetch external information (curl docs/APIs, npm info, package changelogs, GitHub issues, etc.) to support planning decisions with evidence rather than relying solely on internal knowledge
- •Concurrency: Plan acquires
AiTasks/<module>/.lockbefore proceeding and releases on completion (see Concurrency Protection incommands/ai-cli-task.md) - •Task-type-aware test design:
.test/criteria must use domain-appropriate verification methods (e.g., unit tests for code, SSIM/PSNR for image processing, SNR for audio/DSP, schema validation for data pipelines). Research established best practices for the task domain before writing test criteria. Seecheck/SKILL.mdTask-Type-Aware Verification section for the full domain reference table