skills/mine.plan/SKILL.md
Use when the user says: "draft a plan", "create work packages", "generate WPs", "review this plan", or "check the plan". Turns a design doc into task files and validates them against a traceability-focused checklist.
npx skillsauth add NodeJSmith/Claudefiles mine.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.
Turn an approved design doc into a set of task files, validate them against a traceability checklist, and gate on user approval. Combines task generation with plan review in a single flow.
$ARGUMENTS — path to a design.md or the feature directory (design/specs/NNN-<slug>/). If empty, find the most recently modified design/specs/*/design.md and confirm with the user before proceeding.
Resolve the design doc path from $ARGUMENTS (same resolution logic as Phase 1's "Locate the design doc"). Phase 1 reuses this path.
Dispatch a subagent to review the design doc. The core direction is just this — no checklist, no rubric:
Go over the design file with a fine-toothed comb and make sure it's accurate, consistent, and thorough.
Agent:
subagent_type: general-purpose
model: sonnet
prompt: |
Read this design file: <design_doc_path>
Go over it with a fine-toothed comb and make sure it's accurate, consistent, and thorough. Report anything you find.
If the subagent returns findings, present them to the user:
AskUserQuestion:
question: "Fine-toothed comb review found issues. How to proceed?"
header: "Design comb"
multiSelect: false
options:
- label: "Fix and re-review"
description: "Address the findings, then run the review again"
- label: "Proceed to planning"
description: "Acknowledge the findings and continue"
- label: "Stop"
description: "Halt and address issues manually"
If "Fix and re-review": apply the fixes, then re-run this phase.
If the subagent finds nothing notable, proceed silently to Phase 1.
If $ARGUMENTS points to a feature directory (design/specs/NNN-*/), read design.md from that directory.
If $ARGUMENTS is a direct path to a file, use it.
If $ARGUMENTS is empty:
Glob: design/specs/*/design.md
Sort by modification time, take the most recent. Then confirm:
AskUserQuestion:
question: "Found design.md at <path>. Generate task files from this?"
header: "Confirm design doc"
multiSelect: false
options:
- label: "Yes — use this design doc"
- label: "No — let me specify the path"
description: "Tell me the correct path and I'll use that"
Read the doc fully. Extract and record:
### Changed Files subsection of ## Impact). Also note any ### Behavioral Invariants — existing behaviors that must not change.### Existing Tests to Adapt (test files that will break), ### New Test Coverage (behaviors needing tests, mapped to FR#N), and ### Tests to Remove (obsolete tests). If the design doc's Test Strategy states N/A (no test infrastructure), tasks should use "N/A — no test infrastructure in this repo" for their Verify sections rather than inventing test requirements.FR#N (e.g., FR#1, FR#13). Record the complete list of FR identifiers.AC#N (e.g., AC#1, AC#19). Record the complete list of AC identifiers.FR/AC identifier format: Identifiers must match ^FR#\d+$ and ^AC#\d+$ respectively. If the design doc uses a different format (e.g., "FR-1" or "Requirement 1"), note this — the validation gate will flag format non-compliance.
If open questions exist, walk through each one interactively before proceeding. First, count all open questions and record the total as M — you need this before asking the first one.
For each open question:
Analyze the question — read the surrounding context in the design doc to infer the most reasonable answer. Identify exactly 2 substantive resolution options and pick the one you'd recommend.
Prompt the user using AskUserQuestion, one question at a time:
AskUserQuestion:
question: "<Quote the open question verbatim, then add a one-sentence summary of what's at stake>"
header: "Q{N} of {M}"
multiSelect: false
options:
- label: "<Option A — your recommendation>"
description: "RECOMMENDED — <one sentence why>"
- label: "<Option B>"
description: "<tradeoff or implication>"
- label: "Skip — treat as accepted uncertainty"
description: "Leave this unresolved and proceed; the tasks will note the ambiguity"
- label: "Stop — I'll update the design doc first"
description: "Exit now so you can revise the doc before generating tasks"
After all questions are answered (or skipped), briefly summarize the resolutions before continuing to Phase 2:
Resolved open questions: Q1 → Option A, Q2 → Option B, Q3 → skipped. Proceeding to generate task files.
The feature directory is design/specs/NNN-<slug>/ containing the design.md. All task files will be written to <feature_dir>/tasks/. Create the tasks/ subdirectory if it doesn't exist.
Use Glob, Grep, and Read only — no Bash for exploration.
Ground the tasks in reality before writing:
Find exact file paths — for every module, class, or function named in the design, run Glob to get the real path. Record each one.
Locate test infrastructure
Glob: tests/**/*.py or equivalentGrep: conftest.py.github/workflows/*.yml, noxfile.py, tox.ini, or Makefile (whichever applies)Find existing patterns to follow
__init__.py or index files)Note gotchas
Reverse-dependency gap check — search the full codebase for files that depend on what's changing but aren't listed in the design doc's Impact section. This catches dependencies the design doc missed entirely. Skip this step if the design doc has neither an Impact section nor an Architecture / Proposed Approach section.
Identify what's changing: Read the design doc's Architecture section (or Proposed Approach — whichever heading is used). For each sentence that describes adding, modifying, removing, or renaming something, extract the specific identifier — function name, class name, type name, API endpoint, database table, config key, or component name.
Search: Grep the codebase for each identifier. Filter out files already listed in the Impact section — those are known. For each match outside the Impact list, assess whether it represents a genuine dependency that would break or need updating. Classify each gap:
Skip categories that don't apply to the project (e.g., SQL for a frontend-only repo, CSS for a backend service). Note which categories were searched and which were skipped.
Record each gap found with: the category, the file path and line, what it depends on, and what would break.
After step 5, if gaps were found, present them grouped by category. Include all gaps in tasks by default — add Focus items to address each one (update the test, fix the caller, regenerate the types, etc.). After Phase 3, update the design.md Impact section with a gap-check comment listing each gap and which task addresses it: <!-- Gap check [date]: N gaps included — gap1 (file:line) → T02 Focus item 3, gap2 → T03 Focus item 5, ... -->.
Then briefly summarize what was included so the user can push back on any false positives before committing.
If no gaps were found, report: "Gap check clean — no unlisted dependencies found." Proceed to Phase 3.
Do NOT guess file paths. If Glob returns no match, note it explicitly.
Before writing task files, generate the master context file at <feature_dir>/tasks/context.md. This file provides shared context for all executor subagents.
# Context: <Feature Name>
## Problem & Motivation
<Synthesized from the design doc's Problem section. What is broken, missing, or needs improvement. Why it matters. 3-6 sentences.>
## Visual Artifacts
<List every mockup path, screenshot reference, or visual asset mentioned in the design doc. Include the file path and a one-line description of what it depicts. If no visual artifacts exist, write "None.">
## Key Decisions
<The key architecture decisions and their rationale, drawn from the design doc's Architecture/Proposed Approach section. Numbered list. Include tradeoffs accepted.>
## Constraints & Anti-Patterns
<Explicit technical or design constraints from the design doc. Things the executor must NOT do. Non-goals. Common mistakes to avoid.>
## Design Doc References
<Section headings from the design doc that are relevant to this feature, with a one-line description of each. Format: "## Section Name — what it covers".>
## Convention Examples
<If the design doc has a "Convention Examples" section, copy it here verbatim — these are real code snippets from the codebase that implementers must follow. If the design doc has no Convention Examples section, write "None — no convention examples captured during discovery.">
Decompose the design into tasks (minimum 3). Each task represents a distinct, independently reviewable unit of work that a single executor subagent can complete in one session. Let the design's complexity determine the count — don't artificially constrain it.
Task sizing rules:
Task ordering rules:
depends_onFR/AC coverage rule:
implements fieldimplements must also have a corresponding Verify criterionWrite each task to: <feature_dir>/tasks/T{NN}-{slug}.md
Where NN is zero-padded (T01, T02, etc.) and slug is a short kebab-case description derived from the task title.
Example: tasks/T01-data-model.md, tasks/T02-api-endpoints.md
---
task_id: "T01"
title: "<imperative description>"
status: "planned"
depends_on: []
implements: ["FR#1", "FR#3", "AC#7"]
---
## Summary
<Human-readable plain-language description. What this task builds and why. 3-8 lines max.>
## Prompt
<Self-contained instructions. What to build, what files to touch, what patterns to follow. References specific design doc sections and visual artifacts by path. Must be complete enough for a fresh executor subagent with only context.md and this task file.>
## Focus
<Domain-specific context for this executor. Relevant patterns, gotchas, blast-radius notes from Phase 2 exploration. What to watch out for. Gaps found in the reverse-dependency check that this task addresses.>
## Verify
<Binary checklist. Each item references a specific FR or AC. Every item in the `implements` field must have a corresponding Verify criterion.>
- [ ] FR#1: <description of what is verifiable>
- [ ] FR#3: <description of what is verifiable>
- [ ] AC#7: <description of what is verifiable>
T{NN} zero-padded. Must be unique across all tasks.["T01"]). Empty array if none.- [ ] FR#N: or - [ ] AC#N: followed by a concrete, observable criterion. "The endpoint returns 200" not "the feature works". Every implements identifier must have exactly one Verify item.After writing all task files and context.md, dispatch a validation subagent with fresh context to independently verify traceability and correctness. This subagent does NOT inherit the planner's interpretation.
Read ${CLAUDE_HOME:-~/.claude}/skills/mine.plan/validator-prompt.md to get the validator instructions.
Launch a general-purpose subagent with model: sonnet. Pass this prompt (fill in the bracketed values):
You are a plan validation agent. Your job is to independently verify that a set of task files correctly and completely covers the requirements in a design document.
## Your instructions
<full validator-prompt.md content>
## Paths to read
- Design doc: <absolute path to design.md>
- Task files directory: <absolute path to tasks/ directory>
- context.md: <absolute path to tasks/context.md>
## Output path
Write your validation report to: <absolute path to tasks/.validation-report.md>
The subagent reads the design doc and all task files independently (fresh context). It writes the report to <feature_dir>/tasks/.validation-report.md.
Cross-check: After the subagent completes, verify that the traceability matrix row count matches the FR/AC identifier count from Phase 1. If the counts diverge, re-run the validator — the subagent may have dropped or hallucinated identifiers.
Read the validation report. Then present:
.validation-report.md if needed)Note the path to .validation-report.md so the user can inspect the full traceability matrix if desired.
If status is ISSUES_FOUND, ask the user:
AskUserQuestion:
question: "Validation found issues (see report above). How to proceed?"
header: "Validation"
multiSelect: false
options:
- label: "Fix and re-validate"
description: "I'll describe corrections; re-run the validation gate after"
- label: "Proceed anyway"
description: "I understand the gaps; proceed to review"
- label: "Regenerate tasks"
description: "Significant gaps — regenerate with corrections"
If APPROVED (with or without warnings), proceed to Phase 4 automatically.
After the validation gate passes, run schema validation (frontmatter fields, ID format, dependency references — complementary to Phase 3.5's traceability check) and commit:
spec-helper validate <feature>
Where <feature> is the feature directory name (e.g., 007-user-auth). If validation reports errors, fix the task files before committing. Warnings are informational — do not block on them.
Then commit:
git add design/specs/<feature>/tasks/
git commit -m "feat: add task files for NNN-<slug>"
If git operations fail (not a repo, nothing to commit), note it and continue.
Run get-skill-tmpdir mine-plan and use <dir>/review.md for the review output.
Read ${CLAUDE_HOME:-~/.claude}/skills/mine.plan/reviewer-prompt.md to get the checklist content.
Launch a general-purpose subagent with model: sonnet. Pass this prompt (fill in the bracketed values from the files you read):
You are reviewing an implementation design and its task files.
## Design doc content
<full design.md content>
## context.md content
<full tasks/context.md content>
## Task files
<full content of each T*.md, in order, separated by file headers showing the absolute path to each file>
## Your instructions
<full reviewer-prompt.md content>
Write your complete structured review to: <temp file path>
The subagent will write the review to the temp file.
Read the temp file. Format the results clearly:
N. <name>: PASS|WARN|FAIL — noteIf the reviewer's output includes non-blocking suggestions, present "Approve with suggestions" as the first (recommended) option. If there are no suggestions (clean APPROVE), omit it and show "Approve as-is" first.
When suggestions exist:
AskUserQuestion:
question: "Review complete. What would you like to do?"
header: "Plan verdict"
multiSelect: false
options:
- label: "Approve with suggestions (Recommended)"
description: "Apply the reviewer's non-blocking suggestions, then proceed"
- label: "Approve as-is"
description: "Skip suggestions; proceed to execution"
- label: "Revise the plan"
description: "Blocking issues found — regenerate task files with reviewer notes"
- label: "Abandon"
description: "Mark the design as abandoned and stop"
When no suggestions exist:
AskUserQuestion:
question: "Review complete. What would you like to do?"
header: "Plan verdict"
multiSelect: false
options:
- label: "Approve as-is"
description: "Plan is good; proceed to execution"
- label: "Revise the plan"
description: "Blocking issues found — regenerate task files with reviewer notes"
- label: "Abandon"
description: "Mark the design as abandoned and stop"
Update the design.md **Status:** field from draft to approved.
If invoked inline by mine.build (the user chose "Full caliper workflow" or "Accelerated"), skip the gate below and invoke /mine.orchestrate <feature_dir> directly — mine.build handles the flow.
Otherwise, ask:
AskUserQuestion:
question: "Plan approved. Begin implementation?"
header: "Next step"
multiSelect: false
options:
- label: "Yes — start execution"
description: "Invoke /mine.orchestrate for this feature"
- label: "No — I'll start later"
description: "Stop here; the plan is approved and saved"
If "Yes": invoke /mine.orchestrate <feature_dir> directly.
Apply the reviewer's non-blocking suggestions to design.md and/or T*.md files. Restrict task file edits to cosmetic changes (wording, clarifications, review guidance) — substantive task changes require re-running the task generation phases. Show the user a brief summary of what was changed (absolute file path + one-line description per change). Update the design.md **Status:** field from draft to approved.
Then follow the same gate as "Approve as-is" above (invoke /mine.orchestrate on approval).
Surface the reviewer's blocking issues as a numbered list. Loop back to Phase 2 — re-explore the codebase and regenerate task files with the reviewer's notes as context. Tell the user:
Regenerating task files with the reviewer's notes.
Update the design.md **Status:** field from draft to abandoned.
Confirm: "Design saved as abandoned at <path>."
development
Use when the user says: 'create an issue', 'file an issue', 'open an issue', 'write an issue', 'new issue for this'. Codebase-aware issue creation — investigates the code to produce well-structured issues with acceptance criteria, affected areas, and enough detail for automated triage.
development
Use when the user says: 'triage issues', 'classify issues by complexity', 'assess issue complexity', 'find quick wins', 'which issues are small', 'batch issue assessment'. Batch codebase-aware issue triage — parallel Haiku subagents assess actual complexity and effort by reading the code, not just titles.
development
Use when the user says: "review my changes", "run the reviewers", "code and integration review", "readability review", "maintainability review", "sniff test this", "WTF check", "code smells", "is this code any good", "fresh eyes on this branch", "review this directory", "check this module". Dispatches three parallel reviewers — code, integration, and a readability pass — and consolidates findings into one prioritized report.
development
Use when the user says: "clean code check", "style review", "LLM smell check", "code hygiene", "nitpick this", "style check", "find style sins", "nitpicker review", "anal retentive review", "exhaustive style review", "no-filter style report". Dispatches three parallel stylistic checkers — llm-checker (training-bias patterns), lazy-checker (deferred debt), and nitpicker (style hygiene) — and consolidates findings into a report organized by checker with a Summary section for orchestration consumption.