specsmd 0.0.0-dev.7 → 0.0.0-dev.71

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 (78) hide show
  1. package/README.md +10 -2
  2. package/flows/aidlc/commands/construction-agent.md +5 -1
  3. package/flows/aidlc/commands/inception-agent.md +4 -0
  4. package/flows/aidlc/commands/master-agent.md +4 -0
  5. package/flows/aidlc/commands/operations-agent.md +4 -0
  6. package/flows/aidlc/memory-bank.yaml +2 -1
  7. package/{scripts → flows/aidlc/scripts}/artifact-validator.js +3 -3
  8. package/{scripts → flows/aidlc/scripts}/bolt-complete.js +35 -4
  9. package/{scripts → flows/aidlc/scripts}/status-integrity.js +4 -4
  10. package/flows/aidlc/skills/construction/bolt-list.md +1 -1
  11. package/flows/aidlc/skills/construction/bolt-start.md +2 -2
  12. package/flows/aidlc/skills/construction/bolt-status.md +1 -1
  13. package/flows/aidlc/skills/construction/prototype-apply.md +305 -0
  14. package/flows/aidlc/skills/inception/bolt-plan.md +15 -2
  15. package/flows/aidlc/skills/inception/vibe-to-spec.md +406 -0
  16. package/flows/aidlc/skills/master/analyze-context.md +1 -1
  17. package/flows/aidlc/templates/construction/bolt-template.md +22 -1
  18. package/flows/aidlc/templates/construction/bolt-types/ddd-construction-bolt.md +73 -11
  19. package/flows/aidlc/templates/standards/decision-index-template.md +32 -0
  20. package/flows/fire/README.md +19 -0
  21. package/flows/fire/agents/builder/agent.md +252 -0
  22. package/flows/fire/agents/builder/skills/code-review/SKILL.md +254 -0
  23. package/flows/fire/agents/builder/skills/code-review/references/auto-fix-rules.md +212 -0
  24. package/flows/fire/agents/builder/skills/code-review/references/review-categories.md +154 -0
  25. package/flows/fire/agents/builder/skills/code-review/templates/review-report.md.hbs +120 -0
  26. package/flows/fire/agents/builder/skills/run-execute/SKILL.md +566 -0
  27. package/flows/fire/agents/builder/skills/run-execute/scripts/complete-run.js +549 -0
  28. package/flows/fire/agents/builder/skills/run-execute/scripts/init-run.js +454 -0
  29. package/flows/fire/agents/builder/skills/run-execute/templates/plan.md.hbs +61 -0
  30. package/flows/fire/agents/builder/skills/run-execute/templates/test-report.md.hbs +81 -0
  31. package/flows/fire/agents/builder/skills/run-plan/SKILL.md +368 -0
  32. package/flows/fire/agents/builder/skills/run-status/SKILL.md +94 -0
  33. package/flows/fire/agents/builder/skills/walkthrough-generate/SKILL.md +140 -0
  34. package/flows/fire/agents/builder/skills/walkthrough-generate/scripts/render-walkthrough.ts +755 -0
  35. package/flows/fire/agents/builder/skills/walkthrough-generate/templates/walkthrough.md.hbs +77 -0
  36. package/flows/fire/agents/orchestrator/agent.md +127 -0
  37. package/flows/fire/agents/orchestrator/skills/project-init/SKILL.md +225 -0
  38. package/flows/fire/agents/orchestrator/skills/project-init/templates/coding-standards.md.hbs +149 -0
  39. package/flows/fire/agents/orchestrator/skills/project-init/templates/constitution.md.hbs +43 -0
  40. package/flows/fire/agents/orchestrator/skills/project-init/templates/system-architecture.md.hbs +101 -0
  41. package/flows/fire/agents/orchestrator/skills/project-init/templates/tech-stack.md.hbs +136 -0
  42. package/flows/fire/agents/orchestrator/skills/project-init/templates/testing-standards.md.hbs +94 -0
  43. package/flows/fire/agents/orchestrator/skills/project-migrate/SKILL.md +234 -0
  44. package/flows/fire/agents/orchestrator/skills/route/SKILL.md +141 -0
  45. package/flows/fire/agents/orchestrator/skills/status/SKILL.md +100 -0
  46. package/flows/fire/agents/planner/agent.md +138 -0
  47. package/flows/fire/agents/planner/skills/design-doc-generate/SKILL.md +155 -0
  48. package/flows/fire/agents/planner/skills/design-doc-generate/templates/design.md.hbs +124 -0
  49. package/flows/fire/agents/planner/skills/intent-capture/SKILL.md +124 -0
  50. package/flows/fire/agents/planner/skills/intent-capture/templates/brief.md.hbs +40 -0
  51. package/flows/fire/agents/planner/skills/work-item-decompose/SKILL.md +165 -0
  52. package/flows/fire/agents/planner/skills/work-item-decompose/templates/work-item.md.hbs +40 -0
  53. package/flows/fire/commands/fire-builder.md +56 -0
  54. package/flows/fire/commands/fire-planner.md +48 -0
  55. package/flows/fire/commands/fire.md +46 -0
  56. package/flows/fire/memory-bank.yaml +223 -0
  57. package/flows/fire/quick-start.md +130 -0
  58. package/flows/simple/README.md +190 -0
  59. package/flows/simple/agents/agent.md +404 -0
  60. package/flows/simple/commands/agent.md +60 -0
  61. package/flows/simple/context-config.yaml +34 -0
  62. package/flows/simple/memory-bank.yaml +66 -0
  63. package/flows/simple/quick-start.md +231 -0
  64. package/flows/simple/skills/design.md +96 -0
  65. package/flows/simple/skills/execute.md +190 -0
  66. package/flows/simple/skills/requirements.md +94 -0
  67. package/flows/simple/skills/tasks.md +136 -0
  68. package/flows/simple/templates/design-template.md +138 -0
  69. package/flows/simple/templates/requirements-template.md +85 -0
  70. package/flows/simple/templates/tasks-template.md +104 -0
  71. package/lib/analytics/tracker.js +6 -2
  72. package/lib/constants.js +17 -8
  73. package/lib/installer.js +5 -15
  74. package/lib/installers/KiroInstaller.js +55 -0
  75. package/lib/installers/OpenCodeInstaller.js +9 -1
  76. package/lib/installers/ToolInstaller.js +4 -1
  77. package/lib/installers/WindsurfInstaller.js +0 -54
  78. package/package.json +3 -52
@@ -0,0 +1,101 @@
1
+ # System Architecture
2
+
3
+ ## Overview
4
+
5
+ {{overview}}
6
+
7
+ ## System Context
8
+
9
+ {{system_context}}
10
+
11
+ ### Context Diagram
12
+
13
+ ```
14
+ {{context_diagram}}
15
+ ```
16
+
17
+ ### Users
18
+
19
+ {{#each users}}
20
+ - **{{this.name}}**: {{this.description}}
21
+ {{/each}}
22
+
23
+ ### External Systems
24
+
25
+ {{#each external_systems}}
26
+ - **{{this.name}}**: {{this.purpose}}
27
+ {{/each}}
28
+
29
+ ## Architecture Pattern
30
+
31
+ **Pattern**: {{architecture_pattern}}
32
+ **Rationale**: {{architecture_rationale}}
33
+
34
+ ## Component Architecture
35
+
36
+ ### Components
37
+
38
+ {{#each components}}
39
+ #### {{this.name}}
40
+
41
+ - **Purpose**: {{this.purpose}}
42
+ - **Responsibilities**: {{this.responsibilities}}
43
+ - **Dependencies**: {{this.dependencies}}
44
+ {{/each}}
45
+
46
+ ### Component Diagram
47
+
48
+ ```
49
+ {{component_diagram}}
50
+ ```
51
+
52
+ ## Data Flow
53
+
54
+ {{data_flow_description}}
55
+
56
+ ```
57
+ {{data_flow_diagram}}
58
+ ```
59
+
60
+ ## Technology Stack
61
+
62
+ | Layer | Technology | Purpose |
63
+ |-------|------------|---------|
64
+ {{#each tech_stack}}
65
+ | {{this.layer}} | {{this.technology}} | {{this.purpose}} |
66
+ {{/each}}
67
+
68
+ ## Non-Functional Requirements
69
+
70
+ ### Performance
71
+
72
+ {{#each nfr_performance}}
73
+ - **{{this.metric}}**: {{this.target}}
74
+ {{/each}}
75
+
76
+ ### Security
77
+
78
+ {{#each nfr_security}}
79
+ - {{this}}
80
+ {{/each}}
81
+
82
+ ### Scalability
83
+
84
+ {{scalability_approach}}
85
+
86
+ ## Constraints
87
+
88
+ {{#each constraints}}
89
+ - {{this}}
90
+ {{/each}}
91
+
92
+ ## Key Decisions
93
+
94
+ | Decision | Choice | Rationale |
95
+ |----------|--------|-----------|
96
+ {{#each key_decisions}}
97
+ | {{this.decision}} | {{this.choice}} | {{this.rationale}} |
98
+ {{/each}}
99
+
100
+ ---
101
+ *Generated by specs.md - fabriqa.ai FIRE Flow*
@@ -0,0 +1,136 @@
1
+ # Tech Stack
2
+
3
+ ## Overview
4
+
5
+ {{overview}}
6
+
7
+ ## Core Technologies
8
+
9
+ ### Language
10
+
11
+ **Primary**: {{primary_language}}
12
+ **Version**: {{language_version}}
13
+
14
+ ### Framework
15
+
16
+ **Framework**: {{framework}}
17
+ **Version**: {{framework_version}}
18
+ **Rationale**: {{framework_rationale}}
19
+
20
+ ### Runtime
21
+
22
+ **Runtime**: {{runtime}}
23
+ **Version**: {{runtime_version}}
24
+
25
+ ## Data Layer
26
+
27
+ ### Database
28
+
29
+ **Type**: {{database_type}}
30
+ **Database**: {{database}}
31
+ **Version**: {{database_version}}
32
+
33
+ ### ORM / Data Access
34
+
35
+ **Tool**: {{orm}}
36
+ **Rationale**: {{orm_rationale}}
37
+
38
+ ### Caching
39
+
40
+ {{#if caching}}
41
+ **Solution**: {{caching}}
42
+ {{else}}
43
+ Not configured.
44
+ {{/if}}
45
+
46
+ ## API Layer
47
+
48
+ ### API Style
49
+
50
+ **Style**: {{api_style}}
51
+
52
+ ### Documentation
53
+
54
+ **Tool**: {{api_docs}}
55
+
56
+ ## Frontend (if applicable)
57
+
58
+ {{#if frontend}}
59
+ ### UI Framework
60
+
61
+ **Framework**: {{frontend.framework}}
62
+ **Version**: {{frontend.version}}
63
+
64
+ ### Styling
65
+
66
+ **Approach**: {{frontend.styling}}
67
+
68
+ ### State Management
69
+
70
+ **Solution**: {{frontend.state_management}}
71
+ {{else}}
72
+ Not applicable (backend-only or CLI project).
73
+ {{/if}}
74
+
75
+ ## Infrastructure
76
+
77
+ ### Hosting
78
+
79
+ **Platform**: {{hosting_platform}}
80
+
81
+ ### Containerization
82
+
83
+ {{#if containerization}}
84
+ **Tool**: {{containerization}}
85
+ {{else}}
86
+ Not configured.
87
+ {{/if}}
88
+
89
+ ### CI/CD
90
+
91
+ **Platform**: {{ci_platform}}
92
+
93
+ ## Development Tools
94
+
95
+ ### Package Manager
96
+
97
+ **Manager**: {{package_manager}}
98
+
99
+ ### Build Tool
100
+
101
+ **Tool**: {{build_tool}}
102
+
103
+ ### Linting
104
+
105
+ **Linter**: {{linter}}
106
+ **Config**: {{linter_config}}
107
+
108
+ ### Formatting
109
+
110
+ **Formatter**: {{formatter}}
111
+ **Config**: {{formatter_config}}
112
+
113
+ ## Dependencies
114
+
115
+ ### Production Dependencies
116
+
117
+ {{#each prod_dependencies}}
118
+ - `{{this.name}}` ({{this.version}}) — {{this.purpose}}
119
+ {{/each}}
120
+
121
+ ### Development Dependencies
122
+
123
+ {{#each dev_dependencies}}
124
+ - `{{this.name}}` ({{this.version}}) — {{this.purpose}}
125
+ {{/each}}
126
+
127
+ ## Version Requirements
128
+
129
+ | Tool | Minimum Version | Recommended |
130
+ |------|-----------------|-------------|
131
+ {{#each version_requirements}}
132
+ | {{this.tool}} | {{this.minimum}} | {{this.recommended}} |
133
+ {{/each}}
134
+
135
+ ---
136
+ *Generated by specs.md - fabriqa.ai FIRE Flow*
@@ -0,0 +1,94 @@
1
+ # Testing Standards
2
+
3
+ ## Overview
4
+
5
+ {{overview}}
6
+
7
+ ## Testing Framework
8
+
9
+ **Framework**: {{framework}}
10
+ **Runner**: {{runner}}
11
+
12
+ ## Test Types
13
+
14
+ | Type | Tool | Location | When to Use |
15
+ |------|------|----------|-------------|
16
+ {{#each test_types}}
17
+ | {{this.type}} | {{this.tool}} | `{{this.location}}` | {{this.when}} |
18
+ {{/each}}
19
+
20
+ ## Coverage Requirements
21
+
22
+ **Target**: {{coverage_target}}%
23
+ **Enforcement**: {{coverage_enforcement}}
24
+
25
+ **Critical paths that MUST have coverage:**
26
+ {{#each critical_paths}}
27
+ - {{this}}
28
+ {{/each}}
29
+
30
+ ## Test Naming
31
+
32
+ **Pattern**: `{{naming_pattern}}`
33
+
34
+ **Examples**:
35
+ {{#each naming_examples}}
36
+ - `{{this.name}}` — {{this.description}}
37
+ {{/each}}
38
+
39
+ ## Test Structure
40
+
41
+ ```{{language}}
42
+ {{test_structure}}
43
+ ```
44
+
45
+ ## Mock Strategy
46
+
47
+ **Approach**: {{mock_approach}}
48
+
49
+ **Guidelines**:
50
+ {{#each mock_guidelines}}
51
+ - {{this}}
52
+ {{/each}}
53
+
54
+ ## Test Data
55
+
56
+ **Strategy**: {{test_data_strategy}}
57
+
58
+ **Guidelines**:
59
+ {{#each test_data_guidelines}}
60
+ - {{this}}
61
+ {{/each}}
62
+
63
+ ## Running Tests
64
+
65
+ ```bash
66
+ # Run all tests
67
+ {{run_all_command}}
68
+
69
+ # Run with coverage
70
+ {{run_coverage_command}}
71
+
72
+ # Run specific test file
73
+ {{run_single_command}}
74
+
75
+ # Run in watch mode
76
+ {{run_watch_command}}
77
+ ```
78
+
79
+ ## CI/CD Integration
80
+
81
+ {{#if ci_enabled}}
82
+ **Pipeline**: {{ci_pipeline}}
83
+ **Trigger**: {{ci_trigger}}
84
+
85
+ **Required gates**:
86
+ {{#each ci_gates}}
87
+ - {{this}}
88
+ {{/each}}
89
+ {{else}}
90
+ CI/CD integration not configured.
91
+ {{/if}}
92
+
93
+ ---
94
+ *Generated by specs.md - fabriqa.ai FIRE Flow*
@@ -0,0 +1,234 @@
1
+ ---
2
+ name: project-migrate
3
+ description: Migrate existing FIRE project to latest version. Adds constitution.md, updates schema, and optionally detects monorepo modules.
4
+ version: 1.0.0
5
+ ---
6
+
7
+ <objective>
8
+ Upgrade an existing FIRE project to the latest version, adding new features
9
+ (constitution.md, hierarchical standards) while preserving all existing work.
10
+ </objective>
11
+
12
+ <triggers>
13
+ - User runs `/fire-migrate`
14
+ - Orchestrator detects outdated project version
15
+ </triggers>
16
+
17
+ <principles critical="true">
18
+ <principle>NEVER delete or modify existing intents/work-items/runs</principle>
19
+ <principle>Create backup before any changes</principle>
20
+ <principle>Migration is idempotent — safe to run multiple times</principle>
21
+ <principle>Show changes before applying</principle>
22
+ </principles>
23
+
24
+ <flow>
25
+ <step n="1" title="Detect Current Version">
26
+ <action>Check if .specs-fire/ exists</action>
27
+ <check if="no .specs-fire/">
28
+ <output>Not a FIRE project. Use /fire to initialize.</output>
29
+ <exit/>
30
+ </check>
31
+
32
+ <action>Read .specs-fire/state.yaml</action>
33
+ <action>Check project.fire_version field</action>
34
+ <action>Read FIRE flow version from memory-bank.yaml</action>
35
+
36
+ <version_detection>
37
+ | Check | Meaning |
38
+ |-------|---------|
39
+ | project.fire_version missing | Pre-0.1.8 project |
40
+ | project.fire_version < current | Needs migration |
41
+ | project.fire_version == current | Up to date |
42
+
43
+ Also check for feature indicators:
44
+ | Missing Feature | Added In |
45
+ |-----------------|----------|
46
+ | constitution.md | 0.1.8 |
47
+ | workspace.structure | 0.1.8 |
48
+ </version_detection>
49
+
50
+ <check if="already up to date">
51
+ <output>Project is already at the latest version ({current_version}). No migration needed.</output>
52
+ <exit/>
53
+ </check>
54
+
55
+ <output>
56
+ Current version: {project_fire_version or "pre-0.1.8"}
57
+ Latest version: {fire_flow_version}
58
+ Migration required.
59
+ </output>
60
+ </step>
61
+
62
+ <step n="2" title="Analyze Migration Scope">
63
+ <action>Determine what needs to be migrated:</action>
64
+
65
+ <check_constitution>
66
+ Does .specs-fire/standards/constitution.md exist?
67
+ If no → needs_constitution = true
68
+ </check_constitution>
69
+
70
+ <check_schema>
71
+ Does state.yaml have workspace.structure field?
72
+ If no → needs_schema_update = true
73
+ </check_schema>
74
+
75
+ <check_monorepo>
76
+ Is this actually a monorepo? Check for:
77
+ - nx.json, turbo.json, pnpm-workspace.yaml, lerna.json
78
+ - package.json with "workspaces"
79
+ - Multiple package/dependency manifests
80
+ If detected → is_monorepo = true
81
+ </check_monorepo>
82
+
83
+ <output>
84
+ Migration Plan:
85
+ ┌─────────────────────────────────────────────────────┐
86
+ │ Changes to be made: │
87
+ {{#if needs_constitution}}
88
+ │ ✓ Create constitution.md (universal policies) │
89
+ {{/if}}
90
+ {{#if needs_schema_update}}
91
+ │ ✓ Update state.yaml schema │
92
+ {{/if}}
93
+ {{#if is_monorepo}}
94
+ │ ? Monorepo detected — offer module standards │
95
+ {{/if}}
96
+ │ │
97
+ │ Will NOT change: │
98
+ │ • Existing intents and work items │
99
+ │ • Existing runs and logs │
100
+ │ • Existing standards (only add new ones) │
101
+ └─────────────────────────────────────────────────────┘
102
+ </output>
103
+ </step>
104
+
105
+ <step n="3" title="Create Backup">
106
+ <action>Create backup: cp -r .specs-fire .specs-fire-backup-{timestamp}</action>
107
+ <output>Backup created: .specs-fire-backup-{timestamp}</output>
108
+ </step>
109
+
110
+ <step n="4" title="Confirm Migration">
111
+ <ask>
112
+ Ready to migrate. Backup saved.
113
+
114
+ Proceed with migration? [Y/n]
115
+ </ask>
116
+ </step>
117
+
118
+ <step n="5" title="Add Constitution" if="needs_constitution">
119
+ <ask>
120
+ How should I create constitution.md?
121
+
122
+ [a] Auto-generate — analyze project (git, CI, existing patterns)
123
+ [d] Default — use standard template
124
+ [c] Custom — I'll provide the content
125
+ </ask>
126
+
127
+ <check if="response == a">
128
+ <action>Analyze project for constitution content:</action>
129
+ <substep>Check .gitignore, CI config for workflow hints</substep>
130
+ <substep>Check existing PR templates, CONTRIBUTING.md</substep>
131
+ <substep>Infer commit style from git log</substep>
132
+ <action>Generate constitution.md from findings</action>
133
+ </check>
134
+
135
+ <check if="response == d">
136
+ <action>Create constitution.md from default template</action>
137
+ </check>
138
+
139
+ <check if="response == c">
140
+ <ask>Please describe your key policies (git workflow, PR process, security).</ask>
141
+ <action>Generate constitution.md from input</action>
142
+ </check>
143
+
144
+ <action>Write to .specs-fire/standards/constitution.md</action>
145
+ <output>Created: .specs-fire/standards/constitution.md</output>
146
+ </step>
147
+
148
+ <step n="6" title="Update State Schema" if="needs_schema_update">
149
+ <action>Read current state.yaml</action>
150
+ <action>Add missing fields with defaults:</action>
151
+ <substep>project.fire_version: "{current_fire_flow_version}"</substep>
152
+ <substep>workspace.structure: "monolith" (or "monorepo" if detected)</substep>
153
+ <action>Write updated state.yaml (preserve all existing data)</action>
154
+ <output>Updated: .specs-fire/state.yaml</output>
155
+ </step>
156
+
157
+ <step n="7" title="Monorepo Module Setup" if="is_monorepo" optional="true">
158
+ <action>Discover modules (same as project-init):</action>
159
+ <substep>Check workspace config for project list</substep>
160
+ <substep>Scan packages/*, apps/*, services/*, libs/*</substep>
161
+ <substep>Analyze each module's tech stack</substep>
162
+
163
+ <ask>
164
+ This appears to be a monorepo. Found {{module_count}} modules:
165
+
166
+ {{#each modules}}
167
+ • {{path}} ({{language}})
168
+ {{/each}}
169
+
170
+ Create module-specific standards?
171
+ [y] Yes — create for all modules
172
+ [s] Select — choose which modules
173
+ [n] No — skip for now
174
+ </ask>
175
+
176
+ <check if="response == y or response == s">
177
+ <action>For each selected module:</action>
178
+ <substep>Create {module}/.specs-fire/standards/</substep>
179
+ <substep>Generate tech-stack.md with detected settings</substep>
180
+ </check>
181
+ </step>
182
+
183
+ <step n="8" title="Verify Migration">
184
+ <action>Verify migration completed:</action>
185
+ <substep>Read state.yaml — valid YAML?</substep>
186
+ <substep>Check new files exist</substep>
187
+ <substep>Ensure no existing files corrupted</substep>
188
+
189
+ <check if="verification fails">
190
+ <output>Migration failed. Restoring from backup...</output>
191
+ <action>rm -rf .specs-fire && mv .specs-fire-backup-{timestamp} .specs-fire</action>
192
+ <output>Restored. Please report this issue.</output>
193
+ <exit status="error"/>
194
+ </check>
195
+ </step>
196
+
197
+ <step n="9" title="Report">
198
+ <output>
199
+ Migration complete!
200
+
201
+ Changes made:
202
+ {{#each changes_made}}
203
+ ✓ {{description}}
204
+ {{/each}}
205
+
206
+ Backup preserved at: .specs-fire-backup-{timestamp}
207
+ (Delete once you've verified everything works)
208
+
209
+ New features available:
210
+ • Constitution: Universal policies in constitution.md
211
+ {{#if is_monorepo}}
212
+ • Monorepo: Module-specific standards supported
213
+ {{/if}}
214
+ </output>
215
+ </step>
216
+ </flow>
217
+
218
+ <safety_guarantees>
219
+ <guarantee>Backup created before any changes</guarantee>
220
+ <guarantee>Idempotent — running twice is safe</guarantee>
221
+ <guarantee>Verify after — validates migration succeeded</guarantee>
222
+ <guarantee>Restore on failure — automatic rollback</guarantee>
223
+ <guarantee>Never deletes — only adds, never removes</guarantee>
224
+ </safety_guarantees>
225
+
226
+ <success_criteria>
227
+ <criterion>Current version detected correctly</criterion>
228
+ <criterion>Backup created before changes</criterion>
229
+ <criterion>constitution.md added if missing</criterion>
230
+ <criterion>state.yaml schema updated if needed</criterion>
231
+ <criterion>Monorepo modules detected and offered (if applicable)</criterion>
232
+ <criterion>Migration verified successfully</criterion>
233
+ <criterion>No existing data lost or corrupted</criterion>
234
+ </success_criteria>
@@ -0,0 +1,141 @@
1
+ ---
2
+ name: route
3
+ description: Analyze project state and route user to the appropriate agent based on current context.
4
+ version: 1.0.0
5
+ ---
6
+
7
+ <objective>
8
+ Analyze project state and route user to the appropriate agent.
9
+ </objective>
10
+
11
+ <triggers>
12
+ - User runs `/fire` on initialized project
13
+ - After any agent completes its task
14
+ </triggers>
15
+
16
+ <llm critical="true">
17
+ <mandate>ALWAYS scan file system for intents/work-items not in state.yaml</mandate>
18
+ <mandate>FILE SYSTEM is source of truth — state.yaml may be incomplete</mandate>
19
+ <mandate>Route based on VERIFIED state, not assumptions</mandate>
20
+ </llm>
21
+
22
+ <flow>
23
+ <step n="1" title="Discover and Read State">
24
+ <action>Read .specs-fire/state.yaml</action>
25
+
26
+ <file_system_scan critical="true">
27
+ Use these EXACT glob patterns:
28
+
29
+ <pattern purpose="Find intent briefs">
30
+ .specs-fire/intents/*/brief.md
31
+ </pattern>
32
+
33
+ <pattern purpose="Find work items">
34
+ .specs-fire/intents/*/work-items/*.md
35
+ </pattern>
36
+
37
+ Work items are {work-item-id}.md files directly in work-items/ folder.
38
+ </file_system_scan>
39
+
40
+ <action>Reconcile: add discovered items to state as pending</action>
41
+ <action>Parse current project state</action>
42
+ </step>
43
+
44
+ <step n="2" title="Check Active Run">
45
+ <check if="active_run exists and status == in_progress">
46
+ <output>
47
+ Resuming active run: {active_run.id}
48
+ Scope: {active_run.scope}
49
+ Current item: {active_run.current_item}
50
+ Progress: {completed_count}/{total_count} items
51
+ </output>
52
+ <route_to>builder-agent (run-execute)</route_to>
53
+ <stop/>
54
+ </check>
55
+ </step>
56
+
57
+ <step n="3" title="Check Pending Work Items">
58
+ <action>Find work items with status == pending across all intents</action>
59
+ <check if="pending work items exist">
60
+ <output>
61
+ **{pending_count} pending work items** found across {intent_count} intent(s).
62
+
63
+ Plan run scope and start execution? [Y/n]
64
+ </output>
65
+ <check if="response == y">
66
+ <route_to>builder-agent (run-plan)</route_to>
67
+ </check>
68
+ <stop/>
69
+ </check>
70
+ </step>
71
+
72
+ <step n="4" title="Check Active Intent">
73
+ <action>Find intents with status == in_progress</action>
74
+ <check if="active intent has no work items">
75
+ <output>
76
+ Intent "{intent.title}" needs decomposition.
77
+ Routing to Planner to create work items.
78
+ </output>
79
+ <route_to>planner-agent (work-item-decompose)</route_to>
80
+ <stop/>
81
+ </check>
82
+ <check if="all work items completed">
83
+ <action>Mark intent as completed</action>
84
+ <output>
85
+ Intent "{intent.title}" completed!
86
+
87
+ Work items delivered:
88
+ {list completed work items}
89
+
90
+ Ready for next intent? [Y/n]
91
+ </output>
92
+ </check>
93
+ </step>
94
+
95
+ <step n="5" title="No Active Work">
96
+ <output>
97
+ No active work. Ready for a new intent.
98
+
99
+ What do you want to build?
100
+ </output>
101
+ <route_to>planner-agent (intent-capture)</route_to>
102
+ </step>
103
+ </flow>
104
+
105
+ <routing_decision_tree>
106
+ ```
107
+ state.yaml + file system scan
108
+
109
+ ├── active_run? ──────────────> Builder (run-execute, resume)
110
+
111
+ ├── pending work items? ──────> Builder (run-plan, then execute)
112
+
113
+ ├── intent without work items? > Planner (work-item-decompose)
114
+
115
+ └── no active intents ────────> Planner (intent-capture)
116
+ ```
117
+ </routing_decision_tree>
118
+
119
+ <context_passed_to_agents>
120
+ **To Planner:**
121
+ ```yaml
122
+ context:
123
+ action: intent-capture | work-item-decompose
124
+ intent_id: {if decomposing}
125
+ ```
126
+
127
+ **To Builder:**
128
+ ```yaml
129
+ context:
130
+ action: run-plan | run-execute | resume
131
+ pending_items: [{list of pending work items}] # for run-plan
132
+ run_id: {if resuming}
133
+ ```
134
+ </context_passed_to_agents>
135
+
136
+ <success_criteria>
137
+ <criterion>File system scanned for untracked intents/work-items</criterion>
138
+ <criterion>State reconciled with file system</criterion>
139
+ <criterion>Correct agent selected based on state</criterion>
140
+ <criterion>Context passed to target agent</criterion>
141
+ </success_criteria>