@comfanion/workflow 4.38.0-dev.1 → 4.38.1-dev.2
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/package.json +1 -1
- package/src/build-info.json +2 -2
- package/src/opencode/commands/dev-epic.md +6 -156
- package/src/opencode/commands/dev-sprint.md +6 -165
- package/src/opencode/commands/dev-story.md +11 -2
- package/src/opencode/commands/quick.md +5 -8
- package/src/opencode/config.yaml +0 -1
- package/src/opencode/opencode.json +1 -3
- package/src/opencode/plugins/custom-compaction.ts +7 -13
- package/src/opencode/skills/coding-standards/SKILL.md +79 -23
- package/src/opencode/skills/dev-epic/SKILL.md +122 -0
- package/src/opencode/skills/dev-sprint/SKILL.md +120 -0
- package/src/opencode/skills/dev-story/SKILL.md +122 -115
- package/src/opencode/skills/epic-writing/SKILL.md +2 -0
- package/src/opencode/skills/story-writing/SKILL.md +1 -1
package/package.json
CHANGED
package/src/build-info.json
CHANGED
|
@@ -5,165 +5,15 @@ agent: dev
|
|
|
5
5
|
|
|
6
6
|
# /dev-epic Command
|
|
7
7
|
|
|
8
|
-
Implement entire epic by
|
|
8
|
+
Implement an entire epic by following the `dev-epic` skill.
|
|
9
9
|
|
|
10
10
|
## Process
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
4. **Create TODO list from epic** (critical for compaction!):
|
|
17
|
-
- Parse epic file, extract all stories
|
|
18
|
-
- For each story: read story file, count tasks
|
|
19
|
-
- Add stories to TODO with task counts
|
|
20
|
-
- Add epic-level tasks (integration tests, acceptance criteria)
|
|
21
|
-
```
|
|
22
|
-
[ ] Story 1: User Registration (12 tasks)
|
|
23
|
-
[ ] Story 2: Login Flow (8 tasks)
|
|
24
|
-
[ ] Story 3: Password Reset (6 tasks)
|
|
25
|
-
[ ] Run epic integration tests
|
|
26
|
-
[ ] Verify all acceptance criteria
|
|
27
|
-
```
|
|
28
|
-
5. **Create epic state file:** `docs/sprint-artifacts/sprint-N/.sprint-state/epic-XX-state.yaml`
|
|
29
|
-
6. Mark epic as `in-progress`
|
|
30
|
-
|
|
31
|
-
### Phase 2: Story Execution Loop (for each story)
|
|
32
|
-
|
|
33
|
-
7. **Mark story as `in_progress` in TODO** (e.g., "Story 1: User Registration")
|
|
34
|
-
8. Execute story via `/dev-story` workflow:
|
|
35
|
-
- RED → GREEN → REFACTOR
|
|
36
|
-
- @coder implements tasks
|
|
37
|
-
- @reviewer validates (if auto_review: true)
|
|
38
|
-
9. **Mark story as `completed` in TODO** (✓ Story 1: User Registration)
|
|
39
|
-
10. **Update epic state file**:
|
|
40
|
-
- Move story from `pending_stories` → `completed_stories`
|
|
41
|
-
- Add metadata (tasks_completed, tests_added, review_status)
|
|
42
|
-
- Increment `current_story_index`
|
|
43
|
-
- Set `next_action: "Execute story-XX-XX.md"` (next story filename)
|
|
44
|
-
- Update `last_compaction` timestamp
|
|
45
|
-
11. **Trigger compaction** (if `epic_workflow.auto_compact: true`)
|
|
46
|
-
12. **After compaction:**
|
|
47
|
-
- Plugin reads TODO → sees next pending story
|
|
48
|
-
- Plugin reads epic state → gets story path
|
|
49
|
-
- Agent continues next story automatically
|
|
50
|
-
|
|
51
|
-
### Phase 3: Epic Completion
|
|
52
|
-
|
|
53
|
-
13. All stories done → **mark integration test TODO as `in_progress`**
|
|
54
|
-
14. Run epic integration tests (if configured)
|
|
55
|
-
15. **Mark integration test TODO as `completed`**
|
|
56
|
-
16. Update epic state: `status: "done"`
|
|
57
|
-
17. **Clear TODO** (all tasks done)
|
|
58
|
-
18. Generate epic summary
|
|
59
|
-
|
|
60
|
-
## TODO List
|
|
61
|
-
|
|
62
|
-
**Create at epic start:**
|
|
63
|
-
```
|
|
64
|
-
[ ] Story 1: User Registration
|
|
65
|
-
[ ] Story 2: Login Flow
|
|
66
|
-
[ ] Story 3: Password Reset
|
|
67
|
-
[ ] Run epic integration tests
|
|
68
|
-
[ ] Verify acceptance criteria
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
**Update after each story:**
|
|
72
|
-
- Mark story `completed` in TODO
|
|
73
|
-
- Mark next story `in_progress` in TODO
|
|
74
|
-
- TODO survives compaction - plugin shows it to agent
|
|
75
|
-
|
|
76
|
-
## Epic State File Format
|
|
77
|
-
|
|
78
|
-
**Location:** `docs/sprint-artifacts/sprint-N/.sprint-state/epic-XX-state.yaml`
|
|
79
|
-
|
|
80
|
-
```yaml
|
|
81
|
-
epic_id: "PROJ-E01"
|
|
82
|
-
epic_title: "User Authentication"
|
|
83
|
-
epic_path: "docs/sprint-artifacts/backlog/epic-01-user-auth.md"
|
|
84
|
-
sprint: "sprint-1"
|
|
85
|
-
status: "in-progress"
|
|
86
|
-
|
|
87
|
-
current_story_index: 1
|
|
88
|
-
total_stories: 3
|
|
89
|
-
|
|
90
|
-
completed_stories:
|
|
91
|
-
- path: "docs/sprint-artifacts/sprint-1/stories/story-01-01-registration.md"
|
|
92
|
-
title: "User Registration"
|
|
93
|
-
tasks_completed: 12
|
|
94
|
-
tests_added: 45
|
|
95
|
-
review_status: "approved"
|
|
96
|
-
completed_at: "2026-01-27T10:15:00Z"
|
|
97
|
-
|
|
98
|
-
pending_stories:
|
|
99
|
-
- path: "docs/sprint-artifacts/sprint-1/stories/story-01-02-login.md"
|
|
100
|
-
title: "Login Flow"
|
|
101
|
-
- path: "docs/sprint-artifacts/sprint-1/stories/story-01-03-password-reset.md"
|
|
102
|
-
title: "Password Reset"
|
|
103
|
-
|
|
104
|
-
next_action: "Execute story-01-02-login.md"
|
|
105
|
-
last_compaction: "2026-01-27T10:15:00Z"
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
## Compaction Strategy
|
|
109
|
-
|
|
110
|
-
**After compaction, agent reads (minimal context):**
|
|
111
|
-
1. Epic state file (progress + next action)
|
|
112
|
-
2. Next story file (from `next_action`)
|
|
113
|
-
3. CLAUDE.md, docs/prd.md, docs/architecture.md
|
|
114
|
-
|
|
115
|
-
**Agent does NOT re-read:**
|
|
116
|
-
- ❌ Epic file (info in state)
|
|
117
|
-
- ❌ Completed stories
|
|
118
|
-
- ❌ Previous tasks
|
|
119
|
-
|
|
120
|
-
**Context savings: ~68% less than reading all files**
|
|
121
|
-
|
|
122
|
-
## Configuration
|
|
123
|
-
|
|
124
|
-
From `config.yaml → epic_workflow`:
|
|
125
|
-
|
|
126
|
-
```yaml
|
|
127
|
-
epic_workflow:
|
|
128
|
-
auto_compact: true # Compact between stories
|
|
129
|
-
auto_fix: true # Auto-fix review issues
|
|
130
|
-
max_fix_attempts: 3 # Max fix attempts before HALT
|
|
131
|
-
pause_between_stories: false # Continue automatically
|
|
132
|
-
test_after_each_story: false # Skip per-story integration tests
|
|
133
|
-
test_after_epic: true # Run epic integration tests at end
|
|
134
|
-
```
|
|
12
|
+
1. **Load Skill**: Read and follow the instructions in `.opencode/skills/dev-epic/SKILL.md`.
|
|
13
|
+
2. **Initialize**: Create the epic-level TODO list and the epic state file as described in the skill.
|
|
14
|
+
3. **Execute**: Enter the story -> review -> compact -> loop until all stories in the TODO list are complete.
|
|
15
|
+
4. **Finalize**: Run final tests and report completion.
|
|
135
16
|
|
|
136
17
|
## IMPORTANT SKILLS TO LOAD
|
|
137
18
|
|
|
138
|
-
- `dev-
|
|
139
|
-
- `test-design` - Test writing patterns
|
|
140
|
-
- `code-review` - Review and validation
|
|
141
|
-
|
|
142
|
-
## Output
|
|
143
|
-
|
|
144
|
-
- All story implementations (code + tests)
|
|
145
|
-
- Epic state file (updated)
|
|
146
|
-
- Updated epic file (stories marked `[x]`)
|
|
147
|
-
- Epic summary report
|
|
148
|
-
|
|
149
|
-
## HALT Conditions
|
|
150
|
-
|
|
151
|
-
The workflow will HALT and ask for input when:
|
|
152
|
-
- Story fails 3 times (implementation/tests)
|
|
153
|
-
- Code review fails after max_fix_attempts
|
|
154
|
-
- Missing dependencies
|
|
155
|
-
- Ambiguous requirements
|
|
156
|
-
- Integration tests fail
|
|
157
|
-
|
|
158
|
-
## Epic Status Flow
|
|
159
|
-
|
|
160
|
-
```
|
|
161
|
-
ready-for-dev → in-progress → [story 1] → compact → [story 2] → compact → ... → done
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
## Next Steps After Completion
|
|
165
|
-
|
|
166
|
-
- Epic marked `done` in epic state file
|
|
167
|
-
- All stories marked `done`
|
|
168
|
-
- If part of `/dev-sprint`: continue to next epic automatically
|
|
169
|
-
- If standalone: ready for sprint review
|
|
19
|
+
- `dev-epic` - The primary algorithm for this command.
|
|
@@ -5,174 +5,15 @@ agent: dev
|
|
|
5
5
|
|
|
6
6
|
# /dev-sprint Command
|
|
7
7
|
|
|
8
|
-
Implement entire sprint by
|
|
8
|
+
Implement an entire sprint by following the `dev-sprint` skill.
|
|
9
9
|
|
|
10
10
|
## Process
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
4. Load project context (CLAUDE.md, docs/prd.md, docs/architecture.md)
|
|
17
|
-
5. **Create TODO list from sprint** (critical for compaction!):
|
|
18
|
-
- Parse sprint-status.yaml, extract all epics
|
|
19
|
-
- For each epic: read epic file, count stories and tasks
|
|
20
|
-
- Add epics to TODO with story/task counts
|
|
21
|
-
- Add sprint-level tasks (integration tests, acceptance criteria, metrics)
|
|
22
|
-
```
|
|
23
|
-
[ ] Epic 1: User Authentication (3 stories, 26 tasks)
|
|
24
|
-
[ ] Epic 2: Product Catalog (5 stories, 42 tasks)
|
|
25
|
-
[ ] Epic 3: Shopping Cart (4 stories, 31 tasks)
|
|
26
|
-
[ ] Run sprint integration tests
|
|
27
|
-
[ ] Verify sprint acceptance criteria
|
|
28
|
-
[ ] Generate sprint metrics
|
|
29
|
-
```
|
|
30
|
-
6. Mark sprint as `in-progress` in sprint-status.yaml
|
|
31
|
-
|
|
32
|
-
### Phase 2: Epic Execution Loop (for each epic)
|
|
33
|
-
|
|
34
|
-
7. **Mark epic as `in_progress` in TODO** (e.g., "Epic 1: User Authentication")
|
|
35
|
-
8. Execute epic via `/dev-epic` workflow:
|
|
36
|
-
- Epic creates its own TODO for stories
|
|
37
|
-
- Epic executes all stories
|
|
38
|
-
- Auto-compacts between stories
|
|
39
|
-
- Auto-fixes code review issues
|
|
40
|
-
9. **Mark epic as `completed` in TODO** (✓ Epic 1: User Authentication)
|
|
41
|
-
10. **Update sprint-status.yaml**:
|
|
42
|
-
- Mark epic as `done`
|
|
43
|
-
- Update `stories_completed` count
|
|
44
|
-
- Find next epic
|
|
45
|
-
11. **Trigger compaction** (if `epic_workflow.auto_compact: true`)
|
|
46
|
-
12. **After compaction:**
|
|
47
|
-
- Plugin reads TODO → sees next pending epic
|
|
48
|
-
- Plugin reads sprint-status.yaml → gets epic path
|
|
49
|
-
- Agent continues next epic automatically
|
|
50
|
-
|
|
51
|
-
### Phase 3: Sprint Completion
|
|
52
|
-
|
|
53
|
-
13. All epics done → **mark integration test TODO as `in_progress`**
|
|
54
|
-
14. Run sprint integration tests (if configured)
|
|
55
|
-
15. **Mark integration test TODO as `completed`**
|
|
56
|
-
16. **Mark acceptance criteria TODO as `in_progress`**
|
|
57
|
-
17. Verify sprint acceptance criteria
|
|
58
|
-
18. **Mark acceptance criteria TODO as `completed`**
|
|
59
|
-
19. **Mark metrics TODO as `in_progress`**
|
|
60
|
-
20. Generate sprint metrics (velocity, completion rate, etc.)
|
|
61
|
-
21. **Mark metrics TODO as `completed`**
|
|
62
|
-
22. Update sprint-status.yaml: `status: "done"`
|
|
63
|
-
23. **Clear TODO** (all tasks done)
|
|
64
|
-
24. Generate sprint summary
|
|
65
|
-
|
|
66
|
-
## TODO List
|
|
67
|
-
|
|
68
|
-
**Create at sprint start:**
|
|
69
|
-
```
|
|
70
|
-
[ ] Epic 1: User Authentication (3 stories)
|
|
71
|
-
[ ] Epic 2: Product Catalog (5 stories)
|
|
72
|
-
[ ] Epic 3: Shopping Cart (4 stories)
|
|
73
|
-
[ ] Run sprint integration tests
|
|
74
|
-
[ ] Verify sprint acceptance criteria
|
|
75
|
-
[ ] Generate sprint metrics
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
**Update after each epic:**
|
|
79
|
-
- Mark epic `completed` in TODO
|
|
80
|
-
- Mark next epic `in_progress` in TODO
|
|
81
|
-
- TODO survives compaction - plugin shows it to agent
|
|
82
|
-
|
|
83
|
-
**Note:** Each epic creates its own TODO for stories, clears it when done
|
|
84
|
-
|
|
85
|
-
## Sprint State Tracking
|
|
86
|
-
|
|
87
|
-
**Location:** `docs/sprint-artifacts/sprint-status.yaml`
|
|
88
|
-
|
|
89
|
-
```yaml
|
|
90
|
-
sprints:
|
|
91
|
-
- id: sprint-1
|
|
92
|
-
name: "Sprint 1 - Core Features"
|
|
93
|
-
status: in-progress
|
|
94
|
-
start_date: "2026-01-20"
|
|
95
|
-
end_date: "2026-02-03"
|
|
96
|
-
|
|
97
|
-
epics:
|
|
98
|
-
- id: PROJ-E01
|
|
99
|
-
title: "User Authentication"
|
|
100
|
-
path: "docs/sprint-artifacts/backlog/epic-01-user-auth.md"
|
|
101
|
-
status: done
|
|
102
|
-
stories_completed: 3
|
|
103
|
-
stories_total: 3
|
|
104
|
-
|
|
105
|
-
- id: PROJ-E02
|
|
106
|
-
title: "Product Catalog"
|
|
107
|
-
path: "docs/sprint-artifacts/backlog/epic-02-catalog.md"
|
|
108
|
-
status: in-progress # ← Current epic
|
|
109
|
-
stories_completed: 2
|
|
110
|
-
stories_total: 5
|
|
111
|
-
|
|
112
|
-
- id: PROJ-E03
|
|
113
|
-
title: "Shopping Cart"
|
|
114
|
-
path: "docs/sprint-artifacts/backlog/epic-03-cart.md"
|
|
115
|
-
status: ready-for-dev
|
|
116
|
-
stories_total: 4
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
Each epic also has state file in `.sprint-state/epic-XX-state.yaml`
|
|
120
|
-
|
|
121
|
-
## Compaction Strategy
|
|
122
|
-
|
|
123
|
-
**After compaction, agent reads:**
|
|
124
|
-
1. sprint-status.yaml (knows which epic is next)
|
|
125
|
-
2. Next epic file
|
|
126
|
-
3. Next epic state file (if exists)
|
|
127
|
-
4. CLAUDE.md, docs/prd.md, docs/architecture.md
|
|
128
|
-
|
|
129
|
-
**Agent does NOT re-read:**
|
|
130
|
-
- ❌ Completed epic files
|
|
131
|
-
- ❌ Completed story files
|
|
132
|
-
- ❌ Previous epic states
|
|
133
|
-
|
|
134
|
-
## Configuration
|
|
135
|
-
|
|
136
|
-
From `config.yaml → epic_workflow`:
|
|
137
|
-
|
|
138
|
-
```yaml
|
|
139
|
-
epic_workflow:
|
|
140
|
-
auto_compact: true # Compact between epics
|
|
141
|
-
auto_fix: true # Auto-fix review issues
|
|
142
|
-
pause_between_stories: false # Continue automatically
|
|
143
|
-
```
|
|
12
|
+
1. **Load Skill**: Read and follow the instructions in `.opencode/skills/dev-sprint/SKILL.md`.
|
|
13
|
+
2. **Initialize**: Create the sprint-level TODO list and update `sprint-status.yaml` as described in the skill.
|
|
14
|
+
3. **Execute**: Enter the epic -> review -> compact -> loop until all epics in the TODO list are complete.
|
|
15
|
+
4. **Finalize**: Run final sprint tests and report completion.
|
|
144
16
|
|
|
145
17
|
## IMPORTANT SKILLS TO LOAD
|
|
146
18
|
|
|
147
|
-
- `dev-
|
|
148
|
-
- `test-design` - Test writing patterns
|
|
149
|
-
- `code-review` - Review and validation
|
|
150
|
-
|
|
151
|
-
## Output
|
|
152
|
-
|
|
153
|
-
- All epic implementations (code + tests)
|
|
154
|
-
- Updated sprint-status.yaml
|
|
155
|
-
- Sprint summary report
|
|
156
|
-
- Sprint metrics (velocity, completion rate)
|
|
157
|
-
|
|
158
|
-
## HALT Conditions
|
|
159
|
-
|
|
160
|
-
The workflow will HALT and ask for input when:
|
|
161
|
-
- Epic fails repeatedly (3+ failed stories)
|
|
162
|
-
- Multiple stories rejected by @reviewer
|
|
163
|
-
- Sprint deadline approaching (< 20% time, > 50% work)
|
|
164
|
-
- Missing dependencies
|
|
165
|
-
- Sprint integration tests fail
|
|
166
|
-
|
|
167
|
-
## Sprint Status Flow
|
|
168
|
-
|
|
169
|
-
```
|
|
170
|
-
planned → in-progress → [epic 1] → compact → [epic 2] → compact → ... → done
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
## Next Steps After Completion
|
|
174
|
-
|
|
175
|
-
- Sprint marked `done` in sprint-status.yaml
|
|
176
|
-
- All epics and stories marked `done`
|
|
177
|
-
- Ready for sprint review/retrospective
|
|
178
|
-
- Run `/retrospective` to capture learnings
|
|
19
|
+
- `dev-sprint` - The primary algorithm for this command.
|
|
@@ -13,8 +13,17 @@ Implement a story using red-green-refactor cycle with TODO tracking.
|
|
|
13
13
|
1. Find or load story file
|
|
14
14
|
2. Load project context (CLAUDE.md, docs/prd.md, docs/architecture.md)
|
|
15
15
|
3. Use skill dev-story, test-design
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
4. **Create TODO list for full scope of work** (tasks + tests + review):
|
|
17
|
+
- Parse story file, extract all tasks
|
|
18
|
+
- Add each task to TODO
|
|
19
|
+
- **If `config.yaml → development.auto_review: true`**: Add review task to TODO
|
|
20
|
+
```
|
|
21
|
+
[ ] Task 1: Create User entity
|
|
22
|
+
[ ] Task 2: Add repository
|
|
23
|
+
[ ] Task 3: Write integration tests
|
|
24
|
+
[ ] Code review by @reviewer ← if auto_review: true
|
|
25
|
+
```
|
|
26
|
+
5. Mark story as `in-progress`
|
|
18
27
|
|
|
19
28
|
### Phase 2: Implementation (for each task)
|
|
20
29
|
5. **Mark task as `in_progress` in TODO**
|
|
@@ -19,26 +19,23 @@ Automatically used when:
|
|
|
19
19
|
- Single file or < 5 files affected
|
|
20
20
|
- No new requirements needed
|
|
21
21
|
- No architecture changes
|
|
22
|
-
-
|
|
22
|
+
- T-shirt size: S or M
|
|
23
23
|
|
|
24
24
|
## Quick Workflow
|
|
25
25
|
|
|
26
26
|
```
|
|
27
27
|
┌────────────────────┐
|
|
28
|
-
│ 1. Quick Doc
|
|
29
|
-
│ (2-5 min) │
|
|
28
|
+
│ 1. Quick Doc [XS] │ Create minimal change doc
|
|
30
29
|
└────────┬───────────┘
|
|
31
30
|
│
|
|
32
31
|
▼
|
|
33
32
|
┌────────────────────┐
|
|
34
|
-
│ 2. Implement
|
|
35
|
-
│ (varies) │
|
|
33
|
+
│ 2. Implement [S-M] │ Make the change
|
|
36
34
|
└────────┬───────────┘
|
|
37
35
|
│
|
|
38
36
|
▼
|
|
39
37
|
┌────────────────────┐
|
|
40
|
-
│ 3. Test
|
|
41
|
-
│ (5-10 min) │
|
|
38
|
+
│ 3. Test [XS] │ Verify it works
|
|
42
39
|
└────────┬───────────┘
|
|
43
40
|
│
|
|
44
41
|
▼
|
|
@@ -119,7 +116,7 @@ For valid quick changes:
|
|
|
119
116
|
## Quick Change: [Title]
|
|
120
117
|
|
|
121
118
|
**Scale:** L0 (Hotfix) / L1 (Small)
|
|
122
|
-
**
|
|
119
|
+
**Size:** S / M
|
|
123
120
|
|
|
124
121
|
### Files to Modify
|
|
125
122
|
|
package/src/opencode/config.yaml
CHANGED
|
@@ -54,20 +54,18 @@ const BASE_FILES = [
|
|
|
54
54
|
]
|
|
55
55
|
|
|
56
56
|
// Agent-specific file priorities (added to BASE_FILES)
|
|
57
|
+
// These are OPTIONAL files for context, not mandatory
|
|
57
58
|
const AGENT_FILES: Record<string, string[]> = {
|
|
58
59
|
dev: [
|
|
59
60
|
...BASE_FILES,
|
|
60
61
|
"docs/coding-standards/README.md",
|
|
61
62
|
"docs/coding-standards/patterns.md",
|
|
62
|
-
|
|
63
|
-
"docs/prd.md",
|
|
64
|
-
"docs/architecture.md",
|
|
63
|
+
// NO prd.md, NO architecture.md - too large, story has context
|
|
65
64
|
// story path added dynamically
|
|
66
65
|
],
|
|
67
66
|
coder: [
|
|
68
67
|
...BASE_FILES,
|
|
69
68
|
"docs/coding-standards/patterns.md",
|
|
70
|
-
"docs/coding-standards/testing.md",
|
|
71
69
|
],
|
|
72
70
|
architect: [
|
|
73
71
|
...BASE_FILES,
|
|
@@ -111,20 +109,19 @@ const DEFAULT_FILES = [
|
|
|
111
109
|
]
|
|
112
110
|
|
|
113
111
|
// Files agent MUST Read after compaction (commands generated)
|
|
112
|
+
// MINIMAL CONTEXT: ~70KB for dev, not 200KB+
|
|
113
|
+
// Note: coding-standards/README.md is standard path created by /coding-standards command
|
|
114
114
|
const MUST_READ_FILES: Record<string, string[]> = {
|
|
115
115
|
dev: [
|
|
116
116
|
"AGENTS.md",
|
|
117
117
|
"CLAUDE.md",
|
|
118
|
-
"docs/
|
|
119
|
-
|
|
120
|
-
// epic state path added dynamically (if in epic workflow)
|
|
121
|
-
// story path added dynamically
|
|
118
|
+
"docs/coding-standards/README.md", // if exists
|
|
119
|
+
// story/epic state path added dynamically
|
|
122
120
|
],
|
|
123
121
|
coder: [
|
|
124
122
|
"AGENTS.md",
|
|
125
123
|
"CLAUDE.md",
|
|
126
|
-
"docs/
|
|
127
|
-
"docs/architecture.md",
|
|
124
|
+
"docs/coding-standards/README.md",
|
|
128
125
|
],
|
|
129
126
|
architect: [
|
|
130
127
|
"AGENTS.md",
|
|
@@ -136,7 +133,6 @@ const MUST_READ_FILES: Record<string, string[]> = {
|
|
|
136
133
|
"AGENTS.md",
|
|
137
134
|
"CLAUDE.md",
|
|
138
135
|
"docs/prd.md",
|
|
139
|
-
"docs/architecture.md",
|
|
140
136
|
],
|
|
141
137
|
analyst: [
|
|
142
138
|
"AGENTS.md",
|
|
@@ -150,8 +146,6 @@ const MUST_READ_FILES: Record<string, string[]> = {
|
|
|
150
146
|
default: [
|
|
151
147
|
"AGENTS.md",
|
|
152
148
|
"CLAUDE.md",
|
|
153
|
-
"docs/prd.md",
|
|
154
|
-
"docs/architecture.md",
|
|
155
149
|
],
|
|
156
150
|
}
|
|
157
151
|
|
|
@@ -13,9 +13,26 @@ metadata:
|
|
|
13
13
|
|
|
14
14
|
You are a Senior Staff Engineer specializing in establishing coding standards. You create **modular documentation** - multiple focused files (1-10 files), each under 2000 lines.
|
|
15
15
|
|
|
16
|
-
## Core Principle:
|
|
16
|
+
## Core Principle: README.md is the Main File
|
|
17
17
|
|
|
18
|
-
**CRITICAL
|
|
18
|
+
**CRITICAL:** During development, agents read ONLY `README.md` from coding-standards (to save context ~65KB).
|
|
19
|
+
|
|
20
|
+
Therefore `README.md` MUST contain:
|
|
21
|
+
- **ALL critical rules** (not just links!)
|
|
22
|
+
- **Common patterns with examples**
|
|
23
|
+
- **Naming conventions**
|
|
24
|
+
- **Project structure overview**
|
|
25
|
+
- Links to other files for deep dive
|
|
26
|
+
|
|
27
|
+
Other files (testing.md, api.md, etc.) are for **deep dive only** - agents read them when story's "Required Reading" points to them.
|
|
28
|
+
|
|
29
|
+
## Size Guidelines
|
|
30
|
+
|
|
31
|
+
| File | Max Size | Purpose |
|
|
32
|
+
|------|----------|---------|
|
|
33
|
+
| README.md | 20-30KB | Main file, all critical rules |
|
|
34
|
+
| Other files | 10-20KB each | Deep dive on specific topics |
|
|
35
|
+
| Total | <2000 lines/file | Keep files readable |
|
|
19
36
|
|
|
20
37
|
## Documentation Structure
|
|
21
38
|
|
|
@@ -35,7 +52,7 @@ docs/coding-standards/
|
|
|
35
52
|
|
|
36
53
|
## File Templates
|
|
37
54
|
|
|
38
|
-
### README.md (
|
|
55
|
+
### README.md (Main File - Agents Read This!)
|
|
39
56
|
|
|
40
57
|
```markdown
|
|
41
58
|
# Coding Standards
|
|
@@ -44,33 +61,72 @@ docs/coding-standards/
|
|
|
44
61
|
**Tech Stack:** [languages, frameworks]
|
|
45
62
|
**Last Updated:** YYYY-MM-DD
|
|
46
63
|
|
|
47
|
-
##
|
|
64
|
+
## Project Structure
|
|
65
|
+
|
|
66
|
+
\`\`\`
|
|
67
|
+
project/
|
|
68
|
+
├── src/ # Source code
|
|
69
|
+
│ ├── modules/ # Business modules (domain, service, handler)
|
|
70
|
+
│ └── internal/ # Shared infrastructure
|
|
71
|
+
├── docs/ # Documentation
|
|
72
|
+
└── tests/ # Test files
|
|
73
|
+
\`\`\`
|
|
74
|
+
|
|
75
|
+
## Naming Conventions
|
|
76
|
+
|
|
77
|
+
### Files
|
|
78
|
+
- `snake_case` for files: `user_service.go`, `auth_handler.ts`
|
|
79
|
+
- Test files: `*_test.go`, `*.test.ts`
|
|
80
|
+
|
|
81
|
+
### Code
|
|
82
|
+
- Types/Classes: `PascalCase` - `UserService`, `AuthHandler`
|
|
83
|
+
- Functions: `camelCase` (TS) or `PascalCase` (Go exported)
|
|
84
|
+
- Variables: `camelCase` - `userId`, `isValid`
|
|
85
|
+
- Constants: `UPPER_SNAKE_CASE` - `MAX_RETRIES`
|
|
48
86
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
| Security | [security-standards.md](./security-standards.md) | Input validation |
|
|
57
|
-
| Libraries | [libraries.md](./libraries.md) | Approved list |
|
|
58
|
-
| Git | [git-workflow.md](./git-workflow.md) | Conventional commits |
|
|
87
|
+
## Common Patterns
|
|
88
|
+
|
|
89
|
+
### Service Pattern
|
|
90
|
+
[Example of service implementation in your language]
|
|
91
|
+
|
|
92
|
+
### Repository Pattern
|
|
93
|
+
[Example of repository implementation]
|
|
59
94
|
|
|
60
|
-
|
|
95
|
+
### Error Handling
|
|
96
|
+
[Example of error handling pattern]
|
|
61
97
|
|
|
62
|
-
|
|
63
|
-
2. [Second most important]
|
|
64
|
-
3. [Third most important]
|
|
98
|
+
## Critical Rules
|
|
65
99
|
|
|
66
|
-
|
|
100
|
+
1. **No business logic in handlers** - handlers only validate input and call services
|
|
101
|
+
2. **All errors must be wrapped** with context
|
|
102
|
+
3. **No hardcoded values** - use config or constants
|
|
103
|
+
4. **Tests required** for all business logic
|
|
67
104
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
105
|
+
## API Response Format
|
|
106
|
+
|
|
107
|
+
### Success
|
|
108
|
+
\`\`\`json
|
|
109
|
+
{ "data": { ... } }
|
|
110
|
+
\`\`\`
|
|
111
|
+
|
|
112
|
+
### Error
|
|
113
|
+
\`\`\`json
|
|
114
|
+
{ "error": { "code": "VALIDATION_ERROR", "message": "..." } }
|
|
115
|
+
\`\`\`
|
|
116
|
+
|
|
117
|
+
## Deep Dive Documents
|
|
118
|
+
|
|
119
|
+
| Topic | File | When to Read |
|
|
120
|
+
|-------|------|--------------|
|
|
121
|
+
| Testing | [testing.md](./testing.md) | Writing tests |
|
|
122
|
+
| API Design | [api.md](./api.md) | Creating endpoints |
|
|
123
|
+
| Database | [database.md](./database.md) | Schema changes |
|
|
124
|
+
| Security | [security.md](./security.md) | Auth, validation |
|
|
125
|
+
| Git | [git.md](./git.md) | Commits, PRs |
|
|
72
126
|
```
|
|
73
127
|
|
|
128
|
+
**Note:** This README should be 20-30KB with real examples, not placeholders.
|
|
129
|
+
|
|
74
130
|
### project-structure.md
|
|
75
131
|
|
|
76
132
|
```markdown
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dev-epic
|
|
3
|
+
description: Use when executing a full epic, including all stories, reviews, and tests, with auto-compaction.
|
|
4
|
+
metadata:
|
|
5
|
+
domain: development
|
|
6
|
+
agents: [dev]
|
|
7
|
+
artifacts: epic state file, story files
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Dev Epic Skill
|
|
11
|
+
|
|
12
|
+
## CRITICAL: Context Rules
|
|
13
|
+
|
|
14
|
+
**READ ONLY (max ~70KB):**
|
|
15
|
+
- `CLAUDE.md`
|
|
16
|
+
- `docs/coding-standards/README.md`
|
|
17
|
+
- `docs/coding-standards/patterns.md`
|
|
18
|
+
- Epic file (ONE)
|
|
19
|
+
- Current story file (ONE at a time)
|
|
20
|
+
|
|
21
|
+
**❌ DO NOT READ — WASTES CONTEXT:**
|
|
22
|
+
- ❌ `docs/prd.md` — epic/story already has context
|
|
23
|
+
- ❌ `docs/architecture.md` — too large, coding-standards has patterns
|
|
24
|
+
- ❌ All stories at once — read ONE, execute, then next
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
<workflow name="dev-epic">
|
|
29
|
+
|
|
30
|
+
<phase name="1-context" title="Load Minimal Context">
|
|
31
|
+
<critical>DO NOT read prd.md, architecture.md, or all stories!</critical>
|
|
32
|
+
<read>
|
|
33
|
+
<file>CLAUDE.md</file>
|
|
34
|
+
<file>docs/coding-standards/README.md</file>
|
|
35
|
+
<file>docs/coding-standards/patterns.md</file>
|
|
36
|
+
<file>{epic-file}</file>
|
|
37
|
+
<file>{current-story-file} — ONE only!</file>
|
|
38
|
+
</read>
|
|
39
|
+
<goal>~70KB per story, NOT 200KB+</goal>
|
|
40
|
+
</phase>
|
|
41
|
+
|
|
42
|
+
<phase name="2-init" title="Initialize Epic">
|
|
43
|
+
<step n="1">Parse epic file → extract story list</step>
|
|
44
|
+
<step n="2">Create epic state: docs/sprint-artifacts/sprint-N/.sprint-state/epic-XX-state.yaml</step>
|
|
45
|
+
<step n="3">Create TODO list:
|
|
46
|
+
```
|
|
47
|
+
[ ] Story 1: [Title]
|
|
48
|
+
[ ] Review Story 1
|
|
49
|
+
[ ] Story 2: [Title]
|
|
50
|
+
[ ] Review Story 2
|
|
51
|
+
...
|
|
52
|
+
[ ] Epic integration tests
|
|
53
|
+
[ ] Verify epic AC
|
|
54
|
+
```
|
|
55
|
+
</step>
|
|
56
|
+
<step n="4">Set state: status="in-progress", next_action="Execute [first-story.md]"</step>
|
|
57
|
+
<step n="5">Mark first story as in_progress in TODO</step>
|
|
58
|
+
</phase>
|
|
59
|
+
|
|
60
|
+
<phase name="3-loop" title="Story Execution Loop">
|
|
61
|
+
<for-each item="story" in="pending_stories">
|
|
62
|
+
|
|
63
|
+
<action name="execute-story">
|
|
64
|
+
Follow /dev-story logic:
|
|
65
|
+
- Create nested TODO for tasks
|
|
66
|
+
- Implement all tasks (RED/GREEN/REFACTOR)
|
|
67
|
+
- Clear task TODO when done
|
|
68
|
+
</action>
|
|
69
|
+
|
|
70
|
+
<action name="mark-done">
|
|
71
|
+
Mark story as completed in epic TODO
|
|
72
|
+
</action>
|
|
73
|
+
|
|
74
|
+
<action name="review">
|
|
75
|
+
Mark "Review Story" as in_progress
|
|
76
|
+
Invoke @reviewer
|
|
77
|
+
<if condition="CHANGES_REQUESTED">
|
|
78
|
+
Add fix tasks → re-execute → re-review (max 3 attempts)
|
|
79
|
+
</if>
|
|
80
|
+
<if condition="APPROVED">
|
|
81
|
+
Mark "Review Story" as completed
|
|
82
|
+
</if>
|
|
83
|
+
</action>
|
|
84
|
+
|
|
85
|
+
<action name="update-state">
|
|
86
|
+
Edit epic state file:
|
|
87
|
+
- Move story to completed_stories
|
|
88
|
+
- Increment current_story_index
|
|
89
|
+
- Set next_action to next story
|
|
90
|
+
</action>
|
|
91
|
+
|
|
92
|
+
<action name="compact">
|
|
93
|
+
Mark next story as in_progress in TODO
|
|
94
|
+
Wait for auto-compaction
|
|
95
|
+
Plugin reads TODO + state → resume
|
|
96
|
+
</action>
|
|
97
|
+
|
|
98
|
+
</for-each>
|
|
99
|
+
</phase>
|
|
100
|
+
|
|
101
|
+
<phase name="4-finalize" title="Finalize Epic">
|
|
102
|
+
<step n="1">Run epic integration tests (mark in TODO)</step>
|
|
103
|
+
<step n="2">Verify all AC from epic file (mark in TODO)</step>
|
|
104
|
+
<step n="3">Set state: status="done"</step>
|
|
105
|
+
<step n="4">Clear epic TODO list</step>
|
|
106
|
+
<step n="5">Report completion with summary</step>
|
|
107
|
+
</phase>
|
|
108
|
+
|
|
109
|
+
</workflow>
|
|
110
|
+
|
|
111
|
+
<outputs>
|
|
112
|
+
- Implementation code for all stories
|
|
113
|
+
- Updated epic-XX-state.yaml
|
|
114
|
+
- Clean TODO list (all completed)
|
|
115
|
+
</outputs>
|
|
116
|
+
|
|
117
|
+
<rules>
|
|
118
|
+
<do>Create clean TODO list for each epic</do>
|
|
119
|
+
<do>Update epic state file BEFORE compaction</do>
|
|
120
|
+
<dont>Ask user for confirmation between stories — TODO is your guide</dont>
|
|
121
|
+
<dont>Proceed to next story if review fails — enter fix loop</dont>
|
|
122
|
+
</rules>
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dev-sprint
|
|
3
|
+
description: Use when executing a full sprint, including all epics, stories, reviews, and tests, with auto-compaction.
|
|
4
|
+
metadata:
|
|
5
|
+
domain: development
|
|
6
|
+
agents: [dev]
|
|
7
|
+
artifacts: sprint-status.yaml, epic state files, story files
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Dev Sprint Skill
|
|
11
|
+
|
|
12
|
+
## CRITICAL: Context Rules
|
|
13
|
+
|
|
14
|
+
**READ ONLY (max ~70KB):**
|
|
15
|
+
- `CLAUDE.md`
|
|
16
|
+
- `docs/coding-standards/README.md`
|
|
17
|
+
- `docs/coding-standards/patterns.md`
|
|
18
|
+
- `sprint-status.yaml`
|
|
19
|
+
- Current epic file (ONE)
|
|
20
|
+
- Current story file (ONE at a time)
|
|
21
|
+
|
|
22
|
+
**❌ DO NOT READ — WASTES CONTEXT:**
|
|
23
|
+
- ❌ `docs/prd.md` — epic/story already has context
|
|
24
|
+
- ❌ `docs/architecture.md` — too large, coding-standards has patterns
|
|
25
|
+
- ❌ All epics at once — read ONE, execute, then next
|
|
26
|
+
- ❌ All stories at once — read ONE, execute, then next
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
<workflow name="dev-sprint">
|
|
31
|
+
|
|
32
|
+
<phase name="1-context" title="Load Minimal Context">
|
|
33
|
+
<critical>DO NOT read prd.md, architecture.md, or all epics/stories!</critical>
|
|
34
|
+
<read>
|
|
35
|
+
<file>CLAUDE.md</file>
|
|
36
|
+
<file>docs/coding-standards/README.md</file>
|
|
37
|
+
<file>docs/coding-standards/patterns.md</file>
|
|
38
|
+
<file>sprint-status.yaml</file>
|
|
39
|
+
<file>{current-epic-file} — ONE only!</file>
|
|
40
|
+
<file>{current-story-file} — ONE only!</file>
|
|
41
|
+
</read>
|
|
42
|
+
<goal>~70KB per story, NOT 200KB+</goal>
|
|
43
|
+
</phase>
|
|
44
|
+
|
|
45
|
+
<phase name="2-init" title="Initialize Sprint">
|
|
46
|
+
<step n="1">Parse sprint-status.yaml → extract epic list for target sprint</step>
|
|
47
|
+
<step n="2">Create master TODO list:
|
|
48
|
+
```
|
|
49
|
+
[ ] Epic 1: [Title]
|
|
50
|
+
[ ] Story 1-1: [Title]
|
|
51
|
+
[ ] Review Story 1-1
|
|
52
|
+
[ ] Story 1-2: [Title]
|
|
53
|
+
[ ] Review Story 1-2
|
|
54
|
+
[ ] Review Epic 1
|
|
55
|
+
[ ] Epic 2: [Title]
|
|
56
|
+
[ ] Story 2-1: [Title]
|
|
57
|
+
...
|
|
58
|
+
[ ] Sprint integration tests
|
|
59
|
+
```
|
|
60
|
+
</step>
|
|
61
|
+
<step n="3">Set sprint status="in-progress" in sprint-status.yaml</step>
|
|
62
|
+
<step n="4">Mark first epic as in_progress in TODO</step>
|
|
63
|
+
</phase>
|
|
64
|
+
|
|
65
|
+
<phase name="3-loop" title="Epic Execution Loop">
|
|
66
|
+
<for-each item="epic" in="pending_epics">
|
|
67
|
+
|
|
68
|
+
<action name="execute-epic">
|
|
69
|
+
Follow dev-epic skill logic:
|
|
70
|
+
- Creates nested TODO for stories
|
|
71
|
+
- Executes all stories + reviews
|
|
72
|
+
- Clears epic TODO when done
|
|
73
|
+
</action>
|
|
74
|
+
|
|
75
|
+
<action name="mark-done">
|
|
76
|
+
Mark epic as completed in sprint TODO
|
|
77
|
+
</action>
|
|
78
|
+
|
|
79
|
+
<action name="epic-review">
|
|
80
|
+
Mark "Review Epic" as in_progress
|
|
81
|
+
Run epic integration tests
|
|
82
|
+
Mark "Review Epic" as completed
|
|
83
|
+
</action>
|
|
84
|
+
|
|
85
|
+
<action name="update-state">
|
|
86
|
+
Edit sprint-status.yaml:
|
|
87
|
+
- Set completed epic status="done"
|
|
88
|
+
- Set next epic status="in-progress"
|
|
89
|
+
</action>
|
|
90
|
+
|
|
91
|
+
<action name="compact">
|
|
92
|
+
Mark next epic as in_progress in TODO
|
|
93
|
+
Wait for auto-compaction
|
|
94
|
+
Plugin reads sprint TODO → resume
|
|
95
|
+
</action>
|
|
96
|
+
|
|
97
|
+
</for-each>
|
|
98
|
+
</phase>
|
|
99
|
+
|
|
100
|
+
<phase name="4-finalize" title="Finalize Sprint">
|
|
101
|
+
<step n="1">Run sprint integration tests (mark in TODO)</step>
|
|
102
|
+
<step n="2">Set sprint status="done" in sprint-status.yaml</step>
|
|
103
|
+
<step n="3">Clear sprint TODO list</step>
|
|
104
|
+
<step n="4">Report completion with summary + metrics</step>
|
|
105
|
+
</phase>
|
|
106
|
+
|
|
107
|
+
</workflow>
|
|
108
|
+
|
|
109
|
+
<outputs>
|
|
110
|
+
- Implementation code for all stories in sprint
|
|
111
|
+
- Updated sprint-status.yaml
|
|
112
|
+
- Clean TODO list (all completed)
|
|
113
|
+
</outputs>
|
|
114
|
+
|
|
115
|
+
<rules>
|
|
116
|
+
<do>Create ONE master TODO list for entire sprint at start</do>
|
|
117
|
+
<do>Let dev-epic skill manage its own nested TODO</do>
|
|
118
|
+
<dont>Ask for confirmation between epics — sprint TODO is your guide</dont>
|
|
119
|
+
<dont>Proceed to next epic if epic review fails — HALT and report</dont>
|
|
120
|
+
</rules>
|
|
@@ -11,53 +11,82 @@ metadata:
|
|
|
11
11
|
|
|
12
12
|
# Dev Story Skill
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
## CRITICAL: Context Rules
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
**READ ONLY (max ~70KB):**
|
|
17
|
+
- `CLAUDE.md`
|
|
18
|
+
- `docs/coding-standards/README.md`
|
|
19
|
+
- `docs/coding-standards/patterns.md`
|
|
20
|
+
- Story file
|
|
17
21
|
|
|
18
|
-
|
|
22
|
+
**❌ DO NOT READ — WASTES CONTEXT:**
|
|
23
|
+
- ❌ `docs/prd.md` — story already has context
|
|
24
|
+
- ❌ `docs/architecture.md` — too large, coding-standards has patterns
|
|
19
25
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
Story has "Required Reading" and task has "Read First":
|
|
23
|
-
1. Open each linked document
|
|
24
|
-
2. Find the specific sections mentioned
|
|
25
|
-
3. Extract patterns, signatures, constraints
|
|
26
|
-
|
|
27
|
-
### Step 2: Find Existing Code
|
|
28
|
-
|
|
29
|
-
From "Read First" paths:
|
|
30
|
-
1. Read existing similar code (e.g., "existing service example")
|
|
31
|
-
2. Note the structure, imports, error handling
|
|
32
|
-
3. This becomes "Pattern Reference" for @coder
|
|
33
|
-
|
|
34
|
-
### Step 3: Build Context
|
|
35
|
-
|
|
36
|
-
@coder doesn't see story. Provide:
|
|
37
|
-
- **Existing files** - actual paths with what they contain
|
|
38
|
-
- **Patterns to follow** - link to existing similar code
|
|
39
|
-
- **What was done** - results of previous tasks this depends on
|
|
40
|
-
- **Imports** - what packages to use
|
|
41
|
-
|
|
42
|
-
### Step 4: Add Direction
|
|
43
|
-
|
|
44
|
-
Story has "Approach" with high-level steps. Expand with:
|
|
45
|
-
- Interface signatures (method names, params, return types)
|
|
46
|
-
- Error handling approach (what errors to return)
|
|
47
|
-
- Validation rules (what to validate)
|
|
48
|
-
- Constraints from documentation
|
|
49
|
-
|
|
50
|
-
### Step 5: Make Verification Concrete
|
|
51
|
-
|
|
52
|
-
Story has "Done when". Add:
|
|
53
|
-
- Specific test commands to run
|
|
54
|
-
- Files that must compile
|
|
55
|
-
- Test coverage expectations
|
|
56
|
-
|
|
57
|
-
## Formulating Task for @coder
|
|
26
|
+
---
|
|
58
27
|
|
|
59
|
-
|
|
60
|
-
|
|
28
|
+
<workflow name="dev-story">
|
|
29
|
+
|
|
30
|
+
<phase name="1-context" title="Load Minimal Context">
|
|
31
|
+
<critical>DO NOT read prd.md or architecture.md!</critical>
|
|
32
|
+
<read>
|
|
33
|
+
<file>CLAUDE.md</file>
|
|
34
|
+
<file>docs/coding-standards/README.md</file>
|
|
35
|
+
<file>docs/coding-standards/patterns.md</file>
|
|
36
|
+
<file>{story-file}</file>
|
|
37
|
+
</read>
|
|
38
|
+
<goal>~70KB context, NOT 200KB+</goal>
|
|
39
|
+
</phase>
|
|
40
|
+
|
|
41
|
+
<phase name="2-transform" title="Transform Story Task → Executable Instruction">
|
|
42
|
+
<step n="1" name="read-docs">
|
|
43
|
+
Story has "Required Reading", task has "Read First".
|
|
44
|
+
Open each → find sections → extract patterns, signatures, constraints.
|
|
45
|
+
</step>
|
|
46
|
+
<step n="2" name="find-patterns">
|
|
47
|
+
From "Read First" paths, find existing similar code.
|
|
48
|
+
Note structure, imports, error handling → becomes "Pattern Reference".
|
|
49
|
+
</step>
|
|
50
|
+
<step n="3" name="build-context">
|
|
51
|
+
@coder doesn't see story. Provide:
|
|
52
|
+
- Existing files (paths + what they contain)
|
|
53
|
+
- Patterns to follow (link to similar code)
|
|
54
|
+
- What was done (results of previous tasks)
|
|
55
|
+
- Imports (what packages to use)
|
|
56
|
+
</step>
|
|
57
|
+
<step n="4" name="add-direction">
|
|
58
|
+
Story has "Approach". Expand with:
|
|
59
|
+
- Interface signatures (method names, params, return types)
|
|
60
|
+
- Error handling (what errors to return)
|
|
61
|
+
- Validation rules
|
|
62
|
+
</step>
|
|
63
|
+
<step n="5" name="verification">
|
|
64
|
+
Story has "Done when". Add:
|
|
65
|
+
- Specific test commands
|
|
66
|
+
- Files that must compile
|
|
67
|
+
- Test coverage expectations
|
|
68
|
+
</step>
|
|
69
|
+
</phase>
|
|
70
|
+
|
|
71
|
+
<phase name="3-delegate" title="Delegate to @coder">
|
|
72
|
+
<action>Formulate task using template below</action>
|
|
73
|
+
<action>Call @coder with full context</action>
|
|
74
|
+
<rule>@coder writes code. Give direction, NOT solution.</rule>
|
|
75
|
+
</phase>
|
|
76
|
+
|
|
77
|
+
<phase name="4-verify" title="Verify & Mark Done">
|
|
78
|
+
<action>Run tests</action>
|
|
79
|
+
<action>Check "Done when" criteria</action>
|
|
80
|
+
<action>Mark task ✅ in story file</action>
|
|
81
|
+
<next>Next task or story complete</next>
|
|
82
|
+
</phase>
|
|
83
|
+
|
|
84
|
+
</workflow>
|
|
85
|
+
|
|
86
|
+
## Task Template for @coder
|
|
87
|
+
|
|
88
|
+
<template name="coder-task">
|
|
89
|
+
```markdown
|
|
61
90
|
## Task: [Name] (Task IDs)
|
|
62
91
|
|
|
63
92
|
[One line goal]
|
|
@@ -66,89 +95,67 @@ Structure:
|
|
|
66
95
|
- Use `doc-todo` for TODO comments
|
|
67
96
|
|
|
68
97
|
### Context
|
|
69
|
-
- [Existing file]: [
|
|
70
|
-
-
|
|
71
|
-
- Existing pattern: [Path to similar code to follow]
|
|
98
|
+
- [Existing file]: [what to use from it]
|
|
99
|
+
- Existing pattern: [path to similar code]
|
|
72
100
|
|
|
73
101
|
### Output Files
|
|
74
|
-
- [
|
|
102
|
+
- [path/to/create.ext]
|
|
75
103
|
|
|
76
104
|
### Requirements
|
|
77
|
-
[
|
|
105
|
+
1. [What to implement with signatures]
|
|
106
|
+
2. [Another requirement]
|
|
78
107
|
|
|
79
108
|
### Pattern Reference
|
|
80
|
-
[
|
|
109
|
+
→ [path/to/similar/code.ext]
|
|
81
110
|
|
|
82
111
|
### Error Handling
|
|
83
112
|
[How to handle errors]
|
|
84
113
|
|
|
85
114
|
### Done When
|
|
86
|
-
- [ ] [Specific checkable item]
|
|
87
|
-
- [ ] [Another item]
|
|
88
115
|
- [ ] File compiles
|
|
89
116
|
- [ ] Tests pass
|
|
117
|
+
- [ ] [Specific criterion]
|
|
90
118
|
```
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
-
|
|
109
|
-
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
**DO NOT give ready code. Give direction.**
|
|
135
|
-
|
|
136
|
-
✅ **DO provide:**
|
|
137
|
-
- Links to existing code as pattern reference
|
|
138
|
-
- Interface signatures (method names, params, return types)
|
|
139
|
-
- Requirements (what logic to implement)
|
|
140
|
-
- Error handling approach
|
|
141
|
-
- Validation rules
|
|
142
|
-
|
|
143
|
-
❌ **DO NOT provide:**
|
|
144
|
-
- Full method implementations
|
|
145
|
-
- Ready-to-copy code blocks
|
|
146
|
-
- Complete structs with all logic
|
|
147
|
-
|
|
148
|
-
**@coder writes the implementation.** Give direction, not solution.
|
|
149
|
-
|
|
150
|
-
## Methodology
|
|
151
|
-
|
|
152
|
-
Include in task based on config.yaml:
|
|
153
|
-
- **TDD**: "Write failing test first, then implement"
|
|
154
|
-
- **STUB**: "Create stub first, write tests, then real implementation"
|
|
119
|
+
</template>
|
|
120
|
+
|
|
121
|
+
<rules name="delegation">
|
|
122
|
+
<rule name="parallel">
|
|
123
|
+
Each task gets full context. No shared state. Different files only.
|
|
124
|
+
</rule>
|
|
125
|
+
<rule name="no-code">
|
|
126
|
+
Give direction, NOT solution. @coder writes implementation.
|
|
127
|
+
</rule>
|
|
128
|
+
<rule name="methodology">
|
|
129
|
+
TDD: "Write failing test first, then implement"
|
|
130
|
+
STUB: "Create stub first, write tests, then implement"
|
|
131
|
+
</rule>
|
|
132
|
+
</rules>
|
|
133
|
+
|
|
134
|
+
<task-boundaries>
|
|
135
|
+
<good>Logically complete unit (service, handler, entity). Single responsibility. Testable independently.</good>
|
|
136
|
+
<split-when>Multiple unrelated responsibilities. No logical connection.</split-when>
|
|
137
|
+
<combine-when>Too granular. Same file, same concern.</combine-when>
|
|
138
|
+
</task-boundaries>
|
|
139
|
+
|
|
140
|
+
<patterns>
|
|
141
|
+
<pattern name="new-service">
|
|
142
|
+
Context: domain entities, repository interface, existing service
|
|
143
|
+
Requirements: interface, constructor, methods
|
|
144
|
+
Pattern: existing service structure
|
|
145
|
+
</pattern>
|
|
146
|
+
<pattern name="new-handler">
|
|
147
|
+
Context: service interface, DTOs, existing handler
|
|
148
|
+
Requirements: handler struct, methods, error mapping
|
|
149
|
+
Pattern: existing handler structure
|
|
150
|
+
</pattern>
|
|
151
|
+
<pattern name="new-tests">
|
|
152
|
+
Context: code to test, existing test examples
|
|
153
|
+
Requirements: test scenarios, mocks
|
|
154
|
+
Pattern: existing test structure
|
|
155
|
+
</pattern>
|
|
156
|
+
</patterns>
|
|
157
|
+
|
|
158
|
+
<critical>
|
|
159
|
+
✅ PROVIDE: pattern references, interface signatures, requirements, error approach
|
|
160
|
+
❌ DO NOT: full implementations, ready-to-copy code, complete structs
|
|
161
|
+
</critical>
|
|
@@ -183,6 +183,8 @@ Table + dependency diagram:
|
|
|
183
183
|
| S01-01 | Task Domain | M | → Unit: `Task` | ⬜ |
|
|
184
184
|
| S01-02 | Task Repository | M | → Unit: `Task` | ⬜ |
|
|
185
185
|
|
|
186
|
+
**Size Guide:** Prefer S→M or M. (S=2-4 tasks, M=4-8 tasks, L=8+ tasks)
|
|
187
|
+
|
|
186
188
|
```
|
|
187
189
|
S01 ──► S02 ──► S03
|
|
188
190
|
```
|
|
@@ -70,7 +70,7 @@ Use template at: `@.opencode/skills/story-writing/template.md`
|
|
|
70
70
|
id: {{PREFIX}}-S{{E}}-{{N}}
|
|
71
71
|
epic: {{PREFIX}}-E{{E}}
|
|
72
72
|
status: draft | ready | in_progress | review | done
|
|
73
|
-
size: S | M | L
|
|
73
|
+
size: S | M | L # Prefer S→M or M. S=2-4 tasks, M=4-8 tasks, L=8+ tasks
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
### 2. Goal
|