@comfanion/workflow 4.38.0-dev.1 → 4.38.1-dev.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comfanion/workflow",
3
- "version": "4.38.0-dev.1",
3
+ "version": "4.38.1-dev.1",
4
4
  "description": "Initialize OpenCode Workflow system for AI-assisted development with semantic code search",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "4.38.0-dev.1",
3
- "buildDate": "2026-01-26T23:39:37.098Z",
2
+ "version": "4.38.1-dev.1",
3
+ "buildDate": "2026-01-27T01:03:19.105Z",
4
4
  "files": [
5
5
  "config.yaml",
6
6
  "FLOW.yaml",
@@ -5,165 +5,15 @@ agent: dev
5
5
 
6
6
  # /dev-epic Command
7
7
 
8
- Implement entire epic by executing all stories with automatic compaction and context preservation.
8
+ Implement an entire epic by following the `dev-epic` skill.
9
9
 
10
10
  ## Process
11
11
 
12
- ### Phase 1: Epic Setup
13
- 1. Find or load epic file (from path or sprint-status.yaml)
14
- 2. Parse all story references from epic
15
- 3. Load project context (CLAUDE.md, docs/prd.md, docs/architecture.md)
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-story` - Story implementation workflow
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 executing all epics with automatic compaction.
8
+ Implement an entire sprint by following the `dev-sprint` skill.
9
9
 
10
10
  ## Process
11
11
 
12
- ### Phase 1: Sprint Setup
13
- 1. Find sprint (from number or sprint-status.yaml)
14
- 2. Read `sprint-status.yaml`
15
- 3. Parse all epics in sprint
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-story` - Story implementation workflow
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
- 3. **Create TODO list from story tasks** (for progress tracking)
17
- 4. Mark story as `in-progress`
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
- - Estimated time < 2 hours
22
+ - T-shirt size: S or M
23
23
 
24
24
  ## Quick Workflow
25
25
 
26
26
  ```
27
27
  ┌────────────────────┐
28
- │ 1. Quick Doc │ Create minimal change 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 │ Make the change
35
- │ (varies) │
33
+ │ 2. Implement [S-M] │ Make the change
36
34
  └────────┬───────────┘
37
35
 
38
36
 
39
37
  ┌────────────────────┐
40
- │ 3. Test & Verify │ Verify it works
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
- **Estimated Time:** [X] minutes/hours
119
+ **Size:** S / M
123
120
 
124
121
  ### Files to Modify
125
122
 
@@ -164,7 +164,6 @@ development:
164
164
 
165
165
  # Task structure
166
166
  task:
167
- max_hours: 2 # Maximum hours per atomic task
168
167
  include_tests: true # Each task includes test as validation
169
168
  require_interface: true # Interface defined before implementation
170
169
 
@@ -4,9 +4,7 @@
4
4
  "instructions": [
5
5
  "AGENTS.md",
6
6
  ".opencode/FLOW.yaml",
7
- ".opencode/config.yaml",
8
- "docs/prd.md",
9
- "docs/architecture.md"
7
+ ".opencode/config.yaml"
10
8
  ],
11
9
 
12
10
  "agent": {
@@ -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
- "docs/coding-standards/testing.md",
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/prd.md",
119
- "docs/architecture.md",
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/prd.md",
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: Modular Documentation
16
+ ## Core Principle: README.md is the Main File
17
17
 
18
- **CRITICAL RULE:** Each file MUST be under 2000 lines. Split into multiple files when needed.
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 (Index)
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
- ## Quick Reference
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
- | Topic | Document | Key Rules |
50
- |-------|----------|-----------|
51
- | Project Layout | [project-structure.md](./project-structure.md) | Modules, structure |
52
- | Go Code | [go-standards.md](./go-standards.md) | Naming, errors, imports |
53
- | Testing | [testing-standards.md](./testing-standards.md) | 80% coverage, table-driven |
54
- | API | [api-standards.md](./api-standards.md) | REST, error format |
55
- | Database | [database-standards.md](./database-standards.md) | Migrations, SQLC |
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
- ## Critical Rules (MUST follow)
95
+ ### Error Handling
96
+ [Example of error handling pattern]
61
97
 
62
- 1. [Most important rule]
63
- 2. [Second most important]
64
- 3. [Third most important]
98
+ ## Critical Rules
65
99
 
66
- ## Getting Started
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
- New to the project? Read in this order:
69
- 1. [project-structure.md](./project-structure.md)
70
- 2. [[language]-standards.md](./)
71
- 3. [architecture-patterns.md](./architecture-patterns.md)
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,110 @@
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
+ <workflow name="dev-epic">
13
+
14
+ <phase name="1-context" title="Load Minimal Context">
15
+ <read>
16
+ <file>CLAUDE.md</file>
17
+ <file>docs/coding-standards/README.md</file>
18
+ <file>docs/coding-standards/patterns.md</file>
19
+ <file>{epic-file}</file>
20
+ <file>{current-story-file}</file>
21
+ </read>
22
+ <skip reason="too large, epic/story has context">
23
+ <file>docs/prd.md</file>
24
+ <file>docs/architecture.md</file>
25
+ <file>all stories at once</file>
26
+ </skip>
27
+ <goal>~70KB per story</goal>
28
+ </phase>
29
+
30
+ <phase name="2-init" title="Initialize Epic">
31
+ <step n="1">Parse epic file → extract story list</step>
32
+ <step n="2">Create epic state: docs/sprint-artifacts/sprint-N/.sprint-state/epic-XX-state.yaml</step>
33
+ <step n="3">Create TODO list:
34
+ ```
35
+ [ ] Story 1: [Title]
36
+ [ ] Review Story 1
37
+ [ ] Story 2: [Title]
38
+ [ ] Review Story 2
39
+ ...
40
+ [ ] Epic integration tests
41
+ [ ] Verify epic AC
42
+ ```
43
+ </step>
44
+ <step n="4">Set state: status="in-progress", next_action="Execute [first-story.md]"</step>
45
+ <step n="5">Mark first story as in_progress in TODO</step>
46
+ </phase>
47
+
48
+ <phase name="3-loop" title="Story Execution Loop">
49
+ <for-each item="story" in="pending_stories">
50
+
51
+ <action name="execute-story">
52
+ Follow /dev-story logic:
53
+ - Create nested TODO for tasks
54
+ - Implement all tasks (RED/GREEN/REFACTOR)
55
+ - Clear task TODO when done
56
+ </action>
57
+
58
+ <action name="mark-done">
59
+ Mark story as completed in epic TODO
60
+ </action>
61
+
62
+ <action name="review">
63
+ Mark "Review Story" as in_progress
64
+ Invoke @reviewer
65
+ <if condition="CHANGES_REQUESTED">
66
+ Add fix tasks → re-execute → re-review (max 3 attempts)
67
+ </if>
68
+ <if condition="APPROVED">
69
+ Mark "Review Story" as completed
70
+ </if>
71
+ </action>
72
+
73
+ <action name="update-state">
74
+ Edit epic state file:
75
+ - Move story to completed_stories
76
+ - Increment current_story_index
77
+ - Set next_action to next story
78
+ </action>
79
+
80
+ <action name="compact">
81
+ Mark next story as in_progress in TODO
82
+ Wait for auto-compaction
83
+ Plugin reads TODO + state → resume
84
+ </action>
85
+
86
+ </for-each>
87
+ </phase>
88
+
89
+ <phase name="4-finalize" title="Finalize Epic">
90
+ <step n="1">Run epic integration tests (mark in TODO)</step>
91
+ <step n="2">Verify all AC from epic file (mark in TODO)</step>
92
+ <step n="3">Set state: status="done"</step>
93
+ <step n="4">Clear epic TODO list</step>
94
+ <step n="5">Report completion with summary</step>
95
+ </phase>
96
+
97
+ </workflow>
98
+
99
+ <outputs>
100
+ - Implementation code for all stories
101
+ - Updated epic-XX-state.yaml
102
+ - Clean TODO list (all completed)
103
+ </outputs>
104
+
105
+ <rules>
106
+ <do>Create clean TODO list for each epic</do>
107
+ <do>Update epic state file BEFORE compaction</do>
108
+ <dont>Ask user for confirmation between stories — TODO is your guide</dont>
109
+ <dont>Proceed to next story if review fails — enter fix loop</dont>
110
+ </rules>
@@ -0,0 +1,106 @@
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
+ <workflow name="dev-sprint">
13
+
14
+ <phase name="1-context" title="Load Minimal Context">
15
+ <read>
16
+ <file>CLAUDE.md</file>
17
+ <file>docs/coding-standards/README.md</file>
18
+ <file>docs/coding-standards/patterns.md</file>
19
+ <file>sprint-status.yaml</file>
20
+ <file>{current-epic-file}</file>
21
+ <file>{current-story-file}</file>
22
+ </read>
23
+ <skip reason="too large, epic/story has context">
24
+ <file>docs/prd.md</file>
25
+ <file>docs/architecture.md</file>
26
+ <file>all epics/stories at once</file>
27
+ </skip>
28
+ <goal>~70KB per story</goal>
29
+ </phase>
30
+
31
+ <phase name="2-init" title="Initialize Sprint">
32
+ <step n="1">Parse sprint-status.yaml → extract epic list for target sprint</step>
33
+ <step n="2">Create master TODO list:
34
+ ```
35
+ [ ] Epic 1: [Title]
36
+ [ ] Story 1-1: [Title]
37
+ [ ] Review Story 1-1
38
+ [ ] Story 1-2: [Title]
39
+ [ ] Review Story 1-2
40
+ [ ] Review Epic 1
41
+ [ ] Epic 2: [Title]
42
+ [ ] Story 2-1: [Title]
43
+ ...
44
+ [ ] Sprint integration tests
45
+ ```
46
+ </step>
47
+ <step n="3">Set sprint status="in-progress" in sprint-status.yaml</step>
48
+ <step n="4">Mark first epic as in_progress in TODO</step>
49
+ </phase>
50
+
51
+ <phase name="3-loop" title="Epic Execution Loop">
52
+ <for-each item="epic" in="pending_epics">
53
+
54
+ <action name="execute-epic">
55
+ Follow dev-epic skill logic:
56
+ - Creates nested TODO for stories
57
+ - Executes all stories + reviews
58
+ - Clears epic TODO when done
59
+ </action>
60
+
61
+ <action name="mark-done">
62
+ Mark epic as completed in sprint TODO
63
+ </action>
64
+
65
+ <action name="epic-review">
66
+ Mark "Review Epic" as in_progress
67
+ Run epic integration tests
68
+ Mark "Review Epic" as completed
69
+ </action>
70
+
71
+ <action name="update-state">
72
+ Edit sprint-status.yaml:
73
+ - Set completed epic status="done"
74
+ - Set next epic status="in-progress"
75
+ </action>
76
+
77
+ <action name="compact">
78
+ Mark next epic as in_progress in TODO
79
+ Wait for auto-compaction
80
+ Plugin reads sprint TODO → resume
81
+ </action>
82
+
83
+ </for-each>
84
+ </phase>
85
+
86
+ <phase name="4-finalize" title="Finalize Sprint">
87
+ <step n="1">Run sprint integration tests (mark in TODO)</step>
88
+ <step n="2">Set sprint status="done" in sprint-status.yaml</step>
89
+ <step n="3">Clear sprint TODO list</step>
90
+ <step n="4">Report completion with summary + metrics</step>
91
+ </phase>
92
+
93
+ </workflow>
94
+
95
+ <outputs>
96
+ - Implementation code for all stories in sprint
97
+ - Updated sprint-status.yaml
98
+ - Clean TODO list (all completed)
99
+ </outputs>
100
+
101
+ <rules>
102
+ <do>Create ONE master TODO list for entire sprint at start</do>
103
+ <do>Let dev-epic skill manage its own nested TODO</do>
104
+ <dont>Ask for confirmation between epics — sprint TODO is your guide</dont>
105
+ <dont>Proceed to next epic if epic review fails — HALT and report</dont>
106
+ </rules>
@@ -11,53 +11,71 @@ metadata:
11
11
 
12
12
  # Dev Story Skill
13
13
 
14
- How to transform story tasks into executable instructions for @coder.
15
-
16
- ## Task Transformation
17
-
18
- Story task is specification with Approach steps. Transform it into executable instruction with full context.
19
-
20
- ### Step 1: Read Required Reading
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
58
-
59
- Structure:
60
- ```
14
+ <workflow name="dev-story">
15
+
16
+ <phase name="1-context" title="Load Minimal Context">
17
+ <read>
18
+ <file>CLAUDE.md</file>
19
+ <file>docs/coding-standards/README.md</file>
20
+ <file>docs/coding-standards/patterns.md</file>
21
+ <file>{story-file}</file>
22
+ </read>
23
+ <skip reason="too large, story has context">
24
+ <file>docs/prd.md</file>
25
+ <file>docs/architecture.md</file>
26
+ </skip>
27
+ <goal>~70KB context, not 200KB+</goal>
28
+ </phase>
29
+
30
+ <phase name="2-transform" title="Transform Story Task Executable Instruction">
31
+ <step n="1" name="read-docs">
32
+ Story has "Required Reading", task has "Read First".
33
+ Open each → find sections → extract patterns, signatures, constraints.
34
+ </step>
35
+ <step n="2" name="find-patterns">
36
+ From "Read First" paths, find existing similar code.
37
+ Note structure, imports, error handling becomes "Pattern Reference".
38
+ </step>
39
+ <step n="3" name="build-context">
40
+ @coder doesn't see story. Provide:
41
+ - Existing files (paths + what they contain)
42
+ - Patterns to follow (link to similar code)
43
+ - What was done (results of previous tasks)
44
+ - Imports (what packages to use)
45
+ </step>
46
+ <step n="4" name="add-direction">
47
+ Story has "Approach". Expand with:
48
+ - Interface signatures (method names, params, return types)
49
+ - Error handling (what errors to return)
50
+ - Validation rules
51
+ </step>
52
+ <step n="5" name="verification">
53
+ Story has "Done when". Add:
54
+ - Specific test commands
55
+ - Files that must compile
56
+ - Test coverage expectations
57
+ </step>
58
+ </phase>
59
+
60
+ <phase name="3-delegate" title="Delegate to @coder">
61
+ <action>Formulate task using template below</action>
62
+ <action>Call @coder with full context</action>
63
+ <rule>@coder writes code. Give direction, NOT solution.</rule>
64
+ </phase>
65
+
66
+ <phase name="4-verify" title="Verify & Mark Done">
67
+ <action>Run tests</action>
68
+ <action>Check "Done when" criteria</action>
69
+ <action>Mark task ✅ in story file</action>
70
+ <next>Next task or story complete</next>
71
+ </phase>
72
+
73
+ </workflow>
74
+
75
+ ## Task Template for @coder
76
+
77
+ <template name="coder-task">
78
+ ```markdown
61
79
  ## Task: [Name] (Task IDs)
62
80
 
63
81
  [One line goal]
@@ -66,89 +84,67 @@ Structure:
66
84
  - Use `doc-todo` for TODO comments
67
85
 
68
86
  ### Context
69
- - [Existing file]: [What it contains, what to use from it]
70
- - [Another file]: [Description]
71
- - Existing pattern: [Path to similar code to follow]
87
+ - [Existing file]: [what to use from it]
88
+ - Existing pattern: [path to similar code]
72
89
 
73
90
  ### Output Files
74
- - [Path to create/modify]
91
+ - [path/to/create.ext]
75
92
 
76
93
  ### Requirements
77
- [Numbered list of what to implement with signatures/details]
94
+ 1. [What to implement with signatures]
95
+ 2. [Another requirement]
78
96
 
79
97
  ### Pattern Reference
80
- [Link to existing similar code to follow, NOT ready implementation]
98
+ [path/to/similar/code.ext]
81
99
 
82
100
  ### Error Handling
83
101
  [How to handle errors]
84
102
 
85
103
  ### Done When
86
- - [ ] [Specific checkable item]
87
- - [ ] [Another item]
88
104
  - [ ] File compiles
89
105
  - [ ] Tests pass
106
+ - [ ] [Specific criterion]
90
107
  ```
91
-
92
- ## Parallel Tasks
93
-
94
- When delegating multiple tasks in one message:
95
- 1. Each task gets full context (don't assume @coder remembers)
96
- 2. Clearly separate tasks with headers
97
- 3. No shared state between parallel tasks
98
- 4. Tasks must work on different files
99
-
100
- ## Task Boundaries
101
-
102
- **Good task:**
103
- - Logically complete unit (service, handler, entity, feature)
104
- - Clear single responsibility
105
- - Can be tested independently
106
-
107
- **Consider splitting when:**
108
- - Multiple unrelated responsibilities
109
- - No logical connection between parts
110
-
111
- **Consider combining when:**
112
- - Tasks too granular to be meaningful
113
- - Same file, same concern
114
-
115
- ## Common Patterns
116
-
117
- ### New Service
118
- Context: domain entities, repository interface, existing service example
119
- Requirements: interface, constructor, methods
120
- Pattern: existing service structure
121
-
122
- ### New Handler
123
- Context: service interface, DTOs, existing handler example
124
- Requirements: handler struct, methods, error mapping
125
- Pattern: existing handler structure
126
-
127
- ### New Tests
128
- Context: code to test, existing test examples
129
- Requirements: test scenarios, mocks
130
- Pattern: existing test structure
131
-
132
- ## Implementation is @coder's Job
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"
108
+ </template>
109
+
110
+ <rules name="delegation">
111
+ <rule name="parallel">
112
+ Each task gets full context. No shared state. Different files only.
113
+ </rule>
114
+ <rule name="no-code">
115
+ Give direction, NOT solution. @coder writes implementation.
116
+ </rule>
117
+ <rule name="methodology">
118
+ TDD: "Write failing test first, then implement"
119
+ STUB: "Create stub first, write tests, then implement"
120
+ </rule>
121
+ </rules>
122
+
123
+ <task-boundaries>
124
+ <good>Logically complete unit (service, handler, entity). Single responsibility. Testable independently.</good>
125
+ <split-when>Multiple unrelated responsibilities. No logical connection.</split-when>
126
+ <combine-when>Too granular. Same file, same concern.</combine-when>
127
+ </task-boundaries>
128
+
129
+ <patterns>
130
+ <pattern name="new-service">
131
+ Context: domain entities, repository interface, existing service
132
+ Requirements: interface, constructor, methods
133
+ Pattern: existing service structure
134
+ </pattern>
135
+ <pattern name="new-handler">
136
+ Context: service interface, DTOs, existing handler
137
+ Requirements: handler struct, methods, error mapping
138
+ Pattern: existing handler structure
139
+ </pattern>
140
+ <pattern name="new-tests">
141
+ Context: code to test, existing test examples
142
+ Requirements: test scenarios, mocks
143
+ Pattern: existing test structure
144
+ </pattern>
145
+ </patterns>
146
+
147
+ <critical>
148
+ ✅ PROVIDE: pattern references, interface signatures, requirements, error approach
149
+ DO NOT: full implementations, ready-to-copy code, complete structs
150
+ </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