@ydtb/specsmd 0.1.22

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 (143) hide show
  1. package/README.md +322 -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 +67 -0
  9. package/flows/aidlc/commands/inception-agent.md +59 -0
  10. package/flows/aidlc/commands/master-agent.md +51 -0
  11. package/flows/aidlc/commands/operations-agent.md +81 -0
  12. package/flows/aidlc/context-config.yaml +67 -0
  13. package/flows/aidlc/memory-bank.yaml +105 -0
  14. package/flows/aidlc/quick-start.md +322 -0
  15. package/flows/aidlc/scripts/artifact-validator.cjs +594 -0
  16. package/flows/aidlc/scripts/bolt-complete.cjs +606 -0
  17. package/flows/aidlc/scripts/status-integrity.cjs +598 -0
  18. package/flows/aidlc/skills/construction/bolt-list.md +163 -0
  19. package/flows/aidlc/skills/construction/bolt-replan.md +345 -0
  20. package/flows/aidlc/skills/construction/bolt-start.md +442 -0
  21. package/flows/aidlc/skills/construction/bolt-status.md +185 -0
  22. package/flows/aidlc/skills/construction/navigator.md +196 -0
  23. package/flows/aidlc/skills/construction/prototype-apply.md +311 -0
  24. package/flows/aidlc/skills/inception/bolt-plan.md +372 -0
  25. package/flows/aidlc/skills/inception/context.md +171 -0
  26. package/flows/aidlc/skills/inception/intent-create.md +211 -0
  27. package/flows/aidlc/skills/inception/intent-list.md +124 -0
  28. package/flows/aidlc/skills/inception/navigator.md +207 -0
  29. package/flows/aidlc/skills/inception/requirements.md +227 -0
  30. package/flows/aidlc/skills/inception/review.md +248 -0
  31. package/flows/aidlc/skills/inception/story-create.md +304 -0
  32. package/flows/aidlc/skills/inception/units.md +278 -0
  33. package/flows/aidlc/skills/inception/vibe-to-spec.md +410 -0
  34. package/flows/aidlc/skills/master/analyze-context.md +239 -0
  35. package/flows/aidlc/skills/master/answer-question.md +141 -0
  36. package/flows/aidlc/skills/master/explain-flow.md +158 -0
  37. package/flows/aidlc/skills/master/project-init.md +281 -0
  38. package/flows/aidlc/skills/master/route-request.md +126 -0
  39. package/flows/aidlc/skills/operations/build.md +237 -0
  40. package/flows/aidlc/skills/operations/deploy.md +259 -0
  41. package/flows/aidlc/skills/operations/monitor.md +265 -0
  42. package/flows/aidlc/skills/operations/navigator.md +209 -0
  43. package/flows/aidlc/skills/operations/verify.md +224 -0
  44. package/flows/aidlc/templates/construction/bolt-template.md +226 -0
  45. package/flows/aidlc/templates/construction/bolt-types/ddd-construction-bolt/adr-template.md +49 -0
  46. package/flows/aidlc/templates/construction/bolt-types/ddd-construction-bolt/ddd-01-domain-model-template.md +55 -0
  47. package/flows/aidlc/templates/construction/bolt-types/ddd-construction-bolt/ddd-02-technical-design-template.md +67 -0
  48. package/flows/aidlc/templates/construction/bolt-types/ddd-construction-bolt/ddd-03-test-report-template.md +62 -0
  49. package/flows/aidlc/templates/construction/bolt-types/ddd-construction-bolt.md +590 -0
  50. package/flows/aidlc/templates/construction/bolt-types/simple-construction-bolt.md +347 -0
  51. package/flows/aidlc/templates/construction/bolt-types/spike-bolt.md +240 -0
  52. package/flows/aidlc/templates/construction/construction-log-template.md +129 -0
  53. package/flows/aidlc/templates/construction/standards/coding-standards.md +29 -0
  54. package/flows/aidlc/templates/construction/standards/system-architecture.md +22 -0
  55. package/flows/aidlc/templates/construction/standards/tech-stack.md +19 -0
  56. package/flows/aidlc/templates/inception/inception-log-template.md +134 -0
  57. package/flows/aidlc/templates/inception/project/README.md +55 -0
  58. package/flows/aidlc/templates/inception/requirements-template.md +144 -0
  59. package/flows/aidlc/templates/inception/stories-template.md +38 -0
  60. package/flows/aidlc/templates/inception/story-template.md +147 -0
  61. package/flows/aidlc/templates/inception/system-context-template.md +29 -0
  62. package/flows/aidlc/templates/inception/unit-brief-template.md +177 -0
  63. package/flows/aidlc/templates/inception/units-template.md +52 -0
  64. package/flows/aidlc/templates/standards/catalog.yaml +345 -0
  65. package/flows/aidlc/templates/standards/coding-standards.guide.md +553 -0
  66. package/flows/aidlc/templates/standards/data-stack.guide.md +162 -0
  67. package/flows/aidlc/templates/standards/decision-index-template.md +32 -0
  68. package/flows/aidlc/templates/standards/tech-stack.guide.md +280 -0
  69. package/flows/fire/README.md +19 -0
  70. package/flows/fire/agents/builder/agent.md +254 -0
  71. package/flows/fire/agents/builder/skills/code-review/SKILL.md +257 -0
  72. package/flows/fire/agents/builder/skills/code-review/references/auto-fix-rules.md +218 -0
  73. package/flows/fire/agents/builder/skills/code-review/references/review-categories.md +154 -0
  74. package/flows/fire/agents/builder/skills/code-review/templates/review-report.md.hbs +120 -0
  75. package/flows/fire/agents/builder/skills/commit-changes/SKILL.md +232 -0
  76. package/flows/fire/agents/builder/skills/commit-changes/scripts/commit-changes.cjs +447 -0
  77. package/flows/fire/agents/builder/skills/run-execute/SKILL.md +700 -0
  78. package/flows/fire/agents/builder/skills/run-execute/scripts/complete-run.cjs +748 -0
  79. package/flows/fire/agents/builder/skills/run-execute/scripts/init-run.cjs +457 -0
  80. package/flows/fire/agents/builder/skills/run-execute/scripts/update-phase.cjs +239 -0
  81. package/flows/fire/agents/builder/skills/run-execute/templates/plan.md.hbs +61 -0
  82. package/flows/fire/agents/builder/skills/run-execute/templates/test-report.md.hbs +81 -0
  83. package/flows/fire/agents/builder/skills/run-plan/SKILL.md +366 -0
  84. package/flows/fire/agents/builder/skills/run-status/SKILL.md +96 -0
  85. package/flows/fire/agents/builder/skills/walkthrough-generate/SKILL.md +181 -0
  86. package/flows/fire/agents/builder/skills/walkthrough-generate/templates/walkthrough.md.hbs +108 -0
  87. package/flows/fire/agents/orchestrator/agent.md +144 -0
  88. package/flows/fire/agents/orchestrator/skills/project-init/SKILL.md +226 -0
  89. package/flows/fire/agents/orchestrator/skills/project-init/templates/coding-standards.md.hbs +149 -0
  90. package/flows/fire/agents/orchestrator/skills/project-init/templates/constitution.md.hbs +43 -0
  91. package/flows/fire/agents/orchestrator/skills/project-init/templates/system-architecture.md.hbs +101 -0
  92. package/flows/fire/agents/orchestrator/skills/project-init/templates/tech-stack.md.hbs +136 -0
  93. package/flows/fire/agents/orchestrator/skills/project-init/templates/testing-standards.md.hbs +94 -0
  94. package/flows/fire/agents/orchestrator/skills/route/SKILL.md +146 -0
  95. package/flows/fire/agents/orchestrator/skills/status/SKILL.md +696 -0
  96. package/flows/fire/agents/planner/agent.md +143 -0
  97. package/flows/fire/agents/planner/skills/design-doc-generate/SKILL.md +156 -0
  98. package/flows/fire/agents/planner/skills/design-doc-generate/templates/design.md.hbs +124 -0
  99. package/flows/fire/agents/planner/skills/intent-capture/SKILL.md +125 -0
  100. package/flows/fire/agents/planner/skills/intent-capture/templates/brief.md.hbs +40 -0
  101. package/flows/fire/agents/planner/skills/work-item-decompose/SKILL.md +166 -0
  102. package/flows/fire/agents/planner/skills/work-item-decompose/templates/work-item.md.hbs +40 -0
  103. package/flows/fire/commands/fire-builder.md +56 -0
  104. package/flows/fire/commands/fire-planner.md +48 -0
  105. package/flows/fire/commands/fire.md +46 -0
  106. package/flows/fire/memory-bank.yaml +240 -0
  107. package/flows/fire/quick-start.md +146 -0
  108. package/flows/simple/README.md +190 -0
  109. package/flows/simple/agents/agent.md +404 -0
  110. package/flows/simple/commands/agent.md +60 -0
  111. package/flows/simple/context-config.yaml +34 -0
  112. package/flows/simple/memory-bank.yaml +66 -0
  113. package/flows/simple/quick-start.md +231 -0
  114. package/flows/simple/skills/design.md +96 -0
  115. package/flows/simple/skills/execute.md +190 -0
  116. package/flows/simple/skills/requirements.md +94 -0
  117. package/flows/simple/skills/tasks.md +136 -0
  118. package/flows/simple/templates/design-template.md +138 -0
  119. package/flows/simple/templates/requirements-template.md +85 -0
  120. package/flows/simple/templates/tasks-template.md +104 -0
  121. package/lib/InstallerFactory.js +36 -0
  122. package/lib/analytics/env-detector.js +92 -0
  123. package/lib/analytics/index.js +22 -0
  124. package/lib/analytics/machine-id.js +33 -0
  125. package/lib/analytics/tracker.js +232 -0
  126. package/lib/cli-utils.js +342 -0
  127. package/lib/constants.js +44 -0
  128. package/lib/installer.js +406 -0
  129. package/lib/installers/AntigravityInstaller.js +22 -0
  130. package/lib/installers/ClaudeInstaller.js +85 -0
  131. package/lib/installers/ClineInstaller.js +21 -0
  132. package/lib/installers/CodexInstaller.js +21 -0
  133. package/lib/installers/CopilotInstaller.js +113 -0
  134. package/lib/installers/CursorInstaller.js +63 -0
  135. package/lib/installers/GeminiInstaller.js +75 -0
  136. package/lib/installers/KiroInstaller.js +77 -0
  137. package/lib/installers/OpenCodeInstaller.js +30 -0
  138. package/lib/installers/RooInstaller.js +22 -0
  139. package/lib/installers/ToolInstaller.js +76 -0
  140. package/lib/installers/WindsurfInstaller.js +22 -0
  141. package/lib/markdown-validator.ts +175 -0
  142. package/lib/yaml-validator.ts +99 -0
  143. package/package.json +69 -0
@@ -0,0 +1,410 @@
1
+ # Skill: Vibe to Spec
2
+
3
+ ---
4
+
5
+ ## Progress Display
6
+
7
+ Show at start of this skill:
8
+
9
+ ```text
10
+ ### Inception Progress
11
+ - [ ] Prototype analyzed ← current
12
+ - [ ] Design system extracted
13
+ - [ ] Components cataloged
14
+ - [ ] Requirements derived
15
+ - [ ] Ready for standard inception flow
16
+ ```
17
+
18
+ ---
19
+
20
+ ## Checkpoints in This Skill
21
+
22
+ | Checkpoint | Purpose | Wait For |
23
+ |------------|---------|----------|
24
+ | Checkpoint 1 | Prototype inventory review | User confirmation |
25
+ | Checkpoint 2 | Design system approval | User approval |
26
+ | Checkpoint 3 | Derived requirements review | User approval |
27
+
28
+ ---
29
+
30
+ ## Goal
31
+
32
+ Convert a vibe-coded prototype (screenshots, HTML exports, or design mockups) into formal specsmd artifacts that feed into the standard inception workflow.
33
+
34
+ ---
35
+
36
+ ## Input
37
+
38
+ - **Required**: Path to prototype folder (e.g., `proto/`, `mockups/`, `discovery/`)
39
+ - **Required**: `.specsmd/aidlc/memory-bank.yaml` - artifact schema
40
+ - **Optional**: Intent name to associate with (creates new if not provided)
41
+ - **Optional**: Existing design system to extend
42
+
43
+ **Supported Prototype Formats**:
44
+
45
+ - PNG/JPG screenshots
46
+ - HTML exports (with associated CSS/JS in `_files` folders)
47
+ - Figma exports
48
+ - PDF mockups
49
+
50
+ ---
51
+
52
+ ## Process
53
+
54
+ ### Step 1: Inventory Prototype Assets
55
+
56
+ Scan the prototype folder and catalog all assets:
57
+
58
+ ```text
59
+ ## Prototype Inventory
60
+
61
+ Scanning: {prototype-path}
62
+
63
+ ### Screenshots Found
64
+ - {filename}.png - {brief description based on visual analysis}
65
+ - ...
66
+
67
+ ### HTML Exports Found
68
+ - {filename}.html - {title or main heading}
69
+ - ...
70
+
71
+ ### Asset Folders
72
+ - {filename}_files/ - CSS, JS, images
73
+ - ...
74
+
75
+ Total: {n} screens identified
76
+ ```
77
+
78
+ **Checkpoint 1**: Present inventory for user confirmation.
79
+
80
+ ```text
81
+ I found {n} screens in your prototype. Here's what I see:
82
+
83
+ 1. {screen-1-description}
84
+ 2. {screen-2-description}
85
+ ...
86
+
87
+ Is this complete? Are there screens I'm missing or misinterpreting?
88
+ 1 - Yes, continue analysis
89
+ 2 - Let me clarify (provide corrections)
90
+ ```
91
+
92
+ **Wait for user response.**
93
+
94
+ ---
95
+
96
+ ### Step 2: Analyze Each Screen
97
+
98
+ For each screen, extract:
99
+
100
+ **Visual Analysis** (use image analysis capabilities):
101
+
102
+ - Layout structure (sidebar, main content, header, footer)
103
+ - Color palette (primary, secondary, accent, background)
104
+ - Typography (headings, body text, labels)
105
+ - Component patterns (buttons, inputs, cards, lists)
106
+ - Interactive elements (forms, menus, modals)
107
+
108
+ **HTML Analysis** (if available):
109
+
110
+ - Component structure from markup
111
+ - CSS classes and styling patterns
112
+ - JavaScript interactions
113
+
114
+ **Output per screen**:
115
+
116
+ ```markdown
117
+ ### Screen: {screen-name}
118
+ **Source**: {filename}
119
+ **Purpose**: {inferred purpose}
120
+
121
+ #### Layout
122
+ - Structure: {e.g., sidebar-main, header-content-footer}
123
+ - Responsive hints: {any visible breakpoint patterns}
124
+
125
+ #### Components Identified
126
+ - [ ] {component-1}: {description}
127
+ - [ ] {component-2}: {description}
128
+
129
+ #### Interactions
130
+ - {interaction-1}: {trigger} → {result}
131
+
132
+ #### Design Tokens
133
+ - Primary color: {hex}
134
+ - Text color: {hex}
135
+ - Background: {hex}
136
+ - Border radius: {px}
137
+ - Spacing unit: {px}
138
+ ```
139
+
140
+ ---
141
+
142
+ ### Step 3: Synthesize Design System
143
+
144
+ Combine analysis from all screens into a unified design system:
145
+
146
+ ```markdown
147
+ ## Design System: {prototype-name}
148
+
149
+ ### Color Palette
150
+ | Token | Value | Usage |
151
+ |-------|-------|-------|
152
+ | primary | {hex} | Buttons, links, accents |
153
+ | secondary | {hex} | Secondary actions |
154
+ | background | {hex} | Page background |
155
+ | surface | {hex} | Card backgrounds |
156
+ | text-primary | {hex} | Main text |
157
+ | text-secondary | {hex} | Muted text |
158
+ | border | {hex} | Borders, dividers |
159
+ | success | {hex} | Success states |
160
+ | error | {hex} | Error states |
161
+
162
+ ### Typography
163
+ | Element | Font | Size | Weight |
164
+ |---------|------|------|--------|
165
+ | h1 | {font} | {size} | {weight} |
166
+ | h2 | {font} | {size} | {weight} |
167
+ | body | {font} | {size} | {weight} |
168
+ | label | {font} | {size} | {weight} |
169
+ | caption | {font} | {size} | {weight} |
170
+
171
+ ### Spacing Scale
172
+ - xs: {px}
173
+ - sm: {px}
174
+ - md: {px}
175
+ - lg: {px}
176
+ - xl: {px}
177
+
178
+ ### Border Radius
179
+ - sm: {px}
180
+ - md: {px}
181
+ - lg: {px}
182
+ - full: 9999px
183
+
184
+ ### Shadows
185
+ - sm: {shadow}
186
+ - md: {shadow}
187
+ - lg: {shadow}
188
+
189
+ ### Component Patterns
190
+ {list of reusable patterns identified}
191
+ ```
192
+
193
+ **Checkpoint 2**: Present design system for approval.
194
+
195
+ ```text
196
+ ### Design System Review
197
+
198
+ I've extracted the following design system from your prototype:
199
+
200
+ {full design system}
201
+
202
+ Does this accurately capture your prototype's visual language?
203
+ 1 - Yes, continue to derive requirements
204
+ 2 - Need adjustments (specify what's wrong)
205
+ ```
206
+
207
+ **Wait for user response.**
208
+
209
+ ---
210
+
211
+ ### Step 4: Catalog Components
212
+
213
+ Create a component catalog from the prototype:
214
+
215
+ ```markdown
216
+ ## Component Catalog: {prototype-name}
217
+
218
+ ### Navigation Components
219
+ - **Sidebar**: {description, screens where found}
220
+ - **Header**: {description}
221
+ - **Breadcrumb**: {description}
222
+
223
+ ### Form Components
224
+ - **Text Input**: {variants, validation states}
225
+ - **Button**: {variants: primary, secondary, ghost}
226
+ - **Select/Dropdown**: {description}
227
+ - **Checkbox/Radio**: {description}
228
+
229
+ ### Display Components
230
+ - **Card**: {variants}
231
+ - **List**: {variants}
232
+ - **Table**: {if present}
233
+ - **Modal/Dialog**: {if present}
234
+
235
+ ### Feedback Components
236
+ - **Toast/Notification**: {if present}
237
+ - **Loading States**: {spinners, skeletons}
238
+ - **Empty States**: {if present}
239
+ - **Error States**: {if present}
240
+
241
+ ### Layout Components
242
+ - **Container**: {max-width, padding}
243
+ - **Grid**: {columns, gaps}
244
+ - **Stack**: {spacing patterns}
245
+ ```
246
+
247
+ ---
248
+
249
+ ### Step 5: Map User Flows
250
+
251
+ Identify user flows from screen sequences:
252
+
253
+ ```markdown
254
+ ## User Flows
255
+
256
+ ### Flow 1: {flow-name}
257
+ **Screens**: {screen-1} → {screen-2} → {screen-3}
258
+ **Goal**: {what user accomplishes}
259
+ **Steps**:
260
+ 1. User sees {screen-1}, {action}
261
+ 2. System shows {screen-2}
262
+ 3. User {action}
263
+ 4. System {result}
264
+
265
+ ### Flow 2: {flow-name}
266
+ ...
267
+ ```
268
+
269
+ ---
270
+
271
+ ### Step 6: Derive Requirements
272
+
273
+ Transform visual analysis into formal requirements:
274
+
275
+ ```markdown
276
+ ## Derived Requirements
277
+
278
+ ### Functional Requirements (from prototype)
279
+
280
+ #### FR-P1: {Component/Feature Name}
281
+ - **Source**: {screenshot reference}
282
+ - **Description**: {what it does based on visual}
283
+ - **Acceptance Criteria**:
284
+ - [ ] {visual criterion 1}
285
+ - [ ] {visual criterion 2}
286
+ - **Components**: {list of components needed}
287
+ - **Priority**: {inferred from prominence}
288
+
289
+ #### FR-P2: {Component/Feature Name}
290
+ ...
291
+
292
+ ### Non-Functional Requirements (inferred)
293
+
294
+ #### NFR-P1: Visual Consistency
295
+ - Design system must be applied consistently
296
+ - All components follow extracted patterns
297
+
298
+ #### NFR-P2: Responsive Design
299
+ - {any responsive hints from prototype}
300
+
301
+ ### Open Questions
302
+ - {things that aren't clear from prototype}
303
+ - {interactions that need clarification}
304
+ ```
305
+
306
+ **Checkpoint 3**: Present derived requirements.
307
+
308
+ ```text
309
+ ### Derived Requirements Review
310
+
311
+ Based on your prototype, I've derived these requirements:
312
+
313
+ {full requirements list}
314
+
315
+ ### Open Questions
316
+ {list of clarifications needed}
317
+
318
+ How should we proceed?
319
+ 1 - Requirements look good, create intent and continue inception
320
+ 2 - Need to adjust requirements
321
+ 3 - Answer open questions first
322
+ ```
323
+
324
+ **Wait for user response.**
325
+
326
+ ---
327
+
328
+ ## Output
329
+
330
+ ### Artifacts Created
331
+
332
+ Save to `memory-bank/prototypes/{prototype-name}/`:
333
+
334
+ 1. **screen-inventory.md** - Catalog of all screens
335
+ 2. **design-system.md** - Extracted design tokens and patterns
336
+ 3. **component-catalog.md** - Component inventory
337
+ 4. **user-flows.md** - Identified user flows
338
+ 5. **derived-requirements.md** - Requirements ready for inception
339
+
340
+ ### Summary Output
341
+
342
+ ```markdown
343
+ ## Vibe-to-Spec Complete: {prototype-name}
344
+
345
+ ### Prototype Analysis
346
+ - **Screens analyzed**: {n}
347
+ - **Components identified**: {n}
348
+ - **User flows mapped**: {n}
349
+ - **Requirements derived**: {n}
350
+
351
+ ### Artifacts Created
352
+ - `memory-bank/prototypes/{name}/screen-inventory.md`
353
+ - `memory-bank/prototypes/{name}/design-system.md`
354
+ - `memory-bank/prototypes/{name}/component-catalog.md`
355
+ - `memory-bank/prototypes/{name}/user-flows.md`
356
+ - `memory-bank/prototypes/{name}/derived-requirements.md`
357
+
358
+ ### Next Steps
359
+
360
+ 1 - **intent-create**: Create intent using derived requirements
361
+ 2 - **requirements**: Refine requirements with standard flow
362
+ 3 - **review**: Review all prototype artifacts
363
+
364
+ ### Suggested Next Step
365
+ → **intent-create** - Create intent "{suggested-name}" from prototype
366
+
367
+ **Type a number or press Enter for suggested action.**
368
+ ```
369
+
370
+ ---
371
+
372
+ ## Integration with Inception Flow
373
+
374
+ After vibe-to-spec completes:
375
+
376
+ 1. **intent-create** can reference `derived-requirements.md`
377
+ 2. **requirements** skill can import and refine FR-P* items
378
+ 3. **context** skill can use component catalog for system boundaries
379
+ 4. **units** skill can organize by identified flows
380
+ 5. **stories** skill can generate from user flow mapping
381
+
382
+ ---
383
+
384
+ ## Construction Phase Reference
385
+
386
+ When Construction Agent starts a bolt that references this prototype:
387
+
388
+ 1. Load `design-system.md` for styling decisions
389
+ 2. Reference `component-catalog.md` for component specs
390
+ 3. Use screenshots as visual acceptance criteria
391
+ 4. Apply extracted design tokens to implementation
392
+ 5. **Use frontend-design skill if available** - When implementing UI components, invoke the `/frontend-design` skill for high-quality, production-grade frontend code that avoids generic AI aesthetics
393
+
394
+ ---
395
+
396
+ ## Test Contract
397
+
398
+ ```yaml
399
+ input: Prototype folder with screenshots/HTML
400
+ output:
401
+ - screen-inventory.md
402
+ - design-system.md
403
+ - component-catalog.md
404
+ - user-flows.md
405
+ - derived-requirements.md
406
+ checkpoints: 3
407
+ - Checkpoint 1: Prototype inventory confirmed
408
+ - Checkpoint 2: Design system approved
409
+ - Checkpoint 3: Derived requirements approved
410
+ ```
@@ -0,0 +1,239 @@
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, complete)
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
+ ### 6. Validate Status Integrity
74
+
75
+ Check for status inconsistencies across the artifact hierarchy. Status must cascade correctly:
76
+
77
+ ```text
78
+ Bolt complete → Stories complete → Unit complete (if all bolts done) → Intent complete (if all units done)
79
+ ```
80
+
81
+ #### 6.1 Story Status Check
82
+
83
+ For each completed bolt:
84
+
85
+ - Read bolt's `stories` array
86
+ - Check each story file's `status` field
87
+ - **Inconsistency**: Bolt complete but story has `status: draft` or `status: in-progress`
88
+
89
+ #### 6.2 Unit Status Check
90
+
91
+ For each unit:
92
+
93
+ - Find all bolts for unit: `memory-bank/bolts/bolt-{unit}-*/bolt.md`
94
+ - Determine expected status:
95
+ - If ANY bolt `in-progress` → unit should be `in-progress`
96
+ - If ALL bolts `complete` → unit should be `complete`
97
+ - If ALL bolts `planned` and at least one story defined → unit should be `stories-defined`
98
+ - If NO bolts exist but stories exist → unit should be `stories-defined`
99
+ - **Inconsistency**: Unit status doesn't match expected based on bolt states
100
+
101
+ #### 6.3 Intent Status Check
102
+
103
+ For each intent:
104
+
105
+ - Read all unit-briefs: `{intent}/units/*/unit-brief.md`
106
+ - Determine expected status:
107
+ - If ANY unit `in-progress` → intent should be `construction`
108
+ - If ALL units `complete` → intent should be `complete`
109
+ - If units defined but none started → intent should be `units-defined`
110
+ - **Inconsistency**: Intent status doesn't match expected based on unit states
111
+
112
+ #### 6.4 Report Inconsistencies
113
+
114
+ If inconsistencies found, report them:
115
+
116
+ ```markdown
117
+ ## ⚠️ Status Inconsistencies Detected
118
+
119
+ | Artifact | Current Status | Expected Status | Reason |
120
+ |----------|----------------|-----------------|--------|
121
+ | unit-brief: file-watcher | draft | complete | All bolts complete |
122
+ | requirements: 011-vscode-extension | units-defined | construction | Has in-progress units |
123
+
124
+ ### Actions
125
+ 1 - **fix**: Update all statuses to expected values
126
+ 2 - **skip**: Continue without fixing
127
+ 3 - **review**: Show details for each inconsistency
128
+
129
+ **Type 1 to fix inconsistencies, or 2 to skip.**
130
+ ```
131
+
132
+ #### 6.5 Auto-Fix (On User Confirmation)
133
+
134
+ If user confirms fix:
135
+
136
+ - Update each artifact's frontmatter `status` field
137
+ - Update `updated` timestamp to current date
138
+ - Log changes to `memory-bank/maintenance-log.md`
139
+ - Report changes made
140
+
141
+ #### 6.6 Log to Maintenance Log
142
+
143
+ Append entry to `memory-bank/maintenance-log.md` (create if doesn't exist):
144
+
145
+ ```markdown
146
+ ## {ISO-8601-timestamp} - Status Sync
147
+
148
+ **Triggered by**: analyze-context integrity check
149
+
150
+ | Artifact | Old Status | New Status | Reason |
151
+ |----------|------------|------------|--------|
152
+ | {path} | {old} | {new} | {reason} |
153
+
154
+ ---
155
+ ```
156
+
157
+ **Example**:
158
+
159
+ ```markdown
160
+ ## 2025-12-26T15:30:00Z - Status Sync
161
+
162
+ **Triggered by**: analyze-context integrity check
163
+
164
+ | Artifact | Old Status | New Status | Reason |
165
+ |----------|------------|------------|--------|
166
+ | 011-vscode-extension/units/file-watcher/unit-brief.md | draft | complete | All bolts complete (1/1) |
167
+ | 011-vscode-extension/units/extension-core/unit-brief.md | draft | complete | All bolts complete (1/1) |
168
+ | 011-vscode-extension/requirements.md | units-defined | construction | Has in-progress units |
169
+
170
+ ---
171
+ ```
172
+
173
+ ---
174
+
175
+ ## Output
176
+
177
+ Provide a structured analysis:
178
+
179
+ ```markdown
180
+ ## Project State Analysis
181
+
182
+ ### Summary
183
+ - **Phase**: {current phase}
184
+ - **Active Intent**: {name or "None"}
185
+ - **Active Unit**: {name or "None"}
186
+ - **Active Bolt**: {id or "None"}
187
+
188
+ ### Evidence
189
+ - Intents found: {count} ({list names})
190
+ - Units found: {count} for {intent}
191
+ - Stories found: {count} for {unit}
192
+ - Bolts found: {count} ({status breakdown})
193
+
194
+ ### Status Integrity
195
+ - ✅ All statuses consistent (or)
196
+ - ⚠️ {N} inconsistencies found (see details below)
197
+
198
+ ### Current State Details
199
+ {Specific details about what exists and what's missing}
200
+
201
+ {If inconsistencies found, include the inconsistency table here}
202
+
203
+ ### Actions
204
+
205
+ 1 - **proceed**: Execute suggested action
206
+ 2 - **explain**: Learn more about current phase
207
+ 3 - **different**: Work on something else
208
+ {If inconsistencies: 4 - **fix**: Fix status inconsistencies}
209
+
210
+ ### Suggested Next Step
211
+ → **proceed** - {Specific command to run}
212
+
213
+ **Type a number or press Enter for suggested action.**
214
+ ```
215
+
216
+ ---
217
+
218
+ ## Human Validation Point
219
+
220
+ > "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."
221
+
222
+ ---
223
+
224
+ ## Transition
225
+
226
+ After analysis, either:
227
+
228
+ - → **Route Request** (`.specsmd/skills/master/route-request.md`) - to direct user to specialist agent
229
+ - → **Answer Question** (`.specsmd/skills/master/answer-question.md`) - if user has questions about state
230
+
231
+ ---
232
+
233
+ ## Test Contract
234
+
235
+ ```yaml
236
+ input: Memory bank schema and artifacts
237
+ output: Project state analysis with phase, evidence, and suggested next step
238
+ checkpoints: 0 (informational only)
239
+ ```