claude-code-workflow 6.3.41 → 6.3.43
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/.claude/commands/issue/plan.md +46 -59
- package/.claude/commands/issue/queue.md +16 -16
- package/.codex/skills/parallel-dev-cycle/README.md +19 -16
- package/.codex/skills/parallel-dev-cycle/phases/agents/code-developer.md +90 -5
- package/.codex/skills/parallel-dev-cycle/phases/agents/requirements-analyst.md +89 -4
- package/.codex/skills/parallel-dev-cycle/phases/orchestrator.md +696 -696
- package/.codex/skills/parallel-dev-cycle/phases/state-schema.md +436 -436
- package/.codex/skills/parallel-dev-cycle/skill.md +194 -0
- package/.codex/skills/parallel-dev-cycle/specs/communication-optimization.md +423 -423
- package/.codex/skills/parallel-dev-cycle/specs/coordination-protocol.md +31 -16
- package/.codex/skills/parallel-dev-cycle/specs/versioning-strategy.md +74 -73
- package/ccw/dist/commands/issue.d.ts.map +1 -1
- package/ccw/dist/commands/issue.js +63 -0
- package/ccw/dist/commands/issue.js.map +1 -1
- package/ccw/src/commands/issue.ts +78 -0
- package/package.json +1 -1
- package/.codex/skills/parallel-dev-cycle/SKILL.md +0 -513
|
@@ -55,11 +55,11 @@ Unified planning command using **issue-plan-agent** that combines exploration an
|
|
|
55
55
|
## Execution Process
|
|
56
56
|
|
|
57
57
|
```
|
|
58
|
-
Phase 1: Issue Loading
|
|
58
|
+
Phase 1: Issue Loading & Intelligent Grouping
|
|
59
59
|
├─ Parse input (single, comma-separated, or --all-pending)
|
|
60
60
|
├─ Fetch issue metadata (ID, title, tags)
|
|
61
61
|
├─ Validate issues exist (create if needed)
|
|
62
|
-
└─
|
|
62
|
+
└─ Intelligent grouping via Gemini (semantic similarity, max 3 per batch)
|
|
63
63
|
|
|
64
64
|
Phase 2: Unified Explore + Plan (issue-plan-agent)
|
|
65
65
|
├─ Launch issue-plan-agent per batch
|
|
@@ -119,46 +119,11 @@ if (useAllPending) {
|
|
|
119
119
|
}
|
|
120
120
|
// Note: Agent fetches full issue content via `ccw issue status <id> --json`
|
|
121
121
|
|
|
122
|
-
//
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
id: i.id, title: i.title, tags: i.tags
|
|
126
|
-
}));
|
|
127
|
-
|
|
128
|
-
const prompt = `
|
|
129
|
-
PURPOSE: Group similar issues by semantic similarity for batch processing; maximize within-group coherence; max 4 issues per group
|
|
130
|
-
TASK: • Analyze issue titles/tags semantically • Identify functional/architectural clusters • Assign each issue to one group
|
|
131
|
-
MODE: analysis
|
|
132
|
-
CONTEXT: Issue metadata only
|
|
133
|
-
EXPECTED: JSON with groups array, each containing max 4 issue_ids, theme, rationale
|
|
134
|
-
CONSTRAINTS: Each issue in exactly one group | Max 4 issues per group | Balance group sizes
|
|
135
|
-
|
|
136
|
-
INPUT:
|
|
137
|
-
${JSON.stringify(issueSummaries, null, 2)}
|
|
138
|
-
|
|
139
|
-
OUTPUT FORMAT:
|
|
140
|
-
{"groups":[{"group_id":1,"theme":"...","issue_ids":["..."],"rationale":"..."}],"ungrouped":[]}
|
|
141
|
-
`;
|
|
142
|
-
|
|
143
|
-
const taskId = Bash({
|
|
144
|
-
command: `ccw cli -p "${prompt}" --tool gemini --mode analysis`,
|
|
145
|
-
run_in_background: true, timeout: 600000
|
|
146
|
-
});
|
|
147
|
-
const output = TaskOutput({ task_id: taskId, block: true });
|
|
148
|
-
|
|
149
|
-
// Extract JSON from potential markdown code blocks
|
|
150
|
-
function extractJsonFromMarkdown(text) {
|
|
151
|
-
const jsonMatch = text.match(/```json\s*\n([\s\S]*?)\n```/) ||
|
|
152
|
-
text.match(/```\s*\n([\s\S]*?)\n```/);
|
|
153
|
-
return jsonMatch ? jsonMatch[1] : text;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
const result = JSON.parse(extractJsonFromMarkdown(output));
|
|
157
|
-
return result.groups.map(g => g.issue_ids.map(id => issues.find(i => i.id === id)));
|
|
158
|
-
}
|
|
122
|
+
// Intelligent grouping: Analyze issues by title/tags, group semantically similar ones
|
|
123
|
+
// Strategy: Same module/component, related bugs, feature clusters
|
|
124
|
+
// Constraint: Max ${batchSize} issues per batch
|
|
159
125
|
|
|
160
|
-
|
|
161
|
-
console.log(`Processing ${issues.length} issues in ${batches.length} batch(es) (max 4 issues/agent)`);
|
|
126
|
+
console.log(`Processing ${issues.length} issues in ${batches.length} batch(es)`);
|
|
162
127
|
|
|
163
128
|
TodoWrite({
|
|
164
129
|
todos: batches.map((_, i) => ({
|
|
@@ -207,7 +172,9 @@ ${issueList}
|
|
|
207
172
|
- Add explicit verification steps to prevent same failure mode
|
|
208
173
|
6. **If github_url exists**: Add final task to comment on GitHub issue
|
|
209
174
|
7. Write solution to: .workflow/issues/solutions/{issue-id}.jsonl
|
|
210
|
-
8.
|
|
175
|
+
8. **CRITICAL - Binding Decision**:
|
|
176
|
+
- Single solution → **MUST execute**: ccw issue bind <issue-id> <solution-id>
|
|
177
|
+
- Multiple solutions → Return pending_selection only (no bind)
|
|
211
178
|
|
|
212
179
|
### Failure-Aware Planning Rules
|
|
213
180
|
- **Extract failure patterns**: Parse issue.feedback where type='failure' and stage='execute'
|
|
@@ -265,35 +232,55 @@ for (let i = 0; i < agentTasks.length; i += MAX_PARALLEL) {
|
|
|
265
232
|
}
|
|
266
233
|
agentResults.push(summary); // Store for Phase 3 conflict aggregation
|
|
267
234
|
|
|
235
|
+
// Verify binding for bound issues (agent should have executed bind)
|
|
268
236
|
for (const item of summary.bound || []) {
|
|
269
|
-
|
|
237
|
+
const status = JSON.parse(Bash(`ccw issue status ${item.issue_id} --json`).trim());
|
|
238
|
+
if (status.bound_solution_id === item.solution_id) {
|
|
239
|
+
console.log(`✓ ${item.issue_id}: ${item.solution_id} (${item.task_count} tasks)`);
|
|
240
|
+
} else {
|
|
241
|
+
// Fallback: agent failed to bind, execute here
|
|
242
|
+
Bash(`ccw issue bind ${item.issue_id} ${item.solution_id}`);
|
|
243
|
+
console.log(`✓ ${item.issue_id}: ${item.solution_id} (${item.task_count} tasks) [recovered]`);
|
|
244
|
+
}
|
|
270
245
|
}
|
|
271
|
-
// Collect
|
|
246
|
+
// Collect pending selections for Phase 3
|
|
272
247
|
for (const pending of summary.pending_selection || []) {
|
|
273
|
-
console.log(`⏳ ${pending.issue_id}: ${pending.solutions.length} solutions → awaiting selection`);
|
|
274
248
|
pendingSelections.push(pending);
|
|
275
249
|
}
|
|
276
|
-
if (summary.conflicts?.length > 0) {
|
|
277
|
-
console.log(`⚠ Conflicts: ${summary.conflicts.length} detected (will resolve in Phase 3)`);
|
|
278
|
-
}
|
|
279
250
|
updateTodo(`Plan batch ${batchIndex + 1}`, 'completed');
|
|
280
251
|
}
|
|
281
252
|
}
|
|
282
253
|
```
|
|
283
254
|
|
|
284
|
-
### Phase 3:
|
|
255
|
+
### Phase 3: Solution Selection (if pending)
|
|
256
|
+
|
|
257
|
+
```javascript
|
|
258
|
+
// Handle multi-solution issues
|
|
259
|
+
for (const pending of pendingSelections) {
|
|
260
|
+
if (pending.solutions.length === 0) continue;
|
|
261
|
+
|
|
262
|
+
const options = pending.solutions.slice(0, 4).map(sol => ({
|
|
263
|
+
label: `${sol.id} (${sol.task_count} tasks)`,
|
|
264
|
+
description: sol.description || sol.approach || 'No description'
|
|
265
|
+
}));
|
|
266
|
+
|
|
267
|
+
const answer = AskUserQuestion({
|
|
268
|
+
questions: [{
|
|
269
|
+
question: `Issue ${pending.issue_id}: which solution to bind?`,
|
|
270
|
+
header: pending.issue_id,
|
|
271
|
+
options: options,
|
|
272
|
+
multiSelect: false
|
|
273
|
+
}]
|
|
274
|
+
});
|
|
285
275
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
- Low/Medium severity → auto-resolve with `recommended_resolution`
|
|
289
|
-
- High severity → use `AskUserQuestion` to let user choose resolution
|
|
276
|
+
const selected = answer[Object.keys(answer)[0]];
|
|
277
|
+
if (!selected || selected === 'Other') continue;
|
|
290
278
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
- Bind selected solution via `ccw issue bind <issue-id> <solution-id>`
|
|
279
|
+
const solId = selected.split(' ')[0];
|
|
280
|
+
Bash(`ccw issue bind ${pending.issue_id} ${solId}`);
|
|
281
|
+
console.log(`✓ ${pending.issue_id}: ${solId} bound`);
|
|
282
|
+
}
|
|
283
|
+
```
|
|
297
284
|
|
|
298
285
|
### Phase 4: Summary
|
|
299
286
|
|
|
@@ -28,12 +28,13 @@ Queue formation command using **issue-queue-agent** that analyzes all bound solu
|
|
|
28
28
|
| Operation | Correct | Incorrect |
|
|
29
29
|
|-----------|---------|-----------|
|
|
30
30
|
| List issues (brief) | `ccw issue list --status planned --brief` | `Read('issues.jsonl')` |
|
|
31
|
+
| **Batch solutions (NEW)** | `ccw issue solutions --status planned --brief` | Loop `ccw issue solution <id>` |
|
|
31
32
|
| List queue (brief) | `ccw issue queue --brief` | `Read('queues/*.json')` |
|
|
32
33
|
| Read issue details | `ccw issue status <id> --json` | `Read('issues.jsonl')` |
|
|
33
34
|
| Get next item | `ccw issue next --json` | `Read('queues/*.json')` |
|
|
34
35
|
| Update status | `ccw issue update <id> --status ...` | Direct file edit |
|
|
35
36
|
| Sync from queue | `ccw issue update --from-queue` | Direct file edit |
|
|
36
|
-
|
|
|
37
|
+
| Read solution (single) | `ccw issue solution <id> --brief` | `Read('solutions/*.jsonl')` |
|
|
37
38
|
|
|
38
39
|
**Output Options**:
|
|
39
40
|
- `--brief`: JSON with minimal fields (id, status, counts)
|
|
@@ -131,24 +132,23 @@ Phase 7: Active Queue Check & Decision (REQUIRED)
|
|
|
131
132
|
### Phase 1: Solution Loading & Distribution
|
|
132
133
|
|
|
133
134
|
**Data Loading:**
|
|
134
|
-
- Use `ccw issue
|
|
135
|
-
-
|
|
136
|
-
|
|
137
|
-
**Solution Brief Loading** (for each planned issue):
|
|
138
|
-
```bash
|
|
139
|
-
ccw issue solution <issue-id> --brief
|
|
140
|
-
# Returns: [{ solution_id, is_bound, task_count, files_touched[] }]
|
|
141
|
-
```
|
|
135
|
+
- Use `ccw issue solutions --status planned --brief` to get all planned issues with solutions in **one call**
|
|
136
|
+
- Returns: Array of `{ issue_id, solution_id, is_bound, task_count, files_touched[], priority }`
|
|
137
|
+
- If no bound solutions found → display message, suggest `/issue:plan`
|
|
142
138
|
|
|
143
139
|
**Build Solution Objects:**
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
140
|
+
```javascript
|
|
141
|
+
// Single CLI call replaces N individual queries
|
|
142
|
+
const result = Bash(`ccw issue solutions --status planned --brief`).trim();
|
|
143
|
+
const solutions = result ? JSON.parse(result) : [];
|
|
144
|
+
|
|
145
|
+
if (solutions.length === 0) {
|
|
146
|
+
console.log('No bound solutions found. Run /issue:plan first.');
|
|
147
|
+
return;
|
|
151
148
|
}
|
|
149
|
+
|
|
150
|
+
// solutions already in correct format:
|
|
151
|
+
// { issue_id, solution_id, is_bound, task_count, files_touched[], priority }
|
|
152
152
|
```
|
|
153
153
|
|
|
154
154
|
**Multi-Queue Distribution** (if `--queues > 1`):
|
|
@@ -7,7 +7,7 @@ Multi-agent parallel development cycle using Codex subagent pattern with continu
|
|
|
7
7
|
This skill implements a **single-file-per-agent** development workflow:
|
|
8
8
|
|
|
9
9
|
- **RA**: `requirements.md` (all requirements + edge cases + history)
|
|
10
|
-
- **EP**: `
|
|
10
|
+
- **EP**: `exploration.md`, `architecture.md`, `plan.json` (codebase exploration + architecture + structured tasks)
|
|
11
11
|
- **CD**: `implementation.md` (progress + files + decisions + testing)
|
|
12
12
|
- **VAS**: `summary.md` (validation + test results + recommendations)
|
|
13
13
|
|
|
@@ -49,7 +49,9 @@ Creates:
|
|
|
49
49
|
│ ├── requirements.md (v1.0.0)
|
|
50
50
|
│ └── changes.log (NDJSON)
|
|
51
51
|
├── ep/
|
|
52
|
-
│ ├──
|
|
52
|
+
│ ├── exploration.md (v1.0.0)
|
|
53
|
+
│ ├── architecture.md (v1.0.0)
|
|
54
|
+
│ ├── plan.json (v1.0.0)
|
|
53
55
|
│ └── changes.log (NDJSON)
|
|
54
56
|
├── cd/
|
|
55
57
|
│ ├── implementation.md (v1.0.0)
|
|
@@ -113,20 +115,19 @@ When iteration completes, next extends to v1.1.0:
|
|
|
113
115
|
```
|
|
114
116
|
Current State (v1.0.0)
|
|
115
117
|
├── requirements.md (v1.0.0)
|
|
116
|
-
├── plan.
|
|
118
|
+
├── plan.json (v1.0.0)
|
|
117
119
|
├── implementation.md (v1.0.0)
|
|
118
120
|
└── summary.md (v1.0.0)
|
|
119
121
|
|
|
120
122
|
User: "Add GitHub provider"
|
|
121
123
|
↓
|
|
122
124
|
Archive Old Write New
|
|
123
|
-
├── history/requirements-v1.0.0.md
|
|
124
|
-
├── history/plan-v1.0.0.
|
|
125
|
-
├── history/impl-v1.0.0.md
|
|
126
|
-
└── history/summary-v1.0.0.md
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
Append to changes.log (NDJSON)
|
|
125
|
+
├── history/requirements-v1.0.0.md → requirements.md (v1.1.0) - REWRITTEN
|
|
126
|
+
├── history/plan-v1.0.0.json → plan.json (v1.1.0) - REWRITTEN
|
|
127
|
+
├── history/impl-v1.0.0.md → implementation.md (v1.1.0) - REWRITTEN
|
|
128
|
+
└── history/summary-v1.0.0.md → summary.md (v1.1.0) - REWRITTEN
|
|
129
|
+
↓
|
|
130
|
+
Append to changes.log (NDJSON)
|
|
130
131
|
```
|
|
131
132
|
|
|
132
133
|
## Session Files
|
|
@@ -142,11 +143,13 @@ ra/ - Requirements Analyst
|
|
|
142
143
|
└── requirements-v1.1.0.md
|
|
143
144
|
|
|
144
145
|
ep/ - Exploration & Planning
|
|
145
|
-
├──
|
|
146
|
+
├── exploration.md # v1.2.0 (codebase exploration)
|
|
147
|
+
├── architecture.md # v1.2.0 (architecture design)
|
|
148
|
+
├── plan.json # v1.2.0 (structured task list, current)
|
|
146
149
|
├── changes.log # NDJSON audit trail
|
|
147
150
|
└── history/
|
|
148
|
-
├── plan-v1.0.0.
|
|
149
|
-
└── plan-v1.1.0.
|
|
151
|
+
├── plan-v1.0.0.json
|
|
152
|
+
└── plan-v1.1.0.json
|
|
150
153
|
|
|
151
154
|
cd/ - Code Developer
|
|
152
155
|
├── implementation.md # v1.2.0 (current)
|
|
@@ -203,7 +206,7 @@ vas/ - Validation & Archival
|
|
|
203
206
|
| Agent | File | Contains | Size |
|
|
204
207
|
|-------|------|----------|------|
|
|
205
208
|
| **RA** | requirements.md | All FR, NFR, edge cases, history summary | ~2-5KB |
|
|
206
|
-
| **EP** |
|
|
209
|
+
| **EP** | exploration.md + architecture.md + plan.json | Codebase exploration, architecture design, structured task list | ~5-10KB total |
|
|
207
210
|
| **CD** | implementation.md | Completed tasks, files changed, decisions, tests | ~4-10KB |
|
|
208
211
|
| **VAS** | summary.md | Test results, coverage, issues, recommendations | ~5-12KB |
|
|
209
212
|
|
|
@@ -362,14 +365,14 @@ Orchestrator (main coordinator)
|
|
|
362
365
|
↓
|
|
363
366
|
All write to:
|
|
364
367
|
- requirements.md (v1.x.0)
|
|
365
|
-
-
|
|
368
|
+
- exploration.md, architecture.md, plan.json (v1.x.0)
|
|
366
369
|
- implementation.md (v1.x.0)
|
|
367
370
|
- summary.md (v1.x.0)
|
|
368
371
|
- changes.log (NDJSON append)
|
|
369
372
|
↓
|
|
370
373
|
[Automatic archival]
|
|
371
374
|
- history/requirements-v1.{x-1}.0.md
|
|
372
|
-
- history/plan-v1.{x-1}.0.
|
|
375
|
+
- history/plan-v1.{x-1}.0.json
|
|
373
376
|
- etc...
|
|
374
377
|
↓
|
|
375
378
|
Orchestrator: Next iteration?
|
|
@@ -28,7 +28,7 @@ The Code Developer is responsible for implementing features according to the pla
|
|
|
28
28
|
- Document all file modifications
|
|
29
29
|
- Log changes in NDJSON format
|
|
30
30
|
- Track which iteration introduced which changes
|
|
31
|
-
- Update
|
|
31
|
+
- Update changes.log
|
|
32
32
|
|
|
33
33
|
4. **Report Issues**
|
|
34
34
|
- Document development blockers
|
|
@@ -43,7 +43,7 @@ The Code Developer is responsible for implementing features according to the pla
|
|
|
43
43
|
- Test code before submitting
|
|
44
44
|
- Document code changes clearly
|
|
45
45
|
- Track blockers and issues
|
|
46
|
-
- Append to
|
|
46
|
+
- Append to changes.log, never overwrite
|
|
47
47
|
- Reference requirements in code comments
|
|
48
48
|
- Use meaningful commit messages in implementation notes
|
|
49
49
|
|
|
@@ -90,7 +90,7 @@ For each task in the plan:
|
|
|
90
90
|
- Reference requirements
|
|
91
91
|
|
|
92
92
|
3. **Track Changes**
|
|
93
|
-
- Log each file modification to
|
|
93
|
+
- Log each file modification to changes.log
|
|
94
94
|
- Format: `{timestamp, iteration, file, action, description}`
|
|
95
95
|
- Include reason for change
|
|
96
96
|
|
|
@@ -99,12 +99,96 @@ For each task in the plan:
|
|
|
99
99
|
- Verify integration
|
|
100
100
|
- Test error cases
|
|
101
101
|
- Check performance
|
|
102
|
+
- **If tests fail**: Initiate Debug Workflow (see Debug Workflow section)
|
|
102
103
|
|
|
103
104
|
5. **Report Progress**
|
|
104
105
|
- Update implementation.md
|
|
105
106
|
- Log any issues or blockers
|
|
106
107
|
- Note decisions made
|
|
107
108
|
|
|
109
|
+
## Debug Workflow
|
|
110
|
+
|
|
111
|
+
When tests fail during implementation, the CD agent MUST initiate the hypothesis-driven debug workflow. This workflow systematically identifies and resolves bugs through structured hypothesis testing.
|
|
112
|
+
|
|
113
|
+
### Debug Triggers
|
|
114
|
+
|
|
115
|
+
| Trigger | Condition | Action |
|
|
116
|
+
|---------|-----------|--------|
|
|
117
|
+
| **Test Failure** | Automated tests fail during implementation | Start debug workflow |
|
|
118
|
+
| **Integration Conflict** | Blockers logged in `issues.md` | Start debug workflow |
|
|
119
|
+
| **VAS Feedback** | Orchestrator provides validation failure feedback | Start debug workflow |
|
|
120
|
+
|
|
121
|
+
### Debug Workflow Phases
|
|
122
|
+
|
|
123
|
+
1. **Isolate Failure**
|
|
124
|
+
- Pinpoint the specific test or condition that is failing
|
|
125
|
+
- Extract exact error message and stack trace
|
|
126
|
+
- Identify the failing component/function
|
|
127
|
+
|
|
128
|
+
2. **Formulate Hypothesis**
|
|
129
|
+
- Generate a specific, testable hypothesis about the root cause
|
|
130
|
+
- Example: "Error is caused by null value passed from function X"
|
|
131
|
+
- Log hypothesis in `debug-log.ndjson`
|
|
132
|
+
- Prioritize hypotheses based on: error messages > recent changes > dependency relationships > edge cases
|
|
133
|
+
|
|
134
|
+
3. **Design Experiment**
|
|
135
|
+
- Determine minimal change to test hypothesis
|
|
136
|
+
- Options: add logging, create minimal unit test, inspect variable, add breakpoint
|
|
137
|
+
- Document experiment design
|
|
138
|
+
|
|
139
|
+
4. **Execute & Observe**
|
|
140
|
+
- Apply the change and run the test
|
|
141
|
+
- Capture inputs, actions taken, and observed outcomes
|
|
142
|
+
- Log structured results in `debug-log.ndjson`
|
|
143
|
+
|
|
144
|
+
5. **Analyze & Conclude**
|
|
145
|
+
- Compare outcome to hypothesis
|
|
146
|
+
- If **confirmed**: Proceed to implement fix (Phase 6)
|
|
147
|
+
- If **refuted**: Log finding and formulate new hypothesis (return to Phase 2)
|
|
148
|
+
- If **inconclusive**: Refine experiment and repeat
|
|
149
|
+
|
|
150
|
+
6. **Implement Fix**
|
|
151
|
+
- Once root cause confirmed, implement necessary code changes
|
|
152
|
+
- Document fix rationale in implementation.md
|
|
153
|
+
- Log fix in changes.log
|
|
154
|
+
|
|
155
|
+
7. **Verify Fix**
|
|
156
|
+
- Run all relevant tests to ensure fix is effective
|
|
157
|
+
- Verify no regressions introduced
|
|
158
|
+
- Mark issue as resolved in issues.md
|
|
159
|
+
|
|
160
|
+
### Debug Log Format (NDJSON)
|
|
161
|
+
|
|
162
|
+
File: `.workflow/.cycle/{cycleId}.progress/cd/debug-log.ndjson`
|
|
163
|
+
|
|
164
|
+
Schema:
|
|
165
|
+
```json
|
|
166
|
+
{
|
|
167
|
+
"timestamp": "2026-01-23T10:00:00+08:00",
|
|
168
|
+
"iteration": 1,
|
|
169
|
+
"issue_id": "BUG-001",
|
|
170
|
+
"file": "src/auth/oauth.ts",
|
|
171
|
+
"hypothesis": "OAuth token refresh fails due to expired refresh_token not handled",
|
|
172
|
+
"action": "Added logging to capture refresh_token expiry",
|
|
173
|
+
"observation": "Refresh token is expired but code doesn't check expiry before use",
|
|
174
|
+
"outcome": "confirmed"
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Outcome values: `confirmed | refuted | inconclusive`
|
|
179
|
+
|
|
180
|
+
### Hypothesis Priority Order
|
|
181
|
+
|
|
182
|
+
1. **Direct Error Messages/Stack Traces**: Most reliable starting point
|
|
183
|
+
2. **Recent Changes**: Check `changes.log` for recent modifications
|
|
184
|
+
3. **Dependency Relationships**: Analyze relationships between failing component and its dependencies
|
|
185
|
+
4. **Edge Cases**: Review `edge-cases.md` for documented edge cases
|
|
186
|
+
|
|
187
|
+
### Output
|
|
188
|
+
|
|
189
|
+
Debug workflow generates an additional file:
|
|
190
|
+
- **debug-log.ndjson**: NDJSON log of all hypothesis-test cycles
|
|
191
|
+
|
|
108
192
|
### Phase 3: Output
|
|
109
193
|
|
|
110
194
|
Generate files in `.workflow/.cycle/{cycleId}.progress/cd/`:
|
|
@@ -150,7 +234,7 @@ Overview of what was implemented in this iteration.
|
|
|
150
234
|
- Code review and merge
|
|
151
235
|
```
|
|
152
236
|
|
|
153
|
-
**
|
|
237
|
+
**changes.log** (NDJSON):
|
|
154
238
|
```
|
|
155
239
|
{"timestamp":"2026-01-22T10:30:00+08:00","iteration":1,"file":"src/config/oauth.ts","action":"create","task":"TASK-001","description":"Created OAuth configuration","lines_added":45,"lines_removed":0}
|
|
156
240
|
{"timestamp":"2026-01-22T10:45:00+08:00","iteration":1,"file":"src/models/User.ts","action":"modify","task":"TASK-002","description":"Added oauth_id and oauth_provider fields","lines_added":8,"lines_removed":0}
|
|
@@ -190,11 +274,12 @@ Overview of what was implemented in this iteration.
|
|
|
190
274
|
PHASE_RESULT:
|
|
191
275
|
- phase: cd
|
|
192
276
|
- status: success | failed | partial
|
|
193
|
-
- files_written: [implementation.md,
|
|
277
|
+
- files_written: [implementation.md, changes.log, debug-log.ndjson (if debug executed), issues.md]
|
|
194
278
|
- summary: N tasks completed, M files modified, X blockers identified
|
|
195
279
|
- tasks_completed: N
|
|
196
280
|
- files_modified: M
|
|
197
281
|
- tests_passing: X/Y
|
|
282
|
+
- debug_cycles: Z (if debug executed)
|
|
198
283
|
- blockers: []
|
|
199
284
|
- issues: [list of open issues]
|
|
200
285
|
```
|
|
@@ -59,13 +59,24 @@ The Requirements Analyst maintains **a single file** (`requirements.md`) contain
|
|
|
59
59
|
- Task description from state
|
|
60
60
|
- Project tech stack and guidelines
|
|
61
61
|
|
|
62
|
-
2. **Analyze Requirements**
|
|
63
|
-
- Functional requirements
|
|
64
|
-
- Non-functional requirements
|
|
62
|
+
2. **Analyze Explicit Requirements**
|
|
63
|
+
- Functional requirements from user task
|
|
64
|
+
- Non-functional requirements (explicit)
|
|
65
65
|
- Constraints and assumptions
|
|
66
66
|
- Edge cases
|
|
67
67
|
|
|
68
|
-
3. **
|
|
68
|
+
3. **Proactive Enhancement** (NEW - Self-Enhancement Phase)
|
|
69
|
+
- Execute enhancement strategies based on triggers
|
|
70
|
+
- Scan codebase for implied requirements
|
|
71
|
+
- Analyze peer agent outputs (EP, CD, VAS from previous iteration)
|
|
72
|
+
- Suggest associated features and NFR scaffolding
|
|
73
|
+
|
|
74
|
+
4. **Consolidate & Finalize**
|
|
75
|
+
- Merge explicit requirements with proactively generated ones
|
|
76
|
+
- Mark enhanced items with "(ENHANCED v1.0.0 by RA)"
|
|
77
|
+
- Add optional "## Proactive Enhancements" section with justification
|
|
78
|
+
|
|
79
|
+
5. **Generate Single File**
|
|
69
80
|
- Write `requirements.md` v1.0.0
|
|
70
81
|
- Include all sections in one document
|
|
71
82
|
- Add version header
|
|
@@ -283,3 +294,77 @@ appendNDJSON('changes.log', {
|
|
|
283
294
|
5. **Audit Trail**: Changes.log tracks every modification
|
|
284
295
|
6. **Readability First**: File should be clear and concise
|
|
285
296
|
7. **Version Markers**: Mark new items with "(NEW v1.x.0)"
|
|
297
|
+
8. **Proactive Enhancement**: Always apply self-enhancement phase
|
|
298
|
+
|
|
299
|
+
## Self-Enhancement Mechanism
|
|
300
|
+
|
|
301
|
+
The RA agent proactively extends requirements based on context analysis.
|
|
302
|
+
|
|
303
|
+
### Enhancement Triggers
|
|
304
|
+
|
|
305
|
+
| Trigger | Condition | Action |
|
|
306
|
+
|---------|-----------|--------|
|
|
307
|
+
| **Initial Analysis** | First iteration (v1.0.0) | Expand vague or high-level requests |
|
|
308
|
+
| **Implicit Context** | Key config files detected (package.json, Dockerfile, CI config) | Infer NFRs and constraints |
|
|
309
|
+
| **Cross-Agent Feedback** | Previous iteration has `exploration.identified_risks`, `cd.blockers`, or `vas.test_results.failed_tests` | Cover uncovered requirements |
|
|
310
|
+
|
|
311
|
+
### Enhancement Strategies
|
|
312
|
+
|
|
313
|
+
1. **Codebase Analysis**
|
|
314
|
+
- Scan key project files (package.json, Dockerfile, CI/CD configs)
|
|
315
|
+
- Infer technological constraints and dependencies
|
|
316
|
+
- Identify operational requirements
|
|
317
|
+
- Example: Detecting `storybook` dependency → suggest component-driven UI process
|
|
318
|
+
|
|
319
|
+
2. **Peer Output Mining**
|
|
320
|
+
- Analyze EP agent's `exploration.architecture_summary`
|
|
321
|
+
- Review CD agent's blockers and issues
|
|
322
|
+
- Examine VAS agent's `test_results.failed_tests`
|
|
323
|
+
- Formalize insights as new requirements
|
|
324
|
+
|
|
325
|
+
3. **Common Feature Association**
|
|
326
|
+
- Based on functional requirements, suggest associated features
|
|
327
|
+
- Example: "build user login" → suggest "password reset", "MFA"
|
|
328
|
+
- Mark as enhancement candidates for user confirmation
|
|
329
|
+
|
|
330
|
+
4. **NFR Scaffolding**
|
|
331
|
+
- For each major functional requirement, add standard NFRs
|
|
332
|
+
- Categories: Performance, Security, Scalability, Accessibility
|
|
333
|
+
- Set initial values as "TBD" to ensure consideration
|
|
334
|
+
|
|
335
|
+
### Output Format for Enhanced Requirements
|
|
336
|
+
|
|
337
|
+
Enhanced requirements are integrated directly into `requirements.md`:
|
|
338
|
+
|
|
339
|
+
```markdown
|
|
340
|
+
## Functional Requirements
|
|
341
|
+
|
|
342
|
+
### FR-001: OAuth Authentication
|
|
343
|
+
User can authenticate via OAuth providers.
|
|
344
|
+
**Status**: Defined (v1.0.0)
|
|
345
|
+
**Priority**: High
|
|
346
|
+
|
|
347
|
+
### FR-002: Password Reset (ENHANCED v1.0.0 by RA)
|
|
348
|
+
Users can reset their password via email link.
|
|
349
|
+
**Status**: Enhanced (auto-suggested)
|
|
350
|
+
**Priority**: Medium
|
|
351
|
+
**Trigger**: Common Feature Association (FR-001 → password reset)
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
## Proactive Enhancements
|
|
356
|
+
|
|
357
|
+
This section documents auto-generated requirements by the RA agent.
|
|
358
|
+
|
|
359
|
+
| ID | Trigger | Strategy | Justification |
|
|
360
|
+
|----|---------|----------|---------------|
|
|
361
|
+
| FR-002 | FR-001 requires login | Common Feature Association | Standard auth feature set |
|
|
362
|
+
| NFR-003 | package.json has `jest` | Codebase Analysis | Test framework implies testability NFR |
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
### Integration Notes
|
|
366
|
+
|
|
367
|
+
- Self-enhancement is **internal to RA agent** - no orchestrator changes needed
|
|
368
|
+
- Read-only access to codebase and cycle state required
|
|
369
|
+
- Enhanced requirements are **transparently marked** for user review
|
|
370
|
+
- User can accept, modify, or reject enhanced requirements in next iteration
|