/ar:planrefinefrom ar
Critiques an existing plan against actual code, records a change ledger, and iterates until no new material issues remain. Invoked via 'refine the plan', 'critique the plan', or '/ar:planrefine'.
Ships in ar. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The user's request is the task description for everything below.
EnterPlanMode and ExitPlanMode where this skill instructs; ExitPlanMode is the approval boundary.EnterPlanMode or ExitPlanMode on Pi because Pi exposes neither tool. Write or refine the durable plan note directly, report its exact path for approval, and after approval start execution with /ar planprocess <path>.TaskCreate/TaskUpdate; Pi and Prime use those tools only when the autorun extension registered them; Codex uses the flat update_plan checklist only when exposed (update_plan is unavailable in Codex Plan mode). If no native task mutation tool is available, keep progress in the durable Markdown checklist, do not call or retry an unavailable task tool, and report that native task state was not updated. Every unqualified TaskCreate, TaskUpdate, dependency, and TaskList instruction below is conditional on those capabilities.If this session was compacted, these rules STILL apply without exception:
TaskUpdate(status="in_progress"). When done, TaskUpdate(status="completed").| Acronym | Meaning | Question to Ask |
|---|---|---|
| TDD | Test-Driven Development | Tests written first? Location specified? |
| DRY | Don't Repeat Yourself | No code duplication? Reusing utilities? |
| OODA | Observe-Orient-Decide-Act | Cycle followed before each decision? |
| KISS | Keep It Simple | Simplest solution that works? |
| YAGNI | You Aren't Gonna Need It | No premature optimization? |
| SOLID | Single responsibility, Open/closed, Liskov, Interface segregation, Dependency inversion | Each principle addressed? |
| RAII | Resource Acquisition Is Initialization | Resources properly managed? |
| WOLOG | Without Loss Of Generality | Solution generalizes appropriately? |
All outputs should include where applicable:
/path/to/file.ts or ./relative/path.tsfile.ts:42-56handleRequest() in handler.ts:15-28"socket hang up (ECONNRESET)"npm test -- --grep "auth"Claude Code only: If not already in plan mode, use EnterPlanMode now. Pi: remain in the current mode and write the durable plan note directly.
STOP. Before writing one word of plan content, complete ALL steps below. Do not skip. Do not defer.
Step A — Establish the planning boundary: On Claude Code, call EnterPlanMode if needed. On Pi, do not call a plan-mode tool; use the durable plan note.
Step B — Record ALL user instructions as a numbered list at the top of the plan file. Every distinct message must appear with sub-items for context if necessary:
## User Messages (exact quotes, in order)
1. "first message the user sent"
- Context: what prompted this; what was happening at the time
2. "second message — a correction or clarification"
- Context: what changed from the previous message
Include EVERY distinct user message that shaped this plan. Do not summarize or merge messages.
Step C — Create [PLANNING] tasks for EVERY step AND substep via TaskCreate:
TaskCreate(subject="[PLANNING] Step N: [name]", activeForm="Planning [name]...")TaskCreate(subject="[PLANNING] Step N.M: [substep]", activeForm="Planning [substep]...")TaskCreate(subject="[PLANNING] Req: [distinct-requirement]") for each requirementTaskUpdate(taskId=N, addBlockedBy=[N-1]) for sequential stepsStep D — Verify: Call TaskList and confirm ALL [PLANNING] tasks visible before continuing.
Step E — Track Progress:
TaskUpdate(taskId, status="in_progress")TaskUpdate(taskId, status="completed")You are refining an EXISTING plan with deep critique and mandatory code verification. Do NOT execute code changes until plan approved.
Prohibited:
Required:
When editing the plan file:
old_string must be ≤ 5 lines maximumAfter any plan file edit, output the verification line:
[Edit verified: was N lines, now M lines — no content lost]
Every proposed change to any file MUST include:
**BEFORE** (`file.ext:line-start`–`line-end`):
[exact current text from file — no paraphrasing]
**AFTER:**
[exact new text with change applied]
**Justification:** [why this change is needed, with evidence]
PERSISTENT RULE: After EVERY step AND substep of your plan (both during creation and execution), you must output the exact string "Wait," then execute §5 Wait Process "out loud" step by step and substep by substep.
List expertise areas needed. Act as expert. Output in plan: State expertise explicitly.
For each expertise area separately, write:
Output in plan under "## Best Practices" as numbered list.
List from existing plan:
Use Task tool to launch parallel Explore subagents (up to 3) to:
CRITICAL - Verify Subagent Findings:
For EACH code reference in plan:
Output Format:
Plan says: "Add validation to processRequest()"
Actual at src/handler.ts:42-58: Function is `handleRequest`, not `processRequest`
Recommendation: Use correct function name, extend existing validation at :44-48
For each section, output headers "PASS 1:", "PASS 2:", "PASS 3:", evaluating:
After completing each pass, you MUST output the completion marker (exactly this format):
[PASS N COMPLETE: found X issues, Y corrections made]
Only proceed to §7 after outputting a pass marker with 0 issues found ([PASS 3 COMPLETE: found 0 issues, 0 corrections made] at the earliest).
If Pass 3 finds issues, run Pass 4 and continue until a pass finds 0 new issues.
Do NOT summarize or skip passes — each pass must produce output.
Use Task tool with Plan subagent to evaluate alternative approaches discovered during verification.
Trace logic flow through the description. Show data/control flow.
Quote actual code with file:line-range references. No paraphrasing.
Critique overall + line-by-line against ALL best practices (§1.1) and quality standards (§1.3).
Propose ≥3 distinct solutions to each issue. Choose best with compelling justification.
Rank refinements. Output as tracked changes showing before/after.
Each thread of updates (different approaches/solutions being refined) needs a unique name with incrementing version number (<taskname>-v1, <taskname>-v2, ...). This enables referencing specific iterations: "In auth-solution-v2 we tried X, but auth-solution-v3 uses Y".
Verify ALL cases from the user's request:
Check your work. Do not hallucinate.
Verify all file references with Read tool
Confirm code examples are syntactically correct
Ensure no steps skipped (check TaskList)
If ANY case missing: Return to relevant step. Do NOT proceed incomplete.
After outputting "Wait," execute these 8 steps:
<output_contract>
// File: /path/to/file.ext
// Line: XX-YY (where this code goes)
// Purpose: Brief description
[actual code here - not pseudocode]
Requirement: Every implementation step needs ≥1 code block showing exact change.
</output_contract>
| Subagent Type | When to Use |
|---|---|
| Explore | Verify code references, find missed implementations, check patterns |
| Plan | Evaluate alternative approaches, consider tradeoffs |
| code-reviewer | Detailed code quality analysis of proposed changes (Claude Code pr-review-toolkit plugin, when installed) |
| code-explorer | Deep analysis of existing feature implementations (Claude Code feature-dev plugin, when installed) |
Parallel execution: Launch multiple in single message when tasks are independent.
<acceptance_protocol>
When the plan is ready for approval, use the harness-specific boundary above: Claude Code calls ExitPlanMode; Pi reports the durable note path and waits for explicit approval before /ar planprocess <path>.
Then transition to execution:
MANDATORY EXECUTION MODE (Goal and Capabilities)
THREE-STAGE COMPLETION SYSTEM - Execute all three stages during planning:
SYSTEM STOP SIGNALS - NEVER output unless condition met:
AUTORUN_STATE_PRESERVATION_EMERGENCY_STOP - Emergency stopAUTORUN_ALL_TASKS_COMPLETED_AND_VERIFIED_SUCCESSFULLY - Stage 3 doneSafety Protocol: Execute ONLY IF task involves high-risk or irreversible destructive actions (e.g., database operations, file deletion, state modification).
CRITICAL ESCAPE TO STOP SYSTEM: Only if irreversible, catastrophic, or cannot be mitigated, immediately output exact string to halt all actions: AUTORUN_STATE_PRESERVATION_EMERGENCY_STOP
</acceptance_protocol>
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub ahundt/autorun --plugin ar7 skills in this plugin
/commitUse before writing any git commit message or reviewing one, and when the user asks for "commit requirements", "commit message guidelines", or "/ar:commit". Carries the 17-step pre-commit analysis, the concrete-subject rules that ban vague verbs and session-internal jargon, and the checks that keep a message reviewable from the repository alone./philosophyUse when the user asks for the "system design philosophy", "design principles", or "/ar:philosophy", and before major feature work, an architecture decision, or a pull-request review. Lists the 17 universal system design principles, ordered from most fundamental to most specific, with concrete examples where a principle is easy to misread./plannewUse when the user asks to "make a plan", "plan this out", or "/ar:plannew", or starts multi-step work that needs tracked steps. Creates a structured plan with checkbox steps, the evidence each step must produce, and the wait process between them./planprocessUse when the user asks to "execute the plan", "run the plan", or "/ar:planprocess". Executes an approved plan step by step with the wait process, task tracking, and verification before each completion claim./planupdateUse when the user asks to "update the plan", "sync the plan with the code", or "/ar:planupdate". Reconciles an existing plan with the current codebase and marks what already shipped./tmuxList the AI coding sessions running in your tmux windows and send text to the ones you choose. Use when asked "which sessions are waiting", "list my agent sessions", "what is running in my tmux windows", "continue the waiting sessions", "send this to session B", or "/ar:tmux". Finds Claude Code, Codex, Pi, Prime Agent, Antigravity, Gemini CLI, Qwen Code, OpenCode and ForgeCode panes.Other plugins' skills for the same job