sdlc-framework 2.1.0 → 3.0.0
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/README.md +25 -22
- package/package.json +1 -1
- package/src/commands/close.md +23 -10
- package/src/commands/debug.md +2 -2
- package/src/commands/discuss.md +20 -11
- package/src/commands/fast.md +7 -11
- package/src/commands/fix.md +2 -2
- package/src/commands/help.md +12 -11
- package/src/commands/impl.md +2 -2
- package/src/commands/init.md +3 -3
- package/src/commands/review.md +4 -4
- package/src/commands/spec.md +2 -2
- package/src/commands/status.md +2 -2
- package/src/commands/verify.md +3 -2
- package/src/references/prompt-detection.md +3 -3
- package/src/templates/STATE.md +10 -0
- package/src/workflows/close-phase.md +98 -24
- package/src/workflows/debug-flow.md +13 -2
- package/src/workflows/discuss-phase.md +212 -12
- package/src/workflows/fast-forward.md +45 -8
- package/src/workflows/fix-findings.md +26 -3
- package/src/workflows/impl-phase.md +13 -2
- package/src/workflows/init-project.md +15 -4
- package/src/workflows/review-phase.md +27 -3
- package/src/workflows/spec-phase.md +13 -2
- package/src/workflows/status-session.md +25 -2
- package/src/workflows/verify-phase.md +13 -2
- package/src/commands/research.md +0 -136
- package/src/commands/transition.md +0 -99
- package/src/workflows/research.md +0 -219
- package/src/workflows/transition-phase.md +0 -203
|
@@ -313,10 +313,23 @@
|
|
|
313
313
|
Warnings: {count} (non-blocking, but should fix)
|
|
314
314
|
Info: {count}
|
|
315
315
|
|
|
316
|
-
Run /sdlc:fix to systematically fix all blockers, then re-review automatically.
|
|
317
316
|
Report: .sdlc/phases/{phase}/{plan}-REVIEW.md
|
|
317
|
+
|
|
318
|
+
NEXT: /sdlc:fix
|
|
318
319
|
```
|
|
319
320
|
|
|
321
|
+
<auto_advance>
|
|
322
|
+
Read .sdlc/STATE.md auto_advance setting.
|
|
323
|
+
IF auto_advance is true:
|
|
324
|
+
Display: "Auto-advancing to /sdlc:fix in {advance_delay_seconds}s — reply to intervene."
|
|
325
|
+
Sleep for {advance_delay_seconds} seconds using Bash sleep command.
|
|
326
|
+
If no user message received during sleep: automatically execute /sdlc:fix.
|
|
327
|
+
If user sends a message: cancel auto-advance, process user input, then resume.
|
|
328
|
+
IF auto_advance is false:
|
|
329
|
+
Display: "NEXT ACTION REQUIRED: /sdlc:fix — Run /sdlc:fix to systematically fix all blockers, then re-review automatically."
|
|
330
|
+
Wait for user to manually run the command.
|
|
331
|
+
</auto_advance>
|
|
332
|
+
|
|
320
333
|
IF NO BLOCKERS (only warnings and info, or clean):
|
|
321
334
|
Update .sdlc/STATE.md:
|
|
322
335
|
- loop_position: REVIEW ✓
|
|
@@ -333,10 +346,21 @@
|
|
|
333
346
|
|
|
334
347
|
Report: .sdlc/phases/{phase}/{plan}-REVIEW.md
|
|
335
348
|
|
|
336
|
-
NEXT
|
|
337
|
-
Run /sdlc:close to close this loop.
|
|
349
|
+
NEXT: /sdlc:close
|
|
338
350
|
```
|
|
339
351
|
|
|
352
|
+
<auto_advance>
|
|
353
|
+
Read .sdlc/STATE.md auto_advance setting.
|
|
354
|
+
IF auto_advance is true:
|
|
355
|
+
Display: "Auto-advancing to /sdlc:close in {advance_delay_seconds}s — reply to intervene."
|
|
356
|
+
Sleep for {advance_delay_seconds} seconds using Bash sleep command.
|
|
357
|
+
If no user message received during sleep: automatically execute /sdlc:close.
|
|
358
|
+
If user sends a message: cancel auto-advance, process user input, then resume.
|
|
359
|
+
IF auto_advance is false:
|
|
360
|
+
Display: "NEXT ACTION REQUIRED: /sdlc:close"
|
|
361
|
+
Wait for user to manually run the command.
|
|
362
|
+
</auto_advance>
|
|
363
|
+
|
|
340
364
|
WHY: Blockers are the gate. They enforce engineering standards. Warnings are advisory — the team can choose to address them. The gate prevents shipping code that violates critical laws.
|
|
341
365
|
</step>
|
|
342
366
|
|
|
@@ -431,10 +431,21 @@
|
|
|
431
431
|
Acceptance Criteria: {N}
|
|
432
432
|
Boundaries: {N} files protected
|
|
433
433
|
|
|
434
|
-
NEXT
|
|
435
|
-
Run /sdlc:impl to begin sub-agent implementation.
|
|
434
|
+
NEXT: /sdlc:impl
|
|
436
435
|
```
|
|
437
436
|
|
|
437
|
+
<auto_advance>
|
|
438
|
+
Read .sdlc/STATE.md auto_advance setting.
|
|
439
|
+
IF auto_advance is true:
|
|
440
|
+
Display: "Auto-advancing to /sdlc:impl in {advance_delay_seconds}s — reply to intervene."
|
|
441
|
+
Sleep for {advance_delay_seconds} seconds using Bash sleep command.
|
|
442
|
+
If no user message received during sleep: automatically execute /sdlc:impl.
|
|
443
|
+
If user sends a message: cancel auto-advance, process user input, then resume.
|
|
444
|
+
IF auto_advance is false:
|
|
445
|
+
Display: "NEXT ACTION REQUIRED: /sdlc:impl"
|
|
446
|
+
Wait for user to manually run the command.
|
|
447
|
+
</auto_advance>
|
|
448
|
+
|
|
438
449
|
WHY: The forcing function ensures the user moves to implementation. Without it, specs pile up without being built.
|
|
439
450
|
</step>
|
|
440
451
|
|
|
@@ -61,12 +61,24 @@
|
|
|
61
61
|
|
|
62
62
|
Force ONE next action from loop_position with explanation:
|
|
63
63
|
```
|
|
64
|
-
NEXT
|
|
64
|
+
NEXT: /sdlc:impl
|
|
65
65
|
|
|
66
66
|
What it does: Implements the current plan by writing code with subagent workers.
|
|
67
67
|
Why it is next: The spec phase is complete. The plan has been approved.
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
+
<auto_advance>
|
|
71
|
+
Read .sdlc/STATE.md auto_advance setting.
|
|
72
|
+
IF auto_advance is true:
|
|
73
|
+
Display: "Auto-advancing to /sdlc:{next} in {advance_delay_seconds}s — reply to intervene."
|
|
74
|
+
Sleep for {advance_delay_seconds} seconds using Bash sleep command.
|
|
75
|
+
If no user message received during sleep: automatically execute /sdlc:{next}.
|
|
76
|
+
If user sends a message: cancel auto-advance, process user input, then resume.
|
|
77
|
+
IF auto_advance is false:
|
|
78
|
+
Display: "NEXT ACTION REQUIRED: /sdlc:{next}"
|
|
79
|
+
Wait for user to manually run the command.
|
|
80
|
+
</auto_advance>
|
|
81
|
+
|
|
70
82
|
WHY: Status is the "where am I" command. Junior developers need the visual. Senior developers need the forced next action. Both get what they need.
|
|
71
83
|
</step>
|
|
72
84
|
|
|
@@ -198,7 +210,18 @@
|
|
|
198
210
|
|
|
199
211
|
E. FORCE NEXT ACTION:
|
|
200
212
|
Determine from STATE.md next_required_action.
|
|
201
|
-
|
|
213
|
+
|
|
214
|
+
<auto_advance>
|
|
215
|
+
Read .sdlc/STATE.md auto_advance setting.
|
|
216
|
+
IF auto_advance is true:
|
|
217
|
+
Display: "Auto-advancing to {action} in {advance_delay_seconds}s — reply to intervene."
|
|
218
|
+
Sleep for {advance_delay_seconds} seconds using Bash sleep command.
|
|
219
|
+
If no user message received during sleep: automatically execute {action}.
|
|
220
|
+
If user sends a message: cancel auto-advance, process user input, then resume.
|
|
221
|
+
IF auto_advance is false:
|
|
222
|
+
Display: "NEXT ACTION REQUIRED: {action}"
|
|
223
|
+
Wait for user to manually run the command.
|
|
224
|
+
</auto_advance>
|
|
202
225
|
|
|
203
226
|
WHY: Exactly ONE next action. The state machine has already decided. The user just executes it.
|
|
204
227
|
</step>
|
|
@@ -263,10 +263,21 @@
|
|
|
263
263
|
|
|
264
264
|
Report: .sdlc/phases/{phase}/{plan}-VERIFY.md
|
|
265
265
|
|
|
266
|
-
NEXT
|
|
267
|
-
Run /sdlc:review for engineering laws compliance check.
|
|
266
|
+
NEXT: /sdlc:review
|
|
268
267
|
```
|
|
269
268
|
|
|
269
|
+
<auto_advance>
|
|
270
|
+
Read .sdlc/STATE.md auto_advance setting.
|
|
271
|
+
IF auto_advance is true:
|
|
272
|
+
Display: "Auto-advancing to /sdlc:review in {advance_delay_seconds}s — reply to intervene."
|
|
273
|
+
Sleep for {advance_delay_seconds} seconds using Bash sleep command.
|
|
274
|
+
If no user message received during sleep: automatically execute /sdlc:review.
|
|
275
|
+
If user sends a message: cancel auto-advance, process user input, then resume.
|
|
276
|
+
IF auto_advance is false:
|
|
277
|
+
Display: "NEXT ACTION REQUIRED: /sdlc:review"
|
|
278
|
+
Wait for user to manually run the command.
|
|
279
|
+
</auto_advance>
|
|
280
|
+
|
|
270
281
|
IF ANY AC FAILS:
|
|
271
282
|
Do NOT update loop_position. Keep it at "IMPL ✓".
|
|
272
283
|
Update next_required_action to "/sdlc:verify" (stay in verify).
|
package/src/commands/research.md
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: sdlc:research
|
|
3
|
-
description: "Deploy research subagents for discovery"
|
|
4
|
-
argument-hint: "<topic>"
|
|
5
|
-
allowed-tools: [Read, Write, Glob, Grep, Agent, WebSearch, WebFetch]
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
<objective>
|
|
9
|
-
Deploy research subagents to investigate a topic before writing code. This is the ONLY valid use of subagents outside of /sdlc:impl. Research never auto-integrates into code — findings are saved for human review.
|
|
10
|
-
|
|
11
|
-
**When to use:** Before writing a spec, you need to understand something: an API, a library, a codebase pattern, a competing approach, or a technical constraint.
|
|
12
|
-
|
|
13
|
-
**What it does:**
|
|
14
|
-
1. Classify the research type (codebase, web, or both).
|
|
15
|
-
2. Spawn focused subagent(s) with the Agent tool.
|
|
16
|
-
3. Save structured findings to .sdlc/research/{topic}.md.
|
|
17
|
-
4. Present findings for your review. Never auto-apply.
|
|
18
|
-
|
|
19
|
-
**What happens next:** /sdlc:spec to use the research findings in planning.
|
|
20
|
-
</objective>
|
|
21
|
-
|
|
22
|
-
<execution_context>
|
|
23
|
-
@~/.claude/sdlc-framework/workflows/research.md
|
|
24
|
-
@.sdlc/STATE.md
|
|
25
|
-
</execution_context>
|
|
26
|
-
|
|
27
|
-
<context>
|
|
28
|
-
$ARGUMENTS — the research topic. Required.
|
|
29
|
-
|
|
30
|
-
If $ARGUMENTS is empty, output: "Provide a research topic. Example: /sdlc:research authentication patterns" Then stop.
|
|
31
|
-
</context>
|
|
32
|
-
|
|
33
|
-
<process>
|
|
34
|
-
Follow workflow: @~/.claude/sdlc-framework/workflows/research.md
|
|
35
|
-
|
|
36
|
-
Step-by-step:
|
|
37
|
-
|
|
38
|
-
1. **Pre-flight check**
|
|
39
|
-
- Verify $ARGUMENTS is not empty.
|
|
40
|
-
- Read .sdlc/STATE.md to confirm framework is initialized.
|
|
41
|
-
- Create .sdlc/research/ directory if it does not exist.
|
|
42
|
-
|
|
43
|
-
2. **Classify research type**
|
|
44
|
-
- Analyze the topic to determine what kind of research is needed:
|
|
45
|
-
- **Codebase exploration:** Understanding existing patterns, finding usage examples, mapping dependencies. Keywords: "how does", "where is", "existing pattern", "current implementation".
|
|
46
|
-
- **Web research:** External APIs, libraries, best practices, security advisories. Keywords: "library", "API", "best practice", "alternative", "comparison".
|
|
47
|
-
- **Both:** Topics that require understanding current code AND external context. Keywords: "migrate to", "upgrade", "integrate with".
|
|
48
|
-
|
|
49
|
-
3. **Spawn research subagent(s)**
|
|
50
|
-
- For **codebase exploration**: spawn ONE Agent with instructions:
|
|
51
|
-
```
|
|
52
|
-
Research topic: {topic}
|
|
53
|
-
Search the codebase for:
|
|
54
|
-
- Existing implementations of {topic}
|
|
55
|
-
- Patterns used for similar functionality
|
|
56
|
-
- Dependencies and imports related to {topic}
|
|
57
|
-
- Test coverage of related code
|
|
58
|
-
Use Glob, Grep, and Read. Report findings in structured format:
|
|
59
|
-
- Files found
|
|
60
|
-
- Patterns identified
|
|
61
|
-
- Key code snippets (with file paths and line numbers)
|
|
62
|
-
- Gaps or inconsistencies
|
|
63
|
-
```
|
|
64
|
-
- For **web research**: spawn ONE Agent with instructions:
|
|
65
|
-
```
|
|
66
|
-
Research topic: {topic}
|
|
67
|
-
Use WebSearch and WebFetch to find:
|
|
68
|
-
- Official documentation
|
|
69
|
-
- Best practices and recommendations
|
|
70
|
-
- Common pitfalls and gotchas
|
|
71
|
-
- Security considerations
|
|
72
|
-
- Performance implications
|
|
73
|
-
Report findings in structured format with source URLs.
|
|
74
|
-
```
|
|
75
|
-
- For **both**: spawn TWO Agents (one codebase, one web) in parallel.
|
|
76
|
-
|
|
77
|
-
4. **Collect and structure findings**
|
|
78
|
-
- Wait for all agents to complete.
|
|
79
|
-
- Merge findings into a structured document.
|
|
80
|
-
|
|
81
|
-
5. **Save findings**
|
|
82
|
-
- Write to .sdlc/research/{sanitized-topic}.md:
|
|
83
|
-
```
|
|
84
|
-
# Research: {topic}
|
|
85
|
-
Date: {timestamp}
|
|
86
|
-
Type: {codebase | web | both}
|
|
87
|
-
|
|
88
|
-
## Summary
|
|
89
|
-
{2-3 sentence summary of key findings}
|
|
90
|
-
|
|
91
|
-
## Codebase Findings
|
|
92
|
-
{if applicable}
|
|
93
|
-
### Existing Patterns
|
|
94
|
-
- {pattern 1 with file references}
|
|
95
|
-
### Dependencies
|
|
96
|
-
- {dependency 1}
|
|
97
|
-
### Gaps
|
|
98
|
-
- {gap 1}
|
|
99
|
-
|
|
100
|
-
## Web Findings
|
|
101
|
-
{if applicable}
|
|
102
|
-
### Best Practices
|
|
103
|
-
- {practice 1} (source: {url})
|
|
104
|
-
### Pitfalls
|
|
105
|
-
- {pitfall 1}
|
|
106
|
-
### Security Considerations
|
|
107
|
-
- {consideration 1}
|
|
108
|
-
|
|
109
|
-
## Recommendations
|
|
110
|
-
- {recommendation 1}
|
|
111
|
-
- {recommendation 2}
|
|
112
|
-
|
|
113
|
-
## Open Questions
|
|
114
|
-
- {question that needs human input}
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
6. **Present findings — do NOT auto-integrate**
|
|
118
|
-
- Display the summary and recommendations to the user.
|
|
119
|
-
- Explicitly state: "These findings are saved for reference. They have NOT been applied to code."
|
|
120
|
-
- Output: "NEXT ACTION REQUIRED: /sdlc:spec — use these findings to plan your implementation."
|
|
121
|
-
|
|
122
|
-
7. **Update STATE.md**
|
|
123
|
-
- Record that research was conducted on {topic}.
|
|
124
|
-
- Add reference to the findings file.
|
|
125
|
-
</process>
|
|
126
|
-
|
|
127
|
-
<success_criteria>
|
|
128
|
-
- [ ] Research topic provided (not empty)
|
|
129
|
-
- [ ] Research type classified correctly (codebase, web, or both)
|
|
130
|
-
- [ ] Appropriate subagent(s) spawned with clear instructions
|
|
131
|
-
- [ ] Findings saved to .sdlc/research/{topic}.md in structured format
|
|
132
|
-
- [ ] Findings presented to user but NOT auto-applied to code
|
|
133
|
-
- [ ] STATE.md updated with research reference
|
|
134
|
-
- [ ] Output ends with NEXT ACTION REQUIRED: /sdlc:spec
|
|
135
|
-
- [ ] No code changes made — research is read-only
|
|
136
|
-
</success_criteria>
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: sdlc:transition
|
|
3
|
-
description: Transition to the next phase after all plans in a phase complete
|
|
4
|
-
argument-hint: "[phase-name]"
|
|
5
|
-
allowed-tools: [Read, Write, Bash, Glob, Grep, Edit, AskUserQuestion]
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
<objective>
|
|
9
|
-
Transition from the current phase to the next phase within a milestone. Verify phase completeness, update project state, commit the phase, and advance to the next phase.
|
|
10
|
-
|
|
11
|
-
**When to use:** After /sdlc:close detects the last plan in a phase is done. Can also be run manually to force a phase transition.
|
|
12
|
-
|
|
13
|
-
**What it does:**
|
|
14
|
-
1. Verify all plans in the current phase are complete (every SPEC has a SUMMARY, all ACs passed).
|
|
15
|
-
2. Cross-check STATE.md, PROJECT.md, and ROADMAP.md for consistency.
|
|
16
|
-
3. Update PROJECT.md with implemented, superseded, and newly discovered requirements.
|
|
17
|
-
4. Advance state to the next phase (or trigger milestone completion if this was the last phase).
|
|
18
|
-
5. Update ROADMAP.md with phase completion details.
|
|
19
|
-
6. Create a git commit marking the phase boundary.
|
|
20
|
-
|
|
21
|
-
**What happens next:**
|
|
22
|
-
- Next phase exists: Framework directs you to /sdlc:spec for the first plan of the new phase.
|
|
23
|
-
- Last phase in milestone: Framework directs you to /sdlc:close for milestone finalization.
|
|
24
|
-
|
|
25
|
-
**Critical rule:** No phase transitions without completeness verification. Every plan must have a summary. Every AC must pass. State inconsistencies are surfaced and resolved before advancing.
|
|
26
|
-
</objective>
|
|
27
|
-
|
|
28
|
-
<execution_context>
|
|
29
|
-
@~/.claude/sdlc-framework/workflows/transition-phase.md
|
|
30
|
-
@.sdlc/STATE.md
|
|
31
|
-
@.sdlc/ROADMAP.md
|
|
32
|
-
@.sdlc/PROJECT.md
|
|
33
|
-
</execution_context>
|
|
34
|
-
|
|
35
|
-
<context>
|
|
36
|
-
$ARGUMENTS — optional phase name to transition from. If not provided, read from .sdlc/STATE.md current_phase field.
|
|
37
|
-
|
|
38
|
-
Read these files:
|
|
39
|
-
- .sdlc/STATE.md — current phase, milestone, loop position.
|
|
40
|
-
- .sdlc/ROADMAP.md — phase list, plan counts, next phase identification.
|
|
41
|
-
- .sdlc/PROJECT.md — requirements to update based on completed work.
|
|
42
|
-
- All SUMMARY.md files in the completing phase's directory.
|
|
43
|
-
</context>
|
|
44
|
-
|
|
45
|
-
<process>
|
|
46
|
-
Follow workflow: @~/.claude/sdlc-framework/workflows/transition-phase.md
|
|
47
|
-
|
|
48
|
-
Step-by-step:
|
|
49
|
-
|
|
50
|
-
1. **Verify phase completeness**
|
|
51
|
-
- Read .sdlc/STATE.md. Confirm loop_position is CLOSE ✓. If not, warn: "Loop not closed. Run /sdlc:close first."
|
|
52
|
-
- List all SPEC and SUMMARY files in .sdlc/phases/{current_phase}/.
|
|
53
|
-
- Every SPEC must have a corresponding SUMMARY. If not, block: "Phase transition blocked. Plan {N} has a spec but no summary."
|
|
54
|
-
- Every SUMMARY must show all ACs passed. If not, block: "Phase transition blocked. Plan {N} has failing ACs."
|
|
55
|
-
|
|
56
|
-
2. **Verify state consistency**
|
|
57
|
-
- Cross-check STATE.md, PROJECT.md, and ROADMAP.md:
|
|
58
|
-
- STATE.md current_milestone matches ROADMAP.md in-progress milestone.
|
|
59
|
-
- STATE.md current_phase matches the phase being completed.
|
|
60
|
-
- Prior phases in this milestone are all COMPLETE.
|
|
61
|
-
- If inconsistency found: display details, offer to auto-fix, ask for confirmation.
|
|
62
|
-
|
|
63
|
-
3. **Update PROJECT.md**
|
|
64
|
-
- Read all SUMMARY.md files from the completing phase.
|
|
65
|
-
- Mark addressed requirements as IMPLEMENTED.
|
|
66
|
-
- Mark contradicted requirements as SUPERSEDED.
|
|
67
|
-
- Add newly discovered requirements as NOT STARTED.
|
|
68
|
-
- Display proposed changes and ask user to confirm before writing.
|
|
69
|
-
|
|
70
|
-
4. **Advance state to next phase**
|
|
71
|
-
- Read ROADMAP.md to identify the next phase.
|
|
72
|
-
- If next phase exists:
|
|
73
|
-
- Update STATE.md: current_phase, clear current_plan, set loop_position: TRANSITION ✓, set next_required_action: /sdlc:spec.
|
|
74
|
-
- Update ROADMAP.md: mark completed phase as COMPLETE, set next phase to IN PROGRESS.
|
|
75
|
-
- If no next phase (last phase in milestone):
|
|
76
|
-
- Update STATE.md: set next_required_action: /sdlc:close (milestone completion).
|
|
77
|
-
|
|
78
|
-
5. **Update ROADMAP.md with phase summary**
|
|
79
|
-
- Add completion date, plan count, hotfix count, key deliverables, and duration.
|
|
80
|
-
|
|
81
|
-
6. **Create git commit** (if in a git repository)
|
|
82
|
-
- Stage .sdlc/ files and source files from the phase.
|
|
83
|
-
- Commit with message: "feat({phase-name}): complete phase {number}"
|
|
84
|
-
|
|
85
|
-
7. **Output next action**
|
|
86
|
-
- If next phase exists: end with NEXT ACTION REQUIRED: /sdlc:spec
|
|
87
|
-
- If milestone complete: end with NEXT ACTION REQUIRED: /sdlc:close
|
|
88
|
-
</process>
|
|
89
|
-
|
|
90
|
-
<success_criteria>
|
|
91
|
-
- [ ] Phase completeness verified: every SPEC has a SUMMARY, all ACs passed
|
|
92
|
-
- [ ] State consistency checked across STATE.md, PROJECT.md, ROADMAP.md
|
|
93
|
-
- [ ] PROJECT.md updated with implemented, superseded, and new requirements
|
|
94
|
-
- [ ] STATE.md advanced to next phase (or milestone completion)
|
|
95
|
-
- [ ] ROADMAP.md updated with phase completion details and summary
|
|
96
|
-
- [ ] Git commit created at phase boundary (if in a git repo)
|
|
97
|
-
- [ ] If next phase exists: output ends with NEXT ACTION REQUIRED: /sdlc:spec
|
|
98
|
-
- [ ] If milestone complete: output ends with NEXT ACTION REQUIRED: /sdlc:close
|
|
99
|
-
</success_criteria>
|
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
<purpose>Conduct structured research before writing a specification. Spawns sub-agents to explore the codebase or search the web, saves findings, and routes back to the spec phase with informed context.</purpose>
|
|
2
|
-
<when_to_use>Run when you need to understand existing code patterns, evaluate technical options, or gather external information before committing to a spec. Typically run before /sdlc:spec or when the spec phase reveals unknowns.</when_to_use>
|
|
3
|
-
<required_reading>.sdlc/STATE.md, .sdlc/PROJECT.md</required_reading>
|
|
4
|
-
<loop_context>
|
|
5
|
-
expected_phase: RESEARCH (pre-spec activity)
|
|
6
|
-
prior_phase: any (usually between loops or during spec clarification)
|
|
7
|
-
next_phase: SPEC (research always leads to a spec)
|
|
8
|
-
</loop_context>
|
|
9
|
-
<process>
|
|
10
|
-
|
|
11
|
-
<step name="define_research_question" priority="first">
|
|
12
|
-
Ask the user: "What do you need to research? Describe the question or topic."
|
|
13
|
-
|
|
14
|
-
Then classify the research type:
|
|
15
|
-
|
|
16
|
-
TYPE: CODEBASE_EXPLORATION
|
|
17
|
-
Indicators: "how does X work in our code", "where is Y implemented", "what pattern does Z use", "find all instances of W"
|
|
18
|
-
Method: Codebase search agents (Grep, Glob, Read)
|
|
19
|
-
|
|
20
|
-
TYPE: WEB_RESEARCH
|
|
21
|
-
Indicators: "what is the best library for X", "how does Y technology work", "compare options for Z", "what are best practices for W"
|
|
22
|
-
Method: WebSearch agent
|
|
23
|
-
|
|
24
|
-
TYPE: HYBRID
|
|
25
|
-
Indicators: "how should we implement X" (needs both codebase understanding AND external knowledge)
|
|
26
|
-
Method: Both codebase and web agents
|
|
27
|
-
|
|
28
|
-
Display: "Research type: {type}. Proceeding with {method}."
|
|
29
|
-
|
|
30
|
-
WHY: Different research types need different tools. Searching the web for "how is auth implemented in our code" is useless. Searching the codebase for "best JWT library" is equally useless.
|
|
31
|
-
</step>
|
|
32
|
-
|
|
33
|
-
<step name="spawn_codebase_agents" priority="second">
|
|
34
|
-
ONLY IF type is CODEBASE_EXPLORATION or HYBRID.
|
|
35
|
-
|
|
36
|
-
Spawn an exploration agent with run_in_background: true.
|
|
37
|
-
|
|
38
|
-
Agent instruction:
|
|
39
|
-
```
|
|
40
|
-
You are researching the codebase to answer: "{research question}"
|
|
41
|
-
|
|
42
|
-
PROJECT CONTEXT:
|
|
43
|
-
{from PROJECT.md: tech stack, architecture, conventions}
|
|
44
|
-
|
|
45
|
-
YOUR TASK:
|
|
46
|
-
1. Search for files and code related to: {topic}
|
|
47
|
-
- Use Glob to find files by name pattern
|
|
48
|
-
- Use Grep to search file contents for relevant patterns
|
|
49
|
-
- Read key files to understand implementation details
|
|
50
|
-
|
|
51
|
-
2. For each relevant finding, record:
|
|
52
|
-
- File path and line numbers
|
|
53
|
-
- What the code does
|
|
54
|
-
- What pattern it follows
|
|
55
|
-
- How it relates to the research question
|
|
56
|
-
|
|
57
|
-
3. Look for:
|
|
58
|
-
- Existing implementations of similar features
|
|
59
|
-
- Patterns and conventions used in the codebase
|
|
60
|
-
- Utilities, helpers, and shared code that could be reused
|
|
61
|
-
- Test patterns used for similar features
|
|
62
|
-
- Configuration and setup patterns
|
|
63
|
-
|
|
64
|
-
4. Compile findings into a structured summary:
|
|
65
|
-
- Existing patterns found: {list with file references}
|
|
66
|
-
- Reusable code: {list of utilities/helpers that apply}
|
|
67
|
-
- Conventions: {naming, structure, testing patterns}
|
|
68
|
-
- Gaps: {what does NOT exist yet that would be needed}
|
|
69
|
-
- Recommendation: {how to approach the implementation based on existing patterns}
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
WHY: Codebase exploration prevents reinventing the wheel. Finding existing patterns before writing a spec ensures the spec follows conventions.
|
|
73
|
-
</step>
|
|
74
|
-
|
|
75
|
-
<step name="spawn_web_agents" priority="third">
|
|
76
|
-
ONLY IF type is WEB_RESEARCH or HYBRID.
|
|
77
|
-
|
|
78
|
-
Spawn a web research agent with run_in_background: true.
|
|
79
|
-
|
|
80
|
-
Agent instruction:
|
|
81
|
-
```
|
|
82
|
-
You are researching an external topic to inform a specification.
|
|
83
|
-
|
|
84
|
-
RESEARCH QUESTION: "{research question}"
|
|
85
|
-
|
|
86
|
-
PROJECT CONTEXT:
|
|
87
|
-
{from PROJECT.md: tech stack — so research is relevant to the stack}
|
|
88
|
-
|
|
89
|
-
YOUR TASK:
|
|
90
|
-
1. Use WebSearch to find information about: {topic}
|
|
91
|
-
2. Search for:
|
|
92
|
-
- Official documentation for relevant libraries/tools
|
|
93
|
-
- Best practices and common patterns
|
|
94
|
-
- Comparison articles if evaluating options
|
|
95
|
-
- Known issues, gotchas, and caveats
|
|
96
|
-
- Security considerations
|
|
97
|
-
|
|
98
|
-
3. For each option/approach found:
|
|
99
|
-
- Name and description
|
|
100
|
-
- Pros: {advantages}
|
|
101
|
-
- Cons: {disadvantages}
|
|
102
|
-
- Maturity: {stable, beta, experimental}
|
|
103
|
-
- Community: {active, declining, abandoned}
|
|
104
|
-
- Compatibility with our stack: {yes/no, details}
|
|
105
|
-
|
|
106
|
-
4. Compile findings into a structured summary:
|
|
107
|
-
- Options evaluated: {list}
|
|
108
|
-
- Recommended option: {which and why}
|
|
109
|
-
- Key considerations: {trade-offs, risks}
|
|
110
|
-
- Implementation notes: {relevant details for the spec}
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
WHY: Web research prevents choosing outdated or inappropriate tools. It also surfaces gotchas that would otherwise be discovered mid-implementation.
|
|
114
|
-
</step>
|
|
115
|
-
|
|
116
|
-
<step name="review_findings" priority="fourth">
|
|
117
|
-
Wait for all agents to complete.
|
|
118
|
-
|
|
119
|
-
Read and synthesize the results:
|
|
120
|
-
|
|
121
|
-
FOR CODEBASE FINDINGS:
|
|
122
|
-
- Are the patterns consistent? Or are there competing approaches in the codebase?
|
|
123
|
-
- Is there reusable code? How much can be leveraged?
|
|
124
|
-
- What gaps need to be filled?
|
|
125
|
-
|
|
126
|
-
FOR WEB FINDINGS:
|
|
127
|
-
- Are the recommended options compatible with our stack?
|
|
128
|
-
- Do any options conflict with existing patterns?
|
|
129
|
-
- Are there security concerns?
|
|
130
|
-
|
|
131
|
-
FOR HYBRID:
|
|
132
|
-
- Do the codebase patterns align with external best practices?
|
|
133
|
-
- Where do they diverge? Is the divergence justified?
|
|
134
|
-
|
|
135
|
-
Present the synthesized findings to the user:
|
|
136
|
-
```
|
|
137
|
-
Research Findings: {topic}
|
|
138
|
-
|
|
139
|
-
Codebase:
|
|
140
|
-
- Found {N} relevant patterns
|
|
141
|
-
- Key pattern: {description} (used in {files})
|
|
142
|
-
- Reusable: {list of utilities/helpers}
|
|
143
|
-
- Gap: {what is missing}
|
|
144
|
-
|
|
145
|
-
External:
|
|
146
|
-
- Recommended approach: {option}
|
|
147
|
-
- Key trade-off: {trade-off}
|
|
148
|
-
- Risk: {risk}
|
|
149
|
-
|
|
150
|
-
Recommendation for spec:
|
|
151
|
-
{How to approach this in the specification, given both codebase and external findings}
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
Ask: "Does this answer your question? Any follow-up research needed?"
|
|
155
|
-
|
|
156
|
-
IF FOLLOW-UP NEEDED: Return to step 1 with the refined question.
|
|
157
|
-
|
|
158
|
-
WHY: Raw agent output needs synthesis. The user should see a coherent recommendation, not a dump of search results.
|
|
159
|
-
</step>
|
|
160
|
-
|
|
161
|
-
<step name="save_findings" priority="fifth">
|
|
162
|
-
Create .sdlc/research/{topic-slug}.md:
|
|
163
|
-
|
|
164
|
-
```markdown
|
|
165
|
-
# Research: {topic}
|
|
166
|
-
|
|
167
|
-
## Question
|
|
168
|
-
{Original research question}
|
|
169
|
-
|
|
170
|
-
## Date
|
|
171
|
-
{ISO timestamp}
|
|
172
|
-
|
|
173
|
-
## Type
|
|
174
|
-
{CODEBASE|WEB|HYBRID}
|
|
175
|
-
|
|
176
|
-
## Codebase Findings
|
|
177
|
-
{Structured findings from codebase exploration}
|
|
178
|
-
- Pattern: {description} — {file}:{line}
|
|
179
|
-
- Reusable: {utility/helper} — {file}
|
|
180
|
-
|
|
181
|
-
## External Findings
|
|
182
|
-
{Structured findings from web research}
|
|
183
|
-
- Option: {name} — Pros: {pros}, Cons: {cons}
|
|
184
|
-
|
|
185
|
-
## Synthesis
|
|
186
|
-
{Combined analysis}
|
|
187
|
-
|
|
188
|
-
## Recommendation
|
|
189
|
-
{What to do in the spec, and why}
|
|
190
|
-
|
|
191
|
-
## References
|
|
192
|
-
- {file paths for codebase references}
|
|
193
|
-
- {URLs for web references}
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
WHY: Research findings are reusable. A future spec in the same area should read prior research instead of re-doing it. The research/ directory is a knowledge base.
|
|
197
|
-
</step>
|
|
198
|
-
|
|
199
|
-
<step name="route_to_spec" priority="sixth">
|
|
200
|
-
Update .sdlc/STATE.md:
|
|
201
|
-
- Add history entry: "{timestamp} | research | Topic: {topic}. Type: {type}. Findings saved."
|
|
202
|
-
- next_required_action: /sdlc:spec (if not already set)
|
|
203
|
-
|
|
204
|
-
Display:
|
|
205
|
-
```
|
|
206
|
-
Research complete.
|
|
207
|
-
|
|
208
|
-
Findings: .sdlc/research/{topic-slug}.md
|
|
209
|
-
|
|
210
|
-
The spec phase will use these findings for informed task decomposition.
|
|
211
|
-
|
|
212
|
-
NEXT ACTION REQUIRED: /sdlc:spec
|
|
213
|
-
Run /sdlc:spec to create a specification informed by this research.
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
WHY: Research without a spec is just reading. The forcing function ensures findings are applied to actual work.
|
|
217
|
-
</step>
|
|
218
|
-
|
|
219
|
-
</process>
|