skills/architect-plan/SKILL.md
Planning mode: feature decomposition, specialists (debug/refactor/review/document/design), Mode A scribe handoff, artifact schema.
npx skillsauth add roborew/opencode architect-planInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Hard Rules live in the architect agent markdown; this skill adds protocol detail only for planning (Mode A). Non-negotiables—scope, files, delegation, brevity, scribe handoff—come from the agent, not from this file.
Prerequisite (architect agent): For a new planning episode, the grill-me phase must be complete before you load architect-plan or execute anything below—see architect Skill routing (pre-planning interview after plan type + first substantive requirements). If you are reading this skill, the grill phase should already be done.
Classify task type. For features, classify Difficulty (easy | medium | hard), investigate via claude-context, then: easy — synthesize without strategists; medium — synthesize without strategists when single-domain and investigation suffices, else decompose and spawn scoped strategist(s); hard — decompose, spawn one strategist per sub-problem, combine reports. Always include Difficulty in the artifact. Pass the plan to scribe (trust successful scribe writes per agent Hard Rules), prompt user to switch to orchestrate. For other plan types, invoke the corresponding specialist directly.
Orchestrate reads Difficulty for post-implementation gates (see orchestrate-execution skill).
architect-review instead.Before any claude-context discovery for feature investigation, strategist gap-fill, or artifact evidence gathering:
get_indexing_status for the workspace path.index_codebase, then re-check until ready before using search_code or find_files.claude-context is unavailable, errors, or indexing fails after retry may you fall back to bash, glob, or rg. If you do, record MCP_FALLBACK: claude-context unavailable or indexing failed — <error> in the returned plan Context or Gaps.rg when claude-context is configured and healthy.| Role | Responsibility | Writes? | |------|----------------|--------| | Architect | Coordination, decomposition, investigation via claude-context, delegation, scribe handoff; review and documentation after implementation | No — read-only | | strategist | Scoped sub-problem analysis; returns sub-problem report to architect | No — read-only | | debugger, refactor, review, document, designer | Planning specialists; return plan drafts to architect | No — read-only | | scribe | Writes plan artifacts and docs to approved paths | Yes — only write path |
You may only invoke: strategist, debugger, refactor, review, document, designer, and scribe. Do not invoke frontend-dev, developer, or orchestrate — those are execution subagents used by orchestrate.
scribe via Task to create/update .plan/<type>.<slug>.md. Never write the artifact yourself.scribe with the artifact routing tuple (artifact_type, slug) and full markdown content. Pass content verbatim..plan variant). Do not invoke orchestrate yourself.SCRIBE_FAILED, do not re-read or test -f by default. If scribe reports failure, omits evidence, or SCRIBE_FAILED, re-invoke scribe once with the same content. If still missing, report to user. For artifact_type: design, read saved file and compare to passed content; on mismatch, HANDOFF_DRIFT and retry.docs-mcp-server, dash-api) and cite findings in Context. Use claude-context to discover files/code for FilesToChange when the codebase is large or structure is unclear. Use context7 for external library docs when framework behavior is uncertain.rg unless claude-context is unavailable or indexing failed after retry.Brevity: Concise headings and bullets; no reasoning narration unless the user asks; do not repeat unchanged plan text (deltas only).
When the user selects Feature, follow this protocol. You must not send one huge unscoped prompt to a single strategist when multiple sub-problems require strategists; use scoped strategists per sub-problem. Easy and medium single-domain features skip strategists when you synthesize the plan yourself (see below).
After initial understanding, set Difficulty for the feature (write it into the plan artifact as ## Difficulty with value easy, medium, or hard):
| Level | Typical signal | Strategist use | |-------|----------------|----------------| | easy | 1–2 stages, single concern, few files, no cross-cutting changes | Do not spawn strategists; you synthesize the full plan from investigation. | | medium | 3–4 stages, multiple files, moderate complexity | Default: synthesize the full plan yourself if single-domain (one stack, bounded area) and investigation is sufficient. Spawn scoped strategists when multi-domain (e.g. backend + frontend + infra), high uncertainty after investigation, or cross-cutting risk. | | hard | 5+ stages, cross-cutting concerns, high risk | Must decompose and spawn strategists; investigate more thoroughly and pass richer context per sub-problem than for medium. |
After satisfying the Claude Context readiness gate above, read CONTEXT.md or the context file from CONTEXT-MAP.md when present (domain glossary from grill-me). Then use claude-context (search_code, find_files) to investigate the codebase and gather concrete evidence:
For easy difficulty: skip to Easy path — synthesize plan (after Step 1). Do not spawn strategists.
For medium when single-domain and investigation suffices: skip to Medium synthesize path (after Step 1)—author the full artifact yourself (same quality bar as easy); do not spawn strategists.
For medium when multi-domain / high uncertainty / cross-cutting, and for hard: break the feature into distinct, isolated sub-problems. Each sub-problem should:
Assign each sub-problem an ID (e.g. sp-1, sp-data-model, sp-ui-shell).
Decomposition guidelines:
When Difficulty: easy:
Context, Goal, Difficulty: easy, StagePlan, Tasks, FilesToChange, StageAcceptanceChecks, AcceptanceChecks, CompletionReport, ReviewDecisionGate, VerifierInputs, DocumentationOutputs, Risks, OutOfScope, etc., per docs/plan-artifact-schema.md.When Difficulty: medium and you are not spawning strategists:
Difficulty: medium and the same schema requirements as the easy path.For each sub-problem, invoke a separate strategist via Task with:
Sub-problem ID: <sp-id>
Title: <short title>
Description: <specific question/concern to analyse>
Context: <pre-investigated findings from claude-context — relevant file paths, code snippets, patterns>
Constraints: <what is in-scope and out-of-scope for this sub-problem>
Global context: <framework, slug, shared conventions>
Critical: Provide only the context relevant to that sub-problem. Do not dump the full codebase investigation into every strategist.
Require: "Produce your Sub-Problem Report and return immediately. Do not iterate or loop."
After all strategist sub-problems report back:
claude-context and fill them in the combined plan.artifact_type: feature, slug, path .plan/feature.<slug>.md.The combined plan must follow the schema in docs/plan-artifact-schema.md exactly.
Pass the feature plan to scribe via Task. After scribe success with tool evidence and no SCRIBE_FAILED, trust the write (see agent Hard Rules; design artifacts still need content drift check). Prompt user to switch to orchestrate.
artifact_type: one of feature, debug, refactor, review, designslug: kebab-case task identifierartifact_path: derived from artifact_type + slug:
feature -> .plan/feature.<slug>.mddebug -> .plan/debug.<slug>.mdrefactor -> .plan/refactor.<slug>.mdreview -> .plan/review.<slug>.mddesign -> .plan/design.<slug>.mdPass this contract to scribe when invoking the Task: artifact_type, slug, and full content (markdown body).
Follow docs/plan-artifact-schema.md exactly. At minimum include:
Context, Goal, Difficulty (easy | medium | hard)StagePlan, Tasks, FilesToChange — Tasks must order test-first; FilesToChange must include test file paths per stageStageAcceptanceChecks, AcceptanceChecks — every stage MUST have at least one executable test; reject plans where any stage lacks testsCompletionReport, ReviewDecisionGate, VerifierInputs, DocumentationOutputsRisks, OutOfScopedeveloper / frontend-dev Task bounded.Structure plans into distinct stages so the correct specialist subagent executes each. Every stage MUST have an Owner field.
Owner assignment rules:
Owner: frontend-dev — UI/design stages: components, layouts, styling, accessibility, visual hierarchy, interactive states, responsive design. Use when work touches JSX/TSX, CSS, design tokens, or user-facing interfaces.Owner: developer — Logic/backend stages: API handlers, business logic, data models, tests, refactors, migrations, configuration. Use when work is primarily non-visual or test-driven.Schema / migration stages (developer-owned):
FilesToChange lists schema source paths from project opencode.md / README—not generated migration SQL unless the stack uses hand-written migrations by convention.Tasks must name the project's generate command (e.g. pnpm db:generate) and require committing source + generated migrations together.StageAcceptanceChecks must include running generate and verifying new/updated migration artifacts; forbid hand-editing drizzle/, Prisma migrations/, etc.Owner: ux-dev — Prototype-only stages: generating standalone HTML-only framework-agnostic prototype code in .prototype/<slug>/ from a design brief. Use when the artifact is .plan/design.<slug>.md.Structure guidelines:
stage_id, Owner, objective, and dependencies (if any).When relevant, check:
claude-context for discovering files/code to change when drafting plans. Use search_code to populate FilesToChange with evidence. For feature planning, claude-context investigation is mandatory in Step 1 of the Decomposition Protocol. Preflight ensures the codebase is indexed before planning.context7 for external library docs when framework/library API behavior is uncertain (e.g., React, Next.js, Supabase). Call resolve-library-id then query-docs; limit to 3 calls per question.docs-mcp-server for internal references, prototypes, implementation notes, and linked repos.dash-api for framework/library API details when behavior is uncertain.Capture which MCP source informed which decision.
You may invoke only these planning specialists (all read-only; they return plan drafts, never write code).
debugger subagent for diagnosis-first plan draft. Pass debugger output to scribe.refactor subagent for behavior-preserving plan draft. Pass refactor output to scribe.review subagent for review-plan draft. Pass review output to scribe.User may manually force specialist selection via @strategist, @debugger, @refactor, @review, @document.
Document: When user selects Document (option 5) or says "document" / "generate docs": run the document task. Requires an existing plan artifact (e.g. from a completed feature). Invoke document with artifact path, then scribe to write the three docs. Use when user has passed review and wants to generate changelog/guides/architecture, or when resuming to complete documentation.
Prototype Design: When user selects Prototype Design (option 6) or says "prototype design" / "design prototype":
designer subagent with the collected intake and any reference paths. Designer returns a design brief (read-only); no code.scribe with artifact_type: design, slug, and the designer's full markdown content (unchanged).HANDOFF_DRIFT: designer output was altered and re-invoke scribe with the exact designer output (one retry). If drift persists, report to user.orchestrate to generate the prototype." Orchestrate will dispatch to ux-dev to build the prototype in .prototype/<slug>/.scribe via Task with: artifact_type, slug, content (specialist output, verbatim), and mode: create (or update if amending).SCRIBE_FAILED: file not written, re-invoke scribe once with the same content and path.SCRIBE_FAILED, do not re-read or test -f by default. If the file is missing, evidence is absent, or SCRIBE_FAILED, re-invoke scribe once. If it still fails, report to user.artifact_type: design, read the saved file and compare its content to the content you passed to scribe. If they differ, report HANDOFF_DRIFT and re-invoke scribe with the exact content (one retry). If drift persists, report to user.tools
AI-powered code review using CodeRabbit CLI. Use only on explicit user request or when parent passes execution_mode orchestrate_coderabbit_gate. Do not run during orchestrated stage/issue work.
tools
Cross-repo companion to to-prd: after PRD frontmatter is filled, run bin/fanout <slug> from this spec repo to create child GitHub issues (one per ticket or legacy slice).
tools
Issue state machine — transition GitHub issue labels per docs/agents/triage-labels.md. Batch helpers via lib/triage.sh.
documentation
Synthesise a PRD from grill-me / research context, write docs/prd/<slug>.md, publish a GitHub issue with prd + state:ready-for-agent + feature:<slug>. Halt after publish — do not invoke fanout.