@x0rium/devkit-cli 0.6.0 → 0.8.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/constitution.d.ts.map +1 -1
  2. package/dist/constitution.js +62 -8
  3. package/dist/constitution.js.map +1 -1
  4. package/dist/dashboard.d.ts.map +1 -1
  5. package/dist/dashboard.js +6 -2
  6. package/dist/dashboard.js.map +1 -1
  7. package/dist/detector.d.ts.map +1 -1
  8. package/dist/detector.js +5 -2
  9. package/dist/detector.js.map +1 -1
  10. package/dist/escalate.d.ts.map +1 -1
  11. package/dist/escalate.js +8 -3
  12. package/dist/escalate.js.map +1 -1
  13. package/dist/gate.d.ts.map +1 -1
  14. package/dist/gate.js +57 -10
  15. package/dist/gate.js.map +1 -1
  16. package/dist/index.js +64 -8
  17. package/dist/index.js.map +1 -1
  18. package/dist/inject.d.ts +26 -0
  19. package/dist/inject.d.ts.map +1 -0
  20. package/dist/inject.js +161 -0
  21. package/dist/inject.js.map +1 -0
  22. package/dist/investigate.d.ts.map +1 -1
  23. package/dist/investigate.js +8 -10
  24. package/dist/investigate.js.map +1 -1
  25. package/dist/rfc.d.ts.map +1 -1
  26. package/dist/rfc.js +8 -10
  27. package/dist/rfc.js.map +1 -1
  28. package/dist/scaffold.d.ts +1 -0
  29. package/dist/scaffold.d.ts.map +1 -1
  30. package/dist/scaffold.js +11 -1
  31. package/dist/scaffold.js.map +1 -1
  32. package/dist/schemas.js +2 -2
  33. package/dist/schemas.js.map +1 -1
  34. package/dist/status.d.ts.map +1 -1
  35. package/dist/status.js +7 -4
  36. package/dist/status.js.map +1 -1
  37. package/dist/validator.js +1 -1
  38. package/dist/validator.js.map +1 -1
  39. package/dist/watch.js +10 -10
  40. package/dist/watch.js.map +1 -1
  41. package/package.json +2 -4
  42. package/skills/arch-kit/SKILL.md +66 -4
  43. package/skills/devkit-init/SKILL.md +35 -60
  44. package/skills/product-kit/SKILL.md +28 -3
  45. package/skills/qa-kit/SKILL.md +44 -2
  46. package/skills/research-kit/SKILL.md +30 -8
  47. package/skills/spec-kit/SKILL.md +133 -39
  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
@@ -1,10 +1,10 @@
1
1
  ---
2
2
  name: spec-kit
3
- description: DevKit Level 4. Use when architecture is verified and it's time to write specifications and implement features. Integrates with github/spec-kit workflow. Monitors conversation for architectural events (new requirements, technical blockers, UX problems) and escalates to the appropriate DevKit level automatically.
3
+ description: DevKit Level 4. Activated when architecture is verified and constitution is synced. Delegates implementation to github/spec-kit (specify-cli) as the execution engine. DevKit provides event detection (RFC, Investigation, Product Blocker) that interrupts spec-kit workflow when invariants are touched. Triggers on phrases like "let's build", "implement", "start coding", "write the feature".
4
4
  license: MIT
5
5
  metadata:
6
6
  author: devkit
7
- version: "1.0"
7
+ version: "2.0"
8
8
  layer: "4-of-5"
9
9
  prev: arch-kit
10
10
  next: qa-kit
@@ -12,32 +12,99 @@ metadata:
12
12
 
13
13
  # SpecKit — Level 4: "Build it."
14
14
 
15
- You are operating in SpecKit phase. Architecture is verified. You have a constitution.md. Now you build — using the github/spec-kit workflow as the implementation engine.
15
+ You are operating in SpecKit phase. Architecture is verified. Constitution is synced to `.specify/memory/constitution.md`. Now you build — using **github/spec-kit** as the implementation engine.
16
+
17
+ ## Start
18
+
19
+ ```bash
20
+ devkit status
21
+ ```
22
+
23
+ Confirm you are in the spec phase. If not, check gate status of the previous phase.
24
+
25
+ ## Prerequisites
26
+
27
+ Before any spec work, verify:
28
+
29
+ 1. Constitution exists and is synced:
30
+ ```bash
31
+ ls .specify/memory/constitution.md
32
+ ```
33
+ If missing:
34
+ ```bash
35
+ devkit generate-constitution
36
+ devkit sync
37
+ ```
38
+
39
+ 2. spec-kit is initialized:
40
+ ```bash
41
+ ls .specify/scripts/
42
+ ```
43
+ If missing:
44
+ ```bash
45
+ specify init . --ai claude
46
+ ```
16
47
 
17
48
  ## Your Role
18
49
 
19
- - Follow github/spec-kit methodology for specification and implementation
50
+ - Delegate specification and implementation to spec-kit `/speckit.*` commands
20
51
  - Monitor every developer message for escalation triggers
21
52
  - STOP and escalate before proceeding when triggers are detected
22
53
  - Never silently modify architecture within a spec
23
54
 
24
- ## Constitution
55
+ ## spec-kit Workflow
25
56
 
26
- Before any spec work, confirm constitution.md exists at `.specify/constitution.md`.
27
- If it doesn't exist, stop and run: `/arch-kit generate-constitution`
57
+ Execute these commands in order. Each is a slash command provided by spec-kit:
28
58
 
29
- The constitution comes from ArchKit — do not edit it manually. It contains the verified invariants that all specs must respect.
59
+ ### Step 1: Create Feature Specification
60
+ ```
61
+ /speckit.specify <feature description>
62
+ ```
63
+ Creates `.specify/specs/NNN-feature-name/spec.md` + git branch.
64
+ Focuses on WHAT and WHY, not HOW. Max 3 `[NEEDS CLARIFICATION]` markers.
30
65
 
31
- ## Standard Workflow (github/spec-kit)
66
+ ### Step 2: Resolve Ambiguities
67
+ ```
68
+ /speckit.clarify
69
+ ```
70
+ Structured ambiguity scan across 11 categories. Asks up to 5 questions per session.
71
+ Updates spec.md with `## Clarifications` section.
32
72
 
73
+ ### Step 3: Technical Implementation Plan
33
74
  ```
34
- /constitution — already generated by ArchKit, review only
35
- /specify — describe the feature
36
- /clarify — resolve ambiguities before planning
37
- /plan — technical plan respecting invariants
38
- /tasks — break into reviewable units
39
- /analyze — check cross-spec consistency
40
- /implement — generate code
75
+ /speckit.plan <tech stack preferences>
76
+ ```
77
+ Generates: `plan.md`, `research.md`, `data-model.md`, `contracts/`, `quickstart.md`.
78
+ Performs constitution compliance check automatically.
79
+
80
+ ### Step 4: Task Breakdown
81
+ ```
82
+ /speckit.tasks
83
+ ```
84
+ Generates `tasks.md` with dependency ordering.
85
+ Tasks tagged `[P]` for parallelizable, `[USn]` mapped to user stories.
86
+
87
+ ### Step 5: Cross-Artifact Consistency Analysis
88
+ ```
89
+ /speckit.analyze
90
+ ```
91
+ Read-only analysis: duplication, ambiguity, underspecification, constitution alignment, coverage gaps, inconsistency. Outputs severity-rated findings.
92
+
93
+ ### Step 6: Quality Checklists
94
+ ```
95
+ /speckit.checklist <domain>
96
+ ```
97
+ "Unit tests for English" — validates that requirements themselves are complete, clear, consistent, and measurable. Domains: security, ux, api, etc.
98
+
99
+ ### Step 7: Implement
100
+ ```
101
+ /speckit.implement
102
+ ```
103
+ Executes tasks phase-by-phase, marks completed in tasks.md, validates against spec.
104
+
105
+ ### Bonus: Export to GitHub Issues
106
+ ```
107
+ /speckit.taskstoissues
41
108
  ```
42
109
 
43
110
  ## Invariant Guard
@@ -50,7 +117,12 @@ TECHNICAL: [I1, I3] from .devkit/arch/invariants.md
50
117
  UX: [U2] from .devkit/product/ux_invariants.md
51
118
  ```
52
119
 
53
- If implementation requires deviating from an invariant STOP. Do not implement. Open RFC.
120
+ If implementation requires deviating from an invariant STOP. Do not implement. Open RFC:
121
+
122
+ ```bash
123
+ devkit impact "description of deviation"
124
+ devkit rfc "description"
125
+ ```
54
126
 
55
127
  ## Event Detection — CRITICAL
56
128
 
@@ -60,49 +132,71 @@ Monitor every developer message. Before continuing spec work, check for triggers
60
132
  Patterns: "we also need", "add support for", "client wants", "what about", "can we also"
61
133
 
62
134
  Action:
63
- > "This sounds like a new requirement. Let me check if it touches our invariants.
64
- > [read .devkit/arch/invariants.md]
65
- > This affects invariant [I_N]. I need to open an RFC before continuing.
66
- > Estimated impact: [N specs affected]. Proceed with RFC? /arch-kit rfc"
135
+ > "This sounds like a new requirement. Let me check if it touches our invariants."
136
+
137
+ ```bash
138
+ devkit impact "new requirement description"
139
+ devkit rfc "description"
140
+ ```
67
141
 
68
142
  Do NOT continue spec work until RFC is resolved.
69
143
 
70
144
  ### Investigation Trigger — Technical Blocker
71
- Patterns: "bug in library", "this doesn't support", "benchmark shows", "unexpected behavior", "doesn't work as expected", "performance issue"
145
+ Patterns: "bug in library", "this doesn't support", "benchmark shows", "unexpected behavior", "performance issue"
72
146
 
73
147
  Action:
74
- > "This breaks an architectural assumption. Let me identify which one.
75
- > [read .devkit/arch/decisions/ADR-*.md]
76
- > This breaks the assumption in [ADR-N]. Opening Investigation.
77
- > /arch-kit investigate"
148
+ > "This breaks an architectural assumption. Opening Investigation."
149
+
150
+ ```bash
151
+ devkit investigate "description of blocker"
152
+ ```
78
153
 
79
154
  Do NOT work around the blocker silently.
80
155
 
81
156
  ### Product Blocker Trigger — UX Problem
82
- Patterns: "this is hard to use", "too many parameters", "confusing", "users won't get this", "awkward interface"
157
+ Patterns: "this is hard to use", "too many parameters", "confusing", "users won't get this"
83
158
 
84
159
  Action:
85
- > "This looks like a UX invariant issue. Let me check.
86
- > [read .devkit/product/ux_invariants.md]
87
- > This conflicts with [U_N]. Escalating to ProductKit investigation."
160
+ > "This looks like a UX invariant issue."
88
161
 
89
- Do NOT continue with the current design.
162
+ Check `.devkit/product/ux_invariants.md`. If violated escalate to ProductKit.
90
163
 
91
164
  ### No Trigger — Normal Work
92
- When none of the above apply: proceed with standard spec-kit workflow.
165
+ When none of the above apply: proceed with spec-kit workflow.
93
166
 
94
- ## Spec Numbering
167
+ **After creating or updating DevKit artifacts, always run:**
168
+ ```bash
169
+ devkit validate
170
+ ```
171
+
172
+ ## Gate: When Can We Move to QAKit?
95
173
 
96
- Specs are numbered sequentially: spec_001, spec_002, etc.
97
- When specs are revised after an RFC, they keep their number and get revision suffix: spec_003_r1.
174
+ ```bash
175
+ devkit gate
176
+ ```
98
177
 
99
- ## Handoff to QAKit
178
+ ALLOWED when:
179
+ - At least one spec-kit feature implemented (`.specify/specs/NNN-*/`)
180
+ - No open RFCs or Investigations
181
+
182
+ BLOCKED when:
183
+ - Open RFC or Investigation exists
184
+ - No features in `.specify/specs/`
185
+
186
+ ## Handoff
187
+
188
+ When `devkit gate` shows ALLOWED:
189
+
190
+ ```bash
191
+ devkit advance
192
+ devkit status
193
+ ```
100
194
 
101
- After implementation of a feature or milestone:
195
+ Then generate summary:
102
196
  ```
103
197
  IMPLEMENTATION COMPLETE
104
- SPECS: [list]
105
- INVARIANTS COVERED: [list]
198
+ SPECS: [list of .specify/specs/NNN-*/ directories]
199
+ INVARIANTS COVERED: [list from spec invariant coverage sections]
106
200
  OPEN ITEMS: none / [list with owners]
107
201
  READY FOR: QAKit
108
202
  ```
@@ -0,0 +1,201 @@
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
+ ## Goal
14
+
15
+ 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`.
16
+
17
+ ## Operating Constraints
18
+
19
+ **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).
20
+
21
+ **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`.
22
+
23
+ ## Execution Steps
24
+
25
+ ### 1. Initialize Analysis Context
26
+
27
+ 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:
28
+
29
+ - SPEC = FEATURE_DIR/spec.md
30
+ - PLAN = FEATURE_DIR/plan.md
31
+ - TASKS = FEATURE_DIR/tasks.md
32
+
33
+ Abort with an error message if any required file is missing (instruct the user to run missing prerequisite command).
34
+ 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").
35
+
36
+ ### 2. Load Artifacts (Progressive Disclosure)
37
+
38
+ Load only the minimal necessary context from each artifact:
39
+
40
+ **From spec.md:**
41
+
42
+ - Overview/Context
43
+ - Functional Requirements
44
+ - Non-Functional Requirements
45
+ - User Stories
46
+ - Edge Cases (if present)
47
+
48
+ **From plan.md:**
49
+
50
+ - Architecture/stack choices
51
+ - Data Model references
52
+ - Phases
53
+ - Technical constraints
54
+
55
+ **From tasks.md:**
56
+
57
+ - Task IDs
58
+ - Descriptions
59
+ - Phase grouping
60
+ - Parallel markers [P]
61
+ - Referenced file paths
62
+
63
+ **From constitution:**
64
+
65
+ - Load `.specify/memory/constitution.md` for principle validation
66
+
67
+ ### 3. Build Semantic Models
68
+
69
+ Create internal representations (do not include raw artifacts in output):
70
+
71
+ - **Requirements inventory**: Each functional + non-functional requirement with a stable key (derive slug based on imperative phrase; e.g., "User can upload file" → `user-can-upload-file`)
72
+ - **User story/action inventory**: Discrete user actions with acceptance criteria
73
+ - **Task coverage mapping**: Map each task to one or more requirements or stories (inference by keyword / explicit reference patterns like IDs or key phrases)
74
+ - **Constitution rule set**: Extract principle names and MUST/SHOULD normative statements
75
+
76
+ ### 4. Detection Passes (Token-Efficient Analysis)
77
+
78
+ Focus on high-signal findings. Limit to 50 findings total; aggregate remainder in overflow summary.
79
+
80
+ #### A. Duplication Detection
81
+
82
+ - Identify near-duplicate requirements
83
+ - Mark lower-quality phrasing for consolidation
84
+
85
+ #### B. Ambiguity Detection
86
+
87
+ - Flag vague adjectives (fast, scalable, secure, intuitive, robust) lacking measurable criteria
88
+ - Flag unresolved placeholders (TODO, TKTK, ???, `<placeholder>`, etc.)
89
+
90
+ #### C. Underspecification
91
+
92
+ - Requirements with verbs but missing object or measurable outcome
93
+ - User stories missing acceptance criteria alignment
94
+ - Tasks referencing files or components not defined in spec/plan
95
+
96
+ #### D. Constitution Alignment
97
+
98
+ - Any requirement or plan element conflicting with a MUST principle
99
+ - Missing mandated sections or quality gates from constitution
100
+
101
+ #### E. Coverage Gaps
102
+
103
+ - Requirements with zero associated tasks
104
+ - Tasks with no mapped requirement/story
105
+ - Non-functional requirements not reflected in tasks (e.g., performance, security)
106
+
107
+ #### F. Inconsistency
108
+
109
+ - Terminology drift (same concept named differently across files)
110
+ - Data entities referenced in plan but absent in spec (or vice versa)
111
+ - Task ordering contradictions (e.g., integration tasks before foundational setup tasks without dependency note)
112
+ - Conflicting requirements (e.g., one requires Next.js while other specifies Vue)
113
+
114
+ <!-- DEVKIT:START:coverage-pass -->
115
+ #### G. DevKit Invariant Coverage
116
+
117
+ - Run `devkit coverage` and capture the output
118
+ - For each invariant (technical I1-I8, UX U1-U6):
119
+ - Check if the invariant has at least one test covering it
120
+ - Flag uncovered invariants as findings with severity based on invariant type:
121
+ - Technical invariant uncovered → HIGH
122
+ - UX invariant uncovered → MEDIUM
123
+ - Add to Coverage Summary Table:
124
+ - Row per invariant: ID, Name, Covered (yes/no), Test IDs
125
+ - Add "DevKit Invariant Coverage" section to the analysis report with:
126
+ - Coverage percentage
127
+ - Uncovered invariants list
128
+ - Recommendation: `devkit coverage` for detailed map
129
+ <!-- DEVKIT:END:coverage-pass -->
130
+
131
+ ### 5. Severity Assignment
132
+
133
+ Use this heuristic to prioritize findings:
134
+
135
+ - **CRITICAL**: Violates constitution MUST, missing core spec artifact, or requirement with zero coverage that blocks baseline functionality
136
+ - **HIGH**: Duplicate or conflicting requirement, ambiguous security/performance attribute, untestable acceptance criterion
137
+ - **MEDIUM**: Terminology drift, missing non-functional task coverage, underspecified edge case
138
+ - **LOW**: Style/wording improvements, minor redundancy not affecting execution order
139
+
140
+ ### 6. Produce Compact Analysis Report
141
+
142
+ Output a Markdown report (no file writes) with the following structure:
143
+
144
+ ## Specification Analysis Report
145
+
146
+ | ID | Category | Severity | Location(s) | Summary | Recommendation |
147
+ |----|----------|----------|-------------|---------|----------------|
148
+ | A1 | Duplication | HIGH | spec.md:L120-134 | Two similar requirements ... | Merge phrasing; keep clearer version |
149
+
150
+ (Add one row per finding; generate stable IDs prefixed by category initial.)
151
+
152
+ **Coverage Summary Table:**
153
+
154
+ | Requirement Key | Has Task? | Task IDs | Notes |
155
+ |-----------------|-----------|----------|-------|
156
+
157
+ **Constitution Alignment Issues:** (if any)
158
+
159
+ **Unmapped Tasks:** (if any)
160
+
161
+ **Metrics:**
162
+
163
+ - Total Requirements
164
+ - Total Tasks
165
+ - Coverage % (requirements with >=1 task)
166
+ - Ambiguity Count
167
+ - Duplication Count
168
+ - Critical Issues Count
169
+
170
+ ### 7. Provide Next Actions
171
+
172
+ At end of report, output a concise Next Actions block:
173
+
174
+ - If CRITICAL issues exist: Recommend resolving before `/speckit.implement`
175
+ - If only LOW/MEDIUM: User may proceed, but provide improvement suggestions
176
+ - 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'"
177
+
178
+ ### 8. Offer Remediation
179
+
180
+ Ask the user: "Would you like me to suggest concrete remediation edits for the top N issues?" (Do NOT apply them automatically.)
181
+
182
+ ## Operating Principles
183
+
184
+ ### Context Efficiency
185
+
186
+ - **Minimal high-signal tokens**: Focus on actionable findings, not exhaustive documentation
187
+ - **Progressive disclosure**: Load artifacts incrementally; don't dump all content into analysis
188
+ - **Token-efficient output**: Limit findings table to 50 rows; summarize overflow
189
+ - **Deterministic results**: Rerunning without changes should produce consistent IDs and counts
190
+
191
+ ### Analysis Guidelines
192
+
193
+ - **NEVER modify files** (this is read-only analysis)
194
+ - **NEVER hallucinate missing sections** (if absent, report them accurately)
195
+ - **Prioritize constitution violations** (these are always CRITICAL)
196
+ - **Use examples over exhaustive rules** (cite specific instances, not generic patterns)
197
+ - **Report zero issues gracefully** (emit success report with coverage statistics)
198
+
199
+ ## Context
200
+
201
+ $ARGUMENTS