@x0rium/devkit-cli 0.7.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.
@@ -0,0 +1,153 @@
1
+ ---
2
+ description: Generate an actionable, dependency-ordered tasks.md for the feature based on available design artifacts.
3
+ handoffs:
4
+ - label: Analyze For Consistency
5
+ agent: speckit.analyze
6
+ prompt: Run a project analysis for consistency
7
+ send: true
8
+ - label: Implement Project
9
+ agent: speckit.implement
10
+ prompt: Start the implementation in phases
11
+ send: true
12
+ ---
13
+
14
+ ## User Input
15
+
16
+ ```text
17
+ $ARGUMENTS
18
+ ```
19
+
20
+ You **MUST** consider the user input before proceeding (if not empty).
21
+
22
+ ## Outline
23
+
24
+ 1. **Setup**: Run `.specify/scripts/bash/check-prerequisites.sh --json` 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").
25
+
26
+ 2. **Load design documents**: Read from FEATURE_DIR:
27
+ - **Required**: plan.md (tech stack, libraries, structure), spec.md (user stories with priorities)
28
+ - **Optional**: data-model.md (entities), contracts/ (API endpoints), research.md (decisions), quickstart.md (test scenarios)
29
+ - Note: Not all projects have all documents. Generate tasks based on what's available.
30
+
31
+ 3. **Execute task generation workflow**:
32
+ - Load plan.md and extract tech stack, libraries, project structure
33
+ - Load spec.md and extract user stories with their priorities (P1, P2, P3, etc.)
34
+ - If data-model.md exists: Extract entities and map to user stories
35
+ - If contracts/ exists: Map endpoints to user stories
36
+ - If research.md exists: Extract decisions for setup tasks
37
+ - Generate tasks organized by user story (see Task Generation Rules below)
38
+ - Generate dependency graph showing user story completion order
39
+ - Create parallel execution examples per user story
40
+ - Validate task completeness (each user story has all needed tasks, independently testable)
41
+
42
+ 4. **Generate tasks.md**: Use `.specify/templates/tasks-template.md` as structure, fill with:
43
+ - Correct feature name from plan.md
44
+ - Phase 1: Setup tasks (project initialization)
45
+ - Phase 2: Foundational tasks (blocking prerequisites for all user stories)
46
+ - Phase 3+: One phase per user story (in priority order from spec.md)
47
+ - Each phase includes: story goal, independent test criteria, tests (if requested), implementation tasks
48
+ - Final Phase: Polish & cross-cutting concerns
49
+ - All tasks must follow the strict checklist format (see Task Generation Rules below)
50
+ - Clear file paths for each task
51
+ - Dependencies section showing story completion order
52
+ - Parallel execution examples per story
53
+ - Implementation strategy section (MVP first, incremental delivery)
54
+
55
+ 5. **Report**: Output path to generated tasks.md and summary:
56
+ - Total task count
57
+ - Task count per user story
58
+ - Parallel opportunities identified
59
+ - Independent test criteria for each story
60
+ - Suggested MVP scope (typically just User Story 1)
61
+ - Format validation: Confirm ALL tasks follow the checklist format (checkbox, ID, labels, file paths)
62
+
63
+ <!-- DEVKIT:START:validate-checkpoints -->
64
+ 6. **DevKit Validation Checkpoints** — add validation tasks between phases:
65
+
66
+ After generating the task list, insert `devkit validate` checkpoint tasks at phase boundaries:
67
+
68
+ - After Setup phase: `- [ ] [T0XX] Run devkit validate to verify project state`
69
+ - After Foundational phase: `- [ ] [T0XX] Run devkit validate to verify foundational integrity`
70
+ - Before Final Phase: `- [ ] [T0XX] Run devkit coverage to check invariant test coverage`
71
+
72
+ These checkpoints ensure that DevKit invariants remain satisfied throughout implementation. Assign sequential task IDs that fit within the existing numbering scheme.
73
+
74
+ Also include in the report:
75
+ - Number of DevKit validation checkpoints added
76
+ - Reminder: `devkit coverage` shows invariant ↔ test coverage map
77
+ <!-- DEVKIT:END:validate-checkpoints -->
78
+
79
+ Context for task generation: $ARGUMENTS
80
+
81
+ The tasks.md should be immediately executable - each task must be specific enough that an LLM can complete it without additional context.
82
+
83
+ ## Task Generation Rules
84
+
85
+ **CRITICAL**: Tasks MUST be organized by user story to enable independent implementation and testing.
86
+
87
+ **Tests are OPTIONAL**: Only generate test tasks if explicitly requested in the feature specification or if user requests TDD approach.
88
+
89
+ ### Checklist Format (REQUIRED)
90
+
91
+ Every task MUST strictly follow this format:
92
+
93
+ ```text
94
+ - [ ] [TaskID] [P?] [Story?] Description with file path
95
+ ```
96
+
97
+ **Format Components**:
98
+
99
+ 1. **Checkbox**: ALWAYS start with `- [ ]` (markdown checkbox)
100
+ 2. **Task ID**: Sequential number (T001, T002, T003...) in execution order
101
+ 3. **[P] marker**: Include ONLY if task is parallelizable (different files, no dependencies on incomplete tasks)
102
+ 4. **[Story] label**: REQUIRED for user story phase tasks only
103
+ - Format: [US1], [US2], [US3], etc. (maps to user stories from spec.md)
104
+ - Setup phase: NO story label
105
+ - Foundational phase: NO story label
106
+ - User Story phases: MUST have story label
107
+ - Polish phase: NO story label
108
+ 5. **Description**: Clear action with exact file path
109
+
110
+ **Examples**:
111
+
112
+ - CORRECT: `- [ ] T001 Create project structure per implementation plan`
113
+ - CORRECT: `- [ ] T005 [P] Implement authentication middleware in src/middleware/auth.py`
114
+ - CORRECT: `- [ ] T012 [P] [US1] Create User model in src/models/user.py`
115
+ - CORRECT: `- [ ] T014 [US1] Implement UserService in src/services/user_service.py`
116
+ - WRONG: `- [ ] Create User model` (missing ID and Story label)
117
+ - WRONG: `T001 [US1] Create model` (missing checkbox)
118
+ - WRONG: `- [ ] [US1] Create User model` (missing Task ID)
119
+ - WRONG: `- [ ] T001 [US1] Create model` (missing file path)
120
+
121
+ ### Task Organization
122
+
123
+ 1. **From User Stories (spec.md)** - PRIMARY ORGANIZATION:
124
+ - Each user story (P1, P2, P3...) gets its own phase
125
+ - Map all related components to their story:
126
+ - Models needed for that story
127
+ - Services needed for that story
128
+ - Endpoints/UI needed for that story
129
+ - If tests requested: Tests specific to that story
130
+ - Mark story dependencies (most stories should be independent)
131
+
132
+ 2. **From Contracts**:
133
+ - Map each contract/endpoint → to the user story it serves
134
+ - If tests requested: Each contract → contract test task [P] before implementation in that story's phase
135
+
136
+ 3. **From Data Model**:
137
+ - Map each entity to the user story(ies) that need it
138
+ - If entity serves multiple stories: Put in earliest story or Setup phase
139
+ - Relationships → service layer tasks in appropriate story phase
140
+
141
+ 4. **From Setup/Infrastructure**:
142
+ - Shared infrastructure → Setup phase (Phase 1)
143
+ - Foundational/blocking tasks → Foundational phase (Phase 2)
144
+ - Story-specific setup → within that story's phase
145
+
146
+ ### Phase Structure
147
+
148
+ - **Phase 1**: Setup (project initialization)
149
+ - **Phase 2**: Foundational (blocking prerequisites - MUST complete before user stories)
150
+ - **Phase 3+**: User Stories in priority order (P1, P2, P3...)
151
+ - Within each story: Tests (if requested) → Models → Services → Endpoints → Integration
152
+ - Each phase should be a complete, independently testable increment
153
+ - **Final Phase**: Polish & Cross-Cutting Concerns
@@ -0,0 +1,14 @@
1
+ #### G. DevKit Invariant Coverage
2
+
3
+ - Run `devkit coverage` and capture the output
4
+ - For each invariant (technical I1-I8, UX U1-U6):
5
+ - Check if the invariant has at least one test covering it
6
+ - Flag uncovered invariants as findings with severity based on invariant type:
7
+ - Technical invariant uncovered → HIGH
8
+ - UX invariant uncovered → MEDIUM
9
+ - Add to Coverage Summary Table:
10
+ - Row per invariant: ID, Name, Covered (yes/no), Test IDs
11
+ - Add "DevKit Invariant Coverage" section to the analysis report with:
12
+ - Coverage percentage
13
+ - Uncovered invariants list
14
+ - Recommendation: `devkit coverage` for detailed map
@@ -0,0 +1,7 @@
1
+ **DevKit Invariant Coverage** (mandatory category):
2
+ - "Are all technical invariants (from `.devkit/arch/invariants.md`) referenced in the spec? [Traceability]"
3
+ - "Are all UX invariants (from `.devkit/product/ux_invariants.md`) addressed in requirements? [Coverage]"
4
+ - "Is the Invariant Coverage section present and up-to-date? [Completeness]"
5
+ - "Are invariant relations (TOUCHES/DEPENDS) justified with notes? [Clarity]"
6
+ - "Has `devkit impact` been run for this feature? [Process]"
7
+ - "Are there any HIGH/CRITICAL risk invariants that need RFC? [Risk]"
@@ -0,0 +1,15 @@
1
+ 9. **DevKit Invariant Check** — after all clarifications are integrated:
2
+
3
+ a. **Check if clarifications touch invariants**: If any clarification answer modifies or constrains behavior related to project invariants (from `.devkit/arch/invariants.md` or `.devkit/product/ux_invariants.md`), flag it:
4
+
5
+ ```
6
+ ⚠️ Clarification Q[N] touches invariant [ID]: [invariant name]
7
+ Consider: devkit rfc "<description of the change>"
8
+ ```
9
+
10
+ b. **Run validation** to ensure spec still aligns with DevKit artifacts:
11
+ ```bash
12
+ devkit validate
13
+ ```
14
+
15
+ c. Include invariant impact in the completion report if any invariants were touched.
@@ -0,0 +1,25 @@
1
+ 10. **DevKit Phase Guards** — integrate DevKit checks into implementation:
2
+
3
+ a. **Before architecture-impacting tasks**: Run impact analysis:
4
+ ```bash
5
+ devkit impact "<task description>"
6
+ ```
7
+ If risk is HIGH, pause and suggest `devkit rfc` before proceeding.
8
+
9
+ b. **After completing each phase**: Run validation:
10
+ ```bash
11
+ devkit validate
12
+ ```
13
+ If validation fails, halt phase progression and report the issues.
14
+
15
+ c. **On implementation failure**: If a task fails in a way that suggests a broken assumption:
16
+ ```bash
17
+ devkit investigate "<description of the failure and broken assumption>"
18
+ ```
19
+ This creates an Investigation record linking back to relevant ADRs.
20
+
21
+ d. **After final phase**: Run full coverage check:
22
+ ```bash
23
+ devkit coverage
24
+ ```
25
+ Include coverage summary in the implementation completion report.
@@ -0,0 +1,7 @@
1
+ **DevKit Pre-Planning Validation**:
2
+
3
+ Before starting the planning workflow, run:
4
+ ```bash
5
+ devkit validate
6
+ ```
7
+ If validation fails with errors, resolve them before proceeding. Cross-reference the plan against invariants I1-I8 (technical) and U1-U6 (UX) from `.devkit/arch/invariants.md` and `.devkit/product/ux_invariants.md`. Any architectural decision in the plan that conflicts with an invariant must be justified or trigger `devkit rfc`.
@@ -0,0 +1,17 @@
1
+ **DevKit Post-Planning Validation**:
2
+
3
+ After plan generation is complete:
4
+
5
+ 1. **Run validation**:
6
+ ```bash
7
+ devkit validate
8
+ ```
9
+
10
+ 2. **Run impact analysis** on the plan:
11
+ ```bash
12
+ devkit impact "<feature name>: plan generated with tech stack <key technologies>"
13
+ ```
14
+
15
+ 3. If risk is HIGH, recommend running `devkit rfc` before proceeding to task generation.
16
+
17
+ 4. Include DevKit validation status and impact risk level in the plan completion report.
@@ -0,0 +1,37 @@
1
+ 7. **DevKit Invariant Guard** — after the spec is written and validated:
2
+
3
+ a. **Load invariants**: Read `.devkit/arch/invariants.md` and `.devkit/product/ux_invariants.md` (if they exist).
4
+
5
+ b. **Map feature to invariants**: For each invariant (I1-I8, U1-U6 or whatever IDs exist), determine whether this feature TOUCHES, DEPENDS ON, or is UNRELATED to that invariant.
6
+
7
+ c. **Append `## Invariant Coverage` section** to the spec file (before any closing notes):
8
+
9
+ ```markdown
10
+ ## Invariant Coverage
11
+
12
+ > Auto-generated by DevKit. Maps this spec to project invariants.
13
+
14
+ **Technical invariants** (from `.devkit/arch/invariants.md`):
15
+ | ID | Name | Relation | Notes |
16
+ |----|------|----------|-------|
17
+ | I1 | ... | TOUCHES / DEPENDS / — | ... |
18
+
19
+ **UX invariants** (from `.devkit/product/ux_invariants.md`):
20
+ | ID | Name | Relation | Notes |
21
+ |----|------|----------|-------|
22
+ | U1 | ... | TOUCHES / DEPENDS / — | ... |
23
+ ```
24
+
25
+ Only include rows where Relation is TOUCHES or DEPENDS (skip unrelated).
26
+
27
+ d. **Run impact analysis**:
28
+ ```bash
29
+ devkit impact "<feature short name>: touches <list of touched invariant IDs>"
30
+ ```
31
+ - If risk is HIGH or CRITICAL: **WARN** the user before proceeding. Suggest running `devkit rfc` if the feature may need to deviate from an invariant.
32
+ - If risk is LOW or MEDIUM: note it in the report and proceed.
33
+
34
+ e. **Run validation**:
35
+ ```bash
36
+ devkit validate
37
+ ```
@@ -0,0 +1,13 @@
1
+ 6. **DevKit Validation Checkpoints** — add validation tasks between phases:
2
+
3
+ After generating the task list, insert `devkit validate` checkpoint tasks at phase boundaries:
4
+
5
+ - After Setup phase: `- [ ] [T0XX] Run devkit validate to verify project state`
6
+ - After Foundational phase: `- [ ] [T0XX] Run devkit validate to verify foundational integrity`
7
+ - Before Final Phase: `- [ ] [T0XX] Run devkit coverage to check invariant test coverage`
8
+
9
+ These checkpoints ensure that DevKit invariants remain satisfied throughout implementation. Assign sequential task IDs that fit within the existing numbering scheme.
10
+
11
+ Also include in the report:
12
+ - Number of DevKit validation checkpoints added
13
+ - Reminder: `devkit coverage` shows invariant ↔ test coverage map