@cognite/cli 0.5.2 → 0.6.0-alpha.26

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 (54) hide show
  1. package/README.md +94 -33
  2. package/_templates/app/new/config/eslint.config.mjs.ejs.t +99 -0
  3. package/_templates/app/new/config/tsconfig.json.ejs.t +35 -0
  4. package/_templates/app/new/config/tsconfig.node.json.ejs.t +27 -0
  5. package/_templates/app/new/config/vite.config.ts.ejs.t +28 -0
  6. package/_templates/app/new/config/vitest.config.ts.ejs.t +14 -0
  7. package/_templates/app/new/config/vitest.setup.ts.ejs.t +4 -0
  8. package/_templates/app/new/github/ci.yml.ejs.t +36 -0
  9. package/_templates/app/new/prompt.js +49 -0
  10. package/_templates/app/new/root/.npmrc.ejs.t +4 -0
  11. package/_templates/app/new/root/AGENTS.md.ejs.t +215 -0
  12. package/_templates/app/new/root/SPEC.md.ejs.t +77 -0
  13. package/_templates/app/new/root/app.json.ejs.t +20 -0
  14. package/_templates/app/new/root/gitignore.ejs.t +21 -0
  15. package/_templates/app/new/root/index.html.ejs.t +36 -0
  16. package/_templates/app/new/root/manifest.json.ejs.t +9 -0
  17. package/_templates/app/new/root/package.json.ejs.t +65 -0
  18. package/_templates/app/new/src/App.test.tsx.ejs.t +45 -0
  19. package/_templates/app/new/src/App.tsx.ejs.t +234 -0
  20. package/_templates/app/new/src/lib/utils.ts.ejs.t +9 -0
  21. package/_templates/app/new/src/main.tsx.ejs.t +27 -0
  22. package/_templates/app/new/src/styles.css.ejs.t +12 -0
  23. package/_vendor/spec-kit/.version +4 -0
  24. package/_vendor/spec-kit/README.md +39 -0
  25. package/_vendor/spec-kit/commands/speckit.analyze.md +249 -0
  26. package/_vendor/spec-kit/commands/speckit.checklist.md +361 -0
  27. package/_vendor/spec-kit/commands/speckit.clarify.md +247 -0
  28. package/_vendor/spec-kit/commands/speckit.implement.md +198 -0
  29. package/_vendor/spec-kit/commands/speckit.plan.md +149 -0
  30. package/_vendor/spec-kit/commands/speckit.specify.md +327 -0
  31. package/_vendor/spec-kit/commands/speckit.tasks.md +200 -0
  32. package/_vendor/spec-kit/scripts/bash/check-prerequisites.sh +190 -0
  33. package/_vendor/spec-kit/scripts/bash/common.sh +645 -0
  34. package/_vendor/spec-kit/scripts/bash/setup-plan.sh +75 -0
  35. package/_vendor/spec-kit/templates/checklist-template.md +40 -0
  36. package/_vendor/spec-kit/templates/plan-template.md +104 -0
  37. package/_vendor/spec-kit/templates/spec-template.md +128 -0
  38. package/_vendor/spec-kit/templates/tasks-template.md +251 -0
  39. package/dist/chunk-6IFTGM5Y.js +6 -0
  40. package/dist/chunk-6JBK3X6U.js +2 -0
  41. package/dist/chunk-7BIIU2MQ.js +8 -0
  42. package/dist/chunk-CQ5OFVL5.js +2 -0
  43. package/dist/chunk-F3TJC2SP.js +2 -0
  44. package/dist/cli/cli.js +350 -0
  45. package/dist/esm-OFTP7G2W.js +34 -0
  46. package/dist/getMachineId-bsd-3GB6MPGO.js +2 -0
  47. package/dist/getMachineId-darwin-4AJ74CH4.js +3 -0
  48. package/dist/getMachineId-linux-IEUC3AW3.js +2 -0
  49. package/dist/getMachineId-unsupported-YOCUE26C.js +2 -0
  50. package/dist/getMachineId-win-DDKCA2D6.js +2 -0
  51. package/dist/skills-R7PLBJFQ.js +2 -0
  52. package/package.json +26 -17
  53. package/index.js +0 -116
  54. package/operations.js +0 -113
@@ -0,0 +1,247 @@
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
+ ## Pre-Execution Checks
18
+
19
+ **Check for extension hooks (before clarification)**:
20
+ - Check if `.specify/extensions.yml` exists in the project root.
21
+ - If it exists, read it and look for entries under the `hooks.before_clarify` key
22
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
23
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
24
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
25
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
26
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
27
+ - For each executable hook, output the following based on its `optional` flag:
28
+ - **Optional hook** (`optional: true`):
29
+ ```
30
+ ## Extension Hooks
31
+
32
+ **Optional Pre-Hook**: {extension}
33
+ Command: `/{command}`
34
+ Description: {description}
35
+
36
+ Prompt: {prompt}
37
+ To execute: `/{command}`
38
+ ```
39
+ - **Mandatory hook** (`optional: false`):
40
+ ```
41
+ ## Extension Hooks
42
+
43
+ **Automatic Pre-Hook**: {extension}
44
+ Executing: `/{command}`
45
+ EXECUTE_COMMAND: {command}
46
+
47
+ Wait for the result of the hook command before proceeding to the Outline.
48
+ ```
49
+ - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
50
+
51
+ ## Outline
52
+
53
+ Goal: Detect and reduce ambiguity or missing decision points in the active feature specification and record the clarifications directly in the spec file.
54
+
55
+ 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.
56
+
57
+ Execution steps:
58
+
59
+ 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:
60
+ - `FEATURE_DIR`
61
+ - `FEATURE_SPEC`
62
+ - (Optionally capture `IMPL_PLAN`, `TASKS` for future chained flows.)
63
+ - If JSON parsing fails, abort and instruct user to re-run `/speckit.specify` or verify feature branch environment.
64
+ - 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").
65
+
66
+ 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).
67
+
68
+ Functional Scope & Behavior:
69
+ - Core user goals & success criteria
70
+ - Explicit out-of-scope declarations
71
+ - User roles / personas differentiation
72
+
73
+ Domain & Data Model:
74
+ - Entities, attributes, relationships
75
+ - Identity & uniqueness rules
76
+ - Lifecycle/state transitions
77
+ - Data volume / scale assumptions
78
+
79
+ Interaction & UX Flow:
80
+ - Critical user journeys / sequences
81
+ - Error/empty/loading states
82
+ - Accessibility or localization notes
83
+
84
+ Non-Functional Quality Attributes:
85
+ - Performance (latency, throughput targets)
86
+ - Scalability (horizontal/vertical, limits)
87
+ - Reliability & availability (uptime, recovery expectations)
88
+ - Observability (logging, metrics, tracing signals)
89
+ - Security & privacy (authN/Z, data protection, threat assumptions)
90
+ - Compliance / regulatory constraints (if any)
91
+
92
+ Integration & External Dependencies:
93
+ - External services/APIs and failure modes
94
+ - Data import/export formats
95
+ - Protocol/versioning assumptions
96
+
97
+ Edge Cases & Failure Handling:
98
+ - Negative scenarios
99
+ - Rate limiting / throttling
100
+ - Conflict resolution (e.g., concurrent edits)
101
+
102
+ Constraints & Tradeoffs:
103
+ - Technical constraints (language, storage, hosting)
104
+ - Explicit tradeoffs or rejected alternatives
105
+
106
+ Terminology & Consistency:
107
+ - Canonical glossary terms
108
+ - Avoided synonyms / deprecated terms
109
+
110
+ Completion Signals:
111
+ - Acceptance criteria testability
112
+ - Measurable Definition of Done style indicators
113
+
114
+ Misc / Placeholders:
115
+ - TODO markers / unresolved decisions
116
+ - Ambiguous adjectives ("robust", "intuitive") lacking quantification
117
+
118
+ For each category with Partial or Missing status, add a candidate question opportunity unless:
119
+ - Clarification would not materially change implementation or validation strategy
120
+ - Information is better deferred to planning phase (note internally)
121
+
122
+ 3. Generate (internally) a prioritized queue of candidate clarification questions (maximum 5). Do NOT output them all at once. Apply these constraints:
123
+ - Maximum of 5 total questions across the whole session.
124
+ - Each question must be answerable with EITHER:
125
+ - A short multiple‑choice selection (2–5 distinct, mutually exclusive options), OR
126
+ - A one-word / short‑phrase answer (explicitly constrain: "Answer in <=5 words").
127
+ - Only include questions whose answers materially impact architecture, data modeling, task decomposition, test design, UX behavior, operational readiness, or compliance validation.
128
+ - 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.
129
+ - Exclude questions already answered, trivial stylistic preferences, or plan-level execution details (unless blocking correctness).
130
+ - Favor clarifications that reduce downstream rework risk or prevent misaligned acceptance tests.
131
+ - If more than 5 categories remain unresolved, select the top 5 by (Impact * Uncertainty) heuristic.
132
+
133
+ 4. Sequential questioning loop (interactive):
134
+ - Present EXACTLY ONE question at a time.
135
+ - For multiple‑choice questions:
136
+ - **Analyze all options** and determine the **most suitable option** based on:
137
+ - Best practices for the project type
138
+ - Common patterns in similar implementations
139
+ - Risk reduction (security, performance, maintainability)
140
+ - Alignment with any explicit project goals or constraints visible in the spec
141
+ - Present your **recommended option prominently** at the top with clear reasoning (1-2 sentences explaining why this is the best choice).
142
+ - Format as: `**Recommended:** Option [X] - <reasoning>`
143
+ - Then render all options as a Markdown table:
144
+
145
+ | Option | Description |
146
+ |--------|-------------|
147
+ | A | <Option A description> |
148
+ | B | <Option B description> |
149
+ | C | <Option C description> (add D/E as needed up to 5) |
150
+ | Short | Provide a different short answer (<=5 words) (Include only if free-form alternative is appropriate) |
151
+
152
+ - 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.`
153
+ - For short‑answer style (no meaningful discrete options):
154
+ - Provide your **suggested answer** based on best practices and context.
155
+ - Format as: `**Suggested:** <your proposed answer> - <brief reasoning>`
156
+ - Then output: `Format: Short answer (<=5 words). You can accept the suggestion by saying "yes" or "suggested", or provide your own answer.`
157
+ - After the user answers:
158
+ - If the user replies with "yes", "recommended", or "suggested", use your previously stated recommendation/suggestion as the answer.
159
+ - Otherwise, validate the answer maps to one option or fits the <=5 word constraint.
160
+ - If ambiguous, ask for a quick disambiguation (count still belongs to same question; do not advance).
161
+ - Once satisfactory, record it in working memory (do not yet write to disk) and move to the next queued question.
162
+ - Stop asking further questions when:
163
+ - All critical ambiguities resolved early (remaining queued items become unnecessary), OR
164
+ - User signals completion ("done", "good", "no more"), OR
165
+ - You reach 5 asked questions.
166
+ - Never reveal future queued questions in advance.
167
+ - If no valid questions exist at start, immediately report no critical ambiguities.
168
+
169
+ 5. Integration after EACH accepted answer (incremental update approach):
170
+ - Maintain in-memory representation of the spec (loaded once at start) plus the raw file contents.
171
+ - For the first integrated answer in this session:
172
+ - Ensure a `## Clarifications` section exists (create it just after the highest-level contextual/overview section per the spec template if missing).
173
+ - Under it, create (if not present) a `### Session YYYY-MM-DD` subheading for today.
174
+ - Append a bullet line immediately after acceptance: `- Q: <question> → A: <final answer>`.
175
+ - Then immediately apply the clarification to the most appropriate section(s):
176
+ - Functional ambiguity → Update or add a bullet in Functional Requirements.
177
+ - User interaction / actor distinction → Update User Stories or Actors subsection (if present) with clarified role, constraint, or scenario.
178
+ - Data shape / entities → Update Data Model (add fields, types, relationships) preserving ordering; note added constraints succinctly.
179
+ - Non-functional constraint → Add/modify measurable criteria in Success Criteria > Measurable Outcomes (convert vague adjective to metric or explicit target).
180
+ - Edge case / negative flow → Add a new bullet under Edge Cases / Error Handling (or create such subsection if template provides placeholder for it).
181
+ - Terminology conflict → Normalize term across spec; retain original only if necessary by adding `(formerly referred to as "X")` once.
182
+ - If the clarification invalidates an earlier ambiguous statement, replace that statement instead of duplicating; leave no obsolete contradictory text.
183
+ - Save the spec file AFTER each integration to minimize risk of context loss (atomic overwrite).
184
+ - Preserve formatting: do not reorder unrelated sections; keep heading hierarchy intact.
185
+ - Keep each inserted clarification minimal and testable (avoid narrative drift).
186
+
187
+ 6. Validation (performed after EACH write plus final pass):
188
+ - Clarifications session contains exactly one bullet per accepted answer (no duplicates).
189
+ - Total asked (accepted) questions ≤ 5.
190
+ - Updated sections contain no lingering vague placeholders the new answer was meant to resolve.
191
+ - No contradictory earlier statement remains (scan for now-invalid alternative choices removed).
192
+ - Markdown structure valid; only allowed new headings: `## Clarifications`, `### Session YYYY-MM-DD`.
193
+ - Terminology consistency: same canonical term used across all updated sections.
194
+
195
+ 7. Write the updated spec back to `FEATURE_SPEC`.
196
+
197
+ 8. Report completion (after questioning loop ends or early termination):
198
+ - Number of questions asked & answered.
199
+ - Path to updated spec.
200
+ - Sections touched (list names).
201
+ - 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).
202
+ - If any Outstanding or Deferred remain, recommend whether to proceed to `/speckit.plan` or run `/speckit.clarify` again later post-plan.
203
+ - Suggested next command.
204
+
205
+ Behavior rules:
206
+
207
+ - If no meaningful ambiguities found (or all potential questions would be low-impact), respond: "No critical ambiguities detected worth formal clarification." and suggest proceeding.
208
+ - If spec file missing, instruct user to run `/speckit.specify` first (do not create a new spec here).
209
+ - Never exceed 5 total asked questions (clarification retries for a single question do not count as new questions).
210
+ - Avoid speculative tech stack questions unless the absence blocks functional clarity.
211
+ - Respect user early termination signals ("stop", "done", "proceed").
212
+ - If no questions asked due to full coverage, output a compact coverage summary (all categories Clear) then suggest advancing.
213
+ - If quota reached with unresolved high-impact categories remaining, explicitly flag them under Deferred with rationale.
214
+
215
+ Context for prioritization: $ARGUMENTS
216
+
217
+ ## Post-Execution Checks
218
+
219
+ **Check for extension hooks (after clarification)**:
220
+ Check if `.specify/extensions.yml` exists in the project root.
221
+ - If it exists, read it and look for entries under the `hooks.after_clarify` key
222
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
223
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
224
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
225
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
226
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
227
+ - For each executable hook, output the following based on its `optional` flag:
228
+ - **Optional hook** (`optional: true`):
229
+ ```
230
+ ## Extension Hooks
231
+
232
+ **Optional Hook**: {extension}
233
+ Command: `/{command}`
234
+ Description: {description}
235
+
236
+ Prompt: {prompt}
237
+ To execute: `/{command}`
238
+ ```
239
+ - **Mandatory hook** (`optional: false`):
240
+ ```
241
+ ## Extension Hooks
242
+
243
+ **Automatic Hook**: {extension}
244
+ Executing: `/{command}`
245
+ EXECUTE_COMMAND: {command}
246
+ ```
247
+ - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
@@ -0,0 +1,198 @@
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
+ ## Pre-Execution Checks
14
+
15
+ **Check for extension hooks (before implementation)**:
16
+ - Check if `.specify/extensions.yml` exists in the project root.
17
+ - If it exists, read it and look for entries under the `hooks.before_implement` key
18
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
19
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
20
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
21
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
22
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
23
+ - For each executable hook, output the following based on its `optional` flag:
24
+ - **Optional hook** (`optional: true`):
25
+ ```
26
+ ## Extension Hooks
27
+
28
+ **Optional Pre-Hook**: {extension}
29
+ Command: `/{command}`
30
+ Description: {description}
31
+
32
+ Prompt: {prompt}
33
+ To execute: `/{command}`
34
+ ```
35
+ - **Mandatory hook** (`optional: false`):
36
+ ```
37
+ ## Extension Hooks
38
+
39
+ **Automatic Pre-Hook**: {extension}
40
+ Executing: `/{command}`
41
+ EXECUTE_COMMAND: {command}
42
+
43
+ Wait for the result of the hook command before proceeding to the Outline.
44
+ ```
45
+ - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
46
+
47
+ ## Outline
48
+
49
+ 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").
50
+
51
+ 2. **Check checklists status** (if FEATURE_DIR/checklists/ exists):
52
+ - Scan all checklist files in the checklists/ directory
53
+ - For each checklist, count:
54
+ - Total items: All lines matching `- [ ]` or `- [X]` or `- [x]`
55
+ - Completed items: Lines matching `- [X]` or `- [x]`
56
+ - Incomplete items: Lines matching `- [ ]`
57
+ - Create a status table:
58
+
59
+ ```text
60
+ | Checklist | Total | Completed | Incomplete | Status |
61
+ |-----------|-------|-----------|------------|--------|
62
+ | ux.md | 12 | 12 | 0 | ✓ PASS |
63
+ | test.md | 8 | 5 | 3 | ✗ FAIL |
64
+ | security.md | 6 | 6 | 0 | ✓ PASS |
65
+ ```
66
+
67
+ - Calculate overall status:
68
+ - **PASS**: All checklists have 0 incomplete items
69
+ - **FAIL**: One or more checklists have incomplete items
70
+
71
+ - **If any checklist is incomplete**:
72
+ - Display the table with incomplete item counts
73
+ - **STOP** and ask: "Some checklists are incomplete. Do you want to proceed with implementation anyway? (yes/no)"
74
+ - Wait for user response before continuing
75
+ - If user says "no" or "wait" or "stop", halt execution
76
+ - If user says "yes" or "proceed" or "continue", proceed to step 3
77
+
78
+ - **If all checklists are complete**:
79
+ - Display the table showing all checklists passed
80
+ - Automatically proceed to step 3
81
+
82
+ 3. Load and analyze the implementation context:
83
+ - **REQUIRED**: Read tasks.md for the complete task list and execution plan
84
+ - **REQUIRED**: Read plan.md for tech stack, architecture, and file structure
85
+ - **IF EXISTS**: Read data-model.md for entities and relationships
86
+ - **IF EXISTS**: Read contracts/ for API specifications and test requirements
87
+ - **IF EXISTS**: Read research.md for technical decisions and constraints
88
+ - **IF EXISTS**: Read quickstart.md for integration scenarios
89
+
90
+ 4. **Project Setup Verification**:
91
+ - **REQUIRED**: Create/verify ignore files based on actual project setup:
92
+
93
+ **Detection & Creation Logic**:
94
+ - Check if the following command succeeds to determine if the repository is a git repo (create/verify .gitignore if so):
95
+
96
+ ```sh
97
+ git rev-parse --git-dir 2>/dev/null
98
+ ```
99
+
100
+ - Check if Dockerfile* exists or Docker in plan.md → create/verify .dockerignore
101
+ - Check if .eslintrc* exists → create/verify .eslintignore
102
+ - Check if eslint.config.* exists → ensure the config's `ignores` entries cover required patterns
103
+ - Check if .prettierrc* exists → create/verify .prettierignore
104
+ - Check if .npmrc or package.json exists → create/verify .npmignore (if publishing)
105
+ - Check if terraform files (*.tf) exist → create/verify .terraformignore
106
+ - Check if .helmignore needed (helm charts present) → create/verify .helmignore
107
+
108
+ **If ignore file already exists**: Verify it contains essential patterns, append missing critical patterns only
109
+ **If ignore file missing**: Create with full pattern set for detected technology
110
+
111
+ **Common Patterns by Technology** (from plan.md tech stack):
112
+ - **Node.js/JavaScript/TypeScript**: `node_modules/`, `dist/`, `build/`, `*.log`, `.env*`
113
+ - **Python**: `__pycache__/`, `*.pyc`, `.venv/`, `venv/`, `dist/`, `*.egg-info/`
114
+ - **Java**: `target/`, `*.class`, `*.jar`, `.gradle/`, `build/`
115
+ - **C#/.NET**: `bin/`, `obj/`, `*.user`, `*.suo`, `packages/`
116
+ - **Go**: `*.exe`, `*.test`, `vendor/`, `*.out`
117
+ - **Ruby**: `.bundle/`, `log/`, `tmp/`, `*.gem`, `vendor/bundle/`
118
+ - **PHP**: `vendor/`, `*.log`, `*.cache`, `*.env`
119
+ - **Rust**: `target/`, `debug/`, `release/`, `*.rs.bk`, `*.rlib`, `*.prof*`, `.idea/`, `*.log`, `.env*`
120
+ - **Kotlin**: `build/`, `out/`, `.gradle/`, `.idea/`, `*.class`, `*.jar`, `*.iml`, `*.log`, `.env*`
121
+ - **C++**: `build/`, `bin/`, `obj/`, `out/`, `*.o`, `*.so`, `*.a`, `*.exe`, `*.dll`, `.idea/`, `*.log`, `.env*`
122
+ - **C**: `build/`, `bin/`, `obj/`, `out/`, `*.o`, `*.a`, `*.so`, `*.exe`, `*.dll`, `autom4te.cache/`, `config.status`, `config.log`, `.idea/`, `*.log`, `.env*`
123
+ - **Swift**: `.build/`, `DerivedData/`, `*.swiftpm/`, `Packages/`
124
+ - **R**: `.Rproj.user/`, `.Rhistory`, `.RData`, `.Ruserdata`, `*.Rproj`, `packrat/`, `renv/`
125
+ - **Universal**: `.DS_Store`, `Thumbs.db`, `*.tmp`, `*.swp`, `.vscode/`, `.idea/`
126
+
127
+ **Tool-Specific Patterns**:
128
+ - **Docker**: `node_modules/`, `.git/`, `Dockerfile*`, `.dockerignore`, `*.log*`, `.env*`, `coverage/`
129
+ - **ESLint**: `node_modules/`, `dist/`, `build/`, `coverage/`, `*.min.js`
130
+ - **Prettier**: `node_modules/`, `dist/`, `build/`, `coverage/`, `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`
131
+ - **Terraform**: `.terraform/`, `*.tfstate*`, `*.tfvars`, `.terraform.lock.hcl`
132
+ - **Kubernetes/k8s**: `*.secret.yaml`, `secrets/`, `.kube/`, `kubeconfig*`, `*.key`, `*.crt`
133
+
134
+ 5. Parse tasks.md structure and extract:
135
+ - **Task phases**: Setup, Tests, Core, Integration, Polish
136
+ - **Task dependencies**: Sequential vs parallel execution rules
137
+ - **Task details**: ID, description, file paths, parallel markers [P]
138
+ - **Execution flow**: Order and dependency requirements
139
+
140
+ 6. Execute implementation following the task plan:
141
+ - **Phase-by-phase execution**: Complete each phase before moving to the next
142
+ - **Respect dependencies**: Run sequential tasks in order, parallel tasks [P] can run together
143
+ - **Follow TDD approach**: Execute test tasks before their corresponding implementation tasks
144
+ - **File-based coordination**: Tasks affecting the same files must run sequentially
145
+ - **Validation checkpoints**: Verify each phase completion before proceeding
146
+
147
+ 7. Implementation execution rules:
148
+ - **Setup first**: Initialize project structure, dependencies, configuration
149
+ - **Tests before code**: If you need to write tests for contracts, entities, and integration scenarios
150
+ - **Core development**: Implement models, services, CLI commands, endpoints
151
+ - **Integration work**: Database connections, middleware, logging, external services
152
+ - **Polish and validation**: Unit tests, performance optimization, documentation
153
+
154
+ 8. Progress tracking and error handling:
155
+ - Report progress after each completed task
156
+ - Halt execution if any non-parallel task fails
157
+ - For parallel tasks [P], continue with successful tasks, report failed ones
158
+ - Provide clear error messages with context for debugging
159
+ - Suggest next steps if implementation cannot proceed
160
+ - **IMPORTANT** For completed tasks, make sure to mark the task off as [X] in the tasks file.
161
+
162
+ 9. Completion validation:
163
+ - Verify all required tasks are completed
164
+ - Check that implemented features match the original specification
165
+ - Validate that tests pass and coverage meets requirements
166
+ - Confirm the implementation follows the technical plan
167
+ - Report final status with summary of completed work
168
+
169
+ 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.
170
+
171
+ 10. **Check for extension hooks**: After completion validation, check if `.specify/extensions.yml` exists in the project root.
172
+ - If it exists, read it and look for entries under the `hooks.after_implement` key
173
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
174
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
175
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
176
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
177
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
178
+ - For each executable hook, output the following based on its `optional` flag:
179
+ - **Optional hook** (`optional: true`):
180
+ ```
181
+ ## Extension Hooks
182
+
183
+ **Optional Hook**: {extension}
184
+ Command: `/{command}`
185
+ Description: {description}
186
+
187
+ Prompt: {prompt}
188
+ To execute: `/{command}`
189
+ ```
190
+ - **Mandatory hook** (`optional: false`):
191
+ ```
192
+ ## Extension Hooks
193
+
194
+ **Automatic Hook**: {extension}
195
+ Executing: `/{command}`
196
+ EXECUTE_COMMAND: {command}
197
+ ```
198
+ - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
@@ -0,0 +1,149 @@
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
+ ## Pre-Execution Checks
22
+
23
+ **Check for extension hooks (before planning)**:
24
+ - Check if `.specify/extensions.yml` exists in the project root.
25
+ - If it exists, read it and look for entries under the `hooks.before_plan` key
26
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
27
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
28
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
29
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
30
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
31
+ - For each executable hook, output the following based on its `optional` flag:
32
+ - **Optional hook** (`optional: true`):
33
+ ```
34
+ ## Extension Hooks
35
+
36
+ **Optional Pre-Hook**: {extension}
37
+ Command: `/{command}`
38
+ Description: {description}
39
+
40
+ Prompt: {prompt}
41
+ To execute: `/{command}`
42
+ ```
43
+ - **Mandatory hook** (`optional: false`):
44
+ ```
45
+ ## Extension Hooks
46
+
47
+ **Automatic Pre-Hook**: {extension}
48
+ Executing: `/{command}`
49
+ EXECUTE_COMMAND: {command}
50
+
51
+ Wait for the result of the hook command before proceeding to the Outline.
52
+ ```
53
+ - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
54
+
55
+ ## Outline
56
+
57
+ 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").
58
+
59
+ 2. **Load context**: Read FEATURE_SPEC and `.specify/memory/constitution.md`. Load IMPL_PLAN template (already copied).
60
+
61
+ 3. **Execute plan workflow**: Follow the structure in IMPL_PLAN template to:
62
+ - Fill Technical Context (mark unknowns as "NEEDS CLARIFICATION")
63
+ - Fill Constitution Check section from constitution
64
+ - Evaluate gates (ERROR if violations unjustified)
65
+ - Phase 0: Generate research.md (resolve all NEEDS CLARIFICATION)
66
+ - Phase 1: Generate data-model.md, contracts/, quickstart.md
67
+ - Phase 1: Update agent context by running the agent script
68
+ - Re-evaluate Constitution Check post-design
69
+
70
+ 4. **Stop and report**: Command ends after Phase 2 planning. Report branch, IMPL_PLAN path, and generated artifacts.
71
+
72
+ 5. **Check for extension hooks**: After reporting, check if `.specify/extensions.yml` exists in the project root.
73
+ - If it exists, read it and look for entries under the `hooks.after_plan` key
74
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
75
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
76
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
77
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
78
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
79
+ - For each executable hook, output the following based on its `optional` flag:
80
+ - **Optional hook** (`optional: true`):
81
+ ```
82
+ ## Extension Hooks
83
+
84
+ **Optional Hook**: {extension}
85
+ Command: `/{command}`
86
+ Description: {description}
87
+
88
+ Prompt: {prompt}
89
+ To execute: `/{command}`
90
+ ```
91
+ - **Mandatory hook** (`optional: false`):
92
+ ```
93
+ ## Extension Hooks
94
+
95
+ **Automatic Hook**: {extension}
96
+ Executing: `/{command}`
97
+ EXECUTE_COMMAND: {command}
98
+ ```
99
+ - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
100
+
101
+ ## Phases
102
+
103
+ ### Phase 0: Outline & Research
104
+
105
+ 1. **Extract unknowns from Technical Context** above:
106
+ - For each NEEDS CLARIFICATION → research task
107
+ - For each dependency → best practices task
108
+ - For each integration → patterns task
109
+
110
+ 2. **Generate and dispatch research agents**:
111
+
112
+ ```text
113
+ For each unknown in Technical Context:
114
+ Task: "Research {unknown} for {feature context}"
115
+ For each technology choice:
116
+ Task: "Find best practices for {tech} in {domain}"
117
+ ```
118
+
119
+ 3. **Consolidate findings** in `research.md` using format:
120
+ - Decision: [what was chosen]
121
+ - Rationale: [why chosen]
122
+ - Alternatives considered: [what else evaluated]
123
+
124
+ **Output**: research.md with all NEEDS CLARIFICATION resolved
125
+
126
+ ### Phase 1: Design & Contracts
127
+
128
+ **Prerequisites:** `research.md` complete
129
+
130
+ 1. **Extract entities from feature spec** → `data-model.md`:
131
+ - Entity name, fields, relationships
132
+ - Validation rules from requirements
133
+ - State transitions if applicable
134
+
135
+ 2. **Define interface contracts** (if project has external interfaces) → `/contracts/`:
136
+ - Identify what interfaces the project exposes to users or other systems
137
+ - Document the contract format appropriate for the project type
138
+ - Examples: public APIs for libraries, command schemas for CLI tools, endpoints for web services, grammars for parsers, UI contracts for applications
139
+ - Skip if project is purely internal (build scripts, one-off tools, etc.)
140
+
141
+ 3. **Agent context update**:
142
+ - Update the plan reference between the `<!-- SPECKIT START -->` and `<!-- SPECKIT END -->` markers in `AGENTS.md` to point to the plan file created in step 1 (the IMPL_PLAN path)
143
+
144
+ **Output**: data-model.md, /contracts/*, quickstart.md, updated agent context file
145
+
146
+ ## Key rules
147
+
148
+ - Use absolute paths for filesystem operations; use project-relative paths for references in documentation and agent context files
149
+ - ERROR on gate failures or unresolved clarifications