project-iris 0.0.11 → 0.0.12
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.
- package/dist/cli.js +4 -2
- package/dist/commands/create.js +25 -0
- package/dist/iris_bundle/frameworks/iris-core/framework.yaml +9 -0
- package/dist/iris_bundle/frameworks/iris-core/memory/memory-bank.yaml +1 -0
- package/dist/iris_bundle/frameworks/iris-core/policy.yaml +7 -0
- package/dist/iris_bundle/frameworks/iris-core/templates/config/memory-bank.yaml +1 -0
- package/dist/iris_bundle/frameworks/iris-core/templates/construction/bolt-template.md +226 -0
- package/dist/iris_bundle/frameworks/iris-core/templates/construction/bolt-types/ddd-construction-bolt/adr-template.md +49 -0
- package/dist/iris_bundle/frameworks/iris-core/templates/construction/bolt-types/ddd-construction-bolt/ddd-01-domain-model-template.md +55 -0
- package/dist/iris_bundle/frameworks/iris-core/templates/construction/bolt-types/ddd-construction-bolt/ddd-02-technical-design-template.md +67 -0
- package/dist/iris_bundle/frameworks/iris-core/templates/construction/bolt-types/ddd-construction-bolt/ddd-03-test-report-template.md +62 -0
- package/dist/iris_bundle/frameworks/iris-core/templates/construction/bolt-types/ddd-construction-bolt.md +528 -0
- package/dist/iris_bundle/frameworks/iris-core/templates/construction/bolt-types/simple-construction-bolt.md +347 -0
- package/dist/iris_bundle/frameworks/iris-core/templates/construction/bolt-types/spike-bolt.md +240 -0
- package/dist/iris_bundle/frameworks/iris-core/templates/inception/requirements-template.md +144 -0
- package/dist/iris_bundle/frameworks/iris-core/templates/inception/stories-template.md +38 -0
- package/dist/iris_bundle/frameworks/iris-core/templates/inception/story-template.md +147 -0
- package/dist/iris_bundle/frameworks/iris-core/templates/inception/system-context-template.md +29 -0
- package/dist/iris_bundle/frameworks/iris-core/templates/inception/unit-brief-template.md +177 -0
- package/dist/iris_bundle/frameworks/iris-core/templates/inception/units-template.md +52 -0
- package/dist/templates/construction/bolt-template.md +226 -0
- package/dist/templates/construction/bolt-types/ddd-construction-bolt/adr-template.md +49 -0
- package/dist/templates/construction/bolt-types/ddd-construction-bolt/ddd-01-domain-model-template.md +55 -0
- package/dist/templates/construction/bolt-types/ddd-construction-bolt/ddd-02-technical-design-template.md +67 -0
- package/dist/templates/construction/bolt-types/ddd-construction-bolt/ddd-03-test-report-template.md +62 -0
- package/dist/templates/construction/bolt-types/ddd-construction-bolt.md +528 -0
- package/dist/templates/construction/bolt-types/simple-construction-bolt.md +347 -0
- package/dist/templates/construction/bolt-types/spike-bolt.md +240 -0
- package/dist/templates/inception/requirements-template.md +144 -0
- package/dist/templates/inception/stories-template.md +38 -0
- package/dist/templates/inception/story-template.md +147 -0
- package/dist/templates/inception/system-context-template.md +29 -0
- package/dist/templates/inception/unit-brief-template.md +177 -0
- package/dist/templates/inception/units-template.md +52 -0
- package/dist/workflows/bolt-plan.js +57 -28
- package/dist/workflows/intent-inception.js +82 -7
- package/dist/workflows/memory-bank-generator.js +180 -0
- package/package.json +3 -2
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
intent: {NNN}-{intent-name}
|
|
3
|
+
phase: inception
|
|
4
|
+
status: stories-created
|
|
5
|
+
updated: {YYYY-MM-DDTHH:MM:SSZ}
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# {Intent Name} - Stories
|
|
9
|
+
|
|
10
|
+
## User Stories
|
|
11
|
+
|
|
12
|
+
### Story-1: {Title}
|
|
13
|
+
|
|
14
|
+
**As a** {user type}
|
|
15
|
+
**I want** {goal}
|
|
16
|
+
**So that** {benefit}
|
|
17
|
+
|
|
18
|
+
**Acceptance Criteria**:
|
|
19
|
+
|
|
20
|
+
- [ ] {Criterion 1}
|
|
21
|
+
- [ ] {Criterion 2}
|
|
22
|
+
|
|
23
|
+
**Priority**: High/Medium/Low
|
|
24
|
+
**Estimate**: {T-shirt size: S/M/L/XL}
|
|
25
|
+
|
|
26
|
+
### Story-2: {Title}
|
|
27
|
+
|
|
28
|
+
...
|
|
29
|
+
|
|
30
|
+
## Technical Stories
|
|
31
|
+
|
|
32
|
+
### Tech-Story-1: {Title}
|
|
33
|
+
|
|
34
|
+
**Description**: {What needs to be done technically}
|
|
35
|
+
**Rationale**: {Why this is needed}
|
|
36
|
+
**Acceptance Criteria**:
|
|
37
|
+
|
|
38
|
+
- [ ] {Criterion}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# Story Template
|
|
2
|
+
|
|
3
|
+
Use this template when creating individual story files during story creation.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Frontmatter
|
|
8
|
+
|
|
9
|
+
```yaml
|
|
10
|
+
---
|
|
11
|
+
id: {SSS}-{title-slug}
|
|
12
|
+
unit: {UUU}-{unit-name}
|
|
13
|
+
intent: {NNN}-{intent-name}
|
|
14
|
+
status: draft
|
|
15
|
+
priority: must|should|could
|
|
16
|
+
created: {YYYY-MM-DDTHH:MM:SSZ}
|
|
17
|
+
assigned_bolt: null
|
|
18
|
+
implemented: false
|
|
19
|
+
---
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Content
|
|
25
|
+
|
|
26
|
+
```markdown
|
|
27
|
+
# Story: {SSS}-{title-slug}
|
|
28
|
+
|
|
29
|
+
## User Story
|
|
30
|
+
|
|
31
|
+
**As a** {user role}
|
|
32
|
+
**I want** {goal/action}
|
|
33
|
+
**So that** {benefit/reason}
|
|
34
|
+
|
|
35
|
+
## Acceptance Criteria
|
|
36
|
+
|
|
37
|
+
- [ ] **Given** {precondition}, **When** {action}, **Then** {expected outcome}
|
|
38
|
+
- [ ] **Given** {precondition}, **When** {action}, **Then** {expected outcome}
|
|
39
|
+
- [ ] **Given** {precondition}, **When** {action}, **Then** {expected outcome}
|
|
40
|
+
|
|
41
|
+
## Technical Notes
|
|
42
|
+
|
|
43
|
+
{Implementation hints, constraints, or considerations}
|
|
44
|
+
|
|
45
|
+
## Dependencies
|
|
46
|
+
|
|
47
|
+
### Requires
|
|
48
|
+
- {Other stories this depends on, or "None"}
|
|
49
|
+
|
|
50
|
+
### Enables
|
|
51
|
+
- {Stories that depend on this, or "None"}
|
|
52
|
+
|
|
53
|
+
## Edge Cases
|
|
54
|
+
|
|
55
|
+
| Scenario | Expected Behavior |
|
|
56
|
+
|----------|-------------------|
|
|
57
|
+
| {edge case 1} | {behavior} |
|
|
58
|
+
| {edge case 2} | {behavior} |
|
|
59
|
+
|
|
60
|
+
## Out of Scope
|
|
61
|
+
|
|
62
|
+
- {What this story does NOT cover}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Priority Levels
|
|
68
|
+
|
|
69
|
+
| Priority | Meaning | Criteria |
|
|
70
|
+
|----------|---------|----------|
|
|
71
|
+
| `must` | Required for MVP | System unusable without this |
|
|
72
|
+
| `should` | Important | Significant value, not blocking |
|
|
73
|
+
| `could` | Nice to have | Enhances experience |
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Status Values
|
|
78
|
+
|
|
79
|
+
| Status | Meaning |
|
|
80
|
+
|--------|---------|
|
|
81
|
+
| `draft` | Story written, needs review |
|
|
82
|
+
| `ready` | Reviewed, ready for bolt |
|
|
83
|
+
| `in-progress` | Being implemented in a bolt |
|
|
84
|
+
| `implemented` | Code complete |
|
|
85
|
+
| `tested` | Tests passing |
|
|
86
|
+
| `done` | All acceptance criteria met |
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Example
|
|
91
|
+
|
|
92
|
+
```yaml
|
|
93
|
+
---
|
|
94
|
+
id: 001-user-signup
|
|
95
|
+
unit: 001-auth-service
|
|
96
|
+
intent: 001-user-authentication
|
|
97
|
+
status: ready
|
|
98
|
+
priority: must
|
|
99
|
+
created: 2024-12-05T10:00:00Z
|
|
100
|
+
assigned_bolt: 001-auth-service
|
|
101
|
+
implemented: false
|
|
102
|
+
---
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
```markdown
|
|
106
|
+
# Story: 001-user-signup
|
|
107
|
+
|
|
108
|
+
## User Story
|
|
109
|
+
|
|
110
|
+
**As a** new user
|
|
111
|
+
**I want** to register with my email and password
|
|
112
|
+
**So that** I can access the application
|
|
113
|
+
|
|
114
|
+
## Acceptance Criteria
|
|
115
|
+
|
|
116
|
+
- [ ] **Given** I am on the registration page, **When** I enter valid email and password, **Then** my account is created and I receive a confirmation email
|
|
117
|
+
- [ ] **Given** I enter an email that already exists, **When** I submit registration, **Then** I see an error message "Email already registered"
|
|
118
|
+
- [ ] **Given** I enter a password less than 8 characters, **When** I submit, **Then** I see validation error
|
|
119
|
+
|
|
120
|
+
## Technical Notes
|
|
121
|
+
|
|
122
|
+
- Password must be hashed with bcrypt (cost factor 12)
|
|
123
|
+
- Email validation should use RFC 5322 compliant regex
|
|
124
|
+
- Rate limit registration to 5 attempts per IP per hour
|
|
125
|
+
|
|
126
|
+
## Dependencies
|
|
127
|
+
|
|
128
|
+
### Requires
|
|
129
|
+
- None (first story)
|
|
130
|
+
|
|
131
|
+
### Enables
|
|
132
|
+
- 002-user-login (User login)
|
|
133
|
+
- 003-email-verification (Email verification)
|
|
134
|
+
|
|
135
|
+
## Edge Cases
|
|
136
|
+
|
|
137
|
+
| Scenario | Expected Behavior |
|
|
138
|
+
|----------|-------------------|
|
|
139
|
+
| SQL injection in email | Safely escaped, validation fails |
|
|
140
|
+
| Very long email (255+ chars) | Validation error |
|
|
141
|
+
| Unicode in password | Allowed, properly encoded |
|
|
142
|
+
|
|
143
|
+
## Out of Scope
|
|
144
|
+
|
|
145
|
+
- Social login (OAuth) - separate story
|
|
146
|
+
- Password reset - separate story
|
|
147
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
intent: {NNN}-{intent-name}
|
|
3
|
+
phase: inception
|
|
4
|
+
status: context-defined
|
|
5
|
+
updated: {YYYY-MM-DDTHH:MM:SSZ}
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# {Intent Name} - System Context
|
|
9
|
+
|
|
10
|
+
## System Overview
|
|
11
|
+
|
|
12
|
+
{High-level description of what we are building}
|
|
13
|
+
|
|
14
|
+
## Context Diagram
|
|
15
|
+
|
|
16
|
+
{Mermaid diagram showing System, Users, and External Systems}
|
|
17
|
+
|
|
18
|
+
## External Integrations
|
|
19
|
+
|
|
20
|
+
- **System A**: {Purpose of integration}
|
|
21
|
+
- **System B**: {Purpose of integration}
|
|
22
|
+
|
|
23
|
+
## High-Level Constraints
|
|
24
|
+
|
|
25
|
+
- {e.g., Must run on AWS, Must use existing Auth provider}
|
|
26
|
+
|
|
27
|
+
## Key NFR Goals
|
|
28
|
+
|
|
29
|
+
- {High-level performance/security goals to guide construction}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# Unit Brief Template
|
|
2
|
+
|
|
3
|
+
Use this template when creating unit briefs during decomposition. This is the **critical input for Construction**.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Frontmatter
|
|
8
|
+
|
|
9
|
+
```yaml
|
|
10
|
+
---
|
|
11
|
+
unit: {UUU}-{unit-name}
|
|
12
|
+
intent: {NNN}-{intent-name}
|
|
13
|
+
phase: inception
|
|
14
|
+
status: draft|ready
|
|
15
|
+
created: {YYYY-MM-DDTHH:MM:SSZ}
|
|
16
|
+
updated: {YYYY-MM-DDTHH:MM:SSZ}
|
|
17
|
+
---
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
**Note**: The `unit` field uses the full folder name including the 3-digit prefix (e.g., `001-auth-service`). This matches the folder structure and enables direct path construction in scripts. Story naming uses the story title (e.g., `001-user-signup.md`).
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Content
|
|
25
|
+
|
|
26
|
+
```markdown
|
|
27
|
+
# Unit Brief: {Unit Name}
|
|
28
|
+
|
|
29
|
+
## Purpose
|
|
30
|
+
|
|
31
|
+
{Clear, concise statement of what this unit does and why it exists}
|
|
32
|
+
|
|
33
|
+
## Scope
|
|
34
|
+
|
|
35
|
+
### In Scope
|
|
36
|
+
- {What this unit IS responsible for}
|
|
37
|
+
- {What this unit IS responsible for}
|
|
38
|
+
|
|
39
|
+
### Out of Scope
|
|
40
|
+
- {What this unit is NOT responsible for}
|
|
41
|
+
- {What other units handle}
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Assigned Requirements
|
|
46
|
+
|
|
47
|
+
**These FRs from the intent are assigned to this unit. Stories will be created from these.**
|
|
48
|
+
|
|
49
|
+
| FR | Requirement | Priority |
|
|
50
|
+
|----|-------------|----------|
|
|
51
|
+
| FR-{n} | {description from intent requirements.md} | Must/Should/Could |
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Domain Concepts
|
|
56
|
+
|
|
57
|
+
### Key Entities
|
|
58
|
+
| Entity | Description | Attributes |
|
|
59
|
+
|--------|-------------|------------|
|
|
60
|
+
| {Entity 1} | {What it represents} | {Key properties} |
|
|
61
|
+
| {Entity 2} | {What it represents} | {Key properties} |
|
|
62
|
+
|
|
63
|
+
### Key Operations
|
|
64
|
+
| Operation | Description | Inputs | Outputs |
|
|
65
|
+
|-----------|-------------|--------|---------|
|
|
66
|
+
| {Operation 1} | {What it does} | {Input data} | {Output data} |
|
|
67
|
+
| {Operation 2} | {What it does} | {Input data} | {Output data} |
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Story Summary
|
|
72
|
+
|
|
73
|
+
| Metric | Count |
|
|
74
|
+
|--------|-------|
|
|
75
|
+
| Total Stories | {n} |
|
|
76
|
+
| Must Have | {n} |
|
|
77
|
+
| Should Have | {n} |
|
|
78
|
+
| Could Have | {n} |
|
|
79
|
+
|
|
80
|
+
### Stories
|
|
81
|
+
|
|
82
|
+
| Story ID | Title | Priority | Status |
|
|
83
|
+
|----------|-------|----------|--------|
|
|
84
|
+
| {story-1} | {Title} | Must | Planned |
|
|
85
|
+
| {story-2} | {Title} | Should | Planned |
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Dependencies
|
|
90
|
+
|
|
91
|
+
### Depends On
|
|
92
|
+
| Unit | Reason |
|
|
93
|
+
|------|--------|
|
|
94
|
+
| {unit-name} | {Why this dependency exists} |
|
|
95
|
+
|
|
96
|
+
### Depended By
|
|
97
|
+
| Unit | Reason |
|
|
98
|
+
|------|--------|
|
|
99
|
+
| {unit-name} | {Why they depend on this} |
|
|
100
|
+
|
|
101
|
+
### External Dependencies
|
|
102
|
+
| System | Purpose | Risk |
|
|
103
|
+
|--------|---------|------|
|
|
104
|
+
| {External system} | {Why needed} | {Risk level} |
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Technical Context
|
|
109
|
+
|
|
110
|
+
### Suggested Technology
|
|
111
|
+
{Recommendations based on tech stack standards}
|
|
112
|
+
|
|
113
|
+
### Integration Points
|
|
114
|
+
| Integration | Type | Protocol |
|
|
115
|
+
|-------------|------|----------|
|
|
116
|
+
| {System/Unit} | API/Event/DB | REST/GraphQL/Kafka |
|
|
117
|
+
|
|
118
|
+
### Data Storage
|
|
119
|
+
| Data | Type | Volume | Retention |
|
|
120
|
+
|------|------|--------|-----------|
|
|
121
|
+
| {Data type} | SQL/NoSQL/Cache | {Volume} | {Retention} |
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Constraints
|
|
126
|
+
|
|
127
|
+
- {Technical constraint specific to this unit}
|
|
128
|
+
- {Business constraint specific to this unit}
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Success Criteria
|
|
133
|
+
|
|
134
|
+
### Functional
|
|
135
|
+
- [ ] {Criterion 1: What must work}
|
|
136
|
+
- [ ] {Criterion 2: What must work}
|
|
137
|
+
|
|
138
|
+
### Non-Functional
|
|
139
|
+
- [ ] {Performance target}
|
|
140
|
+
- [ ] {Security requirement}
|
|
141
|
+
|
|
142
|
+
### Quality
|
|
143
|
+
- [ ] Code coverage > 80%
|
|
144
|
+
- [ ] All acceptance criteria met
|
|
145
|
+
- [ ] Code reviewed and approved
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## Bolt Suggestions
|
|
150
|
+
|
|
151
|
+
Based on stories and complexity:
|
|
152
|
+
|
|
153
|
+
| Bolt | Type | Stories | Objective |
|
|
154
|
+
|------|------|---------|-----------|
|
|
155
|
+
| bolt-{unit}-1 | DDD | S1, S2 | Core entities |
|
|
156
|
+
| bolt-{unit}-2 | DDD | S3, S4 | API layer |
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Notes
|
|
161
|
+
|
|
162
|
+
{Any additional context, risks, or considerations for Construction}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## Quality Checklist
|
|
168
|
+
|
|
169
|
+
Before marking unit brief as ready:
|
|
170
|
+
|
|
171
|
+
- [ ] Purpose is clear and specific
|
|
172
|
+
- [ ] Scope boundaries are defined
|
|
173
|
+
- [ ] Key entities identified
|
|
174
|
+
- [ ] Stories assigned to this unit
|
|
175
|
+
- [ ] Dependencies mapped
|
|
176
|
+
- [ ] Success criteria are measurable
|
|
177
|
+
- [ ] Bolt suggestions provided
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
intent: {NNN}-{intent-name}
|
|
3
|
+
phase: inception
|
|
4
|
+
status: units-decomposed
|
|
5
|
+
updated: {YYYY-MM-DDTHH:MM:SSZ}
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# {Intent Name} - Unit Decomposition
|
|
9
|
+
|
|
10
|
+
## Units Overview
|
|
11
|
+
|
|
12
|
+
This intent decomposes into {N} units of work:
|
|
13
|
+
|
|
14
|
+
### Unit 1: {unit-name}
|
|
15
|
+
|
|
16
|
+
**Description**: {What this unit does}
|
|
17
|
+
|
|
18
|
+
**Stories**:
|
|
19
|
+
|
|
20
|
+
- Story-1: {Title}
|
|
21
|
+
- Story-3: {Title}
|
|
22
|
+
|
|
23
|
+
**Deliverables**:
|
|
24
|
+
|
|
25
|
+
- {Specific artifacts this unit produces}
|
|
26
|
+
|
|
27
|
+
**Dependencies**:
|
|
28
|
+
|
|
29
|
+
- Depends on: {Other units}
|
|
30
|
+
- Depended by: {Units that need this}
|
|
31
|
+
|
|
32
|
+
**Estimated Complexity**: S/M/L/XL
|
|
33
|
+
|
|
34
|
+
### Unit 2: {unit-name}
|
|
35
|
+
|
|
36
|
+
...
|
|
37
|
+
|
|
38
|
+
## Unit Dependency Graph
|
|
39
|
+
|
|
40
|
+
```text
|
|
41
|
+
[Unit A] ──> [Unit B] ──> [Unit D]
|
|
42
|
+
│ │
|
|
43
|
+
└────> [Unit C] ──┘
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Execution Order
|
|
47
|
+
|
|
48
|
+
Based on dependencies:
|
|
49
|
+
|
|
50
|
+
1. Day 1-2: Unit A (foundation)
|
|
51
|
+
2. Day 2-4: Unit B, Unit C (parallel)
|
|
52
|
+
3. Day 5-6: Unit D (integration)
|
|
@@ -5,6 +5,9 @@ import fs from "fs";
|
|
|
5
5
|
import path from "path";
|
|
6
6
|
import { WorkflowStage } from "../bridge/types.js";
|
|
7
7
|
import { appendEvent, saveRun } from "../iris/run-state.js";
|
|
8
|
+
import { fileURLToPath } from "url";
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = path.dirname(__filename);
|
|
8
11
|
/**
|
|
9
12
|
* Execute Bolt Plan stage
|
|
10
13
|
* Steps:
|
|
@@ -18,44 +21,69 @@ export async function executeBoltPlan(runState, connector, options) {
|
|
|
18
21
|
// Step 1: Generate bolt plan
|
|
19
22
|
console.log(kleur.cyan("→ Generating bolt plan..."));
|
|
20
23
|
const planTaskId = randomUUID();
|
|
24
|
+
// Load template
|
|
25
|
+
const templateDir = path.join(__dirname, "../templates/construction");
|
|
26
|
+
let boltTemplate = "";
|
|
27
|
+
try {
|
|
28
|
+
if (fs.existsSync(path.join(templateDir, "bolt-template.md"))) {
|
|
29
|
+
boltTemplate = fs.readFileSync(path.join(templateDir, "bolt-template.md"), "utf-8");
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
catch (e) {
|
|
33
|
+
console.error("Failed to load bolt template:", e);
|
|
34
|
+
}
|
|
21
35
|
const planPacket = {
|
|
22
36
|
taskId: planTaskId,
|
|
23
37
|
intent: runState.intent,
|
|
24
38
|
stage: WorkflowStage.BOLT_PLAN,
|
|
25
39
|
agent: "iris-master-agent",
|
|
26
40
|
instructions: `Based on the intent artifacts, create a bolt plan and individual bolt files.
|
|
41
|
+
|
|
42
|
+
You must create a DETAILED implementation plan.
|
|
27
43
|
|
|
28
44
|
Intent: ${runState.intent}
|
|
29
45
|
|
|
30
46
|
Review the intent artifacts in memory-bank/intents/ to understand requirements.
|
|
31
47
|
|
|
32
48
|
Create:
|
|
33
|
-
1. memory-bank/
|
|
34
|
-
2. memory-bank/
|
|
35
|
-
|
|
36
|
-
Each bolt should be a focused, testable unit of work (e.g., "setup-database", "create-api-endpoint", "build-ui-component").
|
|
37
|
-
|
|
38
|
-
Bolt file format:
|
|
39
|
-
# Bolt: <Name>
|
|
49
|
+
1. memory-bank/bolts/plan.md - Overall implementation plan listing all bolts
|
|
50
|
+
2. memory-bank/bolts/<bolt-id>/bolt.md - One directory and file per bolt
|
|
40
51
|
|
|
41
|
-
|
|
42
|
-
|
|
52
|
+
For each bolt, generate a separate markdown file with:
|
|
53
|
+
1. Rich YAML frontmatter:
|
|
54
|
+
- id, unit, intent, type, status
|
|
55
|
+
- stories list
|
|
56
|
+
- timestamps (created, started, completed)
|
|
57
|
+
- requires_bolts/enables_bolts arrays
|
|
58
|
+
- complexity metrics
|
|
59
|
+
2. Full bolt structure:
|
|
60
|
+
- Overview, Objective, Stories Included
|
|
61
|
+
- Bolt Type with reference
|
|
62
|
+
- Stages checklist
|
|
63
|
+
- Dependencies (Requires/Enables)
|
|
64
|
+
- Success Criteria
|
|
65
|
+
- Implementation Notes
|
|
43
66
|
|
|
44
|
-
|
|
45
|
-
|
|
67
|
+
Analyze dependencies:
|
|
68
|
+
- Identify which bolts must complete before others
|
|
69
|
+
- Set requires_bolts field for dependent bolts
|
|
70
|
+
- Set enables_bolts to show what each bolt unlocks
|
|
71
|
+
- Calculate complexity based on:
|
|
72
|
+
- avg_complexity: 1-5 (code complexity)
|
|
73
|
+
- avg_uncertainty: 1-5 (requirements clarity)
|
|
74
|
+
- max_dependencies: count
|
|
75
|
+
- testing_scope: 1-5 (testing needed)
|
|
46
76
|
|
|
47
|
-
|
|
48
|
-
- [ ] Task 1
|
|
49
|
-
- [ ] Task 2
|
|
77
|
+
Use the following Bolt Template EXACTLY for each bolt file:
|
|
50
78
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
79
|
+
--- TEMPLATE: bolt.md ---
|
|
80
|
+
${boltTemplate}
|
|
81
|
+
-------------------------
|
|
54
82
|
|
|
55
83
|
In plan.md, list all bolts in dependency order.`,
|
|
56
84
|
inputs: runState.artifacts,
|
|
57
85
|
expectedOutputs: [
|
|
58
|
-
"memory-bank/
|
|
86
|
+
"memory-bank/bolts/plan.md"
|
|
59
87
|
],
|
|
60
88
|
metadata: { step: "generate_bolt_plan" }
|
|
61
89
|
};
|
|
@@ -154,17 +182,17 @@ In plan.md, list all bolts in dependency order.`,
|
|
|
154
182
|
* Looks for bolt file references or creates default list
|
|
155
183
|
*/
|
|
156
184
|
async function parseBoltsFromPlan() {
|
|
157
|
-
const planPath = path.join(process.cwd(), "memory-bank/
|
|
185
|
+
const planPath = path.join(process.cwd(), "memory-bank/bolts/plan.md");
|
|
158
186
|
if (!fs.existsSync(planPath)) {
|
|
159
187
|
return [];
|
|
160
188
|
}
|
|
161
189
|
const content = fs.readFileSync(planPath, "utf8");
|
|
162
190
|
const bolts = [];
|
|
163
|
-
// Look for bolt file references (e.g., "- bolt-name
|
|
164
|
-
const boltPattern = /(?:^|\n)(?:\d+\.|[-*])\s+([a-z0-9-]+)(
|
|
191
|
+
// Look for bolt file references (e.g., "- bolt-name" or "1. bolt-name")
|
|
192
|
+
const boltPattern = /(?:^|\n)(?:\d+\.|[-*])\s+([a-z0-9-]+)(?:\/bolt\.md)?/gi;
|
|
165
193
|
let match;
|
|
166
194
|
while ((match = boltPattern.exec(content)) !== null) {
|
|
167
|
-
const boltId = match[1].replace(
|
|
195
|
+
const boltId = match[1].replace(/\/bolt\.md$/, "");
|
|
168
196
|
if (!bolts.find(b => b.id === boltId)) {
|
|
169
197
|
bolts.push({
|
|
170
198
|
id: boltId,
|
|
@@ -172,16 +200,17 @@ async function parseBoltsFromPlan() {
|
|
|
172
200
|
});
|
|
173
201
|
}
|
|
174
202
|
}
|
|
175
|
-
// Also check for actual bolt
|
|
176
|
-
const boltsDir = path.join(process.cwd(), "memory-bank/
|
|
203
|
+
// Also check for actual bolt directories
|
|
204
|
+
const boltsDir = path.join(process.cwd(), "memory-bank/bolts");
|
|
177
205
|
if (fs.existsSync(boltsDir)) {
|
|
178
206
|
const files = fs.readdirSync(boltsDir);
|
|
179
207
|
files.forEach(file => {
|
|
180
|
-
if
|
|
181
|
-
|
|
182
|
-
|
|
208
|
+
// Check if it's a directory and has bolt.md
|
|
209
|
+
const boltPath = path.join(boltsDir, file, "bolt.md");
|
|
210
|
+
if (fs.existsSync(boltPath)) {
|
|
211
|
+
if (!bolts.find(b => b.id === file)) {
|
|
183
212
|
bolts.push({
|
|
184
|
-
id:
|
|
213
|
+
id: file,
|
|
185
214
|
status: "pending"
|
|
186
215
|
});
|
|
187
216
|
}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { randomUUID } from "crypto";
|
|
2
2
|
import inquirer from "inquirer";
|
|
3
3
|
import kleur from "kleur";
|
|
4
|
+
import path from "path";
|
|
4
5
|
import { WorkflowStage } from "../bridge/types.js";
|
|
5
6
|
import { appendEvent, saveRun } from "../iris/run-state.js";
|
|
7
|
+
import fs from "fs";
|
|
8
|
+
import { fileURLToPath } from "url";
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = path.dirname(__filename);
|
|
6
11
|
/**
|
|
7
12
|
* Execute Intent Inception stage
|
|
8
13
|
* Steps:
|
|
@@ -114,17 +119,35 @@ Return ONLY the question string or "DONE". Do not include JSON or explanation.`;
|
|
|
114
119
|
.replace(/^-|-$/g, "")
|
|
115
120
|
.substring(0, 50);
|
|
116
121
|
const artifactsTaskId = randomUUID();
|
|
122
|
+
// Load templates
|
|
123
|
+
const templateDir = path.join(__dirname, "../templates/inception");
|
|
124
|
+
let templates = {
|
|
125
|
+
requirements: "",
|
|
126
|
+
systemContext: "",
|
|
127
|
+
units: "",
|
|
128
|
+
unitBrief: "",
|
|
129
|
+
story: ""
|
|
130
|
+
};
|
|
131
|
+
try {
|
|
132
|
+
if (fs.existsSync(path.join(templateDir, "requirements-template.md"))) {
|
|
133
|
+
templates.requirements = fs.readFileSync(path.join(templateDir, "requirements-template.md"), "utf-8");
|
|
134
|
+
templates.systemContext = fs.readFileSync(path.join(templateDir, "system-context-template.md"), "utf-8");
|
|
135
|
+
templates.units = fs.readFileSync(path.join(templateDir, "units-template.md"), "utf-8");
|
|
136
|
+
templates.unitBrief = fs.readFileSync(path.join(templateDir, "unit-brief-template.md"), "utf-8");
|
|
137
|
+
templates.story = fs.readFileSync(path.join(templateDir, "story-template.md"), "utf-8");
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
catch (e) {
|
|
141
|
+
console.error("Failed to load templates:", e);
|
|
142
|
+
}
|
|
117
143
|
const artifactsPacket = {
|
|
118
144
|
taskId: artifactsTaskId,
|
|
119
145
|
intent: runState.intent,
|
|
120
146
|
stage: WorkflowStage.INTENT_INCEPTION,
|
|
121
147
|
agent: "iris-inception-agent",
|
|
122
|
-
instructions: `Based on the intent and user answers, create the following intent artifacts
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
2. system-context.md - Architecture decisions, constraints, tooling
|
|
126
|
-
3. stories.md - User stories or feature breakdown (optional)
|
|
127
|
-
4. units/ - If applicable, identify major units/components
|
|
148
|
+
instructions: `Based on the intent and user answers, create the following intent artifacts.
|
|
149
|
+
|
|
150
|
+
You refer to the templates below. Your job is to fill them out with EXTREME DETAIL based on the user's input.
|
|
128
151
|
|
|
129
152
|
Intent: ${runState.intent}
|
|
130
153
|
|
|
@@ -133,7 +156,59 @@ ${Object.entries(answers).map(([q, a]) => `Q: ${q}\nA: ${a}`).join("\n\n")}
|
|
|
133
156
|
|
|
134
157
|
Create files in: memory-bank/intents/${intentSlug}/
|
|
135
158
|
|
|
136
|
-
|
|
159
|
+
=== INSTRUCTIONS ===
|
|
160
|
+
|
|
161
|
+
1. **requirements.md**:
|
|
162
|
+
- Use the TEMPLATE below.
|
|
163
|
+
- Use "FR-X.Y" numbering for functional requirements.
|
|
164
|
+
- Use "SHALL", "SHOULD", "MAY" keywords.
|
|
165
|
+
- Group FRs by feature area.
|
|
166
|
+
- Include specific metrics for NFRs.
|
|
167
|
+
- Fill out "Business Goals" with measurable metrics.
|
|
168
|
+
|
|
169
|
+
2. **system-context.md**:
|
|
170
|
+
- Use the TEMPLATE below.
|
|
171
|
+
- Draw a Mermaid diagram for the context.
|
|
172
|
+
- List specific external integrations.
|
|
173
|
+
|
|
174
|
+
3. **units.md**:
|
|
175
|
+
- Decompose the intent into 3-8 logical units.
|
|
176
|
+
- Each unit should have a clear responsibility.
|
|
177
|
+
- Define dependencies between units.
|
|
178
|
+
|
|
179
|
+
4. **unit-brief.md** (for each unit):
|
|
180
|
+
- Create a directory for each unit: memory-bank/intents/${intentSlug}/units/{unit-name}/
|
|
181
|
+
- Create unit-brief.md inside.
|
|
182
|
+
- Use the TEMPLATE below.
|
|
183
|
+
|
|
184
|
+
5. **stories.md**:
|
|
185
|
+
- Use the TEMPLATE below.
|
|
186
|
+
- Create clear user stories and technical stories.
|
|
187
|
+
|
|
188
|
+
DO NOT use placeholders like "{insert here}". Write REAL content.
|
|
189
|
+
|
|
190
|
+
=== TEMPLATES ===
|
|
191
|
+
|
|
192
|
+
--- TEMPLATE: requirements.md ---
|
|
193
|
+
${templates.requirements}
|
|
194
|
+
--------------------------------
|
|
195
|
+
|
|
196
|
+
--- TEMPLATE: system-context.md ---
|
|
197
|
+
${templates.systemContext}
|
|
198
|
+
----------------------------------
|
|
199
|
+
|
|
200
|
+
--- TEMPLATE: units.md (Use for listing units) ---
|
|
201
|
+
${templates.units}
|
|
202
|
+
-------------------------------------------------
|
|
203
|
+
|
|
204
|
+
--- TEMPLATE: unit-brief.md (Use for each unit in units/) ---
|
|
205
|
+
${templates.unitBrief}
|
|
206
|
+
-----------------------------------------------------------
|
|
207
|
+
|
|
208
|
+
--- TEMPLATE: story.md (Use for each story in unit stories/) ---
|
|
209
|
+
${templates.story}
|
|
210
|
+
--------------------------------------------------------------
|
|
211
|
+
`,
|
|
137
212
|
inputs: [],
|
|
138
213
|
expectedOutputs: [
|
|
139
214
|
`memory-bank/intents/${intentSlug}/requirements.md`,
|