specsmd 0.0.1

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 (83) hide show
  1. package/README.md +300 -0
  2. package/bin/cli.js +21 -0
  3. package/flows/aidlc/README.md +372 -0
  4. package/flows/aidlc/agents/construction-agent.md +81 -0
  5. package/flows/aidlc/agents/inception-agent.md +95 -0
  6. package/flows/aidlc/agents/master-agent.md +61 -0
  7. package/flows/aidlc/agents/operations-agent.md +89 -0
  8. package/flows/aidlc/commands/construction-agent.md +63 -0
  9. package/flows/aidlc/commands/inception-agent.md +55 -0
  10. package/flows/aidlc/commands/master-agent.md +47 -0
  11. package/flows/aidlc/commands/operations-agent.md +77 -0
  12. package/flows/aidlc/context-config.yaml +41 -0
  13. package/flows/aidlc/memory-bank.yaml +104 -0
  14. package/flows/aidlc/quick-start.md +315 -0
  15. package/flows/aidlc/skills/construction/bolt-list.md +163 -0
  16. package/flows/aidlc/skills/construction/bolt-replan.md +343 -0
  17. package/flows/aidlc/skills/construction/bolt-start.md +289 -0
  18. package/flows/aidlc/skills/construction/bolt-status.md +185 -0
  19. package/flows/aidlc/skills/construction/navigator.md +196 -0
  20. package/flows/aidlc/skills/inception/bolt-plan.md +338 -0
  21. package/flows/aidlc/skills/inception/context.md +171 -0
  22. package/flows/aidlc/skills/inception/intent-create.md +211 -0
  23. package/flows/aidlc/skills/inception/intent-list.md +124 -0
  24. package/flows/aidlc/skills/inception/navigator.md +207 -0
  25. package/flows/aidlc/skills/inception/requirements.md +227 -0
  26. package/flows/aidlc/skills/inception/review.md +248 -0
  27. package/flows/aidlc/skills/inception/story-create.md +304 -0
  28. package/flows/aidlc/skills/inception/units.md +271 -0
  29. package/flows/aidlc/skills/master/analyze-context.md +132 -0
  30. package/flows/aidlc/skills/master/answer-question.md +141 -0
  31. package/flows/aidlc/skills/master/explain-flow.md +146 -0
  32. package/flows/aidlc/skills/master/project-init.md +281 -0
  33. package/flows/aidlc/skills/master/route-request.md +126 -0
  34. package/flows/aidlc/skills/operations/build.md +237 -0
  35. package/flows/aidlc/skills/operations/deploy.md +259 -0
  36. package/flows/aidlc/skills/operations/monitor.md +265 -0
  37. package/flows/aidlc/skills/operations/navigator.md +209 -0
  38. package/flows/aidlc/skills/operations/verify.md +224 -0
  39. package/flows/aidlc/templates/construction/bolt-template.md +193 -0
  40. package/flows/aidlc/templates/construction/bolt-types/bdd-construction-bolt.md +250 -0
  41. package/flows/aidlc/templates/construction/bolt-types/ddd-construction-bolt/adr-template.md +49 -0
  42. package/flows/aidlc/templates/construction/bolt-types/ddd-construction-bolt/ddd-01-domain-model-template.md +55 -0
  43. package/flows/aidlc/templates/construction/bolt-types/ddd-construction-bolt/ddd-02-technical-design-template.md +67 -0
  44. package/flows/aidlc/templates/construction/bolt-types/ddd-construction-bolt/ddd-03-test-report-template.md +62 -0
  45. package/flows/aidlc/templates/construction/bolt-types/ddd-construction-bolt.md +528 -0
  46. package/flows/aidlc/templates/construction/bolt-types/simple-construction-bolt.md +273 -0
  47. package/flows/aidlc/templates/construction/bolt-types/spike-bolt.md +240 -0
  48. package/flows/aidlc/templates/construction/bolt-types/tdd-construction-bolt.md +259 -0
  49. package/flows/aidlc/templates/construction/construction-log-template.md +129 -0
  50. package/flows/aidlc/templates/construction/standards/coding-standards.md +29 -0
  51. package/flows/aidlc/templates/construction/standards/system-architecture.md +22 -0
  52. package/flows/aidlc/templates/construction/standards/tech-stack.md +19 -0
  53. package/flows/aidlc/templates/inception/inception-log-template.md +134 -0
  54. package/flows/aidlc/templates/inception/project/README.md +55 -0
  55. package/flows/aidlc/templates/inception/requirements-template.md +144 -0
  56. package/flows/aidlc/templates/inception/stories-template.md +38 -0
  57. package/flows/aidlc/templates/inception/story-template.md +147 -0
  58. package/flows/aidlc/templates/inception/system-context-template.md +29 -0
  59. package/flows/aidlc/templates/inception/unit-brief-template.md +177 -0
  60. package/flows/aidlc/templates/inception/units-template.md +52 -0
  61. package/flows/aidlc/templates/standards/catalog.yaml +345 -0
  62. package/flows/aidlc/templates/standards/coding-standards.guide.md +553 -0
  63. package/flows/aidlc/templates/standards/data-stack.guide.md +162 -0
  64. package/flows/aidlc/templates/standards/tech-stack.guide.md +280 -0
  65. package/lib/InstallerFactory.js +36 -0
  66. package/lib/cli-utils.js +372 -0
  67. package/lib/constants.js +31 -0
  68. package/lib/installer.js +314 -0
  69. package/lib/installers/AntigravityInstaller.js +22 -0
  70. package/lib/installers/ClaudeInstaller.js +85 -0
  71. package/lib/installers/ClineInstaller.js +21 -0
  72. package/lib/installers/CodexInstaller.js +21 -0
  73. package/lib/installers/CopilotInstaller.js +113 -0
  74. package/lib/installers/CursorInstaller.js +63 -0
  75. package/lib/installers/GeminiInstaller.js +75 -0
  76. package/lib/installers/KiroInstaller.js +22 -0
  77. package/lib/installers/OpenCodeInstaller.js +22 -0
  78. package/lib/installers/RooInstaller.js +22 -0
  79. package/lib/installers/ToolInstaller.js +73 -0
  80. package/lib/installers/WindsurfInstaller.js +76 -0
  81. package/lib/markdown-validator.ts +175 -0
  82. package/lib/yaml-validator.ts +99 -0
  83. package/package.json +65 -0
@@ -0,0 +1,304 @@
1
+ # Skill: Create Stories
2
+
3
+ ---
4
+
5
+ ## Progress Display
6
+
7
+ Show at start of this skill:
8
+
9
+ ```text
10
+ ### Inception Progress
11
+ - [x] Intent created
12
+ - [x] Requirements gathered
13
+ - [ ] Generating artifacts... ← current
14
+ - [x] System Context
15
+ - [x] Units
16
+ - [ ] Stories ← this skill
17
+ - [ ] Bolt Plan
18
+ - [ ] Artifacts reviewed (Checkpoint 3)
19
+ - [ ] Ready for Construction
20
+ ```
21
+
22
+ ---
23
+
24
+ ## Checkpoints in This Skill
25
+
26
+ **NO INDIVIDUAL Checkpoint** - This skill is part of the batched artifact generation.
27
+
28
+ All artifacts (Context, Units, Stories, Bolts) are reviewed together at **Checkpoint 3** in the `review` skill.
29
+
30
+ ---
31
+
32
+ ## Goal
33
+
34
+ Define atomic, testable User Stories for each Unit that will guide Construction.
35
+
36
+ ---
37
+
38
+ ## Input
39
+
40
+ - **Required**: Unit name and `unit-brief.md`
41
+ - **Required**: `.specsmd/aidlc/memory-bank.yaml` - artifact schema
42
+ - **Optional**: Requirements to reference
43
+
44
+ ---
45
+
46
+ ## Process
47
+
48
+ ### 0. Gap Analysis (Internal)
49
+
50
+ Before creating stories, analyze existing state internally:
51
+
52
+ 1. **Read story-index.md** if it exists
53
+ 2. **Scan story folders** for existing `.md` files
54
+ 3. **Identify gaps** - missing files, unmarked stories
55
+
56
+ **Auto-proceed**: Create missing stories and update markers. Do not stop for user input.
57
+
58
+ ---
59
+
60
+ ### 1. Analyze Unit Brief
61
+
62
+ Review the unit-brief.md to understand:
63
+
64
+ - **Assigned Requirements** - FRs mapped to this unit (stories come from these)
65
+ - Purpose and scope
66
+ - Key entities and operations
67
+ - Dependencies
68
+ - Success criteria
69
+
70
+ **IMPORTANT**: Stories are created from the unit's **Assigned Requirements** section, NOT directly from intent requirements.md. The FR-to-unit mapping happened during unit decomposition.
71
+
72
+ ### 2. Generate Stories
73
+
74
+ For each feature in the unit:
75
+
76
+ 1. **Identify User Actions**: What can users do?
77
+ 2. **Break Down**: One story per testable behavior
78
+ 3. **Format**: Use standard user story format
79
+ 4. **Size**: Each story should be completable in one bolt stage
80
+
81
+ **Story Format**:
82
+
83
+ ```markdown
84
+ ## Story: {story-id}
85
+
86
+ ### User Story
87
+ As a {role}
88
+ I want to {action}
89
+ So that {benefit}
90
+
91
+ ### Acceptance Criteria
92
+ - [ ] Given {context}, When {action}, Then {outcome}
93
+ - [ ] Given {context}, When {action}, Then {outcome}
94
+
95
+ ### Technical Notes
96
+ - {implementation hints if any}
97
+
98
+ ### Dependencies
99
+ - {other stories this depends on}
100
+ ```
101
+
102
+ ### 3. Apply INVEST Criteria
103
+
104
+ Validate each story against:
105
+
106
+ - [ ] **I**ndependent: Can be developed without other stories? (Preferred)
107
+ - [ ] **N**egotiable: Details can be refined during bolt? (Required)
108
+ - [ ] **V**aluable: Delivers value to user? (Required)
109
+ - [ ] **E**stimable: Scope is clear enough to plan? (Required)
110
+ - [ ] **S**mall: Fits in a single bolt stage? (Required)
111
+ - [ ] **T**estable: Acceptance criteria are binary? (Required)
112
+
113
+ ### 4. Group by Priority
114
+
115
+ Organize stories for bolt planning:
116
+
117
+ - **Must**: Core functionality (Authentication, core CRUD)
118
+ - **Should**: Important but not blocking (Error handling, validation)
119
+ - **Could**: Nice to have (Advanced features, optimizations)
120
+
121
+ ### 5. Document Stories
122
+
123
+ 1. **Read Path**: Check `schema.stories` from `.specsmd/aidlc/memory-bank.yaml`
124
+ *(Default: `memory-bank/intents/{intent-name}/units/{unit-name}/stories/`)*
125
+
126
+ 2. **Create Directory**:
127
+ Ensure `.../units/{unit-name}/stories/` exists
128
+
129
+ 3. **Create Story Files** (IMPORTANT - ONE FILE PER STORY):
130
+
131
+ **Read naming convention from `.specsmd/aidlc/memory-bank.yaml`**
132
+
133
+ Format: `{SSS}-{title-slug}.md`
134
+ - `{SSS}` = 3-digit story number (e.g., `001`, `002`)
135
+ - `{title-slug}` = Kebab-case story title (e.g., `user-can-login`)
136
+
137
+ **DO NOT** create a single `stories.md` file with all stories
138
+
139
+ Use template: `.specsmd/aidlc/templates/inception/story-template.md`
140
+
141
+ **Example for intent `001-user-authentication`, unit `auth-service` with 6 stories:**
142
+
143
+ ```text
144
+ 001-user-authentication/
145
+ └── units/
146
+ └── auth-service/
147
+ ├── unit-brief.md
148
+ └── stories/
149
+ ├── 001-user-signup.md
150
+ ├── 002-user-login.md
151
+ ├── 003-user-logout.md
152
+ ├── 004-invite-members.md
153
+ ├── 005-remove-members.md
154
+ └── 006-change-roles.md
155
+ ```
156
+
157
+ **Global uniqueness** comes from the full path:
158
+ `memory-bank/intents/001-user-authentication/units/auth-service/stories/001-user-signup.md`
159
+
160
+ 4. **Link to Unit**:
161
+ Update unit's story index if one exists
162
+
163
+ ### 6. Update Unit Brief with Story Summary
164
+
165
+ **CRITICAL**: After creating stories, update the unit-brief.md with a story summary.
166
+
167
+ Add/update this section in the unit's `unit-brief.md`:
168
+
169
+ ```markdown
170
+ ---
171
+
172
+ ## Story Summary
173
+
174
+ - **Total Stories**: {n}
175
+ - **Must Have**: {n}
176
+ - **Should Have**: {n}
177
+ - **Could Have**: {n}
178
+
179
+ ### Stories
180
+
181
+ - [ ] **AUTH-001**: User signup - Must - Planned
182
+ - [ ] **AUTH-002**: User login - Must - Planned
183
+ ```
184
+
185
+ This ensures each unit-brief shows its story count at a glance.
186
+
187
+ ### 7. Update Global Story Index
188
+
189
+ **CRITICAL**: After creating EACH story, IMMEDIATELY update the index.
190
+
191
+ **DO NOT** batch index updates - mark each story right after creating its file.
192
+
193
+ 1. **Read Configuration**: Check `story-index` settings in `.specsmd/aidlc/memory-bank.yaml`
194
+
195
+ 2. **Mark each story as generated:**
196
+
197
+ **Format - add ✅ GENERATED marker immediately after filename:**
198
+
199
+ ```markdown
200
+ ### 001-user-signup.md ✅ GENERATED
201
+ **Title**: User Registration with Password Hashing
202
+ ```
203
+
204
+ **Status markers:**
205
+ - No marker = Planned (not yet created)
206
+ - `✅ GENERATED` = File created
207
+ - `✅ COMPLETED` = Implemented in Construction
208
+
209
+ 3. **Based on mode**:
210
+
211
+ **Option 1: single-file** (default)
212
+ - Path: `memory-bank/story-index.md`
213
+ - Add all stories to the central index with full paths
214
+
215
+ **Option 2: per-intent**
216
+ - Path: `memory-bank/intents/{intent-name}/story-index.md`
217
+ - Create/update per-intent story indices
218
+
219
+ **Option 3: aggregate**
220
+ - No file to update (computed from unit stories on demand)
221
+
222
+ 4. **Story Index Format**:
223
+
224
+ ```markdown
225
+ # Global Story Index
226
+
227
+ ## Overview
228
+ - **Total stories**: {count}
229
+ - **Generated**: {count with ✅ GENERATED}
230
+ - **Last updated**: {date}
231
+
232
+ ---
233
+
234
+ ## Stories by Intent
235
+
236
+ ### {intent-name}
237
+
238
+ - [ ] **001-intent-AUTH-001** (auth): User signup - Must - Planned
239
+ - [x] **001-intent-AUTH-002** (auth): User login - Must - ✅ GENERATED
240
+ - [x] **001-intent-TASKS-001** (tasks): Create task - Must - ✅ COMPLETED
241
+
242
+ ---
243
+
244
+ ## Stories by Status
245
+
246
+ - **Planned**: {n}
247
+ - **Generated**: {n}
248
+ - **In Progress**: {n}
249
+ - **Completed**: {n}
250
+ ```
251
+
252
+ 5. **Verification after batch generation:**
253
+
254
+ After generating all stories for a unit, verify:
255
+
256
+ ```markdown
257
+ ### Verification: {unit-name}
258
+ - Stories planned: {n}
259
+ - Stories created: {n}
260
+ - Index updated: {n} marked ✅ GENERATED
261
+ - Gaps: {list any missing}
262
+ ```
263
+
264
+ ---
265
+
266
+ ## Output
267
+
268
+ ```markdown
269
+ ## Stories Created: {unit-name}
270
+
271
+ ### Story Summary
272
+
273
+ - [ ] **S1**: User can register - Must - No dependencies
274
+ - [ ] **S2**: User can login - Must - Requires S1
275
+ - [ ] **S3**: User can reset password - Should - Requires S1
276
+ - [ ] **S4**: User can enable MFA - Could - Requires S2
277
+
278
+ ### Acceptance Criteria Count
279
+ - **Total criteria**: {n}
280
+ - **Must-have stories**: {n}
281
+ - **Should-have stories**: {n}
282
+ - **Could-have stories**: {n}
283
+
284
+ ### Artifacts Created (one file per story)
285
+ ✅ `{unit-path}/stories/001-{title-slug}.md`
286
+ ✅ `{unit-path}/stories/002-{title-slug}.md`
287
+ ✅ `{unit-path}/stories/003-{title-slug}.md`
288
+
289
+ ### Estimated Bolt Coverage
290
+ - Stories can be grouped into ~{n} bolts
291
+ - Suggested grouping provided in bolt-plan
292
+ ```
293
+
294
+ **No menu** - Skill complete, return to agent.
295
+
296
+ ---
297
+
298
+ ## Test Contract
299
+
300
+ ```yaml
301
+ input: Unit brief, requirements
302
+ output: Individual story files with acceptance criteria
303
+ checkpoints: 0 (part of Checkpoint 3 batch)
304
+ ```
@@ -0,0 +1,271 @@
1
+ # Skill: Decompose into Units
2
+
3
+ ---
4
+
5
+ ## Progress Display
6
+
7
+ Show at start of this skill:
8
+
9
+ ```text
10
+ ### Inception Progress
11
+ - [x] Intent created
12
+ - [x] Requirements gathered
13
+ - [ ] Generating artifacts... ← current
14
+ - [x] System Context
15
+ - [ ] Units ← this skill
16
+ - [ ] Stories
17
+ - [ ] Bolt Plan
18
+ - [ ] Artifacts reviewed (Checkpoint 3)
19
+ - [ ] Ready for Construction
20
+ ```
21
+
22
+ ---
23
+
24
+ ## Checkpoints in This Skill
25
+
26
+ **NO INDIVIDUAL Checkpoint** - This skill is part of the batched artifact generation.
27
+
28
+ All artifacts (Context, Units, Stories, Bolts) are reviewed together at **Checkpoint 3** in the `review` skill.
29
+
30
+ ---
31
+
32
+ ## Goal
33
+
34
+ Break the Intent into independently deployable Units of Work based on project type configuration.
35
+
36
+ ---
37
+
38
+ ## Input
39
+
40
+ - **Required**: Intent name
41
+ - **Required**: `requirements.md` for the intent
42
+ - **Required**: `system-context.md` for the intent
43
+ - **Required**: `.specsmd/aidlc/memory-bank.yaml` - artifact schema
44
+ - **Required**: `memory-bank/project.yaml` - project configuration (for project_type)
45
+ - **Required**: `.specsmd/aidlc/templates/standards/catalog.yaml` - project type definitions
46
+
47
+ ---
48
+
49
+ ## Process
50
+
51
+ ### 1. Load Project Type Configuration
52
+
53
+ **CRITICAL**: Before decomposing, understand what types of units to create.
54
+
55
+ 1. **Read project type** from `memory-bank/project.yaml`:
56
+ ```yaml
57
+ project_type: full-stack-web # or backend-api, frontend-app, cli-tool, library
58
+ ```
59
+
60
+ 2. **Read unit structure** from `catalog.yaml` under `project_types.{project_type}.unit_structure`:
61
+ ```yaml
62
+ unit_structure:
63
+ backend:
64
+ enabled: true
65
+ decomposition: domain-driven
66
+ default_bolt_type: ddd-construction-bolt
67
+ frontend:
68
+ enabled: true
69
+ decomposition: feature-based
70
+ default_bolt_type: simple-construction-bolt
71
+ naming_pattern: "{intent}-ui"
72
+ ```
73
+
74
+ 3. **Determine which unit types to create**:
75
+ - If `backend.enabled: true` → Create backend service units using domain-driven decomposition
76
+ - If `frontend.enabled: true` → Create a frontend unit for UI work
77
+ - If `cli.enabled: true` → Create CLI command units
78
+
79
+ **If project.yaml doesn't exist**, default to `backend-api` behavior (backend only).
80
+
81
+ ---
82
+
83
+ ### 2. Analyze Domain (Backend Units)
84
+
85
+ **Skip this step if `backend.enabled: false`.**
86
+
87
+ Review requirements and context to identify:
88
+
89
+ - **Bounded Contexts**: "What distinct domains exist?"
90
+ - **Aggregates**: "What are the core entities and their boundaries?"
91
+ - **Services**: "What operations span multiple entities?"
92
+ - **Integration Points**: "Where do contexts communicate?"
93
+
94
+ ### 3. Apply Decomposition Criteria (Backend Units)
95
+
96
+ **Skip this step if `backend.enabled: false`.**
97
+
98
+ For each potential unit, verify:
99
+
100
+ - [ ] **Single Responsibility**: Does it do one thing well? (Required)
101
+ - [ ] **Independence**: Can it be built/tested separately? (Required)
102
+ - [ ] **Deployability**: Can it be deployed independently? (Preferred)
103
+ - [ ] **Clear Interface**: Are inputs/outputs well-defined? (Required)
104
+ - [ ] **Cohesion**: Do its parts belong together? (Required)
105
+
106
+ ### 4. Map Requirements to Units
107
+
108
+ **CRITICAL**: Each FR from requirements.md must be assigned to exactly one unit.
109
+
110
+ ```markdown
111
+ ## Requirement-to-Unit Mapping
112
+
113
+ - **FR-1**: {description} → `{unit-name}`
114
+ - **FR-2**: {description} → `{unit-name}`
115
+ - **FR-3**: {description} → `{unit-name}`
116
+ ```
117
+
118
+ This mapping ensures:
119
+
120
+ - Every FR is accounted for
121
+ - Units have clear scope based on assigned FRs
122
+ - Stories will be created from unit's assigned FRs (not directly from intent)
123
+
124
+ ### 5. Create Frontend Unit (if enabled)
125
+
126
+ **Skip this step if `frontend.enabled: false`.**
127
+
128
+ When `frontend.enabled: true` in the project type configuration, create a frontend unit:
129
+
130
+ ```markdown
131
+ ### Unit N: {intent}-ui
132
+
133
+ - **Purpose**: Frontend application (pages, components, state management)
134
+ - **Responsibility**: User interface and client-side logic
135
+ - **Assigned Requirements**: All user-facing FRs
136
+ - **Dependencies**: All backend service units
137
+ - **Interface**: Consumes APIs from backend units
138
+ - **Unit Type**: frontend
139
+ - **Default Bolt Type**: simple-construction-bolt
140
+ ```
141
+
142
+ **Frontend unit characteristics**:
143
+
144
+ - Named using `naming_pattern` from catalog (default: `{intent}-ui`)
145
+ - Depends on ALL backend service units
146
+ - Uses `simple-construction-bolt` (not DDD)
147
+ - Assigned all user-facing requirements (UI, UX, interactions)
148
+
149
+ **Include in unit-brief.md**:
150
+
151
+ ```yaml
152
+ ---
153
+ unit: {intent}-ui
154
+ unit_type: frontend
155
+ default_bolt_type: simple-construction-bolt
156
+ ---
157
+ ```
158
+
159
+ ---
160
+
161
+ ### 6. Propose Unit Structure
162
+
163
+ Present proposed decomposition with their assigned requirements:
164
+
165
+ ```markdown
166
+ ## Proposed Units
167
+
168
+ ### Unit 1: {unit-name}
169
+ - **Purpose**: {what it does}
170
+ - **Responsibility**: {single responsibility}
171
+ - **Assigned Requirements**: FR-1, FR-2
172
+ - **Dependencies**: {other units it depends on}
173
+ - **Interface**: {how other units interact with it}
174
+
175
+ ### Unit 2: {unit-name}
176
+ - **Assigned Requirements**: FR-3, FR-4
177
+ ...
178
+
179
+ ### Unit N: {intent}-ui (if frontend enabled)
180
+ - **Purpose**: Frontend application
181
+ - **Unit Type**: frontend
182
+ - **Dependencies**: All backend units
183
+ ```
184
+
185
+ ### 7. Document Units
186
+
187
+ 1. **Read Path**: Check `schema.units` from `.specsmd/aidlc/memory-bank.yaml`
188
+ *(Default: `memory-bank/intents/{intent-name}/units.md`)*
189
+
190
+ 2. **Create Central List**:
191
+ Update `units.md` with all units for this intent
192
+
193
+ 3. **Create Unit Directories**:
194
+ For each unit: `{schema.units}/{unit-name}/`
195
+
196
+ 4. **Create Unit Brief** (CRITICAL):
197
+ For each unit, create `unit-brief.md` using `.specsmd/aidlc/templates/inception/unit-brief-template.md`
198
+
199
+ This brief is the **input for Construction Agent**. Include:
200
+ - Purpose and scope
201
+ - Key entities and operations
202
+ - Dependencies on other units
203
+ - Technical constraints
204
+ - Success criteria
205
+
206
+ Example frontmatter:
207
+
208
+ ```yaml
209
+ ---
210
+ unit: auth-service
211
+ intent: 001-user-authentication
212
+ phase: inception
213
+ status: draft
214
+ ---
215
+ ```
216
+
217
+ Note: Story naming uses the story title (e.g., `001-user-signup.md`). No prefix field needed.
218
+
219
+ **For frontend units**, also include:
220
+ ```yaml
221
+ unit_type: frontend
222
+ default_bolt_type: simple-construction-bolt
223
+ ```
224
+
225
+ ### 8. Validate Independence
226
+
227
+ For each unit, verify:
228
+
229
+ - [ ] Can be developed by a separate team
230
+ - [ ] Has clear API/interface
231
+ - [ ] Failure doesn't cascade to other units
232
+ - [ ] Can be deployed without deploying others
233
+
234
+ ---
235
+
236
+ ## Output
237
+
238
+ ```markdown
239
+ ## Unit Decomposition: {intent-name}
240
+
241
+ ### Units Created
242
+
243
+ - [ ] **{unit-1}**: {purpose} - Dependencies: None - Stories: ~{n}
244
+ - [ ] **{unit-2}**: {purpose} - Dependencies: `{unit-1}` - Stories: ~{n}
245
+
246
+ ### Dependency Graph
247
+
248
+ {unit-1} ──► {unit-2} ──► {unit-3}
249
+
250
+
251
+ {unit-4}
252
+
253
+ ### Artifacts Created
254
+
255
+ ✅ `{intent-path}/units.md`
256
+ ✅ `{intent-path}/units/{unit-1}/unit-brief.md`
257
+ ✅ `{intent-path}/units/{unit-2}/unit-brief.md`
258
+
259
+ ```
260
+
261
+ **No menu** - Skill complete, return to agent.
262
+
263
+ ---
264
+
265
+ ## Test Contract
266
+
267
+ ```yaml
268
+ input: Intent requirements, system context, project.yaml, catalog.yaml
269
+ output: units.md, unit-brief.md for each unit (including frontend unit if enabled)
270
+ checkpoints: 0 (part of Checkpoint 3 batch)
271
+ ```
@@ -0,0 +1,132 @@
1
+ # Skill: Analyze Context
2
+
3
+ ---
4
+
5
+ ## Role
6
+
7
+ Diagnostic skill to determine current project state by inspecting memory bank artifacts.
8
+
9
+ **NO Checkpoint** - Analysis is informational, not a decision point.
10
+
11
+ ---
12
+
13
+ ## Goal
14
+
15
+ Deduce the current project state and recommend the logical next step by inspecting the memory bank artifacts.
16
+
17
+ ---
18
+
19
+ ## Input
20
+
21
+ - **Required**: `.specsmd/aidlc/memory-bank.yaml` - artifact schema
22
+ - **Required**: Project artifacts at paths defined in schema
23
+
24
+ ---
25
+
26
+ ## Process
27
+
28
+ ### 1. Load Schema
29
+
30
+ Read `.specsmd/aidlc/memory-bank.yaml` to understand artifact paths:
31
+
32
+ - `schema.intents` - where intents are stored
33
+ - `schema.units` - where units are stored
34
+ - `schema.bolts` - where bolts are stored
35
+
36
+ ### 2. Inspect Intents
37
+
38
+ List contents of `schema.intents` directory:
39
+
40
+ - Are there any intent directories?
41
+ - For each intent, what artifacts exist?
42
+
43
+ ### 3. Inspect Units (if intents exist)
44
+
45
+ For recent/active intents:
46
+
47
+ - Does `units.md` exist?
48
+ - Does `units/` directory have content?
49
+ - For each unit, are there stories in `stories/`?
50
+
51
+ ### 4. Inspect Bolts (if units exist)
52
+
53
+ Check `schema.bolts` directory:
54
+
55
+ - Are there bolt instance files?
56
+ - What is their status? (planned, in-progress, completed)
57
+ - What stage are in-progress bolts at?
58
+
59
+ ### 5. Determine Phase
60
+
61
+ Based on evidence found:
62
+
63
+ - **No intents** → Pre-Inception → Create first intent
64
+ - **Intent exists, no requirements.md** → Early Inception → Gather requirements
65
+ - **Requirements exist, no units.md** → Mid Inception → Decompose into units
66
+ - **Units exist, no stories** → Late Inception → Create stories
67
+ - **Stories exist, no bolts** → Inception Complete → Plan bolts
68
+ - **Bolts planned** → Ready for Construction → Start first bolt
69
+ - **Bolts in-progress** → Construction → Continue current bolt
70
+ - **All bolts completed** → Ready for Operations → Deploy unit
71
+ - **Deployed to production** → Operations → Monitor and maintain
72
+
73
+ ---
74
+
75
+ ## Output
76
+
77
+ Provide a structured analysis:
78
+
79
+ ```markdown
80
+ ## Project State Analysis
81
+
82
+ ### Summary
83
+ - **Phase**: {current phase}
84
+ - **Active Intent**: {name or "None"}
85
+ - **Active Unit**: {name or "None"}
86
+ - **Active Bolt**: {id or "None"}
87
+
88
+ ### Evidence
89
+ - Intents found: {count} ({list names})
90
+ - Units found: {count} for {intent}
91
+ - Stories found: {count} for {unit}
92
+ - Bolts found: {count} ({status breakdown})
93
+
94
+ ### Current State Details
95
+ {Specific details about what exists and what's missing}
96
+
97
+ ### Actions
98
+
99
+ 1 - **proceed**: Execute suggested action
100
+ 2 - **explain**: Learn more about current phase
101
+ 3 - **different**: Work on something else
102
+
103
+ ### Suggested Next Step
104
+ → **proceed** - {Specific command to run}
105
+
106
+ **Type a number or press Enter for suggested action.**
107
+ ```
108
+
109
+ ---
110
+
111
+ ## Human Validation Point
112
+
113
+ > "Based on my analysis, you're in the {phase} phase. Does this match your understanding? If not, tell me what you're trying to accomplish."
114
+
115
+ ---
116
+
117
+ ## Transition
118
+
119
+ After analysis, either:
120
+
121
+ - → **Route Request** (`.specsmd/skills/master/route-request.md`) - to direct user to specialist agent
122
+ - → **Answer Question** (`.specsmd/skills/master/answer-question.md`) - if user has questions about state
123
+
124
+ ---
125
+
126
+ ## Test Contract
127
+
128
+ ```yaml
129
+ input: Memory bank schema and artifacts
130
+ output: Project state analysis with phase, evidence, and suggested next step
131
+ checkpoints: 0 (informational only)
132
+ ```