plan
Skill3 starsChanged 30 days agoMITView on GitHub
Plan implementations, record architecture decisions, and scaffold boilerplate, with subcommands plan (default), adr, and scaffold. Creates spec folders, manages ADRs, and generates files from existing project patterns. Use when user says "plan this", "how should I implement", "design this feature", "create an ADR", "scaffold a service", "architecture decision", or needs to think through an approach before coding. For code review, use /review; for shipping, use /ship; for running tests, use /test.
184 other projects use a version of this.
Adopted by
Most recently taken up by
- phuthuycoding/kanban-flowtheir own version, first seen Nov 8, 2026
- PeanutGT/NutsSkillstheir own version, first seen Nov 8, 2026
- domengabrovsek/agent-configtheir own version, first seen Nov 8, 2026
- domengabrovsek/claudetheir own version, first seen Nov 8, 2026
- codewithmukesh/dotnet-claude-kittheir own version, first seen Nov 8, 2026
- joeldevz/skynex-pitheir own version, first seen Nov 8, 2026
Used with
Projects with it also use heartmula, webhook-subscriptions and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
math-incSkillheartmula
Set up and run HeartMuLa, the open-source music generation model family (Suno-like). Generates full songs from lyrics + tags with multilingual support.
Also in 9 projects that use this
Tommy-ywSkillwebhook-subscriptions
Create and manage webhook subscriptions for event-driven agent activation, or for direct push notifications (zero LLM cost). Use when the user wants external services to trigger agent runs OR push notifications to chats.
Also in 5 projects that use this
math-incSkillminecraft-modpack-server
Set up a modded Minecraft server from a CurseForge/Modrinth server pack zip. Covers NeoForge/Forge install, Java version, JVM tuning, firewall, LAN config, backups, and launch scripts.
Also in 5 projects that use this
john-data-chenSkilltouchdesigner-mcp
Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.
Also in 6 projects that use this
gaebalaiSkillcodex-system
PROACTIVELY consult Codex CLI, your highly capable supporter with exceptional reasoning and task completion abilities. Codex is a trusted expert you should ALWAYS consult BEFORE making decisions on: design choices, implementation approaches, debugging strategies, refactoring plans, or any non-trivial problem. When uncertain, consult Codex. Don't hesitate - Codex provides better analysis. Explicit triggers: "think deeper", "analyze", "second opinion", "consult codex".
Also in 3 projects that use this
ibahgatSkillcontext-optimize
Improve context efficiency and cache stability for long or complex sessions.
Also in 3 projects that use this
- +3 more from math-inc
Other versions184 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 184
- Yeachan-Heo/oh-my-codex★ 34ksame name
- crbnos/carbon★ 2.8ksame name
- graphistry/pygraphistry★ 2.6ksame name
- zereight/gitlab-mcp★ 2.1ksame name
- math-inc/OpenGauss★ 1.3ksame name
- kdlbs/kandev★ 1.1ksame name
- suboss87/FDEOps★ 940same name
- codewithmukesh/dotnet-claude-kit★ 808same name
- witnesstodark/mr-mak-workspace★ 718same name
- loongclaw-ai/loongclaw★ 640same name
174 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository42 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- asideSkill
- assessmentSkill
- auditSkill
- benchmarkSkill
- brainSkill
- checkpointSkill
- cleanupSkill
- concise-modeSkill
- cross-modelSkill
- deploySkill
- designSkill
- explainSkill
- fix-issueSkill
- ganSkill
- guardSkill
- hotfixSkill
- incidentSkill
- infraSkill
- interview-meSkill
- investigateSkill
- migrateSkill
- module-auditSkill
- morningSkill
- onboardSkill
- profileSkill
- pr-summarySkill
- readmeSkill
- refactorSkill
- researchSkill
- resolveSkill
- respondSkill
- retroSkill
- reviewSkill
- session-logSkill
- setupSkill
- shipSkill
- skill-newSkill
- spikeSkill
- tddSkill
- testSkill
- zoom-outSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
55 rules. 0 are common, 38 are distinctive, and 17 are very specific to this project.
0
Common
Most of the 167 edited versions we read keep these.
38
Distinctive
This author's own choices. Worth a look.
17
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Before implementing a change that touches 3 or more files, crosses a module boundary, or carries a real trade-off.
- Distinctive: line 16
When a significant architecture decision needs a record, or an earlier ADR is being reversed.
- Distinctive: line 17
When new boilerplate has to match an existing project pattern exactly.
- Very specific: line 18
After a change is merged, to fold its spec delta into specs/current/ with /plan archive.
- Distinctive: line 24
Run the matching section. Each subcommand carries its own steps and rules, and the shared Rules at the end apply to all of them.
- Distinctive: line 39
If no subcommand is recognized, treat the argument as a plan description.
- Distinctive: line 49
Before implementing any feature touching 3+ files or involving architectural decisions.
- Distinctive: line 50
When evaluating multiple approaches.
- Distinctive: line 51
Before refactoring that changes module boundaries.
- Distinctive: line 55
No arguments: interactive planning mode.
- Distinctive: line 64
Before step 1, run a structured discovery session.
- Very specific: line 94
Context snapshot: Before anything else, write context.md in the spec folder:
- Very specific: line 143
Match relevant rules: Read rules/index.yml. Match top 3-5 rules by triggers.
- Very specific: line 148
Pivot trigger: when to switch to next-best alternative.
- Distinctive: line 173
Ready check: Before writing tasks, every requirement answers five questions:
- Distinctive: line 190
Every acceptance criterion names an observation that is false at the base commit.
- Very specific: line 214
Append mandatory closing gates: Every plan.md task breakdown must end with these two items, in this order, as the final tasks.
- Distinctive: line 220
Present plan: Wait for approval.
- Very specific: line 232
Never repeat failures: If an action failed, the next action must be different.
- Distinctive: line 242
When an approach fails during planning or research:
- Distinctive: line 244
Strike 1: Diagnose and fix: Read the error. Identify root cause.
- Distinctive: line 257
After the tasks in a plan folder are implemented, verified, and merged.
- Very specific: line 258
When /ship or /retro prompts to close out a change that has a specs/current/ delta.
- Very specific: line 262
No arguments: resolve the most recent plan folder under <root>/plans/, or the legacy specs/, that has an unmerged delta.
- Very specific: line 273
Stamp archived: Add an Archived: <YYYY-MM-DD> line to the plan folder's plan.md header.
- Distinctive: line 279
Never rewrite a whole spec.
- Distinctive: line 280
Never delete the plan folder.
- Distinctive: line 287
Create and manage Architecture Decision Records.
- Distinctive: line 291
After a non-trivial architecture decision.
- Distinctive: line 292
When changing or reversing a previous decision.
- Distinctive: line 297
No arguments: list existing ADRs.
- Very specific: line 327
When SECOND_BRAIN_VAULT resolves to a directory, offer to mirror a pointer note into wiki/decisions/.
- Very specific: line 351
After a /plan run, when the user has said the work will be tracked in issues.
- Distinctive: line 352
When handing off a plan to a teammate or queue.
- Very specific: line 356
No arguments: read the most recent plan folder under <root>/plans/, or the legacy specs/ or .claude/specs/.
- Very specific: line 364
Resolve spec folder: Default to the latest folder under <root>/plans/, then the legacy specs/ or .claude/specs/.
- Very specific: line 377
Never create issues from a --light plan with no task breakdown.
- Distinctive: line 378
Never invoke this subcommand on your own initiative, and never to record a finding from a review, a CI run, or a verification gate.
- Distinctive: line 379
Never push or commit. This subcommand only writes to the issue tracker.
- Distinctive: line 390
When new code must match existing style.
- Distinctive: line 403
Write files. Import each new export from its own module path.
- Distinctive: line 407
Always read existing code to derive patterns.
- Distinctive: line 408
Always present for approval before writing.
- Distinctive: line 410
Never generate without at least one example.
- Very specific: line 412
Keep generated code minimal: a skeleton with no comments, no TODO markers, and no barrel exports, per rules/code-style.md.
- Distinctive: line 434
Only the running Claude Code session writes to disk.
- Distinctive: line 452
Verify: Run formatter + linter + test suite.
- Distinctive: line 475
Every decision must document at least two alternatives.
- Distinctive: line 478
Search for existing work before designing new solutions.
- Very specific: line 492
Stop and re-read context.md and plan.md when a new phase starts or about 50 tool calls have passed since the last read.
- Very specific: line 493
Stop and write to references.md when two searches, reads, or browses have run since the last write.
- Distinctive: line 494
Stop and escalate with the attempt table when the third strike fails.
- Distinctive: line 495
Stop and reshape the task when it ships a single layer or carries an acceptance criterion already true at the base commit.
- Distinctive: line 496
Stop and present the plan for approval when implementation is about to start without one.
- Distinctive: line 502
Every file path the plan names exists on disk or is marked as a new file.
“Common” is measured: kept by at least 6 in 10 of the 167 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Overview
Unified planning skill for requirements gathering, architecture decisions, and code generation.
When to Use
- Before implementing a change that touches 3 or more files, crosses a module boundary, or carries a real trade-off.
- When a significant architecture decision needs a record, or an earlier ADR is being reversed.
- When new boilerplate has to match an existing project pattern exactly.
- After a change is merged, to fold its spec delta into
specs/current/with/plan archive. - For reviewing finished code, use
/review; for committing and opening the PR, use/ship; for running the suite, use/test; for a one-question throwaway prototype, use/spike.
Process
- Route the invocation with the table below. An unrecognized argument is a plan description.
- Run the matching section. Each subcommand carries its own steps and rules, and the shared Rules at the end apply to all of them.
Subcommand Routing
| Invocation | Action |
/plan or /plan <description> | Create implementation plan (default) |
/plan adr | List existing ADRs |
/plan adr new <title> | Create a new ADR |
/plan adr supersede <number> <title> | Supersede an existing ADR |
/plan scaffold <type> <name> | Generate boilerplate from project patterns |
/plan to-issues | Export the active spec folder's task breakdown to GitHub issues |
/plan multi-execute <task> | Plan and execute under a single-writer protocol with parallel model tiers |
/plan archive | Merge a completed change's spec delta into the living spec and stamp the plan folder archived |
If no subcommand is recognized, treat the argument as a plan description.
plan (default)
Gather requirements, search for existing solutions, evaluate trade-offs, and produce a structured implementation plan saved to a spec folder.
When to use
- Before implementing any feature touching 3+ files or involving architectural decisions.
- When evaluating multiple approaches.
- Before refactoring that changes module boundaries.
Arguments
- No arguments: interactive planning mode.
<description>: start planning with the given task.--light: abbreviated plan without references or trade-off analysis. Producesplan.mdonly.--resume: continue from the most recent spec folder.--discover: run a structured discovery session before planning (see Discovery Phase below).--auto: run discovery, scope review, and engineering review automatically. Surface only decisions that need human input. Skip interactive approval between phases.
Discovery Phase (when --discover or --auto is passed)
Before step 1, run a structured discovery session. Ask these six forcing questions, one at a time:
- Problem. What problem does this solve? Who has it today? How do they work around it?
- User. Who is the user? What is their workflow before and after this feature?
- Success. What does success look like? How will you measure it?
- Scope. What is the minimum viable scope? What can be deferred?
- Risk. What are the biggest risks? Technical, product, timeline.
- Alternatives. What existing solutions did you consider? Why are they insufficient?
Record the answers in the spec folder's decisions.md under a "Discovery" heading.
Optional research step. If the task touches a domain with active community discussion, public competitors, or external prior art, run /research <topic> and link the output in the spec folder's references.md. The research skill enforces entity resolution, citation discipline, and confidence scoring. This step is user-initiated, not automatic. Skip when the task is purely internal.
Scope Review (when --auto is passed, runs after discovery)
Challenge the scope with four lenses before proceeding to architecture:
| Lens | Question |
| Expansion | What is missing that users will expect? What adjacent features add outsized value? |
| Selective expansion | Which additions have the best effort-to-impact ratio? |
| Hold | Is the scope right as-is? Does every item justify its cost? |
| Reduction | What can be cut without losing core value? What is nice-to-have masquerading as must-have? |
Present the scope review findings. In --auto mode, only pause for user input if the review suggests changes. If the scope is clean across all four lenses, proceed.
Process
The steps below are enablers, not gates. Their order shows what becomes possible next, not a one-way waterfall. Discovery, scope review, alternatives, and the plan itself are revisitable at any time: if implementation reveals the design was wrong, reopen the relevant artifact and update it rather than forcing the original plan through. The dependencies exist so each step has the context the next one needs, not to lock the work.
Context snapshot. Before anything else, write
context.mdin the spec folder:# Context Snapshot **Created:** <YYYY-MM-DD HH:MM GMT> ## Task <Task statement from user input, verbatim> ## Desired Outcome <What success looks like, in one sentence> ## Known Facts - <Fact from user input or codebase> ## Constraints - <Time, tech, scope, or resource constraints> ## Unknowns - <Question that blocks implementation>: owner <named person or session>, needed by <task> ## Codebase Touchpoints - <Files or modules likely to change> ## Branch State - Branch: <current branch> - Recent commits: <last 3 commit subjects>This snapshot prevents context drift in long sessions. Re-read
context.mdat the start of each phase, steps 1, 5, 8. If the task has evolved, update the snapshot before continuing.When the complaint is about quality rather than a missing feature, diagnose the layer before proposing content. A report that output is weak in some dimension reads as a request for more guidance, and writing more guidance is usually the wrong fix. Ask when each existing layer fires relative to the moment the work is produced: always-on rules fire before, on-demand standards fire only on a trigger match, review checklists fire after the artifact exists, and mechanical hooks fire at write time. Guidance that only fires after the code is written cannot change the code. Compare the dimension the user is unhappy about against a dimension they are happy about, and the difference in enforcement timing is usually the whole finding. Record the comparison in
plan.mdso the approach section follows from evidence rather than from the topic list.- Clarify scope. One question at a time. What is being built? Expected outcome? Constraints? Skip if discovery phase already covered this.
Search for existing work. The tool ordering is mandatory; stop at first match:
- Local codebase:
rg -i "<keyword>", including file names. Coverskills/,agents/,rules/,standards/,hooks/when the new work could land in~/.claude/. - Open PRs:
GH_TOKEN=$(gh auth token --user <account>) gh pr list --search "<keywords>". - Recent branches:
git branch -a --list "*<keyword>*". - Closed PRs:
GH_TOKEN=$(gh auth token --user <account>) gh pr list --state closed --search "<keywords>". A closed PR often names a dead-end or a postponed approach. - GitHub code search:
GH_TOKEN=$(gh auth token --user <account>) gh search code "<keywords>" --language=<lang>. - Library docs:
llms.txtfirst, then official docs of the major library in the area. - Package registry:
pnpm search,pip index versions <name>or the PyPI page, since PyPI disabledpip search,cargo search,gem search. - Web search: last resort, only if 1-7 turned up nothing.
Anti-duplication gate for skills, agents, hooks, standards, rules. Before proposing a new file in
~/.claude/skills/,~/.claude/agents/,~/.claude/hooks/,~/.claude/standards/, or~/.claude/rules/, run steps 1-2 against~/.claude/and therules/index.ymlon-demand entries first. Prefer extending an existing file, new subcommand, new section, new mode, over creating a new one. Justify the new file in writing when no extension fits. Seerules/pre-flight.mdfor the full rule.- Local codebase:
- Gather references. Identify 2-5 files following patterns the new code should match. Read them. Note structure, naming, error handling, testing.
- Match relevant rules. Read
rules/index.yml. Match top 3-5 rules by triggers. Read them. - Evaluate alternatives. For non-trivial decisions, 2-3 approaches with trade-offs, risk level, and recommendation. For each:
- Decisive test: smallest experiment to confirm/invalidate.
- Stop signal: what result means the approach is wrong.
- Pivot trigger: when to switch to next-best alternative.
Present for approval. Suggest
/plan adr newfor significant decisions.
Create spec folder in the project workspace, per
rules/project-workspace.md. The root is<repo>/docs/or<repo>/.work/, resolved byhooks/_lib/project_workspace.py; the folder is never committed:<root>/plans/<YYYY-MM-DD>-<slug>/ plan.md (goal, approach, requirements, test seams, task breakdown, out of scope, risks, validation) decisions.md (context, options, chosen with reasoning) references.md (patterns, related work, applicable rules)For a non-trivial change,
plan.mdcarries a Requirements section before the task breakdown. Each requirement is one observable behavior stated with a normative keyword, and each carries at least one Given/When/Then scenario. Seerules/living-specs.mdfor the format andrules/normative-keywords.mdfor keyword strength. These requirements are the plan's acceptance criteria: each scenario maps to a row in the test traceability matrix (Gate 1) and feeds the 100% coverage gate. Thetest-scenario-generatoragent reads this section when present.## Requirements ### Requirement: <one observable behavior, one MUST/SHALL/SHOULD> #### Scenario: <names the case> - GIVEN <precondition> - WHEN <action> - THEN <expected, checkable outcome>Living-spec delta. When the change touches behavior already covered by a
specs/current/spec,plan.mdalso carries a delta section against that spec using## ADDED Requirements,## MODIFIED Requirements, and## REMOVED Requirements. Describe the diff, not the whole spec. If the project has nospecs/current/yet and the change is non-trivial, seed it with only the requirements this change establishes. Full delta discipline and the triviality boundary:rules/living-specs.md. This is the spec-level analogue ofrules/surgical-edits.md.Ready check. Before writing tasks, every requirement answers five questions:
- Value: who benefits, in one sentence.
- Acceptance: the observable condition that says it is done.
- Failure cases: what happens on invalid input and when a dependency fails, each with its own scenario.
- Access: who may trigger it, with a scenario for a caller who may not.
- Size: it fits one change; otherwise split it.
A requirement that cannot answer a question is split, or its question goes to Unknowns with a named owner. Fixing it live inside the breakdown hides the gap. Questions that do not change what gets built go to the owner and stay out of the plan.
Test seams. Agree the seams before writing tasks, and present them with the plan for approval. Prefer an existing seam to a new one, and pick the highest seam that can observe the behavior; the ideal count is one. A seam nobody agreed to surfaces later as a review finding, so settle it here.
Task breakdown. Every task is a vertical slice: a narrow path through every layer the change touches, schema, API, UI, and tests, that is demoable or verifiable alone and fits one fresh session. A task that ships one layer is a horizontal slice and cannot be verified until its siblings land, so rework it. Order and shape:
- Prefactoring comes first, as its own tasks: make the change easy, then make the easy change.
- Each task names what can be demoed after it, and a Blocked by list of the tasks that must finish before it starts, or
None. A task whose blockers are all done is on the frontier and can start. - Each task carries a Mode:
HITLwhen it needs a human decision or action, such as an architecture choice, a design review, or a credential, andAFKwhen an agent can finish and verify it alone. PreferAFK; split a mostly autonomous task so its human step becomes its ownHITLtask. An agent queue picks onlyAFKtasks, so it never stalls waiting on a person. - Every acceptance criterion names an observation that is false at the base commit. A criterion already true before the work, or one only another task can satisfy, grades nothing.
- A wide refactor, one mechanical change whose blast radius spans the codebase such as a column rename, is the exception. Sequence it expand, migrate, contract: add the new form beside the old, migrate call sites in batches sized by blast radius, each blocked by the expand, then delete the old form in a task blocked by every batch.
## Test Seams - <seam>: <what it observes>, existing or new ## Task Breakdown ### 1. <task title> - **Demo after this:** <the behavior someone can see or run> - **Blocked by:** None - **Mode:** AFK - **Acceptance:** - [ ] <criterion>: observe <signal that is false at the base commit> ## Out of Scope - <what this change deliberately does not do, and why>The Out of Scope section is required and lists real exclusions, including the options the user refused. It is the cheapest place to catch a wrong boundary.
Polishing checklist, optional. For user-facing work,
plan.mdmay carry a## Polishingsection: checks run once every task is done, which bring the delivered parts into harmony without extending scope. Typical items are consistent wording across screens, every error state reachable and readable, empty and loading states present, and keyboard paths complete. An item that adds behavior is a requirement, not polish, and moves to Requirements.Append mandatory closing gates. Every
plan.mdtask breakdown must end with these two items, in this order, as the final tasks. They are not optional. They cannot be moved earlier or removed.Gate 1: Test Coverage, 100%. Apply
../../checklists/checklist.mdcategory 8, Testing. Every file changed or directly related to the changes must reach 100% coverage across statements, branches, functions, and lines, with no exclusion directive, and every user-facing entry point and requirement scenario must have an end-to-end test. "Related" means: files that import from, are imported by, or share a data contract with a changed file. Run the coverage tool scoped to changed files. If any file is below 100%, test the behavior behind the uncovered lines, or delete or refactor code no test can reach, before proceeding.Gate 2: Clean Room Verification. Apply
../../checklists/checklist.mdcategory 50, Clean Room. Run all checks from sections A through E against every file produced by this plan. If no external sources were consulted, state that explicitly and skip. Full process and remediation steps:standards/clean-room.md.- Present plan. Wait for approval.
- Hand off. Confirm spec written. State first step. Suggest
/plan scaffoldif new files needed. Suggest/plan adrif architecture decision was made.
Research Discipline
These rules apply during steps 2-4 and any research, spike, or exploration phase. They prevent context loss during long investigative sessions.
2-action rule. After every two search, read, or browse operations, persist key findings to references.md in the spec folder before continuing. Do not accumulate findings only in context. Multimodal content like screenshots, PDF contents, or browser output must be captured as text immediately because it does not survive context compaction.
Read before decide. Re-read plan.md before any major decision. After ~50 tool calls, the original goal drifts out of the attention window. Re-reading pushes it back in. This applies to implementation too: before starting a new phase, re-read the plan.
Never repeat failures. If an action failed, the next action must be different. Track every failed attempt with its error in decisions.md using this format:
| Attempt | What was tried | Error | Next action |
| 1 | ... | ... | ... |
Failed approaches are valuable context. Keep them visible so the model updates its beliefs rather than retrying the same path.
3-Strike Error Protocol
When an approach fails during planning or research:
- Strike 1: Diagnose and fix. Read the error. Identify root cause. Apply a targeted fix.
- Strike 2: Alternative approach. Same error? Try a different method, tool, or data source. Never repeat the exact same failing action.
- Strike 3: Broader rethink. Question the assumptions behind the approach. Search for solutions. Consider updating the plan's approach entirely.
- After 3 strikes: Escalate. Explain what was tried, share the specific errors, and ask for guidance. Do not continue guessing.
archive
Fold a completed change's spec delta into the living spec, then stamp the plan folder archived. This is the step that keeps specs/current/ from going stale. It owns the shared merge routine that /ship and /retro also call, so the result is identical from any entry point, per the delivery-path-consistency rule in rules/code-style.md.
When to use
- After the tasks in a plan folder are implemented, verified, and merged.
- When
/shipor/retroprompts to close out a change that has aspecs/current/delta.
Arguments
- No arguments: resolve the most recent plan folder under
<root>/plans/, or the legacyspecs/, that has an unmerged delta. <spec-folder>: explicit path to the plan folder to archive.--dry-run: print the merge that would happen without writing.
Steps
- Resolve the plan folder and read its
plan.mddelta sections (ADDED,MODIFIED,REMOVED). If the plan has no delta and noRequirementssection, there is nothing to merge; only stamp it archived. - Locate the target spec under
specs/current/<domain>/spec.mdfor each requirement. Create the domain spec if the delta is allADDEDand no spec exists yet. - Idempotency check. For each delta requirement, compare against the current spec. If it is already merged (ADDED requirement already present with identical text, MODIFIED already applied, REMOVED already absent), skip it and report a no-op. Re-running a completed archive must change nothing.
- Name the target before writing. For every MODIFIED and REMOVED requirement, state which requirement in the current spec it replaces or deletes, per the destructive-action discipline in
rules/code-style.md. In--dry-run, stop here and print the plan. - Apply the merge. ADDED appended to the domain spec, MODIFIED replaces the prior requirement in place, REMOVED deleted with the reason recorded in
decisions.md. - Stamp archived. Add an
Archived: <YYYY-MM-DD>line to the plan folder'splan.mdheader. The plan folder stays in place, dated and permanent; only the living spec moves forward. - Report. Table of merged requirements per domain, plus any skipped no-ops.
Rules
- Idempotent. Re-running on an already-merged delta is a no-op, never a duplicate append.
- Never rewrite a whole spec. Apply only the delta.
- Never delete the plan folder. It records why; the living spec records what.
- The merge logic lives here.
/shipand/retroinvoke it, never reimplement it.
adr
Create and manage Architecture Decision Records. ADRs capture context, alternatives, and reasoning behind significant technical decisions.
When to use
- After a non-trivial architecture decision.
- When changing or reversing a previous decision.
- During planning when a decision deserves its own record.
Subcommands
- No arguments: list existing ADRs.
new <title>: create interactively.supersede <number> <title>: create new ADR that supersedes existing.--status <status>: filter by proposed/accepted/deprecated/superseded.
Process
- Locate the ADR directory the project already tracks, found with
git ls-files | grep -i '/adr/'. When the project tracks none, ask the user where committed ADRs live. Never create it inside the workspace root resolved perrules/project-workspace.md: when that root is<repo>/docs/, adocs/adr/there is excluded from git and the ADR is never committed. A draft the user has not decided to publish goes to<root>/adr/. Files:NNN-<slug>.md, zero-padded. - For new ADRs, ask one question at a time: what decision? What problem? What alternatives?
- Draft:
# ADR-NNN: <Title>
**Status:** accepted
**Date:** <YYYY-MM-DD>
## Context
## Decision
## Alternatives Considered
### <Alt 1> -- pros, cons
### <Alt 2> -- pros, cons
## Consequences
### Positive
### Negative
### Risks- Show draft, incorporate feedback, write file.
- For supersession: update original status to
superseded by ADR-NNN, link from new ADR. When
SECOND_BRAIN_VAULTresolves to a directory, offer to mirror a pointer note intowiki/decisions/.The ADR holds the technical content and stays in the repository, which is the only place it can stay true. The vault note holds what the repository has no place for: who pushed for the decision, what the organization was worried about, which constraint was really binding, and which alternative someone will propose again in six months. It carries a
pointerfield naming the ADR and never copies its body.Delegate the write to
/brain capture. A vault note that duplicates the ADR is a second source of truth and will drift; that is the failure this mirror exists to avoid, so keep it to context and a pointer.
Rules
- ADRs are append-only. Never delete superseded ones.
- The vault mirror is a pointer plus organizational context, never a copy of the ADR body.
- At least two alternatives documented.
- Status values: proposed, accepted, deprecated, superseded by ADR-NNN.
- Title describes the decision, not the problem.
to-issues
Export the active spec folder's task breakdown to GitHub issues. One issue per task.
This subcommand runs only when the user asks for it. It exports planned work the user chose to track, and it is never a way to record a problem instead of fixing it. A defect found while a change is open is fixed in that change, per ../../rules/found-fix.md and ../../rules/pr-comment-discipline.md.
When to use
- After a
/planrun, when the user has said the work will be tracked in issues. - When handing off a plan to a teammate or queue.
Arguments
- No arguments: read the most recent plan folder under
<root>/plans/, or the legacyspecs/or.claude/specs/. <spec-folder>: explicit path to the spec folder.--label <name>: label applied to each issue this flow opens. Repeatable.--milestone <name>: milestone to assign to every issue.--dry-run: print the issue payloads without creating them.
Steps
- Resolve spec folder. Default to the latest folder under
<root>/plans/, then the legacyspecs/or.claude/specs/. - Read
plan.md. Parse the Task Breakdown section. Each numbered task becomes one issue, carrying its demo line, acceptance criteria, Mode, and Blocked by list. - Detect platform and account. GitHub or GitLab from
git remote get-url origin. Map the remote owner to an account perstandards/multi-account-cli.mdand prefix everyghcall withGH_TOKEN=$(gh auth token --user <account>). Never switch the global active account. - Idempotency check. For each task, search existing open and closed issues for the exact title. Skip if a match exists, and reuse its number for blocking edges.
- Build issue body. Include: the behavior the task delivers in the project's domain language, the demo line, the acceptance criteria, and the
HITLorAFKmode. Describe behavior, never code locations: no file paths, line numbers, or function names, which go stale before the issue is picked up. Never name the plan, the workspace, or a planning path, since none of them exist in a clone. - Create issues in dependency order, blockers first, so every blocking edge can name a real issue number at creation time. GitHub:
GH_TOKEN=$(gh auth token --user <account>) gh issue create --title "<title>" --body-file <tmp> --label <label> --blocked-by <n,n> --parent <n>.--blocked-bysets native blocking links and--parentmakes the issue a sub-issue when the plan came from an existing issue; both exist ingh2.102.0, andGH_TOKEN=$(gh auth token --user <account>) gh issue edit <n> --add-blocked-by <n>repairs an edge after creation. Confirm both withgh issue create --help; when the installedghlacks either flag, writeBlocked by #Nlines in the body instead and say so in the summary. GitLab: equivalentglab issue create, withBlocked by #Nin the body. - Print summary. Table of the new issues with URLs and their blocking edges. Skipped, duplicate issues listed separately.
Rules
- Idempotent. Re-running must not create duplicates.
- The title states the behavior the task delivers. It carries no task or phase number, which would number a workflow stage in published text.
- Order and dependencies live in the native blocking links, so the issue reads correctly with no access to the plan.
- Never create issues from a
--lightplan with no task breakdown. - Never invoke this subcommand on your own initiative, and never to record a finding from a review, a CI run, or a verification gate.
- Never push or commit. This subcommand only writes to the issue tracker.
scaffold
Generate boilerplate by reading existing project patterns. No external generators, everything derived from the codebase.
When to use
- Creating a new endpoint, service, component, module, or model.
- When new code must match existing style.
Arguments
<type> <name> where type is a project pattern: endpoint, service, component, module, model, controller, middleware, hook.
Steps
- Parse type and name. If missing, list available types and ask.
- Detect framework and find examples, parallel: read manifest, map directory structure, search for existing examples of the type.
- Analyze 2-3 examples: naming convention, export style, imports, code structure, test file location, TypeScript patterns.
- Generate: main file + test file following exact patterns. Business logic the user has not specified stays out of the skeleton: the function signature, types, and a failing test name the missing behavior, with no
TODOcomment. - Present for approval before writing.
- Write files. Import each new export from its own module path; never create or extend a barrel file.
Rules
- Always read existing code to derive patterns.
- Always present for approval before writing.
- Match exact naming, export style, imports.
- Never generate without at least one example.
- Never install dependencies.
- Keep generated code minimal: a skeleton with no comments, no
TODOmarkers, and no barrel exports, perrules/code-style.md.
multi-execute
Plan and execute a feature with parallel model tiers, Opus + Sonnet + Haiku, while keeping the running Claude Code session as the sole filesystem writer. Subagents propose; the orchestrator integrates and writes.
When to use
- Feature is large enough to benefit from a planner-reviewer split.
- Cost matters: route deep reasoning to Opus, broad searches to Sonnet, mechanical tasks to Haiku.
- The risk of two writers conflicting on the same files is non-trivial.
When NOT to use
- Small change, 1-3 files. Overhead exceeds value.
- Time-critical hotfix. Use
/hotfix. - The task is purely deterministic, rename, format, refactor. Use
/refactor.
Single-Writer Invariant (NON-NEGOTIABLE)
Only the running Claude Code session writes to disk. Subagents return text. The orchestrator parses, validates, and applies.
| Role | Tools | Writes? |
| Orchestrator (this session) | All tools | YES |
| Planner subagent | Read, Grep, Glob, WebSearch | NO |
| Generator subagents | Read, Grep, Glob | NO |
| Reviewer subagents | Read, Grep, Glob | NO |
Subagents must be briefed with: "Return your proposed changes as unified diffs or full-file content in your response. Do NOT call Edit, Write, or MultiEdit." Violations are a wasted run.
Process
- Plan with Opus. Spawn a planner subagent, Opus tier to produce the task breakdown. Single agent, single pass.
- Decompose. Keep the plan's vertical slices: each chunk is one slice, or the part of one slice that owns its files outright, and a chunk starts only when its Blocked by tasks are integrated. Never split work into one chunk per layer, since a layer chunk cannot be verified alone.
- Generate in parallel. Spawn generator subagents, Sonnet tier at most two at a time per the Parallelism Rule. Each receives one chunk plus the file content. Returns proposed text.
- Review in parallel. Spawn reviewer subagents, Sonnet tier on the proposed changes. Returns approval or rejection with rationale.
- Integrate. The orchestrator applies the approved changes with Edit / Write / MultiEdit. Conflicts between proposals get re-planned, back to step 2 for the conflicting subset.
- Verify. Run formatter + linter + test suite. Show output.
Cost discipline
- Planner: Opus, 1 call.
- Generator: Sonnet, N calls where N is the number of independent chunks. Cap at 6.
- Reviewer: Sonnet, N calls matching the generators.
- Orchestrator integration: this session.
Estimate cost before running. Abort and run a simpler /plan flow when the cost exceeds the marginal benefit of parallelism.
Rules
- Single-writer invariant is enforced by the briefing, not by the runtime. Audit subagent responses: if any names a write tool, discard the response.
- Generator chunks must not overlap on the same file. The decomposition step is responsible for partitioning.
- Reviewer subagents read the proposal, not the diff. Diffs hide context.
- Failed verification rolls back the orchestrator's writes,
git stashbefore re-planning.
Rules
- Planning is investigation, not implementation. Do not write production code during
/plan. - Every decision must document at least two alternatives.
- Plan folders are permanent and dated. They record WHY decisions were made. The living spec under
specs/current/records WHAT the system does now and is maintained by/plan archive. Seerules/living-specs.md. - The plan must reference verified file paths.
- Search for existing work before designing new solutions.
- Plan folders go in the project workspace at
<root>/plans/, never committed, and never in~/.claude/unless~/.claudeis the project. Existing folders underspecs/or.claude/specs/stay readable. The living spec underspecs/current/is project documentation and stays where the project keeps it.
Common Rationalizations
- "The design is obvious, so the existing-work search is ceremony": step 2 runs in order and stops at the first match. A closed PR or a sibling skill often already holds the answer.
- "A little code proves the approach faster than a plan": planning writes no production code. A design question that needs running code goes to
/spike. - "Splitting tasks by layer is cleaner": a task that ships one layer cannot be verified until its siblings land. Rework it into a vertical slice.
- "The coverage and clean-room gates are overkill for a small plan": both gates close every
plan.mdtask breakdown, in order, as the final tasks. - "Only one approach is realistic": every decision documents at least two alternatives, each with a decisive test and a stop signal.
- "Nothing is excluded, so Out of Scope stays empty": the section lists real exclusions, including every option the user refused.
Red Flags
- Stop and re-read
context.mdandplan.mdwhen a new phase starts or about 50 tool calls have passed since the last read. - Stop and write to
references.mdwhen two searches, reads, or browses have run since the last write. - Stop and escalate with the attempt table when the third strike fails.
- Stop and reshape the task when it ships a single layer or carries an acceptance criterion already true at the base commit.
- Stop and present the plan for approval when implementation is about to start without one.
Verification
- The plan folder exists at
<root>/plans/<YYYY-MM-DD>-<slug>/withcontext.md,plan.md,decisions.md, andreferences.md, and git does not track it. - A non-trivial
plan.mdcarries Requirements with Given/When/Then scenarios, Test Seams, a Task Breakdown whose tasks name a demo, a Blocked by list, aHITLorAFKmode, and acceptance criteria, an Out of Scope section, and the two closing gates as the last tasks. - Every file path the plan names exists on disk or is marked as a new file.
decisions.mdrecords at least two alternatives for every decision.- The user approved the plan before the hand-off step.
- For
adr,archive,to-issues, andscaffold, the section's own Rules hold, and a re-run ofarchiveorto-issueschanges nothing.
Related skills
/design-- Design consultation before planning UI features./review-- Review code quality after implementing the plan./ship-- Ship the implementation./deploy-- Merge and deploy after shipping./assessment-- Audit completeness after plan execution.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

