@cognite/cli 0.5.1 → 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 -134
  54. package/operations.js +0 -113
@@ -0,0 +1,249 @@
1
+ ---
2
+ description: Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
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 analysis)**:
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_analyze` 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 Goal.
44
+ ```
45
+ - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
46
+
47
+ ## Goal
48
+
49
+ Identify inconsistencies, duplications, ambiguities, and underspecified items across the three core artifacts (`spec.md`, `plan.md`, `tasks.md`) before implementation. This command MUST run only after `/speckit.tasks` has successfully produced a complete `tasks.md`.
50
+
51
+ ## Operating Constraints
52
+
53
+ **STRICTLY READ-ONLY**: Do **not** modify any files. Output a structured analysis report. Offer an optional remediation plan (user must explicitly approve before any follow-up editing commands would be invoked manually).
54
+
55
+ **Constitution Authority**: The project constitution (`.specify/memory/constitution.md`) is **non-negotiable** within this analysis scope. Constitution conflicts are automatically CRITICAL and require adjustment of the spec, plan, or tasks—not dilution, reinterpretation, or silent ignoring of the principle. If a principle itself needs to change, that must occur in a separate, explicit constitution update outside `/speckit.analyze`.
56
+
57
+ ## Execution Steps
58
+
59
+ ### 1. Initialize Analysis Context
60
+
61
+ Run `.specify/scripts/bash/check-prerequisites.sh --json --require-tasks --include-tasks` once from repo root and parse JSON for FEATURE_DIR and AVAILABLE_DOCS. Derive absolute paths:
62
+
63
+ - SPEC = FEATURE_DIR/spec.md
64
+ - PLAN = FEATURE_DIR/plan.md
65
+ - TASKS = FEATURE_DIR/tasks.md
66
+
67
+ Abort with an error message if any required file is missing (instruct the user to run missing prerequisite command).
68
+ 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").
69
+
70
+ ### 2. Load Artifacts (Progressive Disclosure)
71
+
72
+ Load only the minimal necessary context from each artifact:
73
+
74
+ **From spec.md:**
75
+
76
+ - Overview/Context
77
+ - Functional Requirements
78
+ - Success Criteria (measurable outcomes — e.g., performance, security, availability, user success, business impact)
79
+ - User Stories
80
+ - Edge Cases (if present)
81
+
82
+ **From plan.md:**
83
+
84
+ - Architecture/stack choices
85
+ - Data Model references
86
+ - Phases
87
+ - Technical constraints
88
+
89
+ **From tasks.md:**
90
+
91
+ - Task IDs
92
+ - Descriptions
93
+ - Phase grouping
94
+ - Parallel markers [P]
95
+ - Referenced file paths
96
+
97
+ **From constitution:**
98
+
99
+ - Load `.specify/memory/constitution.md` for principle validation
100
+
101
+ ### 3. Build Semantic Models
102
+
103
+ Create internal representations (do not include raw artifacts in output):
104
+
105
+ - **Requirements inventory**: For each Functional Requirement (FR-###) and Success Criterion (SC-###), record a stable key. Use the explicit FR-/SC- identifier as the primary key when present, and optionally also derive an imperative-phrase slug for readability (e.g., "User can upload file" → `user-can-upload-file`). Include only Success Criteria items that require buildable work (e.g., load-testing infrastructure, security audit tooling), and exclude post-launch outcome metrics and business KPIs (e.g., "Reduce support tickets by 50%").
106
+ - **User story/action inventory**: Discrete user actions with acceptance criteria
107
+ - **Task coverage mapping**: Map each task to one or more requirements or stories (inference by keyword / explicit reference patterns like IDs or key phrases)
108
+ - **Constitution rule set**: Extract principle names and MUST/SHOULD normative statements
109
+
110
+ ### 4. Detection Passes (Token-Efficient Analysis)
111
+
112
+ Focus on high-signal findings. Limit to 50 findings total; aggregate remainder in overflow summary.
113
+
114
+ #### A. Duplication Detection
115
+
116
+ - Identify near-duplicate requirements
117
+ - Mark lower-quality phrasing for consolidation
118
+
119
+ #### B. Ambiguity Detection
120
+
121
+ - Flag vague adjectives (fast, scalable, secure, intuitive, robust) lacking measurable criteria
122
+ - Flag unresolved placeholders (TODO, TKTK, ???, `<placeholder>`, etc.)
123
+
124
+ #### C. Underspecification
125
+
126
+ - Requirements with verbs but missing object or measurable outcome
127
+ - User stories missing acceptance criteria alignment
128
+ - Tasks referencing files or components not defined in spec/plan
129
+
130
+ #### D. Constitution Alignment
131
+
132
+ - Any requirement or plan element conflicting with a MUST principle
133
+ - Missing mandated sections or quality gates from constitution
134
+
135
+ #### E. Coverage Gaps
136
+
137
+ - Requirements with zero associated tasks
138
+ - Tasks with no mapped requirement/story
139
+ - Success Criteria requiring buildable work (performance, security, availability) not reflected in tasks
140
+
141
+ #### F. Inconsistency
142
+
143
+ - Terminology drift (same concept named differently across files)
144
+ - Data entities referenced in plan but absent in spec (or vice versa)
145
+ - Task ordering contradictions (e.g., integration tasks before foundational setup tasks without dependency note)
146
+ - Conflicting requirements (e.g., one requires Next.js while other specifies Vue)
147
+
148
+ ### 5. Severity Assignment
149
+
150
+ Use this heuristic to prioritize findings:
151
+
152
+ - **CRITICAL**: Violates constitution MUST, missing core spec artifact, or requirement with zero coverage that blocks baseline functionality
153
+ - **HIGH**: Duplicate or conflicting requirement, ambiguous security/performance attribute, untestable acceptance criterion
154
+ - **MEDIUM**: Terminology drift, missing non-functional task coverage, underspecified edge case
155
+ - **LOW**: Style/wording improvements, minor redundancy not affecting execution order
156
+
157
+ ### 6. Produce Compact Analysis Report
158
+
159
+ Output a Markdown report (no file writes) with the following structure:
160
+
161
+ ## Specification Analysis Report
162
+
163
+ | ID | Category | Severity | Location(s) | Summary | Recommendation |
164
+ |----|----------|----------|-------------|---------|----------------|
165
+ | A1 | Duplication | HIGH | spec.md:L120-134 | Two similar requirements ... | Merge phrasing; keep clearer version |
166
+
167
+ (Add one row per finding; generate stable IDs prefixed by category initial.)
168
+
169
+ **Coverage Summary Table:**
170
+
171
+ | Requirement Key | Has Task? | Task IDs | Notes |
172
+ |-----------------|-----------|----------|-------|
173
+
174
+ **Constitution Alignment Issues:** (if any)
175
+
176
+ **Unmapped Tasks:** (if any)
177
+
178
+ **Metrics:**
179
+
180
+ - Total Requirements
181
+ - Total Tasks
182
+ - Coverage % (requirements with >=1 task)
183
+ - Ambiguity Count
184
+ - Duplication Count
185
+ - Critical Issues Count
186
+
187
+ ### 7. Provide Next Actions
188
+
189
+ At end of report, output a concise Next Actions block:
190
+
191
+ - If CRITICAL issues exist: Recommend resolving before `/speckit.implement`
192
+ - If only LOW/MEDIUM: User may proceed, but provide improvement suggestions
193
+ - Provide explicit command suggestions: e.g., "Run /speckit.specify with refinement", "Run /speckit.plan to adjust architecture", "Manually edit tasks.md to add coverage for 'performance-metrics'"
194
+
195
+ ### 8. Offer Remediation
196
+
197
+ Ask the user: "Would you like me to suggest concrete remediation edits for the top N issues?" (Do NOT apply them automatically.)
198
+
199
+ ### 9. Check for extension hooks
200
+
201
+ After reporting, check if `.specify/extensions.yml` exists in the project root.
202
+ - If it exists, read it and look for entries under the `hooks.after_analyze` key
203
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
204
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
205
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
206
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
207
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
208
+ - For each executable hook, output the following based on its `optional` flag:
209
+ - **Optional hook** (`optional: true`):
210
+ ```
211
+ ## Extension Hooks
212
+
213
+ **Optional Hook**: {extension}
214
+ Command: `/{command}`
215
+ Description: {description}
216
+
217
+ Prompt: {prompt}
218
+ To execute: `/{command}`
219
+ ```
220
+ - **Mandatory hook** (`optional: false`):
221
+ ```
222
+ ## Extension Hooks
223
+
224
+ **Automatic Hook**: {extension}
225
+ Executing: `/{command}`
226
+ EXECUTE_COMMAND: {command}
227
+ ```
228
+ - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
229
+
230
+ ## Operating Principles
231
+
232
+ ### Context Efficiency
233
+
234
+ - **Minimal high-signal tokens**: Focus on actionable findings, not exhaustive documentation
235
+ - **Progressive disclosure**: Load artifacts incrementally; don't dump all content into analysis
236
+ - **Token-efficient output**: Limit findings table to 50 rows; summarize overflow
237
+ - **Deterministic results**: Rerunning without changes should produce consistent IDs and counts
238
+
239
+ ### Analysis Guidelines
240
+
241
+ - **NEVER modify files** (this is read-only analysis)
242
+ - **NEVER hallucinate missing sections** (if absent, report them accurately)
243
+ - **Prioritize constitution violations** (these are always CRITICAL)
244
+ - **Use examples over exhaustive rules** (cite specific instances, not generic patterns)
245
+ - **Report zero issues gracefully** (emit success report with coverage statistics)
246
+
247
+ ## Context
248
+
249
+ $ARGUMENTS
@@ -0,0 +1,361 @@
1
+ ---
2
+ description: Generate a custom checklist for the current feature based on user requirements.
3
+ ---
4
+
5
+ ## Checklist Purpose: "Unit Tests for English"
6
+
7
+ **CRITICAL CONCEPT**: Checklists are **UNIT TESTS FOR REQUIREMENTS WRITING** - they validate the quality, clarity, and completeness of requirements in a given domain.
8
+
9
+ **NOT for verification/testing**:
10
+
11
+ - ❌ NOT "Verify the button clicks correctly"
12
+ - ❌ NOT "Test error handling works"
13
+ - ❌ NOT "Confirm the API returns 200"
14
+ - ❌ NOT checking if code/implementation matches the spec
15
+
16
+ **FOR requirements quality validation**:
17
+
18
+ - ✅ "Are visual hierarchy requirements defined for all card types?" (completeness)
19
+ - ✅ "Is 'prominent display' quantified with specific sizing/positioning?" (clarity)
20
+ - ✅ "Are hover state requirements consistent across all interactive elements?" (consistency)
21
+ - ✅ "Are accessibility requirements defined for keyboard navigation?" (coverage)
22
+ - ✅ "Does the spec define what happens when logo image fails to load?" (edge cases)
23
+
24
+ **Metaphor**: If your spec is code written in English, the checklist is its unit test suite. You're testing whether the requirements are well-written, complete, unambiguous, and ready for implementation - NOT whether the implementation works.
25
+
26
+ ## User Input
27
+
28
+ ```text
29
+ $ARGUMENTS
30
+ ```
31
+
32
+ You **MUST** consider the user input before proceeding (if not empty).
33
+
34
+ ## Pre-Execution Checks
35
+
36
+ **Check for extension hooks (before checklist generation)**:
37
+ - Check if `.specify/extensions.yml` exists in the project root.
38
+ - If it exists, read it and look for entries under the `hooks.before_checklist` key
39
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
40
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
41
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
42
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
43
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
44
+ - For each executable hook, output the following based on its `optional` flag:
45
+ - **Optional hook** (`optional: true`):
46
+ ```
47
+ ## Extension Hooks
48
+
49
+ **Optional Pre-Hook**: {extension}
50
+ Command: `/{command}`
51
+ Description: {description}
52
+
53
+ Prompt: {prompt}
54
+ To execute: `/{command}`
55
+ ```
56
+ - **Mandatory hook** (`optional: false`):
57
+ ```
58
+ ## Extension Hooks
59
+
60
+ **Automatic Pre-Hook**: {extension}
61
+ Executing: `/{command}`
62
+ EXECUTE_COMMAND: {command}
63
+
64
+ Wait for the result of the hook command before proceeding to the Execution Steps.
65
+ ```
66
+ - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
67
+
68
+ ## Execution Steps
69
+
70
+ 1. **Setup**: Run `.specify/scripts/bash/check-prerequisites.sh --json` from repo root and parse JSON for FEATURE_DIR and AVAILABLE_DOCS list.
71
+ - All file paths must be absolute.
72
+ - 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").
73
+
74
+ 2. **Clarify intent (dynamic)**: Derive up to THREE initial contextual clarifying questions (no pre-baked catalog). They MUST:
75
+ - Be generated from the user's phrasing + extracted signals from spec/plan/tasks
76
+ - Only ask about information that materially changes checklist content
77
+ - Be skipped individually if already unambiguous in `$ARGUMENTS`
78
+ - Prefer precision over breadth
79
+
80
+ Generation algorithm:
81
+ 1. Extract signals: feature domain keywords (e.g., auth, latency, UX, API), risk indicators ("critical", "must", "compliance"), stakeholder hints ("QA", "review", "security team"), and explicit deliverables ("a11y", "rollback", "contracts").
82
+ 2. Cluster signals into candidate focus areas (max 4) ranked by relevance.
83
+ 3. Identify probable audience & timing (author, reviewer, QA, release) if not explicit.
84
+ 4. Detect missing dimensions: scope breadth, depth/rigor, risk emphasis, exclusion boundaries, measurable acceptance criteria.
85
+ 5. Formulate questions chosen from these archetypes:
86
+ - Scope refinement (e.g., "Should this include integration touchpoints with X and Y or stay limited to local module correctness?")
87
+ - Risk prioritization (e.g., "Which of these potential risk areas should receive mandatory gating checks?")
88
+ - Depth calibration (e.g., "Is this a lightweight pre-commit sanity list or a formal release gate?")
89
+ - Audience framing (e.g., "Will this be used by the author only or peers during PR review?")
90
+ - Boundary exclusion (e.g., "Should we explicitly exclude performance tuning items this round?")
91
+ - Scenario class gap (e.g., "No recovery flows detected—are rollback / partial failure paths in scope?")
92
+
93
+ Question formatting rules:
94
+ - If presenting options, generate a compact table with columns: Option | Candidate | Why It Matters
95
+ - Limit to A–E options maximum; omit table if a free-form answer is clearer
96
+ - Never ask the user to restate what they already said
97
+ - Avoid speculative categories (no hallucination). If uncertain, ask explicitly: "Confirm whether X belongs in scope."
98
+
99
+ Defaults when interaction impossible:
100
+ - Depth: Standard
101
+ - Audience: Reviewer (PR) if code-related; Author otherwise
102
+ - Focus: Top 2 relevance clusters
103
+
104
+ Output the questions (label Q1/Q2/Q3). After answers: if ≥2 scenario classes (Alternate / Exception / Recovery / Non-Functional domain) remain unclear, you MAY ask up to TWO more targeted follow‑ups (Q4/Q5) with a one-line justification each (e.g., "Unresolved recovery path risk"). Do not exceed five total questions. Skip escalation if user explicitly declines more.
105
+
106
+ 3. **Understand user request**: Combine `$ARGUMENTS` + clarifying answers:
107
+ - Derive checklist theme (e.g., security, review, deploy, ux)
108
+ - Consolidate explicit must-have items mentioned by user
109
+ - Map focus selections to category scaffolding
110
+ - Infer any missing context from spec/plan/tasks (do NOT hallucinate)
111
+
112
+ 4. **Load feature context**: Read from FEATURE_DIR:
113
+ - spec.md: Feature requirements and scope
114
+ - plan.md (if exists): Technical details, dependencies
115
+ - tasks.md (if exists): Implementation tasks
116
+
117
+ **Context Loading Strategy**:
118
+ - Load only necessary portions relevant to active focus areas (avoid full-file dumping)
119
+ - Prefer summarizing long sections into concise scenario/requirement bullets
120
+ - Use progressive disclosure: add follow-on retrieval only if gaps detected
121
+ - If source docs are large, generate interim summary items instead of embedding raw text
122
+
123
+ 5. **Generate checklist** - Create "Unit Tests for Requirements":
124
+ - Create `FEATURE_DIR/checklists/` directory if it doesn't exist
125
+ - Generate unique checklist filename:
126
+ - Use short, descriptive name based on domain (e.g., `ux.md`, `api.md`, `security.md`)
127
+ - Format: `[domain].md`
128
+ - File handling behavior:
129
+ - If file does NOT exist: Create new file and number items starting from CHK001
130
+ - If file exists: Append new items to existing file, continuing from the last CHK ID (e.g., if last item is CHK015, start new items at CHK016)
131
+ - Never delete or replace existing checklist content - always preserve and append
132
+
133
+ **CORE PRINCIPLE - Test the Requirements, Not the Implementation**:
134
+ Every checklist item MUST evaluate the REQUIREMENTS THEMSELVES for:
135
+ - **Completeness**: Are all necessary requirements present?
136
+ - **Clarity**: Are requirements unambiguous and specific?
137
+ - **Consistency**: Do requirements align with each other?
138
+ - **Measurability**: Can requirements be objectively verified?
139
+ - **Coverage**: Are all scenarios/edge cases addressed?
140
+
141
+ **Category Structure** - Group items by requirement quality dimensions:
142
+ - **Requirement Completeness** (Are all necessary requirements documented?)
143
+ - **Requirement Clarity** (Are requirements specific and unambiguous?)
144
+ - **Requirement Consistency** (Do requirements align without conflicts?)
145
+ - **Acceptance Criteria Quality** (Are success criteria measurable?)
146
+ - **Scenario Coverage** (Are all flows/cases addressed?)
147
+ - **Edge Case Coverage** (Are boundary conditions defined?)
148
+ - **Non-Functional Requirements** (Performance, Security, Accessibility, etc. - are they specified?)
149
+ - **Dependencies & Assumptions** (Are they documented and validated?)
150
+ - **Ambiguities & Conflicts** (What needs clarification?)
151
+
152
+ **HOW TO WRITE CHECKLIST ITEMS - "Unit Tests for English"**:
153
+
154
+ ❌ **WRONG** (Testing implementation):
155
+ - "Verify landing page displays 3 episode cards"
156
+ - "Test hover states work on desktop"
157
+ - "Confirm logo click navigates home"
158
+
159
+ ✅ **CORRECT** (Testing requirements quality):
160
+ - "Are the exact number and layout of featured episodes specified?" [Completeness]
161
+ - "Is 'prominent display' quantified with specific sizing/positioning?" [Clarity]
162
+ - "Are hover state requirements consistent across all interactive elements?" [Consistency]
163
+ - "Are keyboard navigation requirements defined for all interactive UI?" [Coverage]
164
+ - "Is the fallback behavior specified when logo image fails to load?" [Edge Cases]
165
+ - "Are loading states defined for asynchronous episode data?" [Completeness]
166
+ - "Does the spec define visual hierarchy for competing UI elements?" [Clarity]
167
+
168
+ **ITEM STRUCTURE**:
169
+ Each item should follow this pattern:
170
+ - Question format asking about requirement quality
171
+ - Focus on what's WRITTEN (or not written) in the spec/plan
172
+ - Include quality dimension in brackets [Completeness/Clarity/Consistency/etc.]
173
+ - Reference spec section `[Spec §X.Y]` when checking existing requirements
174
+ - Use `[Gap]` marker when checking for missing requirements
175
+
176
+ **EXAMPLES BY QUALITY DIMENSION**:
177
+
178
+ Completeness:
179
+ - "Are error handling requirements defined for all API failure modes? [Gap]"
180
+ - "Are accessibility requirements specified for all interactive elements? [Completeness]"
181
+ - "Are mobile breakpoint requirements defined for responsive layouts? [Gap]"
182
+
183
+ Clarity:
184
+ - "Is 'fast loading' quantified with specific timing thresholds? [Clarity, Spec §NFR-2]"
185
+ - "Are 'related episodes' selection criteria explicitly defined? [Clarity, Spec §FR-5]"
186
+ - "Is 'prominent' defined with measurable visual properties? [Ambiguity, Spec §FR-4]"
187
+
188
+ Consistency:
189
+ - "Do navigation requirements align across all pages? [Consistency, Spec §FR-10]"
190
+ - "Are card component requirements consistent between landing and detail pages? [Consistency]"
191
+
192
+ Coverage:
193
+ - "Are requirements defined for zero-state scenarios (no episodes)? [Coverage, Edge Case]"
194
+ - "Are concurrent user interaction scenarios addressed? [Coverage, Gap]"
195
+ - "Are requirements specified for partial data loading failures? [Coverage, Exception Flow]"
196
+
197
+ Measurability:
198
+ - "Are visual hierarchy requirements measurable/testable? [Acceptance Criteria, Spec §FR-1]"
199
+ - "Can 'balanced visual weight' be objectively verified? [Measurability, Spec §FR-2]"
200
+
201
+ **Scenario Classification & Coverage** (Requirements Quality Focus):
202
+ - Check if requirements exist for: Primary, Alternate, Exception/Error, Recovery, Non-Functional scenarios
203
+ - For each scenario class, ask: "Are [scenario type] requirements complete, clear, and consistent?"
204
+ - If scenario class missing: "Are [scenario type] requirements intentionally excluded or missing? [Gap]"
205
+ - Include resilience/rollback when state mutation occurs: "Are rollback requirements defined for migration failures? [Gap]"
206
+
207
+ **Traceability Requirements**:
208
+ - MINIMUM: ≥80% of items MUST include at least one traceability reference
209
+ - Each item should reference: spec section `[Spec §X.Y]`, or use markers: `[Gap]`, `[Ambiguity]`, `[Conflict]`, `[Assumption]`
210
+ - If no ID system exists: "Is a requirement & acceptance criteria ID scheme established? [Traceability]"
211
+
212
+ **Surface & Resolve Issues** (Requirements Quality Problems):
213
+ Ask questions about the requirements themselves:
214
+ - Ambiguities: "Is the term 'fast' quantified with specific metrics? [Ambiguity, Spec §NFR-1]"
215
+ - Conflicts: "Do navigation requirements conflict between §FR-10 and §FR-10a? [Conflict]"
216
+ - Assumptions: "Is the assumption of 'always available podcast API' validated? [Assumption]"
217
+ - Dependencies: "Are external podcast API requirements documented? [Dependency, Gap]"
218
+ - Missing definitions: "Is 'visual hierarchy' defined with measurable criteria? [Gap]"
219
+
220
+ **Content Consolidation**:
221
+ - Soft cap: If raw candidate items > 40, prioritize by risk/impact
222
+ - Merge near-duplicates checking the same requirement aspect
223
+ - If >5 low-impact edge cases, create one item: "Are edge cases X, Y, Z addressed in requirements? [Coverage]"
224
+
225
+ **🚫 ABSOLUTELY PROHIBITED** - These make it an implementation test, not a requirements test:
226
+ - ❌ Any item starting with "Verify", "Test", "Confirm", "Check" + implementation behavior
227
+ - ❌ References to code execution, user actions, system behavior
228
+ - ❌ "Displays correctly", "works properly", "functions as expected"
229
+ - ❌ "Click", "navigate", "render", "load", "execute"
230
+ - ❌ Test cases, test plans, QA procedures
231
+ - ❌ Implementation details (frameworks, APIs, algorithms)
232
+
233
+ **✅ REQUIRED PATTERNS** - These test requirements quality:
234
+ - ✅ "Are [requirement type] defined/specified/documented for [scenario]?"
235
+ - ✅ "Is [vague term] quantified/clarified with specific criteria?"
236
+ - ✅ "Are requirements consistent between [section A] and [section B]?"
237
+ - ✅ "Can [requirement] be objectively measured/verified?"
238
+ - ✅ "Are [edge cases/scenarios] addressed in requirements?"
239
+ - ✅ "Does the spec define [missing aspect]?"
240
+
241
+ 6. **Structure Reference**: Generate the checklist following the canonical template in `.specify/templates/checklist-template.md` for title, meta section, category headings, and ID formatting. If template is unavailable, use: H1 title, purpose/created meta lines, `##` category sections containing `- [ ] CHK### <requirement item>` lines with globally incrementing IDs starting at CHK001.
242
+
243
+ 7. **Report**: Output full path to checklist file, item count, and summarize whether the run created a new file or appended to an existing one. Summarize:
244
+ - Focus areas selected
245
+ - Depth level
246
+ - Actor/timing
247
+ - Any explicit user-specified must-have items incorporated
248
+
249
+ **Important**: Each `/speckit.checklist` command invocation uses a short, descriptive checklist filename and either creates a new file or appends to an existing one. This allows:
250
+
251
+ - Multiple checklists of different types (e.g., `ux.md`, `test.md`, `security.md`)
252
+ - Simple, memorable filenames that indicate checklist purpose
253
+ - Easy identification and navigation in the `checklists/` folder
254
+
255
+ To avoid clutter, use descriptive types and clean up obsolete checklists when done.
256
+
257
+ ## Example Checklist Types & Sample Items
258
+
259
+ **UX Requirements Quality:** `ux.md`
260
+
261
+ Sample items (testing the requirements, NOT the implementation):
262
+
263
+ - "Are visual hierarchy requirements defined with measurable criteria? [Clarity, Spec §FR-1]"
264
+ - "Is the number and positioning of UI elements explicitly specified? [Completeness, Spec §FR-1]"
265
+ - "Are interaction state requirements (hover, focus, active) consistently defined? [Consistency]"
266
+ - "Are accessibility requirements specified for all interactive elements? [Coverage, Gap]"
267
+ - "Is fallback behavior defined when images fail to load? [Edge Case, Gap]"
268
+ - "Can 'prominent display' be objectively measured? [Measurability, Spec §FR-4]"
269
+
270
+ **API Requirements Quality:** `api.md`
271
+
272
+ Sample items:
273
+
274
+ - "Are error response formats specified for all failure scenarios? [Completeness]"
275
+ - "Are rate limiting requirements quantified with specific thresholds? [Clarity]"
276
+ - "Are authentication requirements consistent across all endpoints? [Consistency]"
277
+ - "Are retry/timeout requirements defined for external dependencies? [Coverage, Gap]"
278
+ - "Is versioning strategy documented in requirements? [Gap]"
279
+
280
+ **Performance Requirements Quality:** `performance.md`
281
+
282
+ Sample items:
283
+
284
+ - "Are performance requirements quantified with specific metrics? [Clarity]"
285
+ - "Are performance targets defined for all critical user journeys? [Coverage]"
286
+ - "Are performance requirements under different load conditions specified? [Completeness]"
287
+ - "Can performance requirements be objectively measured? [Measurability]"
288
+ - "Are degradation requirements defined for high-load scenarios? [Edge Case, Gap]"
289
+
290
+ **Security Requirements Quality:** `security.md`
291
+
292
+ Sample items:
293
+
294
+ - "Are authentication requirements specified for all protected resources? [Coverage]"
295
+ - "Are data protection requirements defined for sensitive information? [Completeness]"
296
+ - "Is the threat model documented and requirements aligned to it? [Traceability]"
297
+ - "Are security requirements consistent with compliance obligations? [Consistency]"
298
+ - "Are security failure/breach response requirements defined? [Gap, Exception Flow]"
299
+
300
+ ## Anti-Examples: What NOT To Do
301
+
302
+ **❌ WRONG - These test implementation, not requirements:**
303
+
304
+ ```markdown
305
+ - [ ] CHK001 - Verify landing page displays 3 episode cards [Spec §FR-001]
306
+ - [ ] CHK002 - Test hover states work correctly on desktop [Spec §FR-003]
307
+ - [ ] CHK003 - Confirm logo click navigates to home page [Spec §FR-010]
308
+ - [ ] CHK004 - Check that related episodes section shows 3-5 items [Spec §FR-005]
309
+ ```
310
+
311
+ **✅ CORRECT - These test requirements quality:**
312
+
313
+ ```markdown
314
+ - [ ] CHK001 - Are the number and layout of featured episodes explicitly specified? [Completeness, Spec §FR-001]
315
+ - [ ] CHK002 - Are hover state requirements consistently defined for all interactive elements? [Consistency, Spec §FR-003]
316
+ - [ ] CHK003 - Are navigation requirements clear for all clickable brand elements? [Clarity, Spec §FR-010]
317
+ - [ ] CHK004 - Is the selection criteria for related episodes documented? [Gap, Spec §FR-005]
318
+ - [ ] CHK005 - Are loading state requirements defined for asynchronous episode data? [Gap]
319
+ - [ ] CHK006 - Can "visual hierarchy" requirements be objectively measured? [Measurability, Spec §FR-001]
320
+ ```
321
+
322
+ **Key Differences:**
323
+
324
+ - Wrong: Tests if the system works correctly
325
+ - Correct: Tests if the requirements are written correctly
326
+ - Wrong: Verification of behavior
327
+ - Correct: Validation of requirement quality
328
+ - Wrong: "Does it do X?"
329
+ - Correct: "Is X clearly specified?"
330
+
331
+ ## Post-Execution Checks
332
+
333
+ **Check for extension hooks (after checklist generation)**:
334
+ Check if `.specify/extensions.yml` exists in the project root.
335
+ - If it exists, read it and look for entries under the `hooks.after_checklist` key
336
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
337
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
338
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
339
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
340
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
341
+ - For each executable hook, output the following based on its `optional` flag:
342
+ - **Optional hook** (`optional: true`):
343
+ ```
344
+ ## Extension Hooks
345
+
346
+ **Optional Hook**: {extension}
347
+ Command: `/{command}`
348
+ Description: {description}
349
+
350
+ Prompt: {prompt}
351
+ To execute: `/{command}`
352
+ ```
353
+ - **Mandatory hook** (`optional: false`):
354
+ ```
355
+ ## Extension Hooks
356
+
357
+ **Automatic Hook**: {extension}
358
+ Executing: `/{command}`
359
+ EXECUTE_COMMAND: {command}
360
+ ```
361
+ - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently