claude-code-workflow 7.2.13 → 7.2.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/.claude/commands/workflow/analyze-with-file.md +61 -40
  2. package/.claude/skills/workflow-lite-plan/SKILL.md +3 -7
  3. package/.codex/skills/analyze-with-file/SKILL.md +1181 -1182
  4. package/.codex/skills/brainstorm/SKILL.md +723 -725
  5. package/.codex/skills/brainstorm-with-file/SKILL.md +10 -5
  6. package/.codex/skills/clean/SKILL.md +33 -26
  7. package/.codex/skills/collaborative-plan-with-file/SKILL.md +830 -831
  8. package/.codex/skills/csv-wave-pipeline/SKILL.md +906 -906
  9. package/.codex/skills/issue-discover/SKILL.md +57 -50
  10. package/.codex/skills/issue-discover/phases/01-issue-new.md +18 -11
  11. package/.codex/skills/issue-discover/phases/02-discover.md +31 -26
  12. package/.codex/skills/issue-discover/phases/03-discover-by-prompt.md +13 -11
  13. package/.codex/skills/issue-discover/phases/04-quick-execute.md +32 -27
  14. package/.codex/skills/parallel-dev-cycle/SKILL.md +402 -402
  15. package/.codex/skills/project-documentation-workflow/SKILL.md +13 -3
  16. package/.codex/skills/roadmap-with-file/SKILL.md +901 -897
  17. package/.codex/skills/session-sync/SKILL.md +222 -212
  18. package/.codex/skills/spec-add/SKILL.md +620 -613
  19. package/.codex/skills/spec-generator/SKILL.md +2 -2
  20. package/.codex/skills/spec-generator/phases/01-5-requirement-clarification.md +10 -10
  21. package/.codex/skills/spec-generator/phases/01-discovery.md +11 -18
  22. package/.codex/skills/spec-generator/phases/02-product-brief.md +5 -5
  23. package/.codex/skills/spec-generator/phases/03-requirements.md +7 -7
  24. package/.codex/skills/spec-generator/phases/04-architecture.md +4 -4
  25. package/.codex/skills/spec-generator/phases/05-epics-stories.md +5 -6
  26. package/.codex/skills/spec-generator/phases/06-readiness-check.md +10 -17
  27. package/.codex/skills/spec-generator/phases/07-issue-export.md +326 -329
  28. package/.codex/skills/spec-setup/SKILL.md +669 -657
  29. package/.codex/skills/team-arch-opt/SKILL.md +50 -50
  30. package/.codex/skills/team-arch-opt/agents/completion-handler.md +3 -3
  31. package/.codex/skills/team-brainstorm/SKILL.md +724 -725
  32. package/.codex/skills/team-coordinate/SKILL.md +51 -51
  33. package/.codex/skills/team-coordinate/agents/completion-handler.md +3 -3
  34. package/.codex/skills/team-coordinate/agents/plan-reviewer.md +4 -4
  35. package/.codex/skills/team-designer/SKILL.md +691 -691
  36. package/.codex/skills/team-designer/agents/requirement-clarifier.md +11 -12
  37. package/.codex/skills/team-executor/SKILL.md +45 -45
  38. package/.codex/skills/team-frontend/SKILL.md +45 -45
  39. package/.codex/skills/team-frontend/agents/completion-handler.md +3 -3
  40. package/.codex/skills/team-frontend/agents/qa-gate-reviewer.md +4 -4
  41. package/.codex/skills/team-frontend-debug/SKILL.md +50 -50
  42. package/.codex/skills/team-frontend-debug/agents/completion-handler.md +3 -3
  43. package/.codex/skills/team-frontend-debug/agents/conditional-skip-gate.md +4 -4
  44. package/.codex/skills/team-issue/SKILL.md +751 -740
  45. package/.codex/skills/team-iterdev/SKILL.md +825 -826
  46. package/.codex/skills/team-lifecycle-v4/SKILL.md +775 -775
  47. package/.codex/skills/team-lifecycle-v4/agents/quality-gate.md +165 -165
  48. package/.codex/skills/team-lifecycle-v4/agents/requirement-clarifier.md +163 -163
  49. package/.codex/skills/team-perf-opt/SKILL.md +50 -50
  50. package/.codex/skills/team-perf-opt/agents/completion-handler.md +3 -3
  51. package/.codex/skills/team-planex-v2/SKILL.md +652 -637
  52. package/.codex/skills/team-quality-assurance/SKILL.md +51 -52
  53. package/.codex/skills/team-review/SKILL.md +40 -40
  54. package/.codex/skills/team-roadmap-dev/SKILL.md +51 -51
  55. package/.codex/skills/team-roadmap-dev/agents/roadmap-discusser.md +8 -8
  56. package/.codex/skills/team-tech-debt/SKILL.md +50 -50
  57. package/.codex/skills/team-tech-debt/agents/plan-approver.md +5 -5
  58. package/.codex/skills/team-testing/SKILL.md +51 -52
  59. package/.codex/skills/team-uidesign/SKILL.md +40 -40
  60. package/.codex/skills/team-uidesign/agents/completion-handler.md +177 -177
  61. package/.codex/skills/team-ultra-analyze/SKILL.md +786 -787
  62. package/.codex/skills/team-ultra-analyze/agents/discussion-feedback.md +8 -8
  63. package/.codex/skills/team-ux-improve/SKILL.md +51 -52
  64. package/.codex/skills/team-ux-improve/agents/ux-designer.md +2 -2
  65. package/.codex/skills/team-ux-improve/agents/ux-explorer.md +1 -1
  66. package/.codex/skills/unified-execute-with-file/SKILL.md +797 -796
  67. package/.codex/skills/workflow-execute/SKILL.md +1117 -1118
  68. package/.codex/skills/workflow-lite-planex/SKILL.md +1144 -1141
  69. package/.codex/skills/workflow-plan/SKILL.md +631 -636
  70. package/.codex/skills/workflow-tdd-plan/SKILL.md +753 -759
  71. package/.codex/skills/workflow-test-fix-cycle/SKILL.md +402 -392
  72. package/README.md +25 -0
  73. package/ccw/dist/commands/install.d.ts.map +1 -1
  74. package/ccw/dist/commands/install.js +12 -0
  75. package/ccw/dist/commands/install.js.map +1 -1
  76. package/package.json +1 -1
@@ -1,402 +1,402 @@
1
- ---
2
- name: parallel-dev-cycle
3
- description: Multi-agent parallel development cycle with requirement analysis, exploration planning, code development, and validation. Orchestration runs inline in main flow (no separate orchestrator agent). Supports continuous iteration with markdown progress documentation. Triggers on "parallel-dev-cycle".
4
- allowed-tools: spawn_agent, wait, send_input, close_agent, AskUserQuestion, Read, Write, Edit, Bash, Glob, Grep
5
- ---
6
-
7
- # Parallel Dev Cycle
8
-
9
- Multi-agent parallel development cycle using Codex subagent pattern with four specialized workers:
10
- 1. **Requirements Analysis & Extension** (RA) - Requirement analysis and self-enhancement
11
- 2. **Exploration & Planning** (EP) - Codebase exploration and implementation planning
12
- 3. **Code Development** (CD) - Code development with debug strategy support
13
- 4. **Validation & Archival Summary** (VAS) - Validation and archival summary
14
-
15
- Orchestration logic (phase management, state updates, feedback coordination) runs **inline in the main flow** — no separate orchestrator agent is spawned. Only 4 worker agents are allocated.
16
-
17
- Each agent **maintains one main document** (e.g., requirements.md, plan.json, implementation.md) that is completely rewritten per iteration, plus auxiliary logs (changes.log, debug-log.ndjson) that are append-only.
18
-
19
- ## Architecture Overview
20
-
21
- ```
22
- ┌─────────────────────────────────────────────────────────────┐
23
- │ User Input (Task) │
24
- └────────────────────────────┬────────────────────────────────┘
25
-
26
- v
27
- ┌──────────────────────────────┐
28
- │ Main Flow (Inline Orchestration) │
29
- │ Phase 1 → 2 → 3 → 4 │
30
- └──────────────────────────────┘
31
-
32
- ┌────────────────────┼────────────────────┐
33
- │ │ │
34
- v v v
35
- ┌────────┐ ┌────────┐ ┌────────┐
36
- │ RA │ │ EP │ │ CD │
37
- │Agent │ │Agent │ │Agent │
38
- └────────┘ └────────┘ └────────┘
39
- │ │ │
40
- └────────────────────┼────────────────────┘
41
-
42
- v
43
- ┌────────┐
44
- │ VAS │
45
- │ Agent │
46
- └────────┘
47
-
48
- v
49
- ┌──────────────────────────────┐
50
- │ Summary Report │
51
- │ & Markdown Docs │
52
- └──────────────────────────────┘
53
- ```
54
-
55
- ## Key Design Principles
56
-
57
- 1. **Main Document + Auxiliary Logs**: Each agent maintains one main document (rewritten per iteration) and auxiliary logs (append-only)
58
- 2. **Version-Based Overwrite**: Main documents completely rewritten per version; logs append-only
59
- 3. **Automatic Archival**: Old main document versions automatically archived to `history/` directory
60
- 4. **Complete Audit Trail**: Changes.log (NDJSON) preserves all change history
61
- 5. **Parallel Coordination**: Four agents launched simultaneously; coordination via shared state and inline main flow
62
- 6. **File References**: Use short file paths instead of content passing
63
- 7. **Self-Enhancement**: RA agent proactively extends requirements based on context
64
- 8. **Shared Discovery Board**: All agents share exploration findings via `discoveries.ndjson` — read on start, write as you discover, eliminating redundant codebase exploration
65
-
66
- ## Arguments
67
-
68
- | Arg | Required | Description |
69
- |-----|----------|-------------|
70
- | TASK | One of TASK or --cycle-id | Task description (for new cycle, mutually exclusive with --cycle-id) |
71
- | --cycle-id | One of TASK or --cycle-id | Existing cycle ID to continue (from API or previous session) |
72
- | --extend | No | Extension description (only valid with --cycle-id) |
73
- | --auto | No | Auto-cycle mode (run all phases sequentially without user confirmation) |
74
- | --parallel | No | Number of parallel agents (default: 4, max: 4) |
75
-
76
- ## Auto Mode
77
-
78
- When `--auto`: Run all phases sequentially without user confirmation between iterations. Use recommended defaults for all decisions. Automatically continue iteration loop until tests pass or max iterations reached.
79
-
80
- ## Prep Package Integration
81
-
82
- When `prep-package.json` exists at `{projectRoot}/.workflow/.cycle/prep-package.json`, Phase 1 consumes it to:
83
- - Use refined task description instead of raw TASK
84
- - Apply auto-iteration config (convergence criteria, phase gates)
85
- - Inject per-iteration agent focus directives (0→1 vs 1→100)
86
-
87
- Prep packages are generated by the interactive prompt `/prompts:prep-cycle`. See [phases/00-prep-checklist.md](phases/00-prep-checklist.md) for schema.
88
-
89
- ## Execution Flow
90
-
91
- ```
92
- Input Parsing:
93
- └─ Parse arguments (TASK | --cycle-id + --extend)
94
- └─ Convert to structured context (cycleId, state, progressDir)
95
-
96
- Phase 1: Session Initialization
97
- └─ Ref: phases/01-session-init.md
98
- ├─ Create new cycle OR resume existing cycle
99
- ├─ Initialize state file and directory structure
100
- └─ Output: cycleId, state, progressDir
101
-
102
- Phase 2: Agent Execution (Parallel)
103
- └─ Ref: phases/02-agent-execution.md
104
- ├─ Tasks attached: Spawn RA → Spawn EP → Spawn CD → Spawn VAS → Wait all
105
- ├─ Spawn RA, EP, CD, VAS agents in parallel
106
- ├─ Wait for all agents with timeout handling
107
- └─ Output: agentOutputs (4 agent results)
108
-
109
- Phase 3: Result Aggregation & Iteration
110
- └─ Ref: phases/03-result-aggregation.md
111
- ├─ Parse PHASE_RESULT from each agent
112
- ├─ Detect issues (test failures, blockers)
113
- ├─ Decision: Issues found AND iteration < max?
114
- │ ├─ Yes → Send feedback via send_input, loop back to Phase 2
115
- │ └─ No → Proceed to Phase 4
116
- └─ Output: parsedResults, iteration status
117
-
118
- Phase 4: Completion & Summary
119
- └─ Ref: phases/04-completion-summary.md
120
- ├─ Generate unified summary report
121
- ├─ Update final state
122
- ├─ Sync session state: $session-sync -y "Dev cycle complete: {iterations} iterations"
123
- ├─ Close all agents
124
- └─ Output: final cycle report with continuation instructions
125
- ```
126
-
127
- **Phase Reference Documents** (read on-demand when phase executes):
128
-
129
- | Phase | Document | Purpose |
130
- |-------|----------|---------|
131
- | 1 | [phases/01-session-init.md](phases/01-session-init.md) | Session creation/resume and state initialization |
132
- | 2 | [phases/02-agent-execution.md](phases/02-agent-execution.md) | Parallel agent spawning and execution |
133
- | 3 | [phases/03-result-aggregation.md](phases/03-result-aggregation.md) | Result parsing, feedback generation, iteration handling |
134
- | 4 | [phases/04-completion-summary.md](phases/04-completion-summary.md) | Final summary generation and cleanup |
135
-
136
- ## Data Flow
137
-
138
- ```
139
- User Input (TASK | --cycle-id + --extend)
140
-
141
- [Parse Arguments]
142
- ↓ cycleId, state, progressDir
143
-
144
- Phase 1: Session Initialization
145
- ↓ cycleId, state, progressDir (initialized/resumed)
146
-
147
- Phase 2: Agent Execution
148
- ├─ All agents read coordination/discoveries.ndjson on start
149
- ├─ Each agent explores → writes new discoveries to board
150
- ├─ Later-finishing agents benefit from earlier agents' findings
151
- ↓ agentOutputs {ra, ep, cd, vas} + shared discoveries.ndjson
152
-
153
- Phase 3: Result Aggregation
154
- ↓ parsedResults, hasIssues, iteration count
155
- ↓ [Loop back to Phase 2 if issues and iteration < max]
156
- ↓ (discoveries.ndjson carries over across iterations)
157
-
158
- Phase 4: Completion & Summary
159
- ↓ finalState, summaryReport
160
-
161
- Return: cycle_id, iterations, final_state
162
- ```
163
-
164
- ## Session Structure
165
-
166
- ```
167
- {projectRoot}/.workflow/.cycle/
168
- ├── {cycleId}.json # Master state file
169
- ├── {cycleId}.progress/
170
- ├── ra/
171
- │ ├── requirements.md # Current version (complete rewrite)
172
- │ ├── changes.log # NDJSON complete history (append-only)
173
- │ └── history/ # Archived snapshots
174
- ├── ep/
175
- │ ├── exploration.md # Codebase exploration report
176
- │ ├── architecture.md # Architecture design
177
- │ ├── plan.json # Structured task list (current version)
178
- │ ├── changes.log # NDJSON complete history
179
- │ └── history/
180
- ├── cd/
181
- │ ├── implementation.md # Current version
182
- │ ├── debug-log.ndjson # Debug hypothesis tracking
183
- │ ├── changes.log # NDJSON complete history
184
- │ └── history/
185
- ├── vas/
186
- │ ├── summary.md # Current version
187
- │ ├── changes.log # NDJSON complete history
188
- │ └── history/
189
- └── coordination/
190
- ├── discoveries.ndjson # Shared discovery board (all agents append)
191
- ├── timeline.md # Execution timeline
192
- └── decisions.log # Decision log
193
- ```
194
-
195
- ## State Management
196
-
197
- Master state file: `{projectRoot}/.workflow/.cycle/{cycleId}.json`
198
-
199
- ```json
200
- {
201
- "cycle_id": "cycle-v1-20260122T100000-abc123",
202
- "title": "Task title",
203
- "description": "Full task description",
204
- "status": "created | running | paused | completed | failed",
205
- "created_at": "ISO8601", "updated_at": "ISO8601",
206
- "max_iterations": 5, "current_iteration": 0,
207
- "agents": {
208
- "ra": { "status": "idle | running | completed | failed", "output_files": [] },
209
- "ep": { "status": "idle", "output_files": [] },
210
- "cd": { "status": "idle", "output_files": [] },
211
- "vas": { "status": "idle", "output_files": [] }
212
- },
213
- "current_phase": "init | ra | ep | cd | vas | aggregation | complete",
214
- "completed_phases": [],
215
- "requirements": null, "plan": null, "changes": [], "test_results": null,
216
- "coordination": { "feedback_log": [], "blockers": [] }
217
- }
218
- ```
219
-
220
- **Recovery**: If state corrupted, rebuild from `.progress/` markdown files and changes.log.
221
-
222
- ## TodoWrite Pattern
223
-
224
- ### Phase-Level Tracking (Tasks Attached)
225
-
226
- ```json
227
- [
228
- {"content": "Phase 1: Session Initialization", "status": "completed"},
229
- {"content": "Phase 2: Agent Execution", "status": "in_progress"},
230
- {"content": " → Spawn RA Agent", "status": "completed"},
231
- {"content": " → Spawn EP Agent", "status": "completed"},
232
- {"content": " → Spawn CD Agent", "status": "in_progress"},
233
- {"content": " → Spawn VAS Agent", "status": "pending"},
234
- {"content": "Phase 3: Result Aggregation", "status": "pending"},
235
- {"content": "Phase 4: Completion & Summary", "status": "pending"}
236
- ]
237
- ```
238
-
239
- ### Phase-Level Tracking (Collapsed)
240
-
241
- ```json
242
- [
243
- {"content": "Phase 1: Session Initialization", "status": "completed"},
244
- {"content": "Phase 2: Agent Execution (4 agents completed)", "status": "completed"},
245
- {"content": "Phase 3: Result Aggregation", "status": "in_progress"},
246
- {"content": "Phase 4: Completion & Summary", "status": "pending"}
247
- ]
248
- ```
249
-
250
- ### Iteration Loop Tracking
251
-
252
- ```json
253
- [
254
- {"content": "Phase 1: Session Initialization", "status": "completed"},
255
- {"content": "Iteration 1: Agent Execution + Aggregation", "status": "completed"},
256
- {"content": "Iteration 2: Feedback → Re-execution → Aggregation", "status": "in_progress"},
257
- {"content": "Phase 4: Completion & Summary", "status": "pending"}
258
- ]
259
- ```
260
-
261
- ## Versioning
262
-
263
- - **1.0.0**: Initial cycle → **1.x.0**: Each iteration (minor bump)
264
- - Each iteration: archive old → complete rewrite → append changes.log
265
-
266
- ```
267
- Archive: copy requirements.md → history/requirements-v1.0.0.md
268
- Rewrite: overwrite requirements.md with v1.1.0 (complete new content)
269
- Append: changes.log ← {"timestamp","version":"1.1.0","action":"update","description":"..."}
270
- ```
271
-
272
- | Agent Output | Rewrite (per iteration) | Append-only |
273
- |-------------|------------------------|-------------|
274
- | RA | requirements.md | changes.log |
275
- | EP | exploration.md, architecture.md, plan.json | changes.log |
276
- | CD | implementation.md, issues.md | changes.log, debug-log.ndjson |
277
- | VAS | summary.md, test-results.json | changes.log |
278
-
279
- ## Coordination Protocol
280
-
281
- **Execution Order**: RA → EP → CD → VAS (dependency chain, all spawned in parallel but block on dependencies)
282
-
283
- ### Shared Discovery Board
284
-
285
- All agents share a real-time discovery board at `coordination/discoveries.ndjson`. Each agent reads it on start and appends findings during work. This eliminates redundant codebase exploration.
286
-
287
- **Lifecycle**:
288
- - Created by the first agent to write a discovery (file may not exist initially)
289
- - Carries over across iterations — never cleared or recreated
290
- - Agents use Bash `echo '...' >> discoveries.ndjson` to append entries
291
-
292
- **Format**: NDJSON, each line is a self-contained JSON with required top-level fields `ts`, `agent`, `type`, `data`:
293
- ```jsonl
294
- {"ts":"2026-01-22T10:00:00+08:00","agent":"ra","type":"tech_stack","data":{"language":"TypeScript","framework":"Express","test":"Jest","build":"tsup"}}
295
- ```
296
-
297
- **Discovery Types**:
298
-
299
- | type | Dedup Key | Writers | Readers | Required `data` Fields |
300
- |------|-----------|---------|---------|----------------------|
301
- | `tech_stack` | singleton | RA | EP, CD, VAS | `language`, `framework`, `test`, `build` |
302
- | `project_config` | `data.path` | RA | EP, CD | `path`, `key_deps[]`, `scripts{}` |
303
- | `existing_feature` | `data.name` | RA, EP | CD | `name`, `files[]`, `summary` |
304
- | `architecture` | singleton | EP | CD, VAS | `pattern`, `layers[]`, `entry` |
305
- | `code_pattern` | `data.name` | EP, CD | CD, VAS | `name`, `description`, `example_file` |
306
- | `integration_point` | `data.file` | EP | CD | `file`, `description`, `exports[]` |
307
- | `similar_impl` | `data.feature` | EP | CD | `feature`, `files[]`, `relevance` |
308
- | `code_convention` | singleton | CD | VAS | `naming`, `imports`, `formatting` |
309
- | `utility` | `data.name` | CD | VAS | `name`, `file`, `usage` |
310
- | `test_command` | singleton | CD, VAS | VAS, CD | `unit`, `integration`(opt), `coverage`(opt) |
311
- | `test_baseline` | singleton | VAS | CD | `total`, `passing`, `coverage_pct`, `framework`, `config` |
312
- | `test_pattern` | singleton | VAS | CD | `style`, `naming`, `fixtures` |
313
- | `blocker` | `data.issue` | any | all | `issue`, `severity`, `impact` |
314
-
315
- **Protocol Rules**:
316
- 1. Read board before own exploration → skip covered areas (if file doesn't exist, skip)
317
- 2. Write discoveries immediately via Bash `echo >>` → don't batch
318
- 3. Deduplicate — check existing entries; skip if same `type` + dedup key value already exists
319
- 4. Append-only — never modify or delete existing lines
320
-
321
- ### Agent → Main Flow Communication
322
- ```
323
- PHASE_RESULT:
324
- - phase: ra | ep | cd | vas
325
- - status: success | failed | partial
326
- - files_written: [list]
327
- - summary: one-line summary
328
- - issues: []
329
- ```
330
-
331
- ### Main Flow → Agent Communication
332
-
333
- Feedback via `send_input` (file refs + issue summary, never full content):
334
- ```
335
- ## FEEDBACK FROM [Source]
336
- [Issue summary with file:line references]
337
- ## Reference
338
- - File: .progress/vas/test-results.json (v1.0.0)
339
- ## Actions Required
340
- 1. [Specific fix]
341
- ```
342
-
343
- **Rules**: Only main flow writes state file. Agents read state, write to own `.progress/{agent}/` directory only.
344
-
345
- ## Core Rules
346
-
347
- 1. **Start Immediately**: First action is TodoWrite initialization, then Phase 1 execution
348
- 2. **Progressive Phase Loading**: Read phase docs ONLY when that phase is about to execute
349
- 3. **Parse Every Output**: Extract PHASE_RESULT data from each agent for next phase
350
- 4. **Auto-Continue**: After each phase, execute next pending phase automatically
351
- 5. **Track Progress**: Update TodoWrite dynamically with attachment/collapse pattern
352
- 6. **Single Writer**: Only main flow writes to master state file; agents report via PHASE_RESULT
353
- 7. **File References**: Pass file paths between agents, not content
354
- 8. **DO NOT STOP**: Continuous execution until all phases complete or max iterations reached
355
-
356
- ## Error Handling
357
-
358
- | Error Type | Recovery |
359
- |------------|----------|
360
- | Agent timeout | send_input requesting convergence, then retry |
361
- | State corrupted | Rebuild from progress markdown files and changes.log |
362
- | Agent failed | Re-spawn agent with previous context |
363
- | Conflicting results | Main flow sends reconciliation request |
364
- | Missing files | RA/EP agents identify and request clarification |
365
- | Max iterations reached | Generate summary with remaining issues documented |
366
-
367
- ## Coordinator Checklist (Main Flow)
368
-
369
- ### Before Each Phase
370
-
371
- - [ ] Read phase reference document
372
- - [ ] Check current state for dependencies
373
- - [ ] Update TodoWrite with phase tasks
374
-
375
- ### After Each Phase
376
-
377
- - [ ] Parse agent outputs (PHASE_RESULT)
378
- - [ ] Update master state file
379
- - [ ] Collapse TodoWrite sub-tasks
380
- - [ ] Determine next action (continue / iterate / complete)
381
-
382
- ## Reference Documents
383
-
384
- | Document | Purpose |
385
- |----------|---------|
386
- | [roles/](roles/) | Agent role definitions (RA, EP, CD, VAS) |
387
-
388
- ## Usage
389
-
390
- ```bash
391
- # Start new cycle
392
- /parallel-dev-cycle TASK="Implement real-time notifications"
393
-
394
- # Continue cycle
395
- /parallel-dev-cycle --cycle-id=cycle-v1-20260122-abc123
396
-
397
- # Iteration with extension
398
- /parallel-dev-cycle --cycle-id=cycle-v1-20260122-abc123 --extend="Also add email notifications"
399
-
400
- # Auto mode
401
- /parallel-dev-cycle --auto TASK="Add OAuth authentication"
402
- ```
1
+ ---
2
+ name: parallel-dev-cycle
3
+ description: Multi-agent parallel development cycle with requirement analysis, exploration planning, code development, and validation. Orchestration runs inline in main flow (no separate orchestrator agent). Supports continuous iteration with markdown progress documentation. Triggers on "parallel-dev-cycle".
4
+ allowed-tools: spawn_agent, wait, send_input, close_agent, request_user_input, Read, Write, Edit, Bash, Glob, Grep
5
+ ---
6
+
7
+ # Parallel Dev Cycle
8
+
9
+ Multi-agent parallel development cycle using Codex subagent pattern with four specialized workers:
10
+ 1. **Requirements Analysis & Extension** (RA) - Requirement analysis and self-enhancement
11
+ 2. **Exploration & Planning** (EP) - Codebase exploration and implementation planning
12
+ 3. **Code Development** (CD) - Code development with debug strategy support
13
+ 4. **Validation & Archival Summary** (VAS) - Validation and archival summary
14
+
15
+ Orchestration logic (phase management, state updates, feedback coordination) runs **inline in the main flow** — no separate orchestrator agent is spawned. Only 4 worker agents are allocated.
16
+
17
+ Each agent **maintains one main document** (e.g., requirements.md, plan.json, implementation.md) that is completely rewritten per iteration, plus auxiliary logs (changes.log, debug-log.ndjson) that are append-only.
18
+
19
+ ## Architecture Overview
20
+
21
+ ```
22
+ ┌─────────────────────────────────────────────────────────────┐
23
+ │ User Input (Task) │
24
+ └────────────────────────────┬────────────────────────────────┘
25
+
26
+ v
27
+ ┌──────────────────────────────┐
28
+ │ Main Flow (Inline Orchestration) │
29
+ │ Phase 1 → 2 → 3 → 4 │
30
+ └──────────────────────────────┘
31
+
32
+ ┌────────────────────┼────────────────────┐
33
+ │ │ │
34
+ v v v
35
+ ┌────────┐ ┌────────┐ ┌────────┐
36
+ │ RA │ │ EP │ │ CD │
37
+ │Agent │ │Agent │ │Agent │
38
+ └────────┘ └────────┘ └────────┘
39
+ │ │ │
40
+ └────────────────────┼────────────────────┘
41
+
42
+ v
43
+ ┌────────┐
44
+ │ VAS │
45
+ │ Agent │
46
+ └────────┘
47
+
48
+ v
49
+ ┌──────────────────────────────┐
50
+ │ Summary Report │
51
+ │ & Markdown Docs │
52
+ └──────────────────────────────┘
53
+ ```
54
+
55
+ ## Key Design Principles
56
+
57
+ 1. **Main Document + Auxiliary Logs**: Each agent maintains one main document (rewritten per iteration) and auxiliary logs (append-only)
58
+ 2. **Version-Based Overwrite**: Main documents completely rewritten per version; logs append-only
59
+ 3. **Automatic Archival**: Old main document versions automatically archived to `history/` directory
60
+ 4. **Complete Audit Trail**: Changes.log (NDJSON) preserves all change history
61
+ 5. **Parallel Coordination**: Four agents launched simultaneously; coordination via shared state and inline main flow
62
+ 6. **File References**: Use short file paths instead of content passing
63
+ 7. **Self-Enhancement**: RA agent proactively extends requirements based on context
64
+ 8. **Shared Discovery Board**: All agents share exploration findings via `discoveries.ndjson` — read on start, write as you discover, eliminating redundant codebase exploration
65
+
66
+ ## Arguments
67
+
68
+ | Arg | Required | Description |
69
+ |-----|----------|-------------|
70
+ | TASK | One of TASK or --cycle-id | Task description (for new cycle, mutually exclusive with --cycle-id) |
71
+ | --cycle-id | One of TASK or --cycle-id | Existing cycle ID to continue (from API or previous session) |
72
+ | --extend | No | Extension description (only valid with --cycle-id) |
73
+ | --auto | No | Auto-cycle mode (run all phases sequentially without user confirmation) |
74
+ | --parallel | No | Number of parallel agents (default: 4, max: 4) |
75
+
76
+ ## Auto Mode
77
+
78
+ When `--auto`: Run all phases sequentially without user confirmation between iterations. Use recommended defaults for all decisions. Automatically continue iteration loop until tests pass or max iterations reached.
79
+
80
+ ## Prep Package Integration
81
+
82
+ When `prep-package.json` exists at `{projectRoot}/.workflow/.cycle/prep-package.json`, Phase 1 consumes it to:
83
+ - Use refined task description instead of raw TASK
84
+ - Apply auto-iteration config (convergence criteria, phase gates)
85
+ - Inject per-iteration agent focus directives (0→1 vs 1→100)
86
+
87
+ Prep packages are generated by the interactive prompt `/prompts:prep-cycle`. See [phases/00-prep-checklist.md](phases/00-prep-checklist.md) for schema.
88
+
89
+ ## Execution Flow
90
+
91
+ ```
92
+ Input Parsing:
93
+ └─ Parse arguments (TASK | --cycle-id + --extend)
94
+ └─ Convert to structured context (cycleId, state, progressDir)
95
+
96
+ Phase 1: Session Initialization
97
+ └─ Ref: phases/01-session-init.md
98
+ ├─ Create new cycle OR resume existing cycle
99
+ ├─ Initialize state file and directory structure
100
+ └─ Output: cycleId, state, progressDir
101
+
102
+ Phase 2: Agent Execution (Parallel)
103
+ └─ Ref: phases/02-agent-execution.md
104
+ ├─ Tasks attached: Spawn RA → Spawn EP → Spawn CD → Spawn VAS → Wait all
105
+ ├─ Spawn RA, EP, CD, VAS agents in parallel
106
+ ├─ Wait for all agents with timeout handling
107
+ └─ Output: agentOutputs (4 agent results)
108
+
109
+ Phase 3: Result Aggregation & Iteration
110
+ └─ Ref: phases/03-result-aggregation.md
111
+ ├─ Parse PHASE_RESULT from each agent
112
+ ├─ Detect issues (test failures, blockers)
113
+ ├─ Decision: Issues found AND iteration < max?
114
+ │ ├─ Yes → Send feedback via send_input, loop back to Phase 2
115
+ │ └─ No → Proceed to Phase 4
116
+ └─ Output: parsedResults, iteration status
117
+
118
+ Phase 4: Completion & Summary
119
+ └─ Ref: phases/04-completion-summary.md
120
+ ├─ Generate unified summary report
121
+ ├─ Update final state
122
+ ├─ Sync session state: $session-sync -y "Dev cycle complete: {iterations} iterations"
123
+ ├─ Close all agents
124
+ └─ Output: final cycle report with continuation instructions
125
+ ```
126
+
127
+ **Phase Reference Documents** (read on-demand when phase executes):
128
+
129
+ | Phase | Document | Purpose |
130
+ |-------|----------|---------|
131
+ | 1 | [phases/01-session-init.md](phases/01-session-init.md) | Session creation/resume and state initialization |
132
+ | 2 | [phases/02-agent-execution.md](phases/02-agent-execution.md) | Parallel agent spawning and execution |
133
+ | 3 | [phases/03-result-aggregation.md](phases/03-result-aggregation.md) | Result parsing, feedback generation, iteration handling |
134
+ | 4 | [phases/04-completion-summary.md](phases/04-completion-summary.md) | Final summary generation and cleanup |
135
+
136
+ ## Data Flow
137
+
138
+ ```
139
+ User Input (TASK | --cycle-id + --extend)
140
+
141
+ [Parse Arguments]
142
+ ↓ cycleId, state, progressDir
143
+
144
+ Phase 1: Session Initialization
145
+ ↓ cycleId, state, progressDir (initialized/resumed)
146
+
147
+ Phase 2: Agent Execution
148
+ ├─ All agents read coordination/discoveries.ndjson on start
149
+ ├─ Each agent explores → writes new discoveries to board
150
+ ├─ Later-finishing agents benefit from earlier agents' findings
151
+ ↓ agentOutputs {ra, ep, cd, vas} + shared discoveries.ndjson
152
+
153
+ Phase 3: Result Aggregation
154
+ ↓ parsedResults, hasIssues, iteration count
155
+ ↓ [Loop back to Phase 2 if issues and iteration < max]
156
+ ↓ (discoveries.ndjson carries over across iterations)
157
+
158
+ Phase 4: Completion & Summary
159
+ ↓ finalState, summaryReport
160
+
161
+ Return: cycle_id, iterations, final_state
162
+ ```
163
+
164
+ ## Session Structure
165
+
166
+ ```
167
+ {projectRoot}/.workflow/.cycle/
168
+ ├── {cycleId}.json # Master state file
169
+ ├── {cycleId}.progress/
170
+ ├── ra/
171
+ │ ├── requirements.md # Current version (complete rewrite)
172
+ │ ├── changes.log # NDJSON complete history (append-only)
173
+ │ └── history/ # Archived snapshots
174
+ ├── ep/
175
+ │ ├── exploration.md # Codebase exploration report
176
+ │ ├── architecture.md # Architecture design
177
+ │ ├── plan.json # Structured task list (current version)
178
+ │ ├── changes.log # NDJSON complete history
179
+ │ └── history/
180
+ ├── cd/
181
+ │ ├── implementation.md # Current version
182
+ │ ├── debug-log.ndjson # Debug hypothesis tracking
183
+ │ ├── changes.log # NDJSON complete history
184
+ │ └── history/
185
+ ├── vas/
186
+ │ ├── summary.md # Current version
187
+ │ ├── changes.log # NDJSON complete history
188
+ │ └── history/
189
+ └── coordination/
190
+ ├── discoveries.ndjson # Shared discovery board (all agents append)
191
+ ├── timeline.md # Execution timeline
192
+ └── decisions.log # Decision log
193
+ ```
194
+
195
+ ## State Management
196
+
197
+ Master state file: `{projectRoot}/.workflow/.cycle/{cycleId}.json`
198
+
199
+ ```json
200
+ {
201
+ "cycle_id": "cycle-v1-20260122T100000-abc123",
202
+ "title": "Task title",
203
+ "description": "Full task description",
204
+ "status": "created | running | paused | completed | failed",
205
+ "created_at": "ISO8601", "updated_at": "ISO8601",
206
+ "max_iterations": 5, "current_iteration": 0,
207
+ "agents": {
208
+ "ra": { "status": "idle | running | completed | failed", "output_files": [] },
209
+ "ep": { "status": "idle", "output_files": [] },
210
+ "cd": { "status": "idle", "output_files": [] },
211
+ "vas": { "status": "idle", "output_files": [] }
212
+ },
213
+ "current_phase": "init | ra | ep | cd | vas | aggregation | complete",
214
+ "completed_phases": [],
215
+ "requirements": null, "plan": null, "changes": [], "test_results": null,
216
+ "coordination": { "feedback_log": [], "blockers": [] }
217
+ }
218
+ ```
219
+
220
+ **Recovery**: If state corrupted, rebuild from `.progress/` markdown files and changes.log.
221
+
222
+ ## TodoWrite Pattern
223
+
224
+ ### Phase-Level Tracking (Tasks Attached)
225
+
226
+ ```json
227
+ [
228
+ {"content": "Phase 1: Session Initialization", "status": "completed"},
229
+ {"content": "Phase 2: Agent Execution", "status": "in_progress"},
230
+ {"content": " → Spawn RA Agent", "status": "completed"},
231
+ {"content": " → Spawn EP Agent", "status": "completed"},
232
+ {"content": " → Spawn CD Agent", "status": "in_progress"},
233
+ {"content": " → Spawn VAS Agent", "status": "pending"},
234
+ {"content": "Phase 3: Result Aggregation", "status": "pending"},
235
+ {"content": "Phase 4: Completion & Summary", "status": "pending"}
236
+ ]
237
+ ```
238
+
239
+ ### Phase-Level Tracking (Collapsed)
240
+
241
+ ```json
242
+ [
243
+ {"content": "Phase 1: Session Initialization", "status": "completed"},
244
+ {"content": "Phase 2: Agent Execution (4 agents completed)", "status": "completed"},
245
+ {"content": "Phase 3: Result Aggregation", "status": "in_progress"},
246
+ {"content": "Phase 4: Completion & Summary", "status": "pending"}
247
+ ]
248
+ ```
249
+
250
+ ### Iteration Loop Tracking
251
+
252
+ ```json
253
+ [
254
+ {"content": "Phase 1: Session Initialization", "status": "completed"},
255
+ {"content": "Iteration 1: Agent Execution + Aggregation", "status": "completed"},
256
+ {"content": "Iteration 2: Feedback → Re-execution → Aggregation", "status": "in_progress"},
257
+ {"content": "Phase 4: Completion & Summary", "status": "pending"}
258
+ ]
259
+ ```
260
+
261
+ ## Versioning
262
+
263
+ - **1.0.0**: Initial cycle → **1.x.0**: Each iteration (minor bump)
264
+ - Each iteration: archive old → complete rewrite → append changes.log
265
+
266
+ ```
267
+ Archive: copy requirements.md → history/requirements-v1.0.0.md
268
+ Rewrite: overwrite requirements.md with v1.1.0 (complete new content)
269
+ Append: changes.log ← {"timestamp","version":"1.1.0","action":"update","description":"..."}
270
+ ```
271
+
272
+ | Agent Output | Rewrite (per iteration) | Append-only |
273
+ |-------------|------------------------|-------------|
274
+ | RA | requirements.md | changes.log |
275
+ | EP | exploration.md, architecture.md, plan.json | changes.log |
276
+ | CD | implementation.md, issues.md | changes.log, debug-log.ndjson |
277
+ | VAS | summary.md, test-results.json | changes.log |
278
+
279
+ ## Coordination Protocol
280
+
281
+ **Execution Order**: RA → EP → CD → VAS (dependency chain, all spawned in parallel but block on dependencies)
282
+
283
+ ### Shared Discovery Board
284
+
285
+ All agents share a real-time discovery board at `coordination/discoveries.ndjson`. Each agent reads it on start and appends findings during work. This eliminates redundant codebase exploration.
286
+
287
+ **Lifecycle**:
288
+ - Created by the first agent to write a discovery (file may not exist initially)
289
+ - Carries over across iterations — never cleared or recreated
290
+ - Agents use Bash `echo '...' >> discoveries.ndjson` to append entries
291
+
292
+ **Format**: NDJSON, each line is a self-contained JSON with required top-level fields `ts`, `agent`, `type`, `data`:
293
+ ```jsonl
294
+ {"ts":"2026-01-22T10:00:00+08:00","agent":"ra","type":"tech_stack","data":{"language":"TypeScript","framework":"Express","test":"Jest","build":"tsup"}}
295
+ ```
296
+
297
+ **Discovery Types**:
298
+
299
+ | type | Dedup Key | Writers | Readers | Required `data` Fields |
300
+ |------|-----------|---------|---------|----------------------|
301
+ | `tech_stack` | singleton | RA | EP, CD, VAS | `language`, `framework`, `test`, `build` |
302
+ | `project_config` | `data.path` | RA | EP, CD | `path`, `key_deps[]`, `scripts{}` |
303
+ | `existing_feature` | `data.name` | RA, EP | CD | `name`, `files[]`, `summary` |
304
+ | `architecture` | singleton | EP | CD, VAS | `pattern`, `layers[]`, `entry` |
305
+ | `code_pattern` | `data.name` | EP, CD | CD, VAS | `name`, `description`, `example_file` |
306
+ | `integration_point` | `data.file` | EP | CD | `file`, `description`, `exports[]` |
307
+ | `similar_impl` | `data.feature` | EP | CD | `feature`, `files[]`, `relevance` |
308
+ | `code_convention` | singleton | CD | VAS | `naming`, `imports`, `formatting` |
309
+ | `utility` | `data.name` | CD | VAS | `name`, `file`, `usage` |
310
+ | `test_command` | singleton | CD, VAS | VAS, CD | `unit`, `integration`(opt), `coverage`(opt) |
311
+ | `test_baseline` | singleton | VAS | CD | `total`, `passing`, `coverage_pct`, `framework`, `config` |
312
+ | `test_pattern` | singleton | VAS | CD | `style`, `naming`, `fixtures` |
313
+ | `blocker` | `data.issue` | any | all | `issue`, `severity`, `impact` |
314
+
315
+ **Protocol Rules**:
316
+ 1. Read board before own exploration → skip covered areas (if file doesn't exist, skip)
317
+ 2. Write discoveries immediately via Bash `echo >>` → don't batch
318
+ 3. Deduplicate — check existing entries; skip if same `type` + dedup key value already exists
319
+ 4. Append-only — never modify or delete existing lines
320
+
321
+ ### Agent → Main Flow Communication
322
+ ```
323
+ PHASE_RESULT:
324
+ - phase: ra | ep | cd | vas
325
+ - status: success | failed | partial
326
+ - files_written: [list]
327
+ - summary: one-line summary
328
+ - issues: []
329
+ ```
330
+
331
+ ### Main Flow → Agent Communication
332
+
333
+ Feedback via `send_input` (file refs + issue summary, never full content):
334
+ ```
335
+ ## FEEDBACK FROM [Source]
336
+ [Issue summary with file:line references]
337
+ ## Reference
338
+ - File: .progress/vas/test-results.json (v1.0.0)
339
+ ## Actions Required
340
+ 1. [Specific fix]
341
+ ```
342
+
343
+ **Rules**: Only main flow writes state file. Agents read state, write to own `.progress/{agent}/` directory only.
344
+
345
+ ## Core Rules
346
+
347
+ 1. **Start Immediately**: First action is TodoWrite initialization, then Phase 1 execution
348
+ 2. **Progressive Phase Loading**: Read phase docs ONLY when that phase is about to execute
349
+ 3. **Parse Every Output**: Extract PHASE_RESULT data from each agent for next phase
350
+ 4. **Auto-Continue**: After each phase, execute next pending phase automatically
351
+ 5. **Track Progress**: Update TodoWrite dynamically with attachment/collapse pattern
352
+ 6. **Single Writer**: Only main flow writes to master state file; agents report via PHASE_RESULT
353
+ 7. **File References**: Pass file paths between agents, not content
354
+ 8. **DO NOT STOP**: Continuous execution until all phases complete or max iterations reached
355
+
356
+ ## Error Handling
357
+
358
+ | Error Type | Recovery |
359
+ |------------|----------|
360
+ | Agent timeout | send_input requesting convergence, then retry |
361
+ | State corrupted | Rebuild from progress markdown files and changes.log |
362
+ | Agent failed | Re-spawn agent with previous context |
363
+ | Conflicting results | Main flow sends reconciliation request |
364
+ | Missing files | RA/EP agents identify and request clarification |
365
+ | Max iterations reached | Generate summary with remaining issues documented |
366
+
367
+ ## Coordinator Checklist (Main Flow)
368
+
369
+ ### Before Each Phase
370
+
371
+ - [ ] Read phase reference document
372
+ - [ ] Check current state for dependencies
373
+ - [ ] Update TodoWrite with phase tasks
374
+
375
+ ### After Each Phase
376
+
377
+ - [ ] Parse agent outputs (PHASE_RESULT)
378
+ - [ ] Update master state file
379
+ - [ ] Collapse TodoWrite sub-tasks
380
+ - [ ] Determine next action (continue / iterate / complete)
381
+
382
+ ## Reference Documents
383
+
384
+ | Document | Purpose |
385
+ |----------|---------|
386
+ | [roles/](roles/) | Agent role definitions (RA, EP, CD, VAS) |
387
+
388
+ ## Usage
389
+
390
+ ```bash
391
+ # Start new cycle
392
+ /parallel-dev-cycle TASK="Implement real-time notifications"
393
+
394
+ # Continue cycle
395
+ /parallel-dev-cycle --cycle-id=cycle-v1-20260122-abc123
396
+
397
+ # Iteration with extension
398
+ /parallel-dev-cycle --cycle-id=cycle-v1-20260122-abc123 --extend="Also add email notifications"
399
+
400
+ # Auto mode
401
+ /parallel-dev-cycle --auto TASK="Add OAuth authentication"
402
+ ```