@syntesseraai/opencode-feature-factory 0.6.7 → 0.6.9
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 +6 -4
- package/agents/building.md +28 -541
- package/agents/documenting.md +39 -0
- package/agents/ff-research.md +18 -410
- package/agents/pipeline.md +20 -71
- package/agents/planning.md +28 -350
- package/agents/reviewing.md +27 -475
- package/bin/ff-deploy.js +81 -7
- package/commands/pipeline/building/breakdown.md +4 -3
- package/commands/pipeline/building/implement-batch.md +4 -3
- package/commands/pipeline/building/run.md +8 -8
- package/commands/pipeline/building/validate-batch.md +4 -3
- package/commands/pipeline/complete.md +1 -1
- package/commands/pipeline/documentation/{run-codex.md → document.md} +3 -4
- package/commands/pipeline/documentation/gate.md +3 -3
- package/commands/pipeline/documentation/{run-gemini.md → review.md} +4 -3
- package/commands/pipeline/documentation/run.md +6 -7
- package/commands/pipeline/planning/gate.md +8 -6
- package/commands/pipeline/planning/plan.md +25 -0
- package/commands/pipeline/planning/run.md +7 -7
- package/commands/pipeline/planning/synthesize.md +7 -3
- package/commands/pipeline/reviewing/gate.md +3 -3
- package/commands/pipeline/reviewing/review.md +20 -0
- package/commands/pipeline/reviewing/run.md +6 -6
- package/commands/pipeline/reviewing/synthesize.md +3 -3
- package/commands/pipeline/reviewing/triage.md +2 -2
- package/commands/pipeline/start.md +5 -5
- package/dist/agent-config.js +17 -51
- package/dist/index.d.ts +1 -2
- package/dist/index.js +3 -52
- package/dist/mcp-config.js +17 -51
- package/dist/opencode-global-config.d.ts +9 -0
- package/dist/opencode-global-config.js +79 -0
- package/dist/plugin-config.js +17 -54
- package/package.json +1 -1
- package/skills/ff-reviewing-architecture/SKILL.md +34 -0
- package/skills/ff-reviewing-code-quality/SKILL.md +34 -0
- package/skills/ff-reviewing-documentation/SKILL.md +34 -0
- package/skills/ff-reviewing-security/SKILL.md +34 -0
- package/agents/ff-acceptance.md +0 -285
- package/agents/ff-building-codex.md +0 -305
- package/agents/ff-building-gemini.md +0 -305
- package/agents/ff-building-opus.md +0 -305
- package/agents/ff-planning-codex.md +0 -335
- package/agents/ff-planning-gemini.md +0 -335
- package/agents/ff-planning-opus.md +0 -335
- package/agents/ff-review.md +0 -288
- package/agents/ff-reviewing-codex.md +0 -259
- package/agents/ff-reviewing-gemini.md +0 -259
- package/agents/ff-reviewing-opus.md +0 -259
- package/agents/ff-security.md +0 -322
- package/agents/ff-validate.md +0 -316
- package/agents/ff-well-architected.md +0 -284
- package/commands/pipeline/planning/run-codex.md +0 -22
- package/commands/pipeline/planning/run-gemini.md +0 -21
- package/commands/pipeline/planning/run-opus.md +0 -21
- package/commands/pipeline/reviewing/run-codex.md +0 -12
- package/commands/pipeline/reviewing/run-gemini.md +0 -11
- package/commands/pipeline/reviewing/run-opus.md +0 -11
- package/dist/agent-context.d.ts +0 -57
- package/dist/agent-context.js +0 -282
- package/dist/plugins/ff-agent-context-create-plugin.d.ts +0 -2
- package/dist/plugins/ff-agent-context-create-plugin.js +0 -82
- package/dist/plugins/ff-agent-context-update-plugin.d.ts +0 -2
- package/dist/plugins/ff-agent-context-update-plugin.js +0 -78
- package/dist/plugins/ff-agents-clear-plugin.d.ts +0 -2
- package/dist/plugins/ff-agents-clear-plugin.js +0 -40
- package/dist/plugins/ff-agents-current-plugin.d.ts +0 -2
- package/dist/plugins/ff-agents-current-plugin.js +0 -45
- package/dist/plugins/ff-agents-delete-plugin.d.ts +0 -2
- package/dist/plugins/ff-agents-delete-plugin.js +0 -32
- package/dist/plugins/ff-agents-get-plugin.d.ts +0 -2
- package/dist/plugins/ff-agents-get-plugin.js +0 -32
- package/dist/plugins/ff-agents-list-plugin.d.ts +0 -2
- package/dist/plugins/ff-agents-list-plugin.js +0 -42
- package/dist/plugins/ff-agents-show-plugin.d.ts +0 -2
- package/dist/plugins/ff-agents-show-plugin.js +0 -22
- package/dist/plugins/ff-agents-update-plugin.d.ts +0 -2
- package/dist/plugins/ff-agents-update-plugin.js +0 -32
- package/dist/plugins/ff-plan-create-plugin.d.ts +0 -2
- package/dist/plugins/ff-plan-create-plugin.js +0 -61
- package/dist/plugins/ff-plan-update-plugin.d.ts +0 -2
- package/dist/plugins/ff-plan-update-plugin.js +0 -142
- package/dist/plugins/ff-plans-delete-plugin.d.ts +0 -2
- package/dist/plugins/ff-plans-delete-plugin.js +0 -32
- package/dist/plugins/ff-plans-get-plugin.d.ts +0 -2
- package/dist/plugins/ff-plans-get-plugin.js +0 -32
- package/dist/plugins/ff-plans-list-plugin.d.ts +0 -2
- package/dist/plugins/ff-plans-list-plugin.js +0 -42
- package/dist/plugins/ff-plans-update-plugin.d.ts +0 -2
- package/dist/plugins/ff-plans-update-plugin.js +0 -32
- package/dist/plugins/ff-review-create-plugin.d.ts +0 -2
- package/dist/plugins/ff-review-create-plugin.js +0 -256
- package/dist/plugins/ff-reviews-get-plugin.d.ts +0 -2
- package/dist/plugins/ff-reviews-get-plugin.js +0 -32
- package/dist/plugins/ff-reviews-list-plugin.d.ts +0 -2
- package/dist/plugins/ff-reviews-list-plugin.js +0 -42
- package/dist/plugins/ff-reviews-update-plugin.d.ts +0 -2
- package/dist/plugins/ff-reviews-update-plugin.js +0 -32
- package/skills/ff-context-tracking/SKILL.md +0 -573
- package/skills/ff-delegation/SKILL.md +0 -457
- package/skills/ff-swarm/SKILL.md +0 -209
|
@@ -1,457 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: ff-delegation
|
|
3
|
-
description: Enables agents to parallelize work by delegating tasks to specialized sub-agents. Use this skill to identify parallelization opportunities, select appropriate agents, coordinate multiple agents working simultaneously, and manage shared context through the .feature-factory/agents/ directory.
|
|
4
|
-
license: MIT
|
|
5
|
-
compatibility: opencode
|
|
6
|
-
metadata:
|
|
7
|
-
audience: agents
|
|
8
|
-
category: orchestration
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Delegation Skill
|
|
12
|
-
|
|
13
|
-
Use this skill to parallelize work across multiple specialized agents using UUID-based context tracking.
|
|
14
|
-
|
|
15
|
-
**⚠️ CRITICAL: Always use with ff-context-tracking skill**
|
|
16
|
-
|
|
17
|
-
The ff-context-tracking skill provides the foundation for cross-agent visibility and coordination. You MUST load it before delegating to ensure proper context management.
|
|
18
|
-
|
|
19
|
-
## When to Use
|
|
20
|
-
|
|
21
|
-
You MUST delegate when:
|
|
22
|
-
|
|
23
|
-
- **Multiple independent tasks** can be worked on simultaneously
|
|
24
|
-
- **Specialized expertise** is needed (security, architecture, ff-research)
|
|
25
|
-
- **Validation** is required from multiple perspectives
|
|
26
|
-
- **Information gathering** can happen in parallel with planning
|
|
27
|
-
|
|
28
|
-
## Prerequisites
|
|
29
|
-
|
|
30
|
-
Before using this skill:
|
|
31
|
-
|
|
32
|
-
1. **Load ff-context-tracking skill** - Essential for coordination
|
|
33
|
-
2. **Check existing agents** - Run `ff-agents-current()` to see what's happening
|
|
34
|
-
3. **Read relevant contexts** - Use `ff-agents-show()` to build on others' work
|
|
35
|
-
|
|
36
|
-
## Core Concepts
|
|
37
|
-
|
|
38
|
-
### UUID-Based Tracking
|
|
39
|
-
|
|
40
|
-
Every agent instance gets a unique UUID:
|
|
41
|
-
|
|
42
|
-
- **Your UUID**: Generated when you start working
|
|
43
|
-
- **Child UUIDs**: Generated for each delegated agent
|
|
44
|
-
- **Parent-Child Links**: Track delegation chains
|
|
45
|
-
- **Context Files**: Stored in `.feature-factory/agents/{agent}-{uuid}.md`
|
|
46
|
-
|
|
47
|
-
### Cross-Agent Visibility
|
|
48
|
-
|
|
49
|
-
Thanks to ff-context-tracking, all agents can:
|
|
50
|
-
|
|
51
|
-
- See what other agents are doing (`ff-agents-current()`)
|
|
52
|
-
- Read each other's contexts (`ff-agents-show()`)
|
|
53
|
-
- Build on each other's findings
|
|
54
|
-
- Avoid conflicts and duplication
|
|
55
|
-
|
|
56
|
-
### Available Tools
|
|
57
|
-
|
|
58
|
-
- **ff-agents-current**: List all active agents with their UUIDs
|
|
59
|
-
- **ff-agents-show**: View detailed context for a specific agent by UUID
|
|
60
|
-
- **ff-agents-clear**: Clean up agent context files when done
|
|
61
|
-
|
|
62
|
-
## Delegation Process
|
|
63
|
-
|
|
64
|
-
### Step 1: Check Existing Agents (CRITICAL)
|
|
65
|
-
|
|
66
|
-
**ALWAYS check what other agents are doing before delegating:**
|
|
67
|
-
|
|
68
|
-
```
|
|
69
|
-
ff-agents-current()
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
**Why this matters:**
|
|
73
|
-
|
|
74
|
-
- Avoid delegating research if @ff-research is already active
|
|
75
|
-
- Don't duplicate security audits if @ff-security is running
|
|
76
|
-
- Build on existing work rather than starting from scratch
|
|
77
|
-
- Prevent agent conflicts and resource waste
|
|
78
|
-
|
|
79
|
-
**Read relevant contexts:**
|
|
80
|
-
|
|
81
|
-
```
|
|
82
|
-
ff-agents-show(id: "{existing-agent-uuid}")
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
### Step 2: Generate Your UUID
|
|
86
|
-
|
|
87
|
-
Create a unique identifier for this agent instance:
|
|
88
|
-
|
|
89
|
-
```
|
|
90
|
-
Generate UUID: $MY_UUID = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
### Step 3: Document Your Context
|
|
94
|
-
|
|
95
|
-
Use `ff-agents-update` tool to create your agent context file:
|
|
96
|
-
|
|
97
|
-
```
|
|
98
|
-
ff-agents-update:
|
|
99
|
-
fileName: "{agent}-{$MY_UUID}.md"
|
|
100
|
-
content: |
|
|
101
|
-
---
|
|
102
|
-
id: "{$MY_UUID}"
|
|
103
|
-
agent: {your-agent-name}
|
|
104
|
-
title: "{task title}"
|
|
105
|
-
description: "{task description}"
|
|
106
|
-
folder: "{working directory}"
|
|
107
|
-
status: in-progress
|
|
108
|
-
started: "{ISO timestamp}"
|
|
109
|
-
session: {session ID}
|
|
110
|
-
parent: null
|
|
111
|
-
delegated_to: []
|
|
112
|
-
---
|
|
113
|
-
|
|
114
|
-
## Task Context
|
|
115
|
-
|
|
116
|
-
{Full context of what you're working on}
|
|
117
|
-
|
|
118
|
-
## Progress
|
|
119
|
-
|
|
120
|
-
- [x] Task started
|
|
121
|
-
- [ ] Analysis complete
|
|
122
|
-
- [ ] Implementation pending
|
|
123
|
-
|
|
124
|
-
## Delegated Work
|
|
125
|
-
|
|
126
|
-
No delegated work yet.
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
**Why use ff-agents-update?** This specialized tool provides:
|
|
130
|
-
|
|
131
|
-
- Security (prevents directory traversal attacks)
|
|
132
|
-
- Validation (ensures proper file naming)
|
|
133
|
-
- Organization (enforces .md extension)
|
|
134
|
-
- Safety (restricted to .feature-factory/agents/ directory)
|
|
135
|
-
|
|
136
|
-
### Step 4: Identify Parallel Opportunities
|
|
137
|
-
|
|
138
|
-
Ask: "What work can happen simultaneously?"
|
|
139
|
-
|
|
140
|
-
**Consider what you learned from checking existing agents:**
|
|
141
|
-
|
|
142
|
-
- Don't delegate research if @ff-research already has findings
|
|
143
|
-
- Don't delegate security audit if @ff-security is already running
|
|
144
|
-
- Delegate to fill gaps in existing work
|
|
145
|
-
- Delegate for independent validation dimensions
|
|
146
|
-
|
|
147
|
-
Common parallel tasks:
|
|
148
|
-
|
|
149
|
-
- **ff-research** + **Planning** (research tech while planning architecture)
|
|
150
|
-
- **Security audit** + **Architecture review** (different perspectives)
|
|
151
|
-
- **Multiple file modifications** (if in different modules)
|
|
152
|
-
- **Test writing** + **Documentation** (while implementation continues)
|
|
153
|
-
|
|
154
|
-
### Step 5: Select Agents
|
|
155
|
-
|
|
156
|
-
Use this matrix:
|
|
157
|
-
|
|
158
|
-
| Task Type | Primary Agent | Fallback | Coordination |
|
|
159
|
-
| -------------- | -------------------- | -------- | ------------ |
|
|
160
|
-
| Security audit | @ff-security | @general | Parallel |
|
|
161
|
-
| Code quality | @ff-review | @general | Parallel |
|
|
162
|
-
| Architecture | @ff-well-architected | @general | Parallel |
|
|
163
|
-
| Requirements | @ff-acceptance | @explore | Blocking |
|
|
164
|
-
| Research | @ff-research | @general | Async |
|
|
165
|
-
| Exploration | @explore | @general | Parallel |
|
|
166
|
-
| Implementation | @general | N/A | Sequential |
|
|
167
|
-
|
|
168
|
-
### Step 6: Delegate in Parallel
|
|
169
|
-
|
|
170
|
-
Generate child UUIDs and delegate:
|
|
171
|
-
|
|
172
|
-
```
|
|
173
|
-
Generate child UUIDs:
|
|
174
|
-
- $CHILD_1 = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"
|
|
175
|
-
- $CHILD_2 = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"
|
|
176
|
-
- $CHILD_3 = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"
|
|
177
|
-
|
|
178
|
-
Delegate simultaneously:
|
|
179
|
-
Task(ff-security): "Security audit: Check OAuth implementation for CSRF vulnerabilities. Write context to .feature-factory/agents/ff-security-{$CHILD_1}.md"
|
|
180
|
-
Task(ff-research): "Research: Find best OAuth libraries for Node.js. Write context to .feature-factory/agents/ff-research-{$CHILD_2}.md"
|
|
181
|
-
Task(ff-acceptance): "Validate: Check if acceptance criteria are clear. Write context to .feature-factory/agents/ff-acceptance-{$CHILD_3}.md"
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
**Important:** Each delegated agent will:
|
|
185
|
-
|
|
186
|
-
1. Create their own context file (via ff-context-tracking)
|
|
187
|
-
2. Set `parent: "{$MY_UUID}"` to link back to you
|
|
188
|
-
3. Be visible via `ff-agents-current()`
|
|
189
|
-
4. Clean up their context when done
|
|
190
|
-
|
|
191
|
-
Update your context with delegated agents using `ff-agents-get` to read your file, then `ff-agents-update` to save the updated version:
|
|
192
|
-
|
|
193
|
-
1. First, read your current context:
|
|
194
|
-
|
|
195
|
-
```
|
|
196
|
-
ff-agents-get:
|
|
197
|
-
fileName: "{agent}-{$MY_UUID}.md"
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
2. Then update with delegated agents:
|
|
201
|
-
|
|
202
|
-
```
|
|
203
|
-
ff-agents-update:
|
|
204
|
-
fileName: "{agent}-{$MY_UUID}.md"
|
|
205
|
-
content: |
|
|
206
|
-
[previous content with updated delegated_to section]
|
|
207
|
-
|
|
208
|
-
delegated_to:
|
|
209
|
-
- "{$CHILD_1}"
|
|
210
|
-
- "{$CHILD_2}"
|
|
211
|
-
- "{$CHILD_3}"
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
### Step 7: Monitor Progress
|
|
215
|
-
|
|
216
|
-
Use ff-agents-current to check status:
|
|
217
|
-
|
|
218
|
-
```
|
|
219
|
-
ff-agents-current()
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
Example response:
|
|
223
|
-
|
|
224
|
-
```json
|
|
225
|
-
{
|
|
226
|
-
"count": 4,
|
|
227
|
-
"agents": [
|
|
228
|
-
{
|
|
229
|
-
"id": "550e8400-e29b-41d4-a716-446655440000",
|
|
230
|
-
"agent": "planning",
|
|
231
|
-
"title": "Implement OAuth",
|
|
232
|
-
"status": "in-progress"
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
"id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
|
|
236
|
-
"agent": "ff-security",
|
|
237
|
-
"title": "OAuth security audit",
|
|
238
|
-
"status": "completed",
|
|
239
|
-
"parent": "550e8400-e29b-41d4-a716-446655440000"
|
|
240
|
-
}
|
|
241
|
-
]
|
|
242
|
-
}
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
### Step 8: Read Results
|
|
246
|
-
|
|
247
|
-
View specific agent details:
|
|
248
|
-
|
|
249
|
-
```
|
|
250
|
-
ff-agents-show(id: "6ba7b810-9dad-11d1-80b4-00c04fd430c8")
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
Or read the context file directly:
|
|
254
|
-
|
|
255
|
-
```
|
|
256
|
-
Read file: .feature-factory/agents/ff-security-6ba7b810-9dad-11d1-80b4-00c04fd430c8.md
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
**Thanks to ff-context-tracking, you can:**
|
|
260
|
-
|
|
261
|
-
- See all delegated agent statuses at once with `ff-agents-current()`
|
|
262
|
-
- Read detailed findings from each agent's context
|
|
263
|
-
- Build on their work rather than starting from scratch
|
|
264
|
-
- Coordinate next steps based on their results
|
|
265
|
-
|
|
266
|
-
### Step 9: Aggregate and Act
|
|
267
|
-
|
|
268
|
-
Combine findings from all delegated agents:
|
|
269
|
-
|
|
270
|
-
```markdown
|
|
271
|
-
## Summary of Delegated Work
|
|
272
|
-
|
|
273
|
-
### Security Audit (@ff-security)
|
|
274
|
-
|
|
275
|
-
- **Status:** Completed
|
|
276
|
-
- **Key Finding:** CSRF protection required
|
|
277
|
-
- **Recommendation:** Use state parameter in OAuth flow
|
|
278
|
-
|
|
279
|
-
### Research (@ff-research)
|
|
280
|
-
|
|
281
|
-
- **Status:** Completed
|
|
282
|
-
- **Key Finding:** Passport.js is most popular library
|
|
283
|
-
- **Recommendation:** Use passport-oauth2 strategy
|
|
284
|
-
|
|
285
|
-
### Acceptance Validation (@ff-acceptance)
|
|
286
|
-
|
|
287
|
-
- **Status:** Completed
|
|
288
|
-
- **Result:** All criteria are clear and achievable
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
**Build on their findings:**
|
|
292
|
-
|
|
293
|
-
- Use @ff-research's library recommendation in your plan
|
|
294
|
-
- Address @ff-security's vulnerabilities before implementation
|
|
295
|
-
- Incorporate @ff-acceptance's criteria validation into requirements
|
|
296
|
-
|
|
297
|
-
### Step 10: Clean Up (CRITICAL)
|
|
298
|
-
|
|
299
|
-
When ALL work is complete:
|
|
300
|
-
|
|
301
|
-
```
|
|
302
|
-
ff-agents-clear()
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
Or clear specific agents:
|
|
306
|
-
|
|
307
|
-
```
|
|
308
|
-
ff-agents-clear(id: "6ba7b810-9dad-11d1-80b4-00c04fd430c8")
|
|
309
|
-
ff-agents-clear(sessionID: "session-abc123")
|
|
310
|
-
ff-agents-clear(agent: "ff-research")
|
|
311
|
-
```
|
|
312
|
-
|
|
313
|
-
**Cleanup Scope:**
|
|
314
|
-
|
|
315
|
-
- **Agent context files** (`.feature-factory/agents/`): Clean up via `ff-agents-clear()` - these are temporary coordination files managed by ff-context-tracking
|
|
316
|
-
- **Plan files** (`.feature-factory/plans/`): @building agent asks user if plan should be deleted after implementation is complete
|
|
317
|
-
- **Review files** (`.feature-factory/reviews/`): Do NOT delete - these are idempotent validation records that serve as audit trail
|
|
318
|
-
- **Stale plan check**: @planning agent checks for existing plan files before creating new ones
|
|
319
|
-
|
|
320
|
-
**Why cleanup matters:**
|
|
321
|
-
|
|
322
|
-
- Prevents clutter in `.feature-factory/agents/`
|
|
323
|
-
- Avoids confusion about what's currently active
|
|
324
|
-
- Frees up resources
|
|
325
|
-
- Follows ff-context-tracking best practices
|
|
326
|
-
|
|
327
|
-
## Example: Planning with Parallel Research
|
|
328
|
-
|
|
329
|
-
**Scenario:** Implementing OAuth authentication
|
|
330
|
-
|
|
331
|
-
```markdown
|
|
332
|
-
## My Workflow
|
|
333
|
-
|
|
334
|
-
1. **Load ff-context-tracking skill**
|
|
335
|
-
- Essential for coordination and cross-agent visibility
|
|
336
|
-
|
|
337
|
-
2. **Check existing agents**
|
|
338
|
-
- ff-agents-current() → See what's already happening
|
|
339
|
-
- Avoid duplicating existing research or audits
|
|
340
|
-
|
|
341
|
-
3. **Read relevant contexts**
|
|
342
|
-
- ff-agents-show() → Build on any existing work
|
|
343
|
-
- Check if OAuth was already researched
|
|
344
|
-
|
|
345
|
-
4. **Generate my UUID**
|
|
346
|
-
- $MY_UUID = "550e8400-e29b-41d4-a716-446655440000"
|
|
347
|
-
|
|
348
|
-
5. **Document my context**
|
|
349
|
-
- Write to .feature-factory/agents/planning-550e8400-e29b-41d4-a716-446655440000.md
|
|
350
|
-
- Include context about what needs to be planned
|
|
351
|
-
|
|
352
|
-
6. **Identify parallel tasks**
|
|
353
|
-
- Security audit (can run in parallel)
|
|
354
|
-
- Research OAuth libraries (can run in parallel)
|
|
355
|
-
- Validate acceptance criteria (can run in parallel)
|
|
356
|
-
|
|
357
|
-
7. **Generate child UUIDs**
|
|
358
|
-
- $SECURITY_UUID = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
|
|
359
|
-
- $RESEARCH_UUID = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"
|
|
360
|
-
- $ACCEPTANCE_UUID = "6ba7b812-9dad-11d1-80b4-00c04fd430c8"
|
|
361
|
-
|
|
362
|
-
8. **Delegate in parallel**
|
|
363
|
-
- Task(ff-security): "Audit OAuth..." (use $SECURITY_UUID)
|
|
364
|
-
- Task(ff-research): "Research OAuth..." (use $RESEARCH_UUID)
|
|
365
|
-
- Task(ff-acceptance): "Validate..." (use $ACCEPTANCE_UUID)
|
|
366
|
-
|
|
367
|
-
9. **Update my context**
|
|
368
|
-
- Add delegated_to: [$SECURITY_UUID, $RESEARCH_UUID, $ACCEPTANCE_UUID]
|
|
369
|
-
|
|
370
|
-
10. **Monitor progress**
|
|
371
|
-
- ff-agents-current() → Check status of all delegated agents
|
|
372
|
-
|
|
373
|
-
11. **Read results**
|
|
374
|
-
- ff-agents-show(id: $SECURITY_UUID) → Get security findings
|
|
375
|
-
- ff-agents-show(id: $RESEARCH_UUID) → Get research findings
|
|
376
|
-
- ff-agents-show(id: $ACCEPTANCE_UUID) → Get validation results
|
|
377
|
-
|
|
378
|
-
12. **Create informed plan**
|
|
379
|
-
- Use all findings to create comprehensive plan
|
|
380
|
-
- Incorporate security recommendations from @ff-security
|
|
381
|
-
- Use library recommendations from @ff-research
|
|
382
|
-
- Ensure acceptance criteria from @ff-acceptance are met
|
|
383
|
-
|
|
384
|
-
13. **Clean up**
|
|
385
|
-
- ff-agents-clear() → Remove all agent contexts
|
|
386
|
-
- Clean up your own context and all delegated agents
|
|
387
|
-
```
|
|
388
|
-
|
|
389
|
-
## Best Practices
|
|
390
|
-
|
|
391
|
-
1. **ALWAYS use ff-context-tracking first** - Check existing agents before delegating
|
|
392
|
-
2. **Always document context first** - Other agents need to know what you're working on
|
|
393
|
-
3. **Generate UUIDs immediately** - Every agent instance needs a unique ID
|
|
394
|
-
4. **Prefer parallel over sequential** - Unless tasks have dependencies
|
|
395
|
-
5. **Use specific instructions** - Delegated agents need clear, actionable tasks
|
|
396
|
-
6. **Monitor with ff-agents-current** - Check status before proceeding
|
|
397
|
-
7. **Read full context** - Don't just check status, read the actual findings
|
|
398
|
-
8. **Clean up immediately** - Don't leave context files after completion
|
|
399
|
-
9. **Track parent-child relationships** - Use parent and delegated_to fields
|
|
400
|
-
|
|
401
|
-
## Common Mistakes to Avoid
|
|
402
|
-
|
|
403
|
-
- ❌ **Not checking existing agents** - Always run `ff-agents-current()` first
|
|
404
|
-
- ❌ **Delegating without context** - Always write your context file first
|
|
405
|
-
- ❌ **Reusing UUIDs** - Generate a new UUID for every agent instance
|
|
406
|
-
- ❌ **Waiting sequentially** - Don't wait for one agent to finish before starting another
|
|
407
|
-
- ❌ **Forgetting cleanup** - Always call ff-agents-clear() when done
|
|
408
|
-
- ❌ **Vague instructions** - "Check security" is too vague; "Audit OAuth flow for CSRF vulnerabilities" is specific
|
|
409
|
-
- ❌ **Ignoring results** - Actually read the context files from delegated agents
|
|
410
|
-
- ❌ **Not updating delegated_to** - Track which agents you've delegated to
|
|
411
|
-
|
|
412
|
-
## Integration with Other Skills
|
|
413
|
-
|
|
414
|
-
Always use with:
|
|
415
|
-
|
|
416
|
-
- **ff-context-tracking** - ESSENTIAL: For cross-agent visibility and coordination
|
|
417
|
-
- **ff-mini-plan** - For breaking down tasks before delegation
|
|
418
|
-
- **ff-todo-management** - For tracking parallel tasks
|
|
419
|
-
- **ff-report-templates** - For formatting aggregated results
|
|
420
|
-
|
|
421
|
-
### Why ff-context-tracking is Essential
|
|
422
|
-
|
|
423
|
-
The ff-context-tracking skill provides the foundation that makes delegation work:
|
|
424
|
-
|
|
425
|
-
- **Visibility**: See what all agents are doing via `ff-agents-current()`
|
|
426
|
-
- **Coordination**: Read other agents' contexts via `ff-agents-show()`
|
|
427
|
-
- **Accountability**: Every agent documents their work in context files
|
|
428
|
-
- **Cleanup**: Properly remove context files when done via `ff-agents-clear()`
|
|
429
|
-
|
|
430
|
-
**Without ff-context-tracking:**
|
|
431
|
-
|
|
432
|
-
- Agents work in isolation
|
|
433
|
-
- Duplication occurs
|
|
434
|
-
- Conflicts arise
|
|
435
|
-
- Context files are orphaned
|
|
436
|
-
|
|
437
|
-
**With ff-context-tracking:**
|
|
438
|
-
|
|
439
|
-
- Agents coordinate effectively
|
|
440
|
-
- Work builds on work
|
|
441
|
-
- Conflicts are avoided
|
|
442
|
-
- Resources are managed
|
|
443
|
-
|
|
444
|
-
**Always load ff-context-tracking before using ff-delegation.**
|
|
445
|
-
|
|
446
|
-
## Fallback Strategy
|
|
447
|
-
|
|
448
|
-
If specialized agents are unavailable:
|
|
449
|
-
|
|
450
|
-
1. **@ff-security** → @general with security focus
|
|
451
|
-
2. **@ff-review** → @general with code review focus
|
|
452
|
-
3. **@ff-well-architected** → @general with architecture focus
|
|
453
|
-
4. **@ff-acceptance** → @explore for requirements gathering
|
|
454
|
-
5. **@ff-research** → @general with research focus
|
|
455
|
-
6. **@explore** → @general with read-only tools
|
|
456
|
-
|
|
457
|
-
When falling back, be more specific in your instructions to compensate for the generalist nature of @general.
|
package/skills/ff-swarm/SKILL.md
DELETED
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: ff-swarm
|
|
3
|
-
description: Enables agents to partition tasks and spawn sub-agents of themselves for parallel execution. The originating agent becomes the coordinator, monitoring progress and aggregating results.
|
|
4
|
-
license: MIT
|
|
5
|
-
compatibility: opencode
|
|
6
|
-
metadata:
|
|
7
|
-
audience: agents
|
|
8
|
-
category: orchestration
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Swarm: Self-Partitioned Parallel Execution
|
|
12
|
-
|
|
13
|
-
This skill enables any agent to split a task into partitions and spawn copies of itself as sub-agents to work in parallel. The original agent becomes the **coordinator** — it does not do implementation work itself, only orchestrates.
|
|
14
|
-
|
|
15
|
-
## When to Activate
|
|
16
|
-
|
|
17
|
-
Activate this skill when the user explicitly requests parallel execution:
|
|
18
|
-
|
|
19
|
-
- **"build in parallel"**
|
|
20
|
-
- **"delegate"** (when referring to splitting the current task, not delegating to a different agent type)
|
|
21
|
-
- **"swarm this"**
|
|
22
|
-
- **"split this up"**
|
|
23
|
-
- **"parallelize"**
|
|
24
|
-
|
|
25
|
-
**Do NOT activate** for normal delegation to different agent types (e.g., delegating review to @reviewing). Use the `ff-delegation` skill for that instead.
|
|
26
|
-
|
|
27
|
-
## How It Differs from ff-delegation
|
|
28
|
-
|
|
29
|
-
| Aspect | ff-delegation | ff-swarm |
|
|
30
|
-
| -------------- | ------------------------------------ | -------------------------------------- |
|
|
31
|
-
| Sub-agent type | Different specialized agents | Copies of yourself (same agent type) |
|
|
32
|
-
| Purpose | Cross-functional work (review, test) | Partitioned parallel work on same task |
|
|
33
|
-
| Coordinator | You continue your own work too | You STOP working, only coordinate |
|
|
34
|
-
| Use case | "Review this" / "Run security audit" | "Build these 3 features in parallel" |
|
|
35
|
-
|
|
36
|
-
## Coordinator Role
|
|
37
|
-
|
|
38
|
-
Once you activate swarm mode, you become a **pure coordinator**. Your responsibilities change:
|
|
39
|
-
|
|
40
|
-
1. **Partition** — Break the task into independent, non-overlapping units of work
|
|
41
|
-
2. **Spawn** — Create sub-agents of your own type for each partition
|
|
42
|
-
3. **Monitor** — Track progress of all sub-agents
|
|
43
|
-
4. **Aggregate** — Collect and combine results when sub-agents complete
|
|
44
|
-
5. **Report** — Present the unified result to the user
|
|
45
|
-
|
|
46
|
-
**You do NOT do implementation work yourself.** If there are N partitions, spawn N sub-agents.
|
|
47
|
-
|
|
48
|
-
## Partitioning Rules
|
|
49
|
-
|
|
50
|
-
Good partitions are:
|
|
51
|
-
|
|
52
|
-
- **Independent** — No partition depends on another's output
|
|
53
|
-
- **Non-overlapping** — No two partitions modify the same files
|
|
54
|
-
- **Roughly equal** — Balance work across partitions
|
|
55
|
-
- **Self-contained** — Each partition has all the context it needs
|
|
56
|
-
|
|
57
|
-
If the task cannot be cleanly partitioned (e.g., sequential dependencies, shared file modifications), tell the user and either:
|
|
58
|
-
|
|
59
|
-
- Execute sequentially yourself (no swarm)
|
|
60
|
-
- Partition only the independent parts and handle dependent parts yourself after sub-agents complete
|
|
61
|
-
|
|
62
|
-
## Process
|
|
63
|
-
|
|
64
|
-
### Step 1: Analyze and Partition
|
|
65
|
-
|
|
66
|
-
```markdown
|
|
67
|
-
I'll split this into N parallel tasks:
|
|
68
|
-
|
|
69
|
-
1. **[Partition A]** — [scope and files]
|
|
70
|
-
2. **[Partition B]** — [scope and files]
|
|
71
|
-
3. **[Partition C]** — [scope and files]
|
|
72
|
-
|
|
73
|
-
These are independent — no shared files or dependencies between them.
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
Verify no file conflicts exist between partitions. If two partitions need the same file, restructure the partitions.
|
|
77
|
-
|
|
78
|
-
### Step 2: Generate UUIDs
|
|
79
|
-
|
|
80
|
-
Generate a coordinator UUID for yourself and a child UUID for each sub-agent:
|
|
81
|
-
|
|
82
|
-
- Coordinator: `{your-agent-type}-{coordinator-uuid}` (your context file)
|
|
83
|
-
- Sub-agent 1: `{your-agent-type}-{child-uuid-1}`
|
|
84
|
-
- Sub-agent 2: `{your-agent-type}-{child-uuid-2}`
|
|
85
|
-
- Sub-agent N: `{your-agent-type}-{child-uuid-N}`
|
|
86
|
-
|
|
87
|
-
### Step 3: Document Coordinator Context
|
|
88
|
-
|
|
89
|
-
Write your context file with the partition plan and child UUIDs:
|
|
90
|
-
|
|
91
|
-
```markdown
|
|
92
|
-
# Coordinator: {agent-type}
|
|
93
|
-
|
|
94
|
-
**Mode:** Swarm coordinator
|
|
95
|
-
**Task:** [overall task description]
|
|
96
|
-
**Partitions:** N
|
|
97
|
-
**Sub-agents:** [child-uuid-1, child-uuid-2, ...]
|
|
98
|
-
|
|
99
|
-
## Partition Plan
|
|
100
|
-
|
|
101
|
-
1. [Partition A] → child-uuid-1
|
|
102
|
-
2. [Partition B] → child-uuid-2
|
|
103
|
-
3. [Partition C] → child-uuid-3
|
|
104
|
-
|
|
105
|
-
## Status
|
|
106
|
-
|
|
107
|
-
- [ ] child-uuid-1: Pending
|
|
108
|
-
- [ ] child-uuid-2: Pending
|
|
109
|
-
- [ ] child-uuid-3: Pending
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
### Step 4: Spawn Sub-Agents
|
|
113
|
-
|
|
114
|
-
Use the Task tool to spawn each sub-agent **of your own type**. Each sub-agent must receive:
|
|
115
|
-
|
|
116
|
-
1. **Full context** of its specific partition (not the whole task)
|
|
117
|
-
2. **File boundaries** — which files it owns and must not go beyond
|
|
118
|
-
3. **Completion criteria** — what "done" looks like for its partition
|
|
119
|
-
4. **Context tracking instructions** — write results to its agent context file
|
|
120
|
-
|
|
121
|
-
```
|
|
122
|
-
Task({your-agent-type}): "
|
|
123
|
-
You are a swarm sub-agent handling partition N of a parallel task.
|
|
124
|
-
|
|
125
|
-
## Your Partition
|
|
126
|
-
[Detailed description of this partition's scope]
|
|
127
|
-
|
|
128
|
-
## Files You Own
|
|
129
|
-
- file1.ts
|
|
130
|
-
- file2.ts
|
|
131
|
-
|
|
132
|
-
## Files You Must NOT Touch
|
|
133
|
-
- [files owned by other partitions]
|
|
134
|
-
|
|
135
|
-
## Completion Criteria
|
|
136
|
-
- [What done looks like]
|
|
137
|
-
|
|
138
|
-
## Context
|
|
139
|
-
Write your progress and results to .feature-factory/agents/{your-agent-type}-{child-uuid}.md
|
|
140
|
-
"
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
**Spawn all sub-agents in a single message** so they run concurrently.
|
|
144
|
-
|
|
145
|
-
### Step 5: Monitor Progress
|
|
146
|
-
|
|
147
|
-
After spawning, periodically check on sub-agents:
|
|
148
|
-
|
|
149
|
-
```
|
|
150
|
-
ff-agents-current() → See which sub-agents are still active
|
|
151
|
-
ff-agents-show(id: "child-uuid") → Read completed results
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
### Step 6: Aggregate Results
|
|
155
|
-
|
|
156
|
-
Once all sub-agents complete:
|
|
157
|
-
|
|
158
|
-
1. Read each sub-agent's context file for results
|
|
159
|
-
2. Check for any conflicts or issues
|
|
160
|
-
3. Combine results into a unified summary
|
|
161
|
-
4. Run any cross-partition validation (e.g., type checking, tests)
|
|
162
|
-
|
|
163
|
-
### Step 7: Clean Up and Report
|
|
164
|
-
|
|
165
|
-
1. Clean up all sub-agent context files
|
|
166
|
-
2. Clean up your own coordinator context file
|
|
167
|
-
3. Present the unified result to the user
|
|
168
|
-
|
|
169
|
-
## Example: Building Agent Swarm
|
|
170
|
-
|
|
171
|
-
User says: "Build the user auth, payment integration, and notification system in parallel"
|
|
172
|
-
|
|
173
|
-
```markdown
|
|
174
|
-
## Partition Plan
|
|
175
|
-
|
|
176
|
-
1. **User Auth** → building-aaa111
|
|
177
|
-
- Files: src/auth/\*.ts, src/middleware/auth.ts
|
|
178
|
-
- Scope: Login, registration, JWT handling
|
|
179
|
-
|
|
180
|
-
2. **Payment Integration** → building-bbb222
|
|
181
|
-
- Files: src/payments/\*.ts, src/api/billing.ts
|
|
182
|
-
- Scope: Stripe integration, subscription management
|
|
183
|
-
|
|
184
|
-
3. **Notification System** → building-ccc333
|
|
185
|
-
- Files: src/notifications/\*.ts, src/api/notify.ts
|
|
186
|
-
- Scope: Email, push, webhook notifications
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
Then spawn 3 `building` sub-agents, one for each partition.
|
|
190
|
-
|
|
191
|
-
## Example: Planning Agent Swarm
|
|
192
|
-
|
|
193
|
-
User says: "Plan out the API redesign, database migration, and frontend overhaul in parallel"
|
|
194
|
-
|
|
195
|
-
Spawn 3 `planning` sub-agents, each creating their own plan for their partition.
|
|
196
|
-
|
|
197
|
-
## Example: Reviewing Agent Swarm
|
|
198
|
-
|
|
199
|
-
User says: "Review these 12 changed files in parallel"
|
|
200
|
-
|
|
201
|
-
Partition files into groups and spawn `reviewing` sub-agents, each reviewing their subset.
|
|
202
|
-
|
|
203
|
-
## Guardrails
|
|
204
|
-
|
|
205
|
-
- **Maximum sub-agents:** Cap at 5 concurrent sub-agents to avoid overwhelming the system
|
|
206
|
-
- **File ownership is strict:** Sub-agents must not modify files outside their partition
|
|
207
|
-
- **Fail fast:** If a sub-agent fails, report it immediately rather than waiting for all to complete
|
|
208
|
-
- **No nested swarms:** Sub-agents must NOT activate ff-swarm themselves (one level of fan-out only)
|
|
209
|
-
- **Sequential fallback:** If partitioning isn't possible, say so and execute normally
|