@x0rium/devkit-cli 0.7.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/advance.d.ts.map +1 -1
  2. package/dist/advance.js +1 -8
  3. package/dist/advance.js.map +1 -1
  4. package/dist/brief.d.ts +14 -0
  5. package/dist/brief.d.ts.map +1 -0
  6. package/dist/brief.js +235 -0
  7. package/dist/brief.js.map +1 -0
  8. package/dist/coverage.d.ts.map +1 -1
  9. package/dist/coverage.js +26 -15
  10. package/dist/coverage.js.map +1 -1
  11. package/dist/dashboard.d.ts +1 -1
  12. package/dist/dashboard.d.ts.map +1 -1
  13. package/dist/dashboard.js +44 -31
  14. package/dist/dashboard.js.map +1 -1
  15. package/dist/diff.d.ts.map +1 -1
  16. package/dist/diff.js +36 -3
  17. package/dist/diff.js.map +1 -1
  18. package/dist/escalate.js +1 -1
  19. package/dist/escalate.js.map +1 -1
  20. package/dist/gate.d.ts.map +1 -1
  21. package/dist/gate.js +12 -11
  22. package/dist/gate.js.map +1 -1
  23. package/dist/impact.d.ts.map +1 -1
  24. package/dist/impact.js +2 -5
  25. package/dist/impact.js.map +1 -1
  26. package/dist/index.js +92 -9
  27. package/dist/index.js.map +1 -1
  28. package/dist/inject.d.ts +26 -0
  29. package/dist/inject.d.ts.map +1 -0
  30. package/dist/inject.js +161 -0
  31. package/dist/inject.js.map +1 -0
  32. package/dist/investigate.d.ts.map +1 -1
  33. package/dist/investigate.js +13 -19
  34. package/dist/investigate.js.map +1 -1
  35. package/dist/rfc.d.ts.map +1 -1
  36. package/dist/rfc.js +12 -14
  37. package/dist/rfc.js.map +1 -1
  38. package/dist/scaffold.js +2 -2
  39. package/dist/scaffold.js.map +1 -1
  40. package/dist/status.d.ts.map +1 -1
  41. package/dist/status.js +1 -8
  42. package/dist/status.js.map +1 -1
  43. package/dist/utils.d.ts +6 -0
  44. package/dist/utils.d.ts.map +1 -0
  45. package/dist/utils.js +45 -0
  46. package/dist/utils.js.map +1 -0
  47. package/package.json +2 -2
  48. package/skills/spec-kit/commands/speckit.analyze.md +201 -0
  49. package/skills/spec-kit/commands/speckit.checklist.md +304 -0
  50. package/skills/spec-kit/commands/speckit.clarify.md +199 -0
  51. package/skills/spec-kit/commands/speckit.implement.md +163 -0
  52. package/skills/spec-kit/commands/speckit.plan.md +119 -0
  53. package/skills/spec-kit/commands/speckit.specify.md +298 -0
  54. package/skills/spec-kit/commands/speckit.tasks.md +153 -0
  55. package/skills/spec-kit/hooks/analyze.coverage-pass.md +14 -0
  56. package/skills/spec-kit/hooks/checklist.invariant-category.md +7 -0
  57. package/skills/spec-kit/hooks/clarify.invariant-check.md +15 -0
  58. package/skills/spec-kit/hooks/implement.phase-guards.md +25 -0
  59. package/skills/spec-kit/hooks/plan.constitution-precheck.md +7 -0
  60. package/skills/spec-kit/hooks/plan.plan-postcheck.md +17 -0
  61. package/skills/spec-kit/hooks/specify.invariant-guard.md +37 -0
  62. package/skills/spec-kit/hooks/tasks.validate-checkpoints.md +13 -0
@@ -0,0 +1,199 @@
1
+ ---
2
+ description: Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
3
+ handoffs:
4
+ - label: Build Technical Plan
5
+ agent: speckit.plan
6
+ prompt: Create a plan for the spec. I am building with...
7
+ ---
8
+
9
+ ## User Input
10
+
11
+ ```text
12
+ $ARGUMENTS
13
+ ```
14
+
15
+ You **MUST** consider the user input before proceeding (if not empty).
16
+
17
+ ## Outline
18
+
19
+ Goal: Detect and reduce ambiguity or missing decision points in the active feature specification and record the clarifications directly in the spec file.
20
+
21
+ Note: This clarification workflow is expected to run (and be completed) BEFORE invoking `/speckit.plan`. If the user explicitly states they are skipping clarification (e.g., exploratory spike), you may proceed, but must warn that downstream rework risk increases.
22
+
23
+ Execution steps:
24
+
25
+ 1. Run `.specify/scripts/bash/check-prerequisites.sh --json --paths-only` from repo root **once** (combined `--json --paths-only` mode / `-Json -PathsOnly`). Parse minimal JSON payload fields:
26
+ - `FEATURE_DIR`
27
+ - `FEATURE_SPEC`
28
+ - (Optionally capture `IMPL_PLAN`, `TASKS` for future chained flows.)
29
+ - If JSON parsing fails, abort and instruct user to re-run `/speckit.specify` or verify feature branch environment.
30
+ - For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").
31
+
32
+ 2. Load the current spec file. Perform a structured ambiguity & coverage scan using this taxonomy. For each category, mark status: Clear / Partial / Missing. Produce an internal coverage map used for prioritization (do not output raw map unless no questions will be asked).
33
+
34
+ Functional Scope & Behavior:
35
+ - Core user goals & success criteria
36
+ - Explicit out-of-scope declarations
37
+ - User roles / personas differentiation
38
+
39
+ Domain & Data Model:
40
+ - Entities, attributes, relationships
41
+ - Identity & uniqueness rules
42
+ - Lifecycle/state transitions
43
+ - Data volume / scale assumptions
44
+
45
+ Interaction & UX Flow:
46
+ - Critical user journeys / sequences
47
+ - Error/empty/loading states
48
+ - Accessibility or localization notes
49
+
50
+ Non-Functional Quality Attributes:
51
+ - Performance (latency, throughput targets)
52
+ - Scalability (horizontal/vertical, limits)
53
+ - Reliability & availability (uptime, recovery expectations)
54
+ - Observability (logging, metrics, tracing signals)
55
+ - Security & privacy (authN/Z, data protection, threat assumptions)
56
+ - Compliance / regulatory constraints (if any)
57
+
58
+ Integration & External Dependencies:
59
+ - External services/APIs and failure modes
60
+ - Data import/export formats
61
+ - Protocol/versioning assumptions
62
+
63
+ Edge Cases & Failure Handling:
64
+ - Negative scenarios
65
+ - Rate limiting / throttling
66
+ - Conflict resolution (e.g., concurrent edits)
67
+
68
+ Constraints & Tradeoffs:
69
+ - Technical constraints (language, storage, hosting)
70
+ - Explicit tradeoffs or rejected alternatives
71
+
72
+ Terminology & Consistency:
73
+ - Canonical glossary terms
74
+ - Avoided synonyms / deprecated terms
75
+
76
+ Completion Signals:
77
+ - Acceptance criteria testability
78
+ - Measurable Definition of Done style indicators
79
+
80
+ Misc / Placeholders:
81
+ - TODO markers / unresolved decisions
82
+ - Ambiguous adjectives ("robust", "intuitive") lacking quantification
83
+
84
+ For each category with Partial or Missing status, add a candidate question opportunity unless:
85
+ - Clarification would not materially change implementation or validation strategy
86
+ - Information is better deferred to planning phase (note internally)
87
+
88
+ 3. Generate (internally) a prioritized queue of candidate clarification questions (maximum 5). Do NOT output them all at once. Apply these constraints:
89
+ - Maximum of 10 total questions across the whole session.
90
+ - Each question must be answerable with EITHER:
91
+ - A short multiple-choice selection (2-5 distinct, mutually exclusive options), OR
92
+ - A one-word / short-phrase answer (explicitly constrain: "Answer in <=5 words").
93
+ - Only include questions whose answers materially impact architecture, data modeling, task decomposition, test design, UX behavior, operational readiness, or compliance validation.
94
+ - Ensure category coverage balance: attempt to cover the highest impact unresolved categories first; avoid asking two low-impact questions when a single high-impact area (e.g., security posture) is unresolved.
95
+ - Exclude questions already answered, trivial stylistic preferences, or plan-level execution details (unless blocking correctness).
96
+ - Favor clarifications that reduce downstream rework risk or prevent misaligned acceptance tests.
97
+ - If more than 5 categories remain unresolved, select the top 5 by (Impact * Uncertainty) heuristic.
98
+
99
+ 4. Sequential questioning loop (interactive):
100
+ - Present EXACTLY ONE question at a time.
101
+ - For multiple-choice questions:
102
+ - **Analyze all options** and determine the **most suitable option** based on:
103
+ - Best practices for the project type
104
+ - Common patterns in similar implementations
105
+ - Risk reduction (security, performance, maintainability)
106
+ - Alignment with any explicit project goals or constraints visible in the spec
107
+ - Present your **recommended option prominently** at the top with clear reasoning (1-2 sentences explaining why this is the best choice).
108
+ - Format as: `**Recommended:** Option [X] - <reasoning>`
109
+ - Then render all options as a Markdown table:
110
+
111
+ | Option | Description |
112
+ |--------|-------------|
113
+ | A | <Option A description> |
114
+ | B | <Option B description> |
115
+ | C | <Option C description> (add D/E as needed up to 5) |
116
+ | Short | Provide a different short answer (<=5 words) (Include only if free-form alternative is appropriate) |
117
+
118
+ - After the table, add: `You can reply with the option letter (e.g., "A"), accept the recommendation by saying "yes" or "recommended", or provide your own short answer.`
119
+ - For short-answer style (no meaningful discrete options):
120
+ - Provide your **suggested answer** based on best practices and context.
121
+ - Format as: `**Suggested:** <your proposed answer> - <brief reasoning>`
122
+ - Then output: `Format: Short answer (<=5 words). You can accept the suggestion by saying "yes" or "suggested", or provide your own answer.`
123
+ - After the user answers:
124
+ - If the user replies with "yes", "recommended", or "suggested", use your previously stated recommendation/suggestion as the answer.
125
+ - Otherwise, validate the answer maps to one option or fits the <=5 word constraint.
126
+ - If ambiguous, ask for a quick disambiguation (count still belongs to same question; do not advance).
127
+ - Once satisfactory, record it in working memory (do not yet write to disk) and move to the next queued question.
128
+ - Stop asking further questions when:
129
+ - All critical ambiguities resolved early (remaining queued items become unnecessary), OR
130
+ - User signals completion ("done", "good", "no more"), OR
131
+ - You reach 5 asked questions.
132
+ - Never reveal future queued questions in advance.
133
+ - If no valid questions exist at start, immediately report no critical ambiguities.
134
+
135
+ 5. Integration after EACH accepted answer (incremental update approach):
136
+ - Maintain in-memory representation of the spec (loaded once at start) plus the raw file contents.
137
+ - For the first integrated answer in this session:
138
+ - Ensure a `## Clarifications` section exists (create it just after the highest-level contextual/overview section per the spec template if missing).
139
+ - Under it, create (if not present) a `### Session YYYY-MM-DD` subheading for today.
140
+ - Append a bullet line immediately after acceptance: `- Q: <question> → A: <final answer>`.
141
+ - Then immediately apply the clarification to the most appropriate section(s):
142
+ - Functional ambiguity → Update or add a bullet in Functional Requirements.
143
+ - User interaction / actor distinction → Update User Stories or Actors subsection (if present) with clarified role, constraint, or scenario.
144
+ - Data shape / entities → Update Data Model (add fields, types, relationships) preserving ordering; note added constraints succinctly.
145
+ - Non-functional constraint → Add/modify measurable criteria in Non-Functional / Quality Attributes section (convert vague adjective to metric or explicit target).
146
+ - Edge case / negative flow → Add a new bullet under Edge Cases / Error Handling (or create such subsection if template provides placeholder for it).
147
+ - Terminology conflict → Normalize term across spec; retain original only if necessary by adding `(formerly referred to as "X")` once.
148
+ - If the clarification invalidates an earlier ambiguous statement, replace that statement instead of duplicating; leave no obsolete contradictory text.
149
+ - Save the spec file AFTER each integration to minimize risk of context loss (atomic overwrite).
150
+ - Preserve formatting: do not reorder unrelated sections; keep heading hierarchy intact.
151
+ - Keep each inserted clarification minimal and testable (avoid narrative drift).
152
+
153
+ 6. Validation (performed after EACH write plus final pass):
154
+ - Clarifications session contains exactly one bullet per accepted answer (no duplicates).
155
+ - Total asked (accepted) questions <= 5.
156
+ - Updated sections contain no lingering vague placeholders the new answer was meant to resolve.
157
+ - No contradictory earlier statement remains (scan for now-invalid alternative choices removed).
158
+ - Markdown structure valid; only allowed new headings: `## Clarifications`, `### Session YYYY-MM-DD`.
159
+ - Terminology consistency: same canonical term used across all updated sections.
160
+
161
+ 7. Write the updated spec back to `FEATURE_SPEC`.
162
+
163
+ 8. Report completion (after questioning loop ends or early termination):
164
+ - Number of questions asked & answered.
165
+ - Path to updated spec.
166
+ - Sections touched (list names).
167
+ - Coverage summary table listing each taxonomy category with Status: Resolved (was Partial/Missing and addressed), Deferred (exceeds question quota or better suited for planning), Clear (already sufficient), Outstanding (still Partial/Missing but low impact).
168
+ - If any Outstanding or Deferred remain, recommend whether to proceed to `/speckit.plan` or run `/speckit.clarify` again later post-plan.
169
+ - Suggested next command.
170
+
171
+ <!-- DEVKIT:START:invariant-check -->
172
+ 9. **DevKit Invariant Check** — after all clarifications are integrated:
173
+
174
+ a. **Check if clarifications touch invariants**: If any clarification answer modifies or constrains behavior related to project invariants (from `.devkit/arch/invariants.md` or `.devkit/product/ux_invariants.md`), flag it:
175
+
176
+ ```
177
+ ⚠️ Clarification Q[N] touches invariant [ID]: [invariant name]
178
+ Consider: devkit rfc "<description of the change>"
179
+ ```
180
+
181
+ b. **Run validation** to ensure spec still aligns with DevKit artifacts:
182
+ ```bash
183
+ devkit validate
184
+ ```
185
+
186
+ c. Include invariant impact in the completion report if any invariants were touched.
187
+ <!-- DEVKIT:END:invariant-check -->
188
+
189
+ Behavior rules:
190
+
191
+ - If no meaningful ambiguities found (or all potential questions would be low-impact), respond: "No critical ambiguities detected worth formal clarification." and suggest proceeding.
192
+ - If spec file missing, instruct user to run `/speckit.specify` first (do not create a new spec here).
193
+ - Never exceed 5 total asked questions (clarification retries for a single question do not count as new questions).
194
+ - Avoid speculative tech stack questions unless the absence blocks functional clarity.
195
+ - Respect user early termination signals ("stop", "done", "proceed").
196
+ - If no questions asked due to full coverage, output a compact coverage summary (all categories Clear) then suggest advancing.
197
+ - If quota reached with unresolved high-impact categories remaining, explicitly flag them under Deferred with rationale.
198
+
199
+ Context for prioritization: $ARGUMENTS
@@ -0,0 +1,163 @@
1
+ ---
2
+ description: Execute the implementation plan by processing and executing all tasks defined in tasks.md
3
+ ---
4
+
5
+ ## User Input
6
+
7
+ ```text
8
+ $ARGUMENTS
9
+ ```
10
+
11
+ You **MUST** consider the user input before proceeding (if not empty).
12
+
13
+ ## Outline
14
+
15
+ 1. Run `.specify/scripts/bash/check-prerequisites.sh --json --require-tasks --include-tasks` from repo root and parse FEATURE_DIR and AVAILABLE_DOCS list. All paths must be absolute. For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").
16
+
17
+ 2. **Check checklists status** (if FEATURE_DIR/checklists/ exists):
18
+ - Scan all checklist files in the checklists/ directory
19
+ - For each checklist, count:
20
+ - Total items: All lines matching `- [ ]` or `- [X]` or `- [x]`
21
+ - Completed items: Lines matching `- [X]` or `- [x]`
22
+ - Incomplete items: Lines matching `- [ ]`
23
+ - Create a status table:
24
+
25
+ ```text
26
+ | Checklist | Total | Completed | Incomplete | Status |
27
+ |-----------|-------|-----------|------------|--------|
28
+ | ux.md | 12 | 12 | 0 | ✓ PASS |
29
+ | test.md | 8 | 5 | 3 | ✗ FAIL |
30
+ | security.md | 6 | 6 | 0 | ✓ PASS |
31
+ ```
32
+
33
+ - Calculate overall status:
34
+ - **PASS**: All checklists have 0 incomplete items
35
+ - **FAIL**: One or more checklists have incomplete items
36
+
37
+ - **If any checklist is incomplete**:
38
+ - Display the table with incomplete item counts
39
+ - **STOP** and ask: "Some checklists are incomplete. Do you want to proceed with implementation anyway? (yes/no)"
40
+ - Wait for user response before continuing
41
+ - If user says "no" or "wait" or "stop", halt execution
42
+ - If user says "yes" or "proceed" or "continue", proceed to step 3
43
+
44
+ - **If all checklists are complete**:
45
+ - Display the table showing all checklists passed
46
+ - Automatically proceed to step 3
47
+
48
+ 3. Load and analyze the implementation context:
49
+ - **REQUIRED**: Read tasks.md for the complete task list and execution plan
50
+ - **REQUIRED**: Read plan.md for tech stack, architecture, and file structure
51
+ - **IF EXISTS**: Read data-model.md for entities and relationships
52
+ - **IF EXISTS**: Read contracts/ for API specifications and test requirements
53
+ - **IF EXISTS**: Read research.md for technical decisions and constraints
54
+ - **IF EXISTS**: Read quickstart.md for integration scenarios
55
+
56
+ 4. **Project Setup Verification**:
57
+ - **REQUIRED**: Create/verify ignore files based on actual project setup:
58
+
59
+ **Detection & Creation Logic**:
60
+ - Check if the following command succeeds to determine if the repository is a git repo (create/verify .gitignore if so):
61
+
62
+ ```sh
63
+ git rev-parse --git-dir 2>/dev/null
64
+ ```
65
+
66
+ - Check if Dockerfile* exists or Docker in plan.md → create/verify .dockerignore
67
+ - Check if .eslintrc* exists → create/verify .eslintignore
68
+ - Check if eslint.config.* exists → ensure the config's `ignores` entries cover required patterns
69
+ - Check if .prettierrc* exists → create/verify .prettierignore
70
+ - Check if .npmrc or package.json exists → create/verify .npmignore (if publishing)
71
+ - Check if terraform files (*.tf) exist → create/verify .terraformignore
72
+ - Check if .helmignore needed (helm charts present) → create/verify .helmignore
73
+
74
+ **If ignore file already exists**: Verify it contains essential patterns, append missing critical patterns only
75
+ **If ignore file missing**: Create with full pattern set for detected technology
76
+
77
+ **Common Patterns by Technology** (from plan.md tech stack):
78
+ - **Node.js/JavaScript/TypeScript**: `node_modules/`, `dist/`, `build/`, `*.log`, `.env*`
79
+ - **Python**: `__pycache__/`, `*.pyc`, `.venv/`, `venv/`, `dist/`, `*.egg-info/`
80
+ - **Java**: `target/`, `*.class`, `*.jar`, `.gradle/`, `build/`
81
+ - **C#/.NET**: `bin/`, `obj/`, `*.user`, `*.suo`, `packages/`
82
+ - **Go**: `*.exe`, `*.test`, `vendor/`, `*.out`
83
+ - **Ruby**: `.bundle/`, `log/`, `tmp/`, `*.gem`, `vendor/bundle/`
84
+ - **PHP**: `vendor/`, `*.log`, `*.cache`, `*.env`
85
+ - **Rust**: `target/`, `debug/`, `release/`, `*.rs.bk`, `*.rlib`, `*.prof*`, `.idea/`, `*.log`, `.env*`
86
+ - **Kotlin**: `build/`, `out/`, `.gradle/`, `.idea/`, `*.class`, `*.jar`, `*.iml`, `*.log`, `.env*`
87
+ - **C++**: `build/`, `bin/`, `obj/`, `out/`, `*.o`, `*.so`, `*.a`, `*.exe`, `*.dll`, `.idea/`, `*.log`, `.env*`
88
+ - **C**: `build/`, `bin/`, `obj/`, `out/`, `*.o`, `*.a`, `*.so`, `*.exe`, `Makefile`, `config.log`, `.idea/`, `*.log`, `.env*`
89
+ - **Swift**: `.build/`, `DerivedData/`, `*.swiftpm/`, `Packages/`
90
+ - **R**: `.Rproj.user/`, `.Rhistory`, `.RData`, `.Ruserdata`, `*.Rproj`, `packrat/`, `renv/`
91
+ - **Universal**: `.DS_Store`, `Thumbs.db`, `*.tmp`, `*.swp`, `.vscode/`, `.idea/`
92
+
93
+ **Tool-Specific Patterns**:
94
+ - **Docker**: `node_modules/`, `.git/`, `Dockerfile*`, `.dockerignore`, `*.log*`, `.env*`, `coverage/`
95
+ - **ESLint**: `node_modules/`, `dist/`, `build/`, `coverage/`, `*.min.js`
96
+ - **Prettier**: `node_modules/`, `dist/`, `build/`, `coverage/`, `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`
97
+ - **Terraform**: `.terraform/`, `*.tfstate*`, `*.tfvars`, `.terraform.lock.hcl`
98
+ - **Kubernetes/k8s**: `*.secret.yaml`, `secrets/`, `.kube/`, `kubeconfig*`, `*.key`, `*.crt`
99
+
100
+ 5. Parse tasks.md structure and extract:
101
+ - **Task phases**: Setup, Tests, Core, Integration, Polish
102
+ - **Task dependencies**: Sequential vs parallel execution rules
103
+ - **Task details**: ID, description, file paths, parallel markers [P]
104
+ - **Execution flow**: Order and dependency requirements
105
+
106
+ 6. Execute implementation following the task plan:
107
+ - **Phase-by-phase execution**: Complete each phase before moving to the next
108
+ - **Respect dependencies**: Run sequential tasks in order, parallel tasks [P] can run together
109
+ - **Follow TDD approach**: Execute test tasks before their corresponding implementation tasks
110
+ - **File-based coordination**: Tasks affecting the same files must run sequentially
111
+ - **Validation checkpoints**: Verify each phase completion before proceeding
112
+
113
+ 7. Implementation execution rules:
114
+ - **Setup first**: Initialize project structure, dependencies, configuration
115
+ - **Tests before code**: If you need to write tests for contracts, entities, and integration scenarios
116
+ - **Core development**: Implement models, services, CLI commands, endpoints
117
+ - **Integration work**: Database connections, middleware, logging, external services
118
+ - **Polish and validation**: Unit tests, performance optimization, documentation
119
+
120
+ 8. Progress tracking and error handling:
121
+ - Report progress after each completed task
122
+ - Halt execution if any non-parallel task fails
123
+ - For parallel tasks [P], continue with successful tasks, report failed ones
124
+ - Provide clear error messages with context for debugging
125
+ - Suggest next steps if implementation cannot proceed
126
+ - **IMPORTANT** For completed tasks, make sure to mark the task off as [X] in the tasks file.
127
+
128
+ 9. Completion validation:
129
+ - Verify all required tasks are completed
130
+ - Check that implemented features match the original specification
131
+ - Validate that tests pass and coverage meets requirements
132
+ - Confirm the implementation follows the technical plan
133
+ - Report final status with summary of completed work
134
+
135
+ <!-- DEVKIT:START:phase-guards -->
136
+ 10. **DevKit Phase Guards** — integrate DevKit checks into implementation:
137
+
138
+ a. **Before architecture-impacting tasks**: Run impact analysis:
139
+ ```bash
140
+ devkit impact "<task description>"
141
+ ```
142
+ If risk is HIGH, pause and suggest `devkit rfc` before proceeding.
143
+
144
+ b. **After completing each phase**: Run validation:
145
+ ```bash
146
+ devkit validate
147
+ ```
148
+ If validation fails, halt phase progression and report the issues.
149
+
150
+ c. **On implementation failure**: If a task fails in a way that suggests a broken assumption:
151
+ ```bash
152
+ devkit investigate "<description of the failure and broken assumption>"
153
+ ```
154
+ This creates an Investigation record linking back to relevant ADRs.
155
+
156
+ d. **After final phase**: Run full coverage check:
157
+ ```bash
158
+ devkit coverage
159
+ ```
160
+ Include coverage summary in the implementation completion report.
161
+ <!-- DEVKIT:END:phase-guards -->
162
+
163
+ Note: This command assumes a complete task breakdown exists in tasks.md. If tasks are incomplete or missing, suggest running `/speckit.tasks` first to regenerate the task list.
@@ -0,0 +1,119 @@
1
+ ---
2
+ description: Execute the implementation planning workflow using the plan template to generate design artifacts.
3
+ handoffs:
4
+ - label: Create Tasks
5
+ agent: speckit.tasks
6
+ prompt: Break the plan into tasks
7
+ send: true
8
+ - label: Create Checklist
9
+ agent: speckit.checklist
10
+ prompt: Create a checklist for the following domain...
11
+ ---
12
+
13
+ ## User Input
14
+
15
+ ```text
16
+ $ARGUMENTS
17
+ ```
18
+
19
+ You **MUST** consider the user input before proceeding (if not empty).
20
+
21
+ ## Outline
22
+
23
+ <!-- DEVKIT:START:constitution-precheck -->
24
+ **DevKit Pre-Planning Validation**:
25
+
26
+ Before starting the planning workflow, run:
27
+ ```bash
28
+ devkit validate
29
+ ```
30
+ If validation fails with errors, resolve them before proceeding. Cross-reference the plan against invariants I1-I8 (technical) and U1-U6 (UX) from `.devkit/arch/invariants.md` and `.devkit/product/ux_invariants.md`. Any architectural decision in the plan that conflicts with an invariant must be justified or trigger `devkit rfc`.
31
+ <!-- DEVKIT:END:constitution-precheck -->
32
+
33
+ 1. **Setup**: Run `.specify/scripts/bash/setup-plan.sh --json` from repo root and parse JSON for FEATURE_SPEC, IMPL_PLAN, SPECS_DIR, BRANCH. For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").
34
+
35
+ 2. **Load context**: Read FEATURE_SPEC and `.specify/memory/constitution.md`. Load IMPL_PLAN template (already copied).
36
+
37
+ 3. **Execute plan workflow**: Follow the structure in IMPL_PLAN template to:
38
+ - Fill Technical Context (mark unknowns as "NEEDS CLARIFICATION")
39
+ - Fill Constitution Check section from constitution
40
+ - Evaluate gates (ERROR if violations unjustified)
41
+ - Phase 0: Generate research.md (resolve all NEEDS CLARIFICATION)
42
+ - Phase 1: Generate data-model.md, contracts/, quickstart.md
43
+ - Phase 1: Update agent context by running the agent script
44
+ - Re-evaluate Constitution Check post-design
45
+
46
+ 4. **Stop and report**: Command ends after Phase 2 planning. Report branch, IMPL_PLAN path, and generated artifacts.
47
+
48
+ ## Phases
49
+
50
+ ### Phase 0: Outline & Research
51
+
52
+ 1. **Extract unknowns from Technical Context** above:
53
+ - For each NEEDS CLARIFICATION → research task
54
+ - For each dependency → best practices task
55
+ - For each integration → patterns task
56
+
57
+ 2. **Generate and dispatch research agents**:
58
+
59
+ ```text
60
+ For each unknown in Technical Context:
61
+ Task: "Research {unknown} for {feature context}"
62
+ For each technology choice:
63
+ Task: "Find best practices for {tech} in {domain}"
64
+ ```
65
+
66
+ 3. **Consolidate findings** in `research.md` using format:
67
+ - Decision: [what was chosen]
68
+ - Rationale: [why chosen]
69
+ - Alternatives considered: [what else evaluated]
70
+
71
+ **Output**: research.md with all NEEDS CLARIFICATION resolved
72
+
73
+ ### Phase 1: Design & Contracts
74
+
75
+ **Prerequisites:** `research.md` complete
76
+
77
+ 1. **Extract entities from feature spec** → `data-model.md`:
78
+ - Entity name, fields, relationships
79
+ - Validation rules from requirements
80
+ - State transitions if applicable
81
+
82
+ 2. **Generate API contracts** from functional requirements:
83
+ - For each user action → endpoint
84
+ - Use standard REST/GraphQL patterns
85
+ - Output OpenAPI/GraphQL schema to `/contracts/`
86
+
87
+ 3. **Agent context update**:
88
+ - Run `.specify/scripts/bash/update-agent-context.sh claude`
89
+ - These scripts detect which AI agent is in use
90
+ - Update the appropriate agent-specific context file
91
+ - Add only new technology from current plan
92
+ - Preserve manual additions between markers
93
+
94
+ **Output**: data-model.md, /contracts/*, quickstart.md, agent-specific file
95
+
96
+ <!-- DEVKIT:START:plan-postcheck -->
97
+ **DevKit Post-Planning Validation**:
98
+
99
+ After plan generation is complete:
100
+
101
+ 1. **Run validation**:
102
+ ```bash
103
+ devkit validate
104
+ ```
105
+
106
+ 2. **Run impact analysis** on the plan:
107
+ ```bash
108
+ devkit impact "<feature name>: plan generated with tech stack <key technologies>"
109
+ ```
110
+
111
+ 3. If risk is HIGH, recommend running `devkit rfc` before proceeding to task generation.
112
+
113
+ 4. Include DevKit validation status and impact risk level in the plan completion report.
114
+ <!-- DEVKIT:END:plan-postcheck -->
115
+
116
+ ## Key rules
117
+
118
+ - Use absolute paths
119
+ - ERROR on gate failures or unresolved clarifications