@jmylchreest/aide-plugin 0.0.24 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -1
- package/skills/build-fix/SKILL.md +162 -0
- package/skills/code-search/SKILL.md +108 -0
- package/skills/debug/SKILL.md +189 -0
- package/skills/decide/SKILL.md +225 -0
- package/skills/design/SKILL.md +192 -0
- package/skills/docs/SKILL.md +269 -0
- package/skills/git/SKILL.md +181 -0
- package/skills/implement/SKILL.md +240 -0
- package/skills/memorise/SKILL.md +139 -0
- package/skills/perf/SKILL.md +305 -0
- package/skills/plan-swarm/SKILL.md +135 -0
- package/skills/ralph/SKILL.md +483 -0
- package/skills/recall/SKILL.md +90 -0
- package/skills/review/SKILL.md +147 -0
- package/skills/swarm/SKILL.md +501 -0
- package/skills/test/SKILL.md +244 -0
- package/skills/verify/SKILL.md +299 -0
- package/skills/worktree-resolve/SKILL.md +342 -0
- package/src/core/index.ts +1 -0
- package/src/core/partial-memory.ts +354 -0
- package/src/core/session-init.ts +0 -3
- package/src/core/session-summary-logic.ts +2 -6
- package/src/opencode/hooks.ts +237 -25
- package/src/opencode/index.ts +10 -1
- package/src/opencode/types.ts +98 -3
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: review
|
|
3
|
+
description: Code review and security audit
|
|
4
|
+
triggers:
|
|
5
|
+
- review this
|
|
6
|
+
- review the
|
|
7
|
+
- code review
|
|
8
|
+
- security audit
|
|
9
|
+
- audit this
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Code Review Mode
|
|
13
|
+
|
|
14
|
+
**Recommended model tier:** smart (opus) - this skill requires complex reasoning
|
|
15
|
+
|
|
16
|
+
Comprehensive code review covering quality, security, and maintainability.
|
|
17
|
+
|
|
18
|
+
## Review Checklist
|
|
19
|
+
|
|
20
|
+
### Code Quality
|
|
21
|
+
- [ ] Clear naming (variables, functions, classes)
|
|
22
|
+
- [ ] Single responsibility (functions do one thing)
|
|
23
|
+
- [ ] DRY (no unnecessary duplication)
|
|
24
|
+
- [ ] Appropriate abstraction level
|
|
25
|
+
- [ ] Error handling coverage
|
|
26
|
+
- [ ] Edge cases considered
|
|
27
|
+
|
|
28
|
+
### Security (OWASP Top 10)
|
|
29
|
+
- [ ] Input validation (no injection vulnerabilities)
|
|
30
|
+
- [ ] Authentication checks (routes protected)
|
|
31
|
+
- [ ] Authorization (proper access control)
|
|
32
|
+
- [ ] Sensitive data handling (no secrets in code)
|
|
33
|
+
- [ ] SQL/NoSQL injection prevention
|
|
34
|
+
- [ ] XSS prevention (output encoding)
|
|
35
|
+
- [ ] CSRF protection
|
|
36
|
+
- [ ] Secure dependencies (no known vulnerabilities)
|
|
37
|
+
|
|
38
|
+
### Maintainability
|
|
39
|
+
- [ ] Code is readable without comments
|
|
40
|
+
- [ ] Comments explain "why" not "what"
|
|
41
|
+
- [ ] Consistent with codebase patterns
|
|
42
|
+
- [ ] Tests cover critical paths
|
|
43
|
+
- [ ] No dead code
|
|
44
|
+
|
|
45
|
+
### Performance
|
|
46
|
+
- [ ] No N+1 queries
|
|
47
|
+
- [ ] Appropriate caching
|
|
48
|
+
- [ ] No memory leaks
|
|
49
|
+
- [ ] Efficient algorithms
|
|
50
|
+
|
|
51
|
+
## Review Process
|
|
52
|
+
|
|
53
|
+
1. **Read the diff/files** - Understand what changed
|
|
54
|
+
2. **Search for context** - Use `code_search` MCP tool to find:
|
|
55
|
+
- Related symbols that might be affected
|
|
56
|
+
- Other usages of modified functions/classes
|
|
57
|
+
- Similar patterns in the codebase
|
|
58
|
+
3. **Check integration** - How does it fit the larger system?
|
|
59
|
+
4. **Run static analysis** - Use lsp_diagnostics, ast_grep if available
|
|
60
|
+
5. **Document findings** - Use severity levels
|
|
61
|
+
|
|
62
|
+
## MCP Tools
|
|
63
|
+
|
|
64
|
+
Use these tools during review:
|
|
65
|
+
|
|
66
|
+
- `mcp__plugin_aide_aide__code_search` - Find symbols related to changes (e.g., `code_search query="getUserById"`)
|
|
67
|
+
- `mcp__plugin_aide_aide__code_symbols` - List all symbols in a file being reviewed
|
|
68
|
+
- `mcp__plugin_aide_aide__memory_search` - Check for related past decisions or issues
|
|
69
|
+
|
|
70
|
+
## Output Format
|
|
71
|
+
|
|
72
|
+
```markdown
|
|
73
|
+
## Code Review: [Feature/PR Name]
|
|
74
|
+
|
|
75
|
+
### Summary
|
|
76
|
+
[1-2 sentence overview]
|
|
77
|
+
|
|
78
|
+
### Findings
|
|
79
|
+
|
|
80
|
+
#### 🔴 Critical (must fix)
|
|
81
|
+
- **[Issue]** `file:line`
|
|
82
|
+
- Problem: [description]
|
|
83
|
+
- Fix: [recommendation]
|
|
84
|
+
|
|
85
|
+
#### 🟡 Warning (should fix)
|
|
86
|
+
- **[Issue]** `file:line`
|
|
87
|
+
- Problem: [description]
|
|
88
|
+
- Fix: [recommendation]
|
|
89
|
+
|
|
90
|
+
#### 🔵 Suggestion (consider)
|
|
91
|
+
- **[Issue]** `file:line`
|
|
92
|
+
- Suggestion: [recommendation]
|
|
93
|
+
|
|
94
|
+
### Security Notes
|
|
95
|
+
- [Any security-specific observations]
|
|
96
|
+
|
|
97
|
+
### Verdict
|
|
98
|
+
[ ] ✅ Approve
|
|
99
|
+
[ ] ⚠️ Approve with comments
|
|
100
|
+
[ ] ❌ Request changes
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Severity Guide
|
|
104
|
+
|
|
105
|
+
| Level | Criteria |
|
|
106
|
+
|-------|----------|
|
|
107
|
+
| Critical | Security vulnerability, data loss risk, crash |
|
|
108
|
+
| Warning | Bug potential, maintainability issue, performance |
|
|
109
|
+
| Suggestion | Style, minor improvement, optional |
|
|
110
|
+
|
|
111
|
+
## Failure Handling
|
|
112
|
+
|
|
113
|
+
### If unable to complete review:
|
|
114
|
+
|
|
115
|
+
1. **Missing files** - Report which files could not be read
|
|
116
|
+
2. **Ambiguous scope** - Ask user to clarify what code to review
|
|
117
|
+
3. **Large changeset** - Break into smaller chunks, review systematically
|
|
118
|
+
|
|
119
|
+
### Reporting blockers:
|
|
120
|
+
|
|
121
|
+
```markdown
|
|
122
|
+
## Review Status: Incomplete
|
|
123
|
+
|
|
124
|
+
### Blockers
|
|
125
|
+
- Could not access: `path/to/file.ts` (permission denied)
|
|
126
|
+
- Missing context: Need to understand `AuthService` implementation
|
|
127
|
+
|
|
128
|
+
### Partial Findings
|
|
129
|
+
[Include any findings from files that were reviewed]
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Verification Criteria
|
|
133
|
+
|
|
134
|
+
A complete code review must:
|
|
135
|
+
|
|
136
|
+
1. **Read all changed files** - Verify each file was actually read
|
|
137
|
+
2. **Check for related code** - Use code search to find callers/callees
|
|
138
|
+
3. **Verify test coverage** - Check if tests exist for critical paths
|
|
139
|
+
4. **Document all findings** - Even if no issues found, state that explicitly
|
|
140
|
+
|
|
141
|
+
### Checklist before submitting review:
|
|
142
|
+
|
|
143
|
+
- [ ] All files in diff/scope have been read
|
|
144
|
+
- [ ] Related symbols searched (callers, implementations)
|
|
145
|
+
- [ ] Security checklist evaluated
|
|
146
|
+
- [ ] Findings documented with file:line references
|
|
147
|
+
- [ ] Verdict provided with clear reasoning
|
|
@@ -0,0 +1,501 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: swarm
|
|
3
|
+
description: Parallel agents with SDLC pipeline per story
|
|
4
|
+
triggers:
|
|
5
|
+
- swarm
|
|
6
|
+
- parallel agents
|
|
7
|
+
- spawn agents
|
|
8
|
+
- multi-agent
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Swarm Mode
|
|
12
|
+
|
|
13
|
+
**Recommended model tier:** smart (opus) - this skill requires complex reasoning
|
|
14
|
+
|
|
15
|
+
Launch parallel agents, each working on a story through SDLC stages.
|
|
16
|
+
|
|
17
|
+
## NON-NEGOTIABLE REQUIREMENTS
|
|
18
|
+
|
|
19
|
+
1. **SDLC Pipeline is MANDATORY** - Every story MUST go through all 5 stages: DESIGN → TEST → DEV → VERIFY → DOCS
|
|
20
|
+
2. **Git Worktrees are MANDATORY** - Each story agent MUST work in an isolated worktree
|
|
21
|
+
3. **VERIFY failures trigger BUILD-FIX loop** - If VERIFY fails, invoke `/aide:build-fix` and re-verify until passing
|
|
22
|
+
4. **Swarm MUST conclude with `/aide:worktree-resolve`** - All story branches must be merged before completion
|
|
23
|
+
|
|
24
|
+
## Activation
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
swarm 3 → 3 story agents (SDLC mode)
|
|
28
|
+
swarm stories "Auth" "Payments" → Named stories
|
|
29
|
+
swarm 2 --flat → Flat task mode (legacy)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Architecture
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
┌─────────────────────────────────────────────────────────────────────────┐
|
|
36
|
+
│ ORCHESTRATOR (you) │
|
|
37
|
+
│ 1. Decompose work into stories │
|
|
38
|
+
│ 2. Create worktree per story │
|
|
39
|
+
│ 3. Spawn story agent per worktree (subagent_type: general-purpose) │
|
|
40
|
+
│ 4. Monitor progress via TaskList (DO NOT create tasks yourself!) │
|
|
41
|
+
│ 5. Call /aide:worktree-resolve when all stories complete │
|
|
42
|
+
└─────────────────────────────────────────────────────────────────────────┘
|
|
43
|
+
│
|
|
44
|
+
┌──────────────────────┼──────────────────────┐
|
|
45
|
+
▼ ▼ ▼
|
|
46
|
+
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
|
|
47
|
+
│ Story A Agent │ │ Story B Agent │ │ Story C Agent │
|
|
48
|
+
│ (worktree-a) │ │ (worktree-b) │ │ (worktree-c) │
|
|
49
|
+
├─────────────────┤ ├─────────────────┤ ├─────────────────┤
|
|
50
|
+
│ SDLC Pipeline: │ │ SDLC Pipeline: │ │ SDLC Pipeline: │
|
|
51
|
+
│ [DESIGN] │ │ [DESIGN] │ │ [DESIGN] │
|
|
52
|
+
│ [TEST] │ │ [TEST] │ │ [TEST] │
|
|
53
|
+
│ [DEV] │ │ [DEV] │ │ [DEV] │
|
|
54
|
+
│ [VERIFY] │ │ [VERIFY] │ │ [VERIFY] │
|
|
55
|
+
│ [DOCS] │ │ [DOCS] │ │ [DOCS] │
|
|
56
|
+
└─────────────────┘ └─────────────────┘ └─────────────────┘
|
|
57
|
+
│ │ │
|
|
58
|
+
└─────────────────────┼─────────────────────┘
|
|
59
|
+
▼
|
|
60
|
+
┌─────────────────────────────────────────────────────────────────────────┐
|
|
61
|
+
│ SHARED NATIVE TASKS (Claude Code TaskList) │
|
|
62
|
+
│ All agents can see, create, and update tasks │
|
|
63
|
+
│ Dependencies via blockedBy auto-manage stage ordering │
|
|
64
|
+
└─────────────────────────────────────────────────────────────────────────┘
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Workflow
|
|
68
|
+
|
|
69
|
+
### 1. Story Decomposition
|
|
70
|
+
|
|
71
|
+
**First, check for an existing plan** from `/aide:plan-swarm`:
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
mcp__plugin_aide_aide__decision_get with topic="swarm-plan"
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
If a plan exists, use its stories directly — skip ad-hoc decomposition. The plan has already been validated for independence and acceptance criteria.
|
|
78
|
+
|
|
79
|
+
If no plan exists, break the work into independent stories/features:
|
|
80
|
+
|
|
81
|
+
```markdown
|
|
82
|
+
## Stories
|
|
83
|
+
|
|
84
|
+
1. **Auth Module** - User authentication with JWT
|
|
85
|
+
2. **Payment Processing** - Stripe integration for subscriptions
|
|
86
|
+
3. **User Dashboard** - Profile management UI
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Each story should be:
|
|
90
|
+
- Independent (can be developed in parallel)
|
|
91
|
+
- Complete (has clear boundaries)
|
|
92
|
+
- Testable (has acceptance criteria)
|
|
93
|
+
|
|
94
|
+
### 2. Create Git Worktrees
|
|
95
|
+
|
|
96
|
+
Each story agent gets an isolated workspace. Create worktrees using git commands:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
git worktree add .aide/worktrees/story-auth -b feat/story-auth
|
|
100
|
+
git worktree add .aide/worktrees/story-payments -b feat/story-payments
|
|
101
|
+
git worktree add .aide/worktrees/story-dashboard -b feat/story-dashboard
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Automatic Integration:**
|
|
105
|
+
- Worktrees in `.aide/worktrees/` are **auto-discovered** by AIDE hooks
|
|
106
|
+
- When agents spawn, their worktree path is **auto-injected** into context
|
|
107
|
+
- When agents complete, worktrees are marked as **"agent-complete"** (ready for merge)
|
|
108
|
+
- Worktree state is tracked in `.aide/state/worktrees.json`
|
|
109
|
+
|
|
110
|
+
**Naming Convention:**
|
|
111
|
+
- Use `story-<name>` as worktree directory name
|
|
112
|
+
- Use matching `agent-<name>` as agent_id when spawning
|
|
113
|
+
- Example: `story-auth` worktree → spawn with `agent_id` containing "auth"
|
|
114
|
+
|
|
115
|
+
**If worktree creation fails:**
|
|
116
|
+
1. Check if branch exists: `git branch -a | grep feat/story-auth`
|
|
117
|
+
2. Remove stale worktree: `git worktree remove .aide/worktrees/story-auth --force`
|
|
118
|
+
3. Prune refs: `git worktree prune`
|
|
119
|
+
4. Retry creation
|
|
120
|
+
|
|
121
|
+
### 3. Spawn Story Agents
|
|
122
|
+
|
|
123
|
+
Launch agents using the Task tool with `subagent_type: "general-purpose"` (required for Edit/Write access).
|
|
124
|
+
|
|
125
|
+
**IMPORTANT: Task Ownership**
|
|
126
|
+
- The ORCHESTRATOR does NOT create SDLC tasks
|
|
127
|
+
- Each SUBAGENT creates and manages its OWN tasks
|
|
128
|
+
- Orchestrator only monitors via `TaskList`
|
|
129
|
+
|
|
130
|
+
Each agent manages its own SDLC pipeline.
|
|
131
|
+
|
|
132
|
+
```typescript
|
|
133
|
+
Task({
|
|
134
|
+
subagent_type: "general-purpose",
|
|
135
|
+
prompt: `You are a story agent working on: Auth Module
|
|
136
|
+
|
|
137
|
+
Worktree: /path/to/.aide/worktrees/story-auth
|
|
138
|
+
Story ID: story-auth
|
|
139
|
+
Agent ID: agent-auth
|
|
140
|
+
|
|
141
|
+
## Your Mission
|
|
142
|
+
Implement the Auth Module through the full SDLC pipeline.
|
|
143
|
+
|
|
144
|
+
## SDLC Pipeline
|
|
145
|
+
You will create and execute these stages IN ORDER:
|
|
146
|
+
|
|
147
|
+
### Stage 1: DESIGN
|
|
148
|
+
Use the /aide:design skill (or follow its workflow).
|
|
149
|
+
Output: Technical design with interfaces, decisions, acceptance criteria.
|
|
150
|
+
|
|
151
|
+
### Stage 2: TEST
|
|
152
|
+
Use the /aide:test skill.
|
|
153
|
+
Write failing tests based on acceptance criteria from DESIGN.
|
|
154
|
+
|
|
155
|
+
### Stage 3: DEV
|
|
156
|
+
Use the /aide:implement skill.
|
|
157
|
+
Make all tests pass with minimal implementation.
|
|
158
|
+
|
|
159
|
+
### Stage 4: VERIFY
|
|
160
|
+
Use the /aide:verify skill.
|
|
161
|
+
Run full test suite, lint, type check. Must all pass.
|
|
162
|
+
|
|
163
|
+
**IF VERIFY FAILS:**
|
|
164
|
+
1. Invoke /aide:build-fix to address failures
|
|
165
|
+
2. Re-run /aide:verify
|
|
166
|
+
3. Repeat until VERIFY passes
|
|
167
|
+
4. Only then proceed to DOCS
|
|
168
|
+
|
|
169
|
+
### Stage 5: DOCS
|
|
170
|
+
Use the /aide:docs skill.
|
|
171
|
+
Update documentation to match implementation.
|
|
172
|
+
|
|
173
|
+
## Task Management
|
|
174
|
+
Use native Claude Code task tools to track your progress:
|
|
175
|
+
|
|
176
|
+
1. Create all stage tasks upfront:
|
|
177
|
+
TaskCreate: "[story-auth][DESIGN] Design auth module"
|
|
178
|
+
TaskCreate: "[story-auth][TEST] Write auth tests" (blockedBy: DESIGN task)
|
|
179
|
+
TaskCreate: "[story-auth][DEV] Implement auth" (blockedBy: TEST task)
|
|
180
|
+
TaskCreate: "[story-auth][VERIFY] Verify auth" (blockedBy: DEV task)
|
|
181
|
+
TaskCreate: "[story-auth][DOCS] Document auth" (blockedBy: VERIFY task)
|
|
182
|
+
|
|
183
|
+
2. As you start each stage:
|
|
184
|
+
TaskUpdate: taskId=X, status=in_progress, owner=agent-auth
|
|
185
|
+
|
|
186
|
+
3. As you complete each stage:
|
|
187
|
+
TaskUpdate: taskId=X, status=completed
|
|
188
|
+
|
|
189
|
+
## Coordination
|
|
190
|
+
|
|
191
|
+
**Messaging (MCP tools):**
|
|
192
|
+
- Send status: \`message_send\` with from=agent-auth, type="status", content="[DESIGN] complete"
|
|
193
|
+
- Send blocker: \`message_send\` with from=agent-auth, type="blocker", content="Need API schema"
|
|
194
|
+
- Check inbox: \`message_list\` with agent_id=agent-auth
|
|
195
|
+
- Acknowledge: \`message_ack\` with message_id=N, agent_id=agent-auth
|
|
196
|
+
|
|
197
|
+
**At each stage transition:**
|
|
198
|
+
1. Check messages via \`message_list\`
|
|
199
|
+
2. Acknowledge and act on any requests
|
|
200
|
+
3. Send \`status\` message with new stage
|
|
201
|
+
|
|
202
|
+
**Shared state (MCP + CLI):**
|
|
203
|
+
- Check decisions: \`mcp__plugin_aide_aide__decision_get\` (MCP read)
|
|
204
|
+
- Record decisions: \`aide decision set <topic> "<decision>"\` (CLI write)
|
|
205
|
+
- Share discoveries: \`aide memory add --category=discovery "<finding>"\` (CLI write)
|
|
206
|
+
|
|
207
|
+
## Completion
|
|
208
|
+
When all 5 stages are complete:
|
|
209
|
+
1. Verify all tasks show completed
|
|
210
|
+
2. Ensure all changes are committed
|
|
211
|
+
3. Send completion message: \`message_send\` with from=agent-auth, type="completion"
|
|
212
|
+
4. Report: "Story complete: Auth Module"
|
|
213
|
+
\`
|
|
214
|
+
});
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### 4. Monitor Progress
|
|
218
|
+
|
|
219
|
+
Use TaskList to see all story progress:
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
TaskList
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Example output:
|
|
226
|
+
```
|
|
227
|
+
#10 [completed] [story-auth][DESIGN] Design auth module (agent-auth)
|
|
228
|
+
#11 [completed] [story-auth][TEST] Write auth tests (agent-auth)
|
|
229
|
+
#12 [in_progress] [story-auth][DEV] Implement auth (agent-auth)
|
|
230
|
+
#13 [pending] [story-auth][VERIFY] Verify auth [blocked by #12]
|
|
231
|
+
#14 [pending] [story-auth][DOCS] Document auth [blocked by #13]
|
|
232
|
+
#20 [in_progress] [story-payments][DESIGN] Design payment module (agent-payments)
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### 5. Merge Results
|
|
236
|
+
|
|
237
|
+
When all stories complete, use `/aide:worktree-resolve`:
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
# Verify all tasks complete
|
|
241
|
+
TaskList # Should show all [completed]
|
|
242
|
+
|
|
243
|
+
# Check for blockers (use MCP tool)
|
|
244
|
+
mcp__plugin_aide_aide__memory_list with category=blocker
|
|
245
|
+
|
|
246
|
+
# Merge worktrees
|
|
247
|
+
/aide:worktree-resolve
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
## SDLC Stage Reference
|
|
251
|
+
|
|
252
|
+
| Stage | Skill | Creates | Depends On |
|
|
253
|
+
|-------|-------|---------|------------|
|
|
254
|
+
| DESIGN | `/aide:design` | Interfaces, decisions, acceptance criteria | - |
|
|
255
|
+
| TEST | `/aide:test` | Failing tests | DESIGN |
|
|
256
|
+
| DEV | `/aide:implement` | Passing implementation | TEST |
|
|
257
|
+
| VERIFY | `/aide:verify` | Quality validation | DEV |
|
|
258
|
+
| DOCS | `/aide:docs` | Updated documentation | VERIFY |
|
|
259
|
+
|
|
260
|
+
### VERIFY → BUILD-FIX Loop
|
|
261
|
+
|
|
262
|
+
```
|
|
263
|
+
┌──────────────┐
|
|
264
|
+
│ VERIFY │
|
|
265
|
+
└──────┬───────┘
|
|
266
|
+
│
|
|
267
|
+
┌────────────┴────────────┐
|
|
268
|
+
│ │
|
|
269
|
+
PASS FAIL
|
|
270
|
+
│ │
|
|
271
|
+
▼ ▼
|
|
272
|
+
┌────────┐ ┌──────────────┐
|
|
273
|
+
│ DOCS │ │ BUILD-FIX │
|
|
274
|
+
└────────┘ └──────┬───────┘
|
|
275
|
+
│
|
|
276
|
+
└──────► back to VERIFY
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
If VERIFY fails:
|
|
280
|
+
1. `/aide:build-fix` to fix issues
|
|
281
|
+
2. Re-run `/aide:verify`
|
|
282
|
+
3. Repeat until passing
|
|
283
|
+
4. Then proceed to DOCS
|
|
284
|
+
|
|
285
|
+
## Story Agent Instructions Template
|
|
286
|
+
|
|
287
|
+
When spawning story agents, include:
|
|
288
|
+
|
|
289
|
+
```markdown
|
|
290
|
+
You are story agent [AGENT-ID] working in worktree [PATH].
|
|
291
|
+
|
|
292
|
+
## Story
|
|
293
|
+
[Story name and description]
|
|
294
|
+
|
|
295
|
+
## SDLC Pipeline
|
|
296
|
+
|
|
297
|
+
Execute these stages in order. For each stage:
|
|
298
|
+
1. Create task with TaskCreate (set blockedBy for dependencies)
|
|
299
|
+
2. Claim task with TaskUpdate (owner=your-id, status=in_progress)
|
|
300
|
+
3. Execute stage using appropriate skill
|
|
301
|
+
4. Mark complete with TaskUpdate (status=completed)
|
|
302
|
+
|
|
303
|
+
### Stage Tasks to Create
|
|
304
|
+
|
|
305
|
+
TaskCreate({
|
|
306
|
+
subject: "[STORY-ID][DESIGN] Design [feature]",
|
|
307
|
+
description: "Technical design with interfaces and acceptance criteria",
|
|
308
|
+
activeForm: "Designing [feature]"
|
|
309
|
+
})
|
|
310
|
+
|
|
311
|
+
TaskCreate({
|
|
312
|
+
subject: "[STORY-ID][TEST] Write tests for [feature]",
|
|
313
|
+
description: "Failing tests based on acceptance criteria",
|
|
314
|
+
activeForm: "Writing tests"
|
|
315
|
+
})
|
|
316
|
+
// ... set blockedBy to DESIGN task ID
|
|
317
|
+
|
|
318
|
+
TaskCreate({
|
|
319
|
+
subject: "[STORY-ID][DEV] Implement [feature]",
|
|
320
|
+
description: "Make tests pass with minimal code",
|
|
321
|
+
activeForm: "Implementing [feature]"
|
|
322
|
+
})
|
|
323
|
+
// ... set blockedBy to TEST task ID
|
|
324
|
+
|
|
325
|
+
TaskCreate({
|
|
326
|
+
subject: "[STORY-ID][VERIFY] Verify [feature]",
|
|
327
|
+
description: "Full test suite, lint, type check",
|
|
328
|
+
activeForm: "Verifying [feature]"
|
|
329
|
+
})
|
|
330
|
+
// ... set blockedBy to DEV task ID
|
|
331
|
+
|
|
332
|
+
TaskCreate({
|
|
333
|
+
subject: "[STORY-ID][DOCS] Document [feature]",
|
|
334
|
+
description: "Update documentation",
|
|
335
|
+
activeForm: "Documenting [feature]"
|
|
336
|
+
})
|
|
337
|
+
// ... set blockedBy to VERIFY task ID
|
|
338
|
+
|
|
339
|
+
## Coordination
|
|
340
|
+
|
|
341
|
+
**Messaging (MCP tools):**
|
|
342
|
+
- Send status: `message_send` with from=[AGENT-ID], type="status", content="[STAGE] complete"
|
|
343
|
+
- Send blocker: `message_send` with from=[AGENT-ID], type="blocker", content="description"
|
|
344
|
+
- Check inbox: `message_list` with agent_id=[AGENT-ID]
|
|
345
|
+
- Acknowledge: `message_ack` with message_id=N, agent_id=[AGENT-ID]
|
|
346
|
+
|
|
347
|
+
**At each stage transition:**
|
|
348
|
+
1. Check messages via `message_list`
|
|
349
|
+
2. Acknowledge and act on any requests
|
|
350
|
+
3. Send `status` message with new stage name
|
|
351
|
+
|
|
352
|
+
**Shared state:**
|
|
353
|
+
- Check existing decisions: `mcp__plugin_aide_aide__decision_get` (MCP read)
|
|
354
|
+
- Record new decisions: `aide decision set <topic> "<decision>"` (CLI write)
|
|
355
|
+
- Share discoveries: `aide memory add --category=discovery "<finding>"` (CLI write)
|
|
356
|
+
|
|
357
|
+
## VERIFY Failure Handling
|
|
358
|
+
|
|
359
|
+
If VERIFY stage fails:
|
|
360
|
+
1. DO NOT proceed to DOCS
|
|
361
|
+
2. Invoke /aide:build-fix to address failures
|
|
362
|
+
3. Re-run /aide:verify
|
|
363
|
+
4. Repeat until VERIFY passes
|
|
364
|
+
5. Only then proceed to DOCS
|
|
365
|
+
|
|
366
|
+
## Completion
|
|
367
|
+
|
|
368
|
+
All stages must complete. When done:
|
|
369
|
+
1. All 5 tasks show [completed]
|
|
370
|
+
2. VERIFY must have passed (not skipped)
|
|
371
|
+
3. All changes committed to your worktree branch
|
|
372
|
+
4. Send completion: `message_send` with from=[AGENT-ID], type="completion", content="Story [STORY-ID] complete"
|
|
373
|
+
5. Report: "Story [STORY-ID] complete - ready for merge"
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
## Flat Mode (Legacy)
|
|
377
|
+
|
|
378
|
+
For non-code tasks or simple work, use `--flat`:
|
|
379
|
+
|
|
380
|
+
```
|
|
381
|
+
swarm 3 --flat
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
This uses the original task-grabbing model without SDLC stages.
|
|
385
|
+
|
|
386
|
+
## Coordination via aide
|
|
387
|
+
|
|
388
|
+
**Messages** (MCP tools — primary coordination mechanism):
|
|
389
|
+
```
|
|
390
|
+
# Send status update (broadcast)
|
|
391
|
+
message_send: from="agent-auth", type="status", content="[DESIGN] complete, starting TEST"
|
|
392
|
+
|
|
393
|
+
# Send direct message
|
|
394
|
+
message_send: from="agent-auth", to="agent-payments", type="request", content="Need payment API schema"
|
|
395
|
+
|
|
396
|
+
# Check inbox
|
|
397
|
+
message_list: agent_id="agent-auth"
|
|
398
|
+
|
|
399
|
+
# Acknowledge after reading
|
|
400
|
+
message_ack: message_id=42, agent_id="agent-auth"
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
**Decisions** (shared across agents):
|
|
404
|
+
```bash
|
|
405
|
+
# Write (CLI)
|
|
406
|
+
aide decision set "auth-strategy" "JWT with refresh tokens"
|
|
407
|
+
|
|
408
|
+
# Read (MCP) - use mcp__plugin_aide_aide__decision_get with topic="auth-strategy"
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
**Memory** (shared discoveries):
|
|
412
|
+
```bash
|
|
413
|
+
aide memory add --category=discovery "User model needs email validation"
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
## OpenCode Mode
|
|
417
|
+
|
|
418
|
+
OpenCode does not have native subagent support. For multi-agent swarms with OpenCode:
|
|
419
|
+
|
|
420
|
+
**Setup:**
|
|
421
|
+
1. Create worktrees as normal (one per story)
|
|
422
|
+
2. Launch separate OpenCode terminal sessions, one per story
|
|
423
|
+
3. Each session works in its assigned worktree directory
|
|
424
|
+
|
|
425
|
+
**Coordination:**
|
|
426
|
+
- **No TaskList** — OpenCode sessions don't share a task system
|
|
427
|
+
- **Use aide messages** as the primary coordination mechanism:
|
|
428
|
+
- Each session uses `message_send` to report status, blockers, and completion
|
|
429
|
+
- Check `message_list` at each stage transition
|
|
430
|
+
- The orchestrator monitors all agents via `message_list` with their own agent_id
|
|
431
|
+
- **Use aide state** for progress tracking:
|
|
432
|
+
```bash
|
|
433
|
+
aide state set "agent-auth:stage" "TEST"
|
|
434
|
+
aide state set "agent-auth:status" "running"
|
|
435
|
+
```
|
|
436
|
+
- Monitor all agents: `mcp__plugin_aide_aide__state_list`
|
|
437
|
+
|
|
438
|
+
**Orchestrator role (human or primary session):**
|
|
439
|
+
1. Decompose stories (use `/aide:plan-swarm` first)
|
|
440
|
+
2. Create worktrees
|
|
441
|
+
3. Launch terminal sessions with instructions
|
|
442
|
+
4. Monitor via `message_list` and `state_list`
|
|
443
|
+
5. When all sessions report `completion`, run `/aide:worktree-resolve`
|
|
444
|
+
|
|
445
|
+
## Completion (MANDATORY STEPS)
|
|
446
|
+
|
|
447
|
+
Swarm completion checklist - ALL REQUIRED:
|
|
448
|
+
|
|
449
|
+
### Step 1: Verify All Stories Complete
|
|
450
|
+
```
|
|
451
|
+
TaskList # All story tasks must show [completed]
|
|
452
|
+
```
|
|
453
|
+
- Every story must have completed all 5 SDLC stages
|
|
454
|
+
- No tasks should be [pending] or [in_progress]
|
|
455
|
+
|
|
456
|
+
### Step 2: Check for Blockers
|
|
457
|
+
Use `mcp__plugin_aide_aide__memory_list` with category=blocker
|
|
458
|
+
- If blockers exist, resolve them before proceeding
|
|
459
|
+
- Use `/aide:build-fix` for any remaining build/test issues
|
|
460
|
+
|
|
461
|
+
### Step 3: Final Verification
|
|
462
|
+
Run verification on each worktree:
|
|
463
|
+
```bash
|
|
464
|
+
cd .aide/worktrees/story-X && npm test && npm run build
|
|
465
|
+
```
|
|
466
|
+
- If any fail, invoke `/aide:build-fix` and re-verify
|
|
467
|
+
|
|
468
|
+
### Step 4: Merge Worktrees (MANDATORY)
|
|
469
|
+
**YOU MUST invoke `/aide:worktree-resolve`** - this is not optional.
|
|
470
|
+
```
|
|
471
|
+
/aide:worktree-resolve
|
|
472
|
+
```
|
|
473
|
+
This skill will:
|
|
474
|
+
- Merge each story branch into main
|
|
475
|
+
- Handle any merge conflicts
|
|
476
|
+
- Clean up worktrees
|
|
477
|
+
|
|
478
|
+
### Step 5: Record Session
|
|
479
|
+
Only after successful merge, record the swarm session (see Orchestrator Memory below).
|
|
480
|
+
|
|
481
|
+
## Orchestrator Memory
|
|
482
|
+
|
|
483
|
+
After swarm completes, record the session using the CLI:
|
|
484
|
+
|
|
485
|
+
```bash
|
|
486
|
+
aide memory add --category=session --tags=swarm,sdlc,session:${CLAUDE_SESSION_ID:0:8} "## Swarm: [Brief Description]
|
|
487
|
+
|
|
488
|
+
### Stories Completed
|
|
489
|
+
- Story A: [outcome]
|
|
490
|
+
- Story B: [outcome]
|
|
491
|
+
- Story C: [outcome]
|
|
492
|
+
|
|
493
|
+
### Key Decisions Made
|
|
494
|
+
- [decision]: [rationale]
|
|
495
|
+
|
|
496
|
+
### Files Changed
|
|
497
|
+
- [summary of changes per story]
|
|
498
|
+
|
|
499
|
+
### Merge Status
|
|
500
|
+
- [branches merged successfully / any conflicts]"
|
|
501
|
+
```
|