specsmd 0.0.0-dev

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 (85) hide show
  1. package/README.md +397 -0
  2. package/bin/cli.js +21 -0
  3. package/flows/aidlc/README.md +372 -0
  4. package/flows/aidlc/agents/construction-agent.md +80 -0
  5. package/flows/aidlc/agents/inception-agent.md +97 -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 +67 -0
  13. package/flows/aidlc/memory-bank.yaml +104 -0
  14. package/flows/aidlc/quick-start.md +322 -0
  15. package/flows/aidlc/skills/construction/bolt-list.md +163 -0
  16. package/flows/aidlc/skills/construction/bolt-replan.md +345 -0
  17. package/flows/aidlc/skills/construction/bolt-start.md +414 -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 +359 -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 +278 -0
  29. package/flows/aidlc/skills/master/analyze-context.md +239 -0
  30. package/flows/aidlc/skills/master/answer-question.md +141 -0
  31. package/flows/aidlc/skills/master/explain-flow.md +158 -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 +205 -0
  40. package/flows/aidlc/templates/construction/bolt-types/ddd-construction-bolt/adr-template.md +49 -0
  41. package/flows/aidlc/templates/construction/bolt-types/ddd-construction-bolt/ddd-01-domain-model-template.md +55 -0
  42. package/flows/aidlc/templates/construction/bolt-types/ddd-construction-bolt/ddd-02-technical-design-template.md +67 -0
  43. package/flows/aidlc/templates/construction/bolt-types/ddd-construction-bolt/ddd-03-test-report-template.md +62 -0
  44. package/flows/aidlc/templates/construction/bolt-types/ddd-construction-bolt.md +528 -0
  45. package/flows/aidlc/templates/construction/bolt-types/simple-construction-bolt.md +342 -0
  46. package/flows/aidlc/templates/construction/bolt-types/spike-bolt.md +240 -0
  47. package/flows/aidlc/templates/construction/construction-log-template.md +129 -0
  48. package/flows/aidlc/templates/construction/standards/coding-standards.md +29 -0
  49. package/flows/aidlc/templates/construction/standards/system-architecture.md +22 -0
  50. package/flows/aidlc/templates/construction/standards/tech-stack.md +19 -0
  51. package/flows/aidlc/templates/inception/inception-log-template.md +134 -0
  52. package/flows/aidlc/templates/inception/project/README.md +55 -0
  53. package/flows/aidlc/templates/inception/requirements-template.md +144 -0
  54. package/flows/aidlc/templates/inception/stories-template.md +38 -0
  55. package/flows/aidlc/templates/inception/story-template.md +147 -0
  56. package/flows/aidlc/templates/inception/system-context-template.md +29 -0
  57. package/flows/aidlc/templates/inception/unit-brief-template.md +177 -0
  58. package/flows/aidlc/templates/inception/units-template.md +52 -0
  59. package/flows/aidlc/templates/standards/catalog.yaml +345 -0
  60. package/flows/aidlc/templates/standards/coding-standards.guide.md +553 -0
  61. package/flows/aidlc/templates/standards/data-stack.guide.md +162 -0
  62. package/flows/aidlc/templates/standards/tech-stack.guide.md +280 -0
  63. package/lib/InstallerFactory.js +36 -0
  64. package/lib/analytics/env-detector.js +92 -0
  65. package/lib/analytics/index.js +22 -0
  66. package/lib/analytics/machine-id.js +33 -0
  67. package/lib/analytics/tracker.js +227 -0
  68. package/lib/cli-utils.js +342 -0
  69. package/lib/constants.js +32 -0
  70. package/lib/installer.js +402 -0
  71. package/lib/installers/AntigravityInstaller.js +22 -0
  72. package/lib/installers/ClaudeInstaller.js +85 -0
  73. package/lib/installers/ClineInstaller.js +21 -0
  74. package/lib/installers/CodexInstaller.js +21 -0
  75. package/lib/installers/CopilotInstaller.js +113 -0
  76. package/lib/installers/CursorInstaller.js +63 -0
  77. package/lib/installers/GeminiInstaller.js +75 -0
  78. package/lib/installers/KiroInstaller.js +22 -0
  79. package/lib/installers/OpenCodeInstaller.js +22 -0
  80. package/lib/installers/RooInstaller.js +22 -0
  81. package/lib/installers/ToolInstaller.js +73 -0
  82. package/lib/installers/WindsurfInstaller.js +76 -0
  83. package/lib/markdown-validator.ts +175 -0
  84. package/lib/yaml-validator.ts +99 -0
  85. package/package.json +117 -0
@@ -0,0 +1,196 @@
1
+ # Skill: Construction Navigator
2
+
3
+ ---
4
+
5
+ ## Role
6
+
7
+ Entry point for Construction Agent. Routes to appropriate skill based on state.
8
+
9
+ **NO Checkpoint** - Navigator is a routing skill, not a decision point.
10
+
11
+ ---
12
+
13
+ ## Progress Display
14
+
15
+ Show workflow position with checkpoint markers:
16
+
17
+ ```text
18
+ ### Construction Workflow (2 Checkpoints per Bolt)
19
+
20
+ [Checkpoint 1] Which bolt to work on? --> bolt-list skill
21
+ |
22
+ [Domain + Logical Design]
23
+ |
24
+ [Checkpoint 2] Design Review --> bolt-start skill
25
+ |
26
+ [Code + Tests] --> Auto-validate if tests pass
27
+ |
28
+ [What's Next?] --> Next bolt / Done
29
+ ```
30
+
31
+ ---
32
+
33
+ ## Goal
34
+
35
+ Present the Construction Agent's skills and guide the user to the appropriate next action.
36
+
37
+ ---
38
+
39
+ ## Input
40
+
41
+ - **Optional**: `--unit` - Current unit context
42
+ - **Optional**: `--bolt-id` - Current bolt context
43
+ - **Required**: `.specsmd/aidlc/memory-bank.yaml` - artifact schema
44
+
45
+ ---
46
+
47
+ ## Process
48
+
49
+ ### 1. Determine Context
50
+
51
+ Load current construction state:
52
+
53
+ - Check for in-progress bolts
54
+ - Identify which units have planned bolts
55
+ - Calculate overall construction progress
56
+
57
+ ### 2. Present Menu
58
+
59
+ ```markdown
60
+ ## Construction Agent
61
+
62
+ {Context section if bolt/unit is active}
63
+
64
+ ### Skills
65
+
66
+ 1 - **List Bolts**: View all bolts and status (`bolt-list`)
67
+ 2 - **Bolt Status**: Detailed status of a bolt (`bolt-status --bolt-id="{id}"`)
68
+ 3 - **Start/Continue Bolt**: Execute bolt stages (`bolt-start --bolt-id="{id}"`)
69
+ 4 - **Plan Bolts**: Plan new bolts → Inception (`bolt-plan --unit="{unit}"`)
70
+
71
+ ### Current State
72
+ {Show in-progress bolts and overall progress}
73
+
74
+ ### Suggested Next Step
75
+ → {Recommended action based on state}
76
+
77
+ **Type a number (1-4) or specify a bolt ID to work on.**
78
+ ```
79
+
80
+ ### 3. Context-Aware Suggestions
81
+
82
+ Based on construction state, suggest actions:
83
+
84
+ - **No bolts planned** → Redirect to Inception for planning
85
+ - **Bolts planned, none started** → Start first bolt
86
+ - **Bolt in-progress** → Continue current bolt
87
+ - **Bolt blocked** → Show blocker, suggest resolution
88
+ - **All bolts complete for unit** → Proceed to Operations
89
+
90
+ ### 4. Handle Selection
91
+
92
+ When user selects an option:
93
+
94
+ 1. Acknowledge the selection
95
+ 2. Load the corresponding skill file
96
+ 3. Execute with current context
97
+
98
+ ---
99
+
100
+ ## Output (With Active Bolt)
101
+
102
+ ```markdown
103
+ ## Construction Agent
104
+
105
+ ### Active Bolt: `{bolt-id}`
106
+ **Unit**: `{unit-name}`
107
+ **Type**: {bolt-type}
108
+ **Stage**: {current_stage} ({n}/{total})
109
+
110
+ ### Progress
111
+ [████████████░░░░░░░░] 60% (3/5 stages)
112
+
113
+ ### Quick Actions
114
+
115
+ 1 - **Continue Current Bolt**: Resume work (`bolt-start --bolt-id="{bolt-id}"`)
116
+ 2 - **View Bolt Status**: Detailed status (`bolt-status --bolt-id="{bolt-id}"`)
117
+ 3 - **List All Bolts**: See all bolts (`bolt-list`)
118
+ 4 - **Switch Bolt**: Select a different bolt
119
+
120
+ ### Suggested Next Step
121
+ → Continue working on `{bolt-id}` - currently at {stage} stage
122
+
123
+ **Press Enter to continue or type a number.**
124
+ ```
125
+
126
+ ---
127
+
128
+ ## Output (No Active Bolt)
129
+
130
+ ```markdown
131
+ ## Construction Agent
132
+
133
+ ### No Active Bolt
134
+
135
+ ### Available Bolts
136
+
137
+ - [ ] `001-auth-service` (auth-service, DDD) - planned
138
+ - [ ] `002-auth-service` (auth-service, DDD) - planned
139
+ - [ ] `003-api-gateway` (api-gateway, Simple) - planned
140
+
141
+ ### Quick Actions
142
+
143
+ 1 - **Start 001-auth-service**: Begin first bolt
144
+ 2 - **List all bolts**: View with details
145
+ 3 - **View bolt status**: Check specific bolt
146
+
147
+ ### Suggested Next Step
148
+ → Start construction with `001-auth-service`
149
+
150
+ **Type a number or enter a bolt ID.**
151
+ ```
152
+
153
+ ---
154
+
155
+ ## Output (All Bolts Complete)
156
+
157
+ ```markdown
158
+ ## Construction Agent
159
+
160
+ ### Construction Complete for Unit: `{unit-name}`
161
+
162
+ All {n} bolts have been completed:
163
+
164
+ - ✅ `001-{unit-name}` - Completed 2024-12-05 (3h)
165
+ - ✅ `005-{unit-name}` - Completed 2024-12-06 (4h)
166
+
167
+ ### Summary
168
+ - Stories delivered: {n}
169
+ - Tests passing: ✅
170
+ - Ready for deployment
171
+
172
+ ### Next Step
173
+ → Proceed to Operations: `/specsmd-operations-agent --unit="{unit}"`
174
+
175
+ Or work on another unit's bolts.
176
+ ```
177
+
178
+ ---
179
+
180
+ ## Transition
181
+
182
+ After user selection:
183
+
184
+ - → Load selected skill
185
+ - → Skill contains the Checkpoint markers
186
+ - → Execute skill process
187
+
188
+ ---
189
+
190
+ ## Test Contract
191
+
192
+ ```yaml
193
+ input: Unit/bolt state (optional)
194
+ output: Menu with skill options, suggested next step
195
+ checkpoints: 0 (routing only)
196
+ ```
@@ -0,0 +1,359 @@
1
+ # Skill: Plan Bolts
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
+ - [x] Stories
17
+ - [ ] Bolt Plan ← this skill
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
+ Group User Stories into logical Bolts (execution sessions) that will guide the Construction Phase.
35
+
36
+ ---
37
+
38
+ ## Input
39
+
40
+ - **Required**: Unit name
41
+ - **Required**: `unit-brief.md` for the unit (contains `default_bolt_type` if specified)
42
+ - **Required**: Stories for the unit (`stories/*.md`)
43
+ - **Required**: `.specsmd/aidlc/memory-bank.yaml` - artifact schema
44
+ - **Required**: `.specsmd/aidlc/templates/standards/catalog.yaml` - project type definitions
45
+
46
+ ---
47
+
48
+ ## Process
49
+
50
+ ### 1. Analyze Stories
51
+
52
+ Review all stories to understand:
53
+
54
+ - Dependencies between stories
55
+ - Complexity and effort estimates
56
+ - Logical groupings by domain/feature
57
+
58
+ ### 2. Determine Bolt Type
59
+
60
+ **Read bolt type from unit-brief.md or use default based on unit type.**
61
+
62
+ 1. **Check unit-brief.md frontmatter** for `default_bolt_type`:
63
+
64
+ ```yaml
65
+ ---
66
+ unit: 001-expense-tracker-ui
67
+ unit_type: frontend
68
+ default_bolt_type: simple-construction-bolt
69
+ ---
70
+ ```
71
+
72
+ 2. **If not specified**, use defaults based on unit type:
73
+ - `unit_type: frontend` → `simple-construction-bolt`
74
+ - `unit_type: cli` → `simple-construction-bolt`
75
+ - `unit_type: backend` or unspecified → `ddd-construction-bolt`
76
+
77
+ 3. **Bolt type templates** are located at:
78
+ `.specsmd/aidlc/templates/construction/bolt-types/{bolt-type}.md`
79
+
80
+ **Available bolt types**:
81
+
82
+ - `ddd-construction-bolt` - For domain-heavy backend work (5 stages)
83
+ - `simple-construction-bolt` - For UI, integrations, utilities (3 stages)
84
+
85
+ ### 3. Assess Story Complexity
86
+
87
+ For each story, evaluate these factors:
88
+
89
+ | Factor | Question | Low (1) | Medium (2) | High (3) |
90
+ |--------|----------|---------|------------|----------|
91
+ | **Complexity** | How intricate is the logic? | CRUD, known patterns | Business rules, validation | Novel algorithms, complex logic |
92
+ | **Uncertainty** | How clear are requirements? | Fully specified | Some ambiguity | Many unknowns (→ spike) |
93
+ | **Dependencies** | What external things does it need? | Self-contained | Internal APIs/units | External systems, 3rd party |
94
+ | **Testing** | What validation is needed? | Unit tests | Integration tests | E2E + manual validation |
95
+
96
+ ### 4. Group Stories into Bolts
97
+
98
+ **Grouping rules:**
99
+
100
+ 1. **Cohesion**: Stories for same domain concept → same bolt
101
+ 2. **Dependencies**: Story A needs Story B → same or adjacent bolt
102
+ 3. **Balance**: Mix high + low complexity stories
103
+ 4. **Limit**: Max 5-6 stories per bolt
104
+ 5. **Risk**: Any story with High (3) Uncertainty → spike bolt first
105
+
106
+ **Suggested groupings:**
107
+
108
+ - **Bolt 1**: Setup & Core Entities (foundational stories)
109
+ - **Bolt 2**: Primary Operations (main CRUD/business logic)
110
+ - **Bolt 3**: Integration & Edge Cases (advanced stories)
111
+
112
+ ### 5. Analyze Dependencies
113
+
114
+ **CRITICAL**: Before defining sequence, analyze ALL dependencies:
115
+
116
+ #### 5a. Story Dependencies (within bolt)
117
+
118
+ For each story, check:
119
+
120
+ - Does it depend on another story's output?
121
+ - Does it require data/models from another story?
122
+
123
+ #### 5b. Bolt Dependencies (within unit)
124
+
125
+ For each bolt, determine:
126
+
127
+ - `requires_bolts`: Which bolts must complete first?
128
+ - `enables_bolts`: Which bolts are waiting on this one?
129
+
130
+ #### 5c. Unit Dependencies (cross-unit)
131
+
132
+ For each bolt, check if it depends on another unit:
133
+
134
+ - `requires_units`: Which units must be complete?
135
+ - Example: `api-bolt-1` may require `auth-service` unit to be complete
136
+
137
+ **Dependency Analysis Output**:
138
+
139
+ ```markdown
140
+ ## Dependency Analysis
141
+
142
+ ### Within-Unit Dependencies
143
+
144
+ - **bolt-auth-2** requires bolt-auth-1 (Needs User entity)
145
+ - **bolt-auth-3** requires bolt-auth-2 (Needs Auth service)
146
+
147
+ ### Cross-Unit Dependencies
148
+
149
+ - **bolt-api-1** requires auth-service unit (Needs auth tokens)
150
+ - **bolt-payment-1** requires user-service unit (Needs user data)
151
+
152
+ ### Dependency Warnings
153
+ - ⚠️ bolt-api-1 blocked until auth-service unit complete
154
+ - ⚠️ Circular dependency detected: {if any}
155
+ ```
156
+
157
+ ### 6. Define Bolt Sequence
158
+
159
+ Establish execution order based on dependencies:
160
+
161
+ ```markdown
162
+ ## Bolt Sequence
163
+
164
+ ```text
165
+
166
+ [Bolt 1] ──► [Bolt 2] ──► [Bolt 3]
167
+ │ │
168
+ ▼ ▼
169
+ Entity API Layer
170
+ Setup Implementation
171
+
172
+ ```
173
+
174
+ ## Cross-Unit Dependencies
175
+
176
+ ```text
177
+
178
+ [auth-service] ──► [api-service]
179
+
180
+
181
+ [payment-service]
182
+
183
+ ```
184
+
185
+ ### 7. Create Bolt Instance Files (CRITICAL)
186
+
187
+ **⚠️ YOU MUST CREATE INDIVIDUAL BOLT DIRECTORIES WITH bolt.md FILES**
188
+ **⚠️ DO NOT CREATE A SUMMARY DOCUMENT CALLED "bolt-plan.md"**
189
+
190
+ 1. **Read Path**: Check `schema.bolts` from `.specsmd/aidlc/memory-bank.yaml`
191
+ *(Default: `memory-bank/bolts/{bolt-id}/`)*
192
+
193
+ 2. **Determine Bolt ID**:
194
+ - List all directories in `memory-bank/bolts/`
195
+ - Extract the 3-digit prefix from each (e.g., `015` from `015-auth-service`)
196
+ - Find the highest number
197
+ - Next bolt uses the next available number (e.g., if highest is `015`, next is `016`)
198
+
199
+ **⚠️ CRITICAL**: The `{BBB}` prefix is a **GLOBAL** sequence across ALL bolts in `memory-bank/bolts/`, NOT per-unit.
200
+
201
+ 3. **Create Directory + File Per Bolt**:
202
+ For EACH bolt in the plan:
203
+ - Create directory: `memory-bank/bolts/{BBB}-{unit-name}/`
204
+ - Create file inside: `memory-bank/bolts/{BBB}-{unit-name}/bolt.md`
205
+ - Use template: `.specsmd/aidlc/templates/construction/bolt-template.md`
206
+
207
+ **Naming Convention** (from `memory-bank.yaml`):
208
+ - Format: `{BBB}-{unit-name}/` where BBB is a **GLOBAL** 3-digit sequence
209
+ - The number is global across ALL bolts in `memory-bank/bolts/` (not per-unit)
210
+ - Example sequence: `001-auth-service/`, `002-auth-service/`, `003-payment-service/`, `004-auth-service/`
211
+
212
+ **Example**: Planning bolts across multiple units (global numbering):
213
+
214
+ ```text
215
+ memory-bank/bolts/
216
+ ├── 001-auth-service/bolt.md ← First bolt ever created
217
+ ├── 002-auth-service/bolt.md ← Second bolt (same unit, continues sequence)
218
+ ├── 003-payment-service/bolt.md ← Third bolt (different unit)
219
+ ├── 004-auth-service/bolt.md ← Fourth bolt (back to auth-service)
220
+ └── 005-api-gateway/bolt.md ← Fifth bolt (another unit)
221
+ ```
222
+
223
+ **Stage artifacts will be added to same directory during construction:**
224
+
225
+ ```text
226
+ memory-bank/bolts/001-auth-service/
227
+ ├── bolt.md ← You create this now
228
+ └── {stage-artifacts} ← Created during construction (varies by bolt type)
229
+ ```
230
+
231
+ *Note: Artifact names depend on bolt type (e.g., DDD bolts create `ddd-01-domain-model.md`, simple bolts create `implementation-plan.md`).*
232
+
233
+ 4. **Bolt File Structure** (CRITICAL: Include all dependencies in frontmatter):
234
+
235
+ ```markdown
236
+ ---
237
+ id: {BBB}-{unit-name}
238
+ unit: {UUU}-{unit-name}
239
+ intent: {NNN}-{intent-name}
240
+ type: {bolt-type} # From unit-brief.md or default (ddd-construction-bolt, simple-construction-bolt)
241
+ status: planned
242
+ stories: [story-1, story-2]
243
+ created: {date}
244
+
245
+ # Dependency Tracking (REQUIRED)
246
+ requires_bolts: [001-auth-service] # Bolts that must complete first
247
+ enables_bolts: [003-auth-service, 001-api-service] # Bolts that depend on this
248
+ requires_units: [auth-service] # Units that must be complete
249
+ blocks: false # true if waiting on dependency
250
+
251
+ # Complexity Assessment (aggregate of included stories)
252
+ complexity:
253
+ avg_complexity: 2 # 1=Low, 2=Medium, 3=High
254
+ avg_uncertainty: 1 # 1=Low, 2=Medium, 3=High
255
+ max_dependencies: 2 # Highest dependency score among stories
256
+ testing_scope: 2 # 1=Unit, 2=Integration, 3=E2E
257
+ ---
258
+
259
+ ## Bolt: {BBB}-{unit-name}
260
+
261
+ ### Objective
262
+ {What this bolt will accomplish}
263
+
264
+ ### Stories Included
265
+
266
+ - [ ] **{story-id}**: {description} - Priority: {priority}
267
+
268
+ ### Expected Outputs
269
+ - {artifact 1}
270
+ - {artifact 2}
271
+
272
+ ### Dependencies
273
+
274
+ #### Bolt Dependencies (within intent)
275
+
276
+ - **001-auth-service** (Required): Completed
277
+ - **002-auth-service** (Optional): In Progress
278
+
279
+ #### Unit Dependencies (cross-unit)
280
+
281
+ - **auth-service**: Needs auth tokens - Completed
282
+
283
+ #### Enables (other bolts waiting on this)
284
+ - 003-auth-service
285
+ - 001-api-service
286
+ ```
287
+
288
+ ### 9. Validate Plan
289
+
290
+ Check the plan against:
291
+
292
+ - [ ] All stories are assigned to bolts
293
+ - [ ] Dependencies are respected (bolt-to-bolt AND unit-to-unit)
294
+ - [ ] All dependencies documented in frontmatter
295
+ - [ ] Complexity assessment included for each bolt
296
+ - [ ] Each bolt has clear outputs
297
+ - [ ] No bolt is too large (max 5-6 stories)
298
+ - [ ] No circular dependencies exist
299
+ - [ ] Cross-unit dependencies are explicit
300
+
301
+ ---
302
+
303
+ ## Output
304
+
305
+ ### Directories & Files Created (REQUIRED)
306
+
307
+ **⚠️ YOU MUST CREATE THESE DIRECTORIES AND FILES:**
308
+
309
+ ```text
310
+ memory-bank/bolts/{BBB}-{unit-name}/bolt.md ← CREATE THIS DIRECTORY AND FILE
311
+ ```
312
+
313
+ **Naming Convention** (from `memory-bank.yaml`):
314
+
315
+ - Format: `{BBB}-{unit-name}/` where BBB is a global 3-digit sequence
316
+ - Example: `001-auth-service/`, `002-auth-service/`, `016-analytics-tracker/`
317
+
318
+ **⚠️ DO NOT CREATE:**
319
+
320
+ - `bolt-plan.md` (summary doc)
321
+ - `README.md` files
322
+ - Flat files like `001-auth-service.md` (must be in directory)
323
+ - Old format like `bolt-{unit}-1/` (incorrect)
324
+
325
+ ### Summary (displayed to user)
326
+
327
+ ```markdown
328
+ ## Bolt Plan Complete: {unit-name}
329
+
330
+ ### Bolts Created
331
+
332
+ - [ ] **001-auth-service** ({bolt-type}): 001-user-signup, 002-user-login
333
+ - [ ] **002-auth-service** ({bolt-type}): 003-password-reset, 004-email-verify
334
+ - [ ] **003-auth-service** ({bolt-type}): 005-mfa-setup
335
+
336
+ ### Dependency Graph
337
+ 001-auth-service ──► 002-auth-service ──► 003-auth-service
338
+
339
+ ### Directories Created
340
+ ✅ `memory-bank/bolts/001-auth-service/bolt.md`
341
+ ✅ `memory-bank/bolts/002-auth-service/bolt.md`
342
+ ✅ `memory-bank/bolts/003-auth-service/bolt.md`
343
+
344
+ ### Total
345
+ - {n} bolts created
346
+ - {n} stories covered
347
+ ```
348
+
349
+ **No menu** - Skill complete, return to agent.
350
+
351
+ ---
352
+
353
+ ## Test Contract
354
+
355
+ ```yaml
356
+ input: Stories for unit
357
+ output: Bolt directories with bolt.md files
358
+ checkpoints: 0 (part of Checkpoint 3 batch)
359
+ ```
@@ -0,0 +1,171 @@
1
+ # Skill: Define System Context
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
+ - [ ] System Context ← this skill
15
+ - [ ] Units
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
+ Identify system boundaries, actors, and external dependencies to establish the "world" the system lives in.
35
+
36
+ ---
37
+
38
+ ## Input
39
+
40
+ - **Required**: Intent name
41
+ - **Required**: `requirements.md` for the intent
42
+ - **Required**: `.specsmd/aidlc/memory-bank.yaml` - artifact schema
43
+
44
+ ---
45
+
46
+ ## Process
47
+
48
+ ### 1. Identify Actors
49
+
50
+ Ask questions to discover all system users:
51
+
52
+ - **Human Users**: "Who uses this directly?" (Admin, Customer, Support)
53
+ - **System Users**: "What systems call this?" (Scheduler, Event Bus)
54
+ - **External Systems**: "What third-party services interact?" (Stripe, Auth0)
55
+
56
+ ### 2. Map External Systems
57
+
58
+ For each external dependency, document:
59
+
60
+ - **System name**: What is it?
61
+ - **Direction**: Inbound/Outbound/Both
62
+ - **Data Exchanged**: What data crosses?
63
+ - **Protocol**: REST/GraphQL/Event
64
+
65
+ ### 3. Define Data Flows
66
+
67
+ Document what data crosses the boundary:
68
+
69
+ **Inbound**:
70
+
71
+ - What data enters the system?
72
+ - What format? (JSON, XML, Binary)
73
+ - What validation is needed?
74
+
75
+ **Outbound**:
76
+
77
+ - What data leaves the system?
78
+ - What consumers expect it?
79
+ - What guarantees are needed? (Delivery, ordering)
80
+
81
+ ### 4. Create Context Diagram
82
+
83
+ Generate a C4 Context diagram (Mermaid):
84
+
85
+ ```markdown
86
+ ## System Context Diagram
87
+
88
+ ​```mermaid
89
+ C4Context
90
+ title System Context - {intent-name}
91
+
92
+ Person(user, "User", "Primary user of the system")
93
+ System(sys, "{System Name}", "The system being built")
94
+ System_Ext(ext1, "External System", "Third-party service")
95
+
96
+ Rel(user, sys, "Uses")
97
+ Rel(sys, ext1, "Integrates with")
98
+ ​```
99
+ ```
100
+
101
+ ### 5. Document Context
102
+
103
+ 1. **Read Path**: Check `schema.system_context` from `.specsmd/aidlc/memory-bank.yaml`
104
+ *(Default: `memory-bank/intents/{intent-name}/system-context.md`)*
105
+
106
+ 2. **Use Template**: `.specsmd/aidlc/templates/inception/system-context-template.md`
107
+
108
+ 3. **Structure**:
109
+
110
+ ```markdown
111
+ ## Actors
112
+
113
+ - **{Actor}** ({Type}): {Description}
114
+
115
+ ## External Systems
116
+
117
+ - **{System}**: {Purpose} - {Integration Type}
118
+
119
+ ## Data Flows
120
+ ### Inbound
121
+ ### Outbound
122
+
123
+ ## Context Diagram
124
+ {Mermaid diagram}
125
+ ```
126
+
127
+ ### 6. Validate Completeness
128
+
129
+ Ask:
130
+
131
+ - "Did I miss any third-party integrations?"
132
+ - "Are there legacy systems this needs to work with?"
133
+ - "Any planned future integrations to consider?"
134
+
135
+ ---
136
+
137
+ ## Output
138
+
139
+ ```markdown
140
+ ## System Context: {intent-name}
141
+
142
+ ### Actors Identified
143
+
144
+ - **Customer** (Human): Web/Mobile UI
145
+ - **Admin** (Human): Admin Dashboard
146
+ - **Payment Gateway** (System): REST API
147
+
148
+ ### External Dependencies
149
+
150
+ - **Stripe**: Payments - Risk: High
151
+ - **SendGrid**: Email - Risk: Medium
152
+
153
+ ### Data Flow Summary
154
+ - **Inbound**: User requests, webhook events
155
+ - **Outbound**: Transaction records, notifications
156
+
157
+ ### Artifact Created
158
+ ✅ `{intent-path}/system-context.md`
159
+ ```
160
+
161
+ **No menu** - Skill complete, return to agent.
162
+
163
+ ---
164
+
165
+ ## Test Contract
166
+
167
+ ```yaml
168
+ input: Intent requirements
169
+ output: system-context.md with actors, systems, data flows
170
+ checkpoints: 0 (part of Checkpoint 3 batch)
171
+ ```