skills/code-plan/SKILL.md
Write evidence-backed coding plans for implementation, debugging, refactoring, migrations, design parity work, and long-running agent tasks. Use when defining, clarifying, refining, or validating a development plan, /goal prompt, implementation approach, scope and non-goals, work sequence, acceptance criteria, regression evidence, verification strategy, or stop condition. Near miss: use code-review when judging an existing diff, spec, or already drafted plan rather than drafting or revising a plan.
npx skillsauth add plimeor/agent-skills code-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.
Produce one self-contained engineering plan that another agent can execute without losing the user's intent, context, boundaries, validation bar, implementation strategy, ordering, or stopping condition.
A plan is not just a Goal contract and not just a task list. It explains why the work matters, what must be true at the end, the approach and order, how to verify it, which risks to watch, and when to pause or stop.
Every plan is incomplete unless it includes:
A plan is elevated-risk when it touches public contracts, schemas, persisted state, migrations, security boundaries, cross-module ownership, or irreversible or external side effects; when a fact that would change the approach is still assumed rather than verified; or when the user asks for deep or careful planning. Elevated-risk plans also require:
Planning iteration status: independent research, delegated research, design review, local review, or explicit skip reasoncode-review or an equivalent local review, plus an explicit reason if the critique was skippedEvery plan must pass the Design Twice Gate below before it is returned: an adversarial second-design pass that tries to defeat the drafted design shape with a materially different alternative, with the outcome integrated into the plan.
Do not split the artifact into separate goal, spec, and plan documents unless the user asks. Keep one cohesive plan.
Start from the user's request and provided artifacts. Inspect local files, docs, issues, screenshots, Figma links, logs, tests, or existing plans only when they affect objective, scope, implementation approach, sequencing, acceptance, verification, risk, or stop conditions.
Ask a focused question when a missing fact would materially change the plan or authorize external side effects. Otherwise proceed with a conservative assumption and label it in the plan.
High-impact missing facts include target files or surfaces, source-of-truth behavior, allowed differences, required verification commands, credentials, deployment, destructive actions, persistent config changes, and public contract changes.
Use independent research only for questions whose answers can materially improve the plan. When sub-agents might help, use subagent-delegation to decide whether delegation is authorized and worth the overhead. If delegation is not used, keep the research local and record the skip reason only when it affects coverage, risk, or trust.
Activate this gate when the request is too broad, conflicting, or under-specified to produce a faithful plan.
Required evidence before drafting:
Weak substitutes do not satisfy the gate: a broad checklist, multiple unchosen interpretations, hidden assumptions, or "adjust later" language.
If the user wants to proceed without answers, record the assumptions under Clarification status, Scope, Non-goals, Assumptions, Risks, or Pause conditions.
Activate this gate when the request mixes a desired outcome with a proposed implementation, the plan could add unrequested surface area, or a boundary change appears necessary or tempting.
Run the code-scope-gate triage (question → delete → simplify) instead of re-deriving scope rules here. The plan is incomplete until the triage separates the requested outcome from candidate implementations, names what was deleted, deferred, reused, or left out, classifies boundary changes as avoided, authorized, or blocked pending user confirmation, and chooses the smallest sufficient approach before work slices are expanded.
Weak substitutes do not satisfy the gate: restating the user's proposed implementation as a requirement, saying "keep it simple" without naming what stays out, moving speculative work into the plan as optional implementation detail, or hiding public API, schema, persistence, security, deployment, or cross-module changes inside ordinary work slices.
Write the gate result into Scope, Non-goals, Proposed approach, Pause conditions, and Stop condition. Do not add a separate visible Scope Gate section unless the user explicitly asks for it or the boundary decision needs to be audited.
If an unauthorized boundary change is required to satisfy the request, the plan must choose a conservative no-boundary-change alternative, ask one user decision question, or mark a pause condition before that work begins.
Use the shortest structure that preserves executable value. For most coding plans, use these sections in this order:
Clarification status - clear enough, assumptions, or blockers.Background / problem - why this work exists and what pain or requirement it addresses.Objective - one durable outcome.Scope - included files, modules, routes, workflows, states, users, data, or environments.Non-goals - adjacent work and boundary changes that stay out.Required context - specific files, docs, tests, screenshots, issues, commands, traces, or source baselines to read first.Planning iteration - the design-twice result, plus when useful: draft frame, independent research, delegated research, or design review used or skipped, and findings integrated.Proposed approach - recommended implementation direction and why it fits the constraints.Work sequence - ordered slices with purpose, likely touchpoints, dependencies, and proof expected after each slice.Acceptance, regression evidence, and verification - observable results, preserved behaviors, thresholds, data sources, commands, artifacts, review gates, coverage gaps, and scope.Risks and rabbit holes - likely traps, unknowns, tradeoffs, and how to avoid or contain them.Checkpoints - evidence to report before moving past risky or irreversible points.Stop condition - concrete state where work is done and the agent should stop.Pause conditions - conditions requiring user input or authorization.Progress report format - only for long-running tasks.For small plans, collapse obvious sections, but keep objective, scope/non-goals, approach, work sequence, regression evidence, acceptance/verification, pause conditions, and stop condition explicit.
Write one objective. Do not turn milestones, tasks, or deliverables into separate objectives.
Acceptance results should measure what changes or becomes true, not merely which actions were performed. Each acceptance result should name the observable outcome, verification source, pass/fail threshold, and applicable scope when the domain permits.
Prefer:
All existing tests pass with [command] over works correctly.No public API signatures, exported names, event payloads, or persisted formats change over compatible.Rendered desktop and mobile screenshots match the approved reference with 0 unapproved diffs over looks aligned.Manual review by [role] passes [rubric] over quality is good.When automation is unavailable, define manual evidence: reviewer, artifact, rubric, and pass condition.
Do not jump from first understanding to final plan when independent research or review could materially improve correctness.
Activate this gate when a high-quality plan needs evidence that can be researched independently before the final plan is written, such as regression surface analysis, source-of-truth behavior, migration parity, public contract risk, visual reference review, test strategy, or implementation touchpoint discovery.
Before delegated or independent review, the main session must define a compact draft planning frame: Objective, Scope, Non-goals, known constraints, candidate approach, suspected regression surface, and the exact questions the research or review must answer. The draft can be incomplete, but it must contain enough context for another agent or local review pass to investigate without inventing the goal.
Use subagent-delegation before any sub-agent operation. Delegate only when that skill classifies delegation as authorized and useful. Useful independent tasks include:
Use code-review rather than plan-critic when the draft plan needs design critique: implementation approach, module boundaries, public API shape, schema or persisted-state shape, wrapper behavior, abstraction choice, error ownership, or information hiding. plan-critic is for executability, scope, sequencing, and verification weaknesses.
When delegation is authorized, load only the sub-agent prompt file needed for that task:
Delegated or local independent work is valid only when it has a bounded question, an expected evidence format, and an integration target in the final plan. Useful outputs include regression surfaces, baseline commands, affected files, public contracts, existing test coverage, coverage gaps, risks, and recommended verification evidence.
Weak substitutes do not satisfy this gate: asking a sub-agent to "review the plan", delegating broad planning ownership, bypassing subagent-delegation, pasting unintegrated findings, adding ceremonial parallel tasks, treating another agent's conclusion as accepted without source evidence, or delegating work the main session can answer from already inspected context.
The final plan must integrate delegated findings into the relevant sections, especially Required context, Proposed approach, Work sequence, Acceptance, regression evidence, and verification, Risks and rabbit holes, Checkpoints, Pause conditions, and Stop condition. Keep only findings that change scope, order, evidence, risk, or completion criteria.
Activate this gate when the plan chooses or changes module boundaries, shared abstractions, public APIs, CLI contracts, schemas, persisted state, wrapper semantics, generated artifacts, error handling, or cross-module ownership. Also activate it when a small-looking change could push complexity onto future callers or maintainers.
Before the final plan, create a draft planning frame and run code-review as a design critique when the host can apply another skill within the current authorization boundary. If skill chaining or delegation is unavailable, perform the same design-shape review locally and record that in Planning iteration.
The final plan is incomplete unless it names:
Weak substitutes do not satisfy the gate: "keep it simple", style-only critique, listing alternatives without choosing, adding generic abstractions for future flexibility, calling a broad review without design questions, or leaving review findings unintegrated.
If design review surfaces unresolved ownership, API, schema, persistence, or compatibility risk, the final plan must either choose the conservative no-boundary-change path, ask one user decision question, or mark a pause condition.
Run this gate on every plan after the draft is complete and before it is returned. It is not user-triggered. The pass is adversarial: try to defeat the drafted design shape with a materially different alternative instead of confirming it.
Keep the plan frame fixed during the pass: objective, scope, non-goals, constraints, acceptance bar, regression bar, and authorization boundaries. The pass reviews design shape; it does not restart planning.
Required evidence before the plan is returned:
Record the result compactly in Planning iteration: the design choice tested, the losing option and why it lost, and which plan sections changed. If the pass finds no material design choice — a mechanical change with a single viable shape — record that conclusion and the inspected surface in one line instead of fabricating alternatives.
When the Design Review Gate is also active, feed the design-twice options into that critique instead of running two disconnected reviews.
Weak substitutes do not satisfy this gate: a single real option plus a strawman, superficial naming variants, generic pros and cons, "cleaner" without a maintainer task, future-flexibility theater, skipping the pass because the draft already looks good, or a revision that changes public API, schema, persistence, security posture, deployment, or external side effects without authorization.
A plan must identify the existing behavior, public contract, workflow, data format, visual surface, or integration boundary that the change could accidentally break, since protecting existing behavior usually matters more than proving the new code path once.
For each material work slice, define both:
Regression evidence should use the smallest existing public boundary that protects real users or callers: existing tests, typecheck, lint, build, contract tests, E2E paths, CLI output, API responses, rendered UI states, persisted data checks, characterization tests, or a manual smoke matrix.
Do not satisfy regression evidence with weak substitutes such as a new-code-only test, private helper assertions, mock call counts without user-visible proof, "no obvious issues", or a successful compile when behavior risk is outside compilation.
For high-risk work, plan a baseline check before edits when feasible, so pre-existing failures are distinguished from new regressions. If full regression coverage is too expensive, stale, unavailable, or already failing, name the Regression gap, the accepted risk, and the next best evidence.
If the project does not have enough tests to cover the regression surface, finish the plan with a Test gap decision question. Ask whether the remaining gaps should be covered by targeted behavior test cases or end-to-end tests. For web projects, prefer end-to-end tests unless a lower-level public-boundary test clearly gives equal confidence at lower cost.
Do not silently choose to add broad tests, defer the gap, or treat manual smoke as enough when the user needs to decide the coverage strategy.
For complex or high-risk changes, a delegated Regression Gate analysis may identify existing behavior, public contracts, baseline checks, coverage gaps, and the smallest useful regression evidence. The final plan must still choose the accepted evidence and name unresolved gaps.
Name the recommended path, not every possible path. Include alternatives only when the choice is material to risk, user authorization, or implementation cost.
The approach should explain the reasoning boundary: why this is the smallest sufficient path, what it preserves, and what it intentionally leaves out.
When the Scope Triage Gate applies, the approach must preserve the distinction between requested outcomes and candidate implementations. Do not let a proposed mechanism become a requirement unless the user or source-of-truth behavior makes it one.
The work sequence is an execution map, not a backlog dump. Each slice should have:
Order risky discovery, characterization, or contract checks before broad edits. Put irreversible actions, external side effects, deployments, and destructive operations behind explicit pause conditions.
Call out details that could derail execution: hidden coupling, stale docs, migration parity gaps, visual mismatch, unclear product judgment, flaky tests, missing credentials, schema or API compatibility, and generated-file churn.
For each meaningful risk, either state the containment plan or mark it as a pause condition.
Activate when the user provides a Figma URL, screenshot, mock, design frame, or asks to match a visual reference.
The plan is incomplete unless the first acceptance result names the reference source, target surface, states, viewport matrix, required evidence, allowed masks, and review rule.
Default threshold: 0 unapproved visual diffs. Dynamic text or data may be masked; layout, spacing, typography, colors, borders, radius, shadows, icons, selected states, empty states, and filled states may not be masked unless the user explicitly approves.
Weak substitutes do not satisfy this gate: looks aligned, manual smoke, Figma inspect, or an uncaptured screenshot comparison.
Activate when migrating a component, module, workflow, framework, or implementation from a source project/path into a target.
The plan is incomplete unless it names the source baseline, target location, public contract surface, fixture/state matrix, parity evidence, allowed differences, and stop gate.
Adapting imports, file layout, naming, formatting, framework conventions, local helpers, and design-system primitives does not authorize observable behavior changes.
Before returning the plan, check for every plan:
Planning iteration?When the plan is elevated-risk or used independent research or delegation:
subagent-delegation for authorization and coordination?When the plan has design-shape risk:
code-review or an equivalent design critique inspect interface depth, information hiding, invariant/error ownership, and complexity pushed to callers?Planning iteration explain why no plan change was needed?When scope risk exists:
Scope, Non-goals, and Proposed approach.When project tests are insufficient for the regression surface:
Stop when the user has one executable plan that has passed the Design Twice Gate, the required Test gap decision question for any unresolved regression gaps, the next narrow clarification question, or a blocker list explaining which missing facts prevent a faithful plan.
When scope risk remains unresolved, stop only after the plan names the conservative no-boundary-change path, the user decision needed, or the pause condition that blocks expansion.
When independent or delegated research is used, stop only after the final plan integrates the relevant findings and names unresolved evidence gaps, waived risks, or user decisions. Do not stop with unintegrated notes unless the user explicitly asked for raw research output.
The next phase is separate unless already authorized: implementation, file edits, documentation changes, test execution, commits, pushes, deployment, or external side effects require the user's current request or an active execution task.
development
Set up, resume, or repair a compact active execution workbench for long-horizon, multi-session or checkpointed work. Use when a task needs durable handoff, unattended iteration, human gates, auditable evidence, or active-vs-archive routing that keeps a current packet separate from stale historical context. Do not use for one-session tasks, ordinary plans/reviews/audits, one-session bug fixes, direct code edits, or simple docs cleanup; complete those directly.
tools
Decide whether and how to use authorized sub-agents, then coordinate delegated work while preserving the main agent's context. Use when the user asks for orchestration, parallel agents, delegation, background workers, context isolation, or when another skill needs delegated research, review, implementation, or verification. Owns host-policy checks, delegation packets, non-overlap, report verification, and stop rules. Do not use to bypass tool policy, infer user authorization, or add coordination overhead to simple single-threaded tasks.
development
Use before finalizing a non-trivial answer, recommendation, review, or decision to reconsider it and raise its quality, especially when shallow reasoning, context inertia, false framing, overconfidence, unfit analogy transfer, or an obvious-but-missed defect could distort the result. Trigger especially before applying external evidence, familiar frameworks, or comparisons to the user's specific request, and when the user asks to reconsider, double-check, take a second look, or sanity-check an answer.
tools
Route durable rules and context to the right layer — task, project, skill, tooling, hooks, MCP, or global. Use for global rules files (~/.claude/CLAUDE.md, global AGENTS.md), repo-local AGENTS.md/CLAUDE.md, task context packs, hook placement (Codex/Claude Code settings.json), collaboration friction diagnosis, and rule-placement decisions.