@syntesseraai/opencode-feature-factory 0.2.13 → 0.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agents/building.md +66 -16
- package/agents/planning.md +59 -15
- package/agents/reviewing.md +47 -16
- package/dist/agent-context.d.ts +54 -0
- package/dist/agent-context.js +273 -0
- package/dist/agent-management-tools.d.ts +5 -0
- package/dist/agent-management-tools.js +117 -0
- package/dist/feature-factory-setup.d.ts +9 -0
- package/dist/feature-factory-setup.js +151 -0
- package/dist/index.d.ts +7 -2
- package/dist/index.js +61 -6
- package/dist/output.test.js +1 -1
- package/dist/quality-gate-config.test.js +1 -1
- package/dist/stop-quality-gate.js +22 -4
- package/dist/stop-quality-gate.test.js +1 -1
- package/dist/uuid.d.ts +13 -0
- package/dist/uuid.js +22 -0
- package/package.json +1 -1
- package/skills/ff-delegation/SKILL.md +313 -0
|
@@ -0,0 +1,313 @@
|
|
|
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
|
+
## When to Use
|
|
16
|
+
|
|
17
|
+
You MUST delegate when:
|
|
18
|
+
|
|
19
|
+
- **Multiple independent tasks** can be worked on simultaneously
|
|
20
|
+
- **Specialized expertise** is needed (security, architecture, research)
|
|
21
|
+
- **Validation** is required from multiple perspectives
|
|
22
|
+
- **Information gathering** can happen in parallel with planning
|
|
23
|
+
|
|
24
|
+
## Core Concepts
|
|
25
|
+
|
|
26
|
+
### UUID-Based Tracking
|
|
27
|
+
|
|
28
|
+
Every agent instance gets a unique UUID:
|
|
29
|
+
|
|
30
|
+
- **Your UUID**: Generated when you start working
|
|
31
|
+
- **Child UUIDs**: Generated for each delegated agent
|
|
32
|
+
- **Parent-Child Links**: Track delegation chains
|
|
33
|
+
- **Context Files**: Stored in `.feature-factory/agents/{agent}-{uuid}.md`
|
|
34
|
+
|
|
35
|
+
### Available Tools
|
|
36
|
+
|
|
37
|
+
- **ff-agents-current**: List all active agents with their UUIDs
|
|
38
|
+
- **ff-agents-show**: View detailed context for a specific agent by UUID
|
|
39
|
+
- **ff-agents-clear**: Clean up agent context files when done
|
|
40
|
+
|
|
41
|
+
## Delegation Process
|
|
42
|
+
|
|
43
|
+
### Step 1: Generate Your UUID
|
|
44
|
+
|
|
45
|
+
Create a unique identifier for this agent instance:
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
Generate UUID: $MY_UUID = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Step 2: Document Your Context
|
|
52
|
+
|
|
53
|
+
Write your task to `.feature-factory/agents/`:
|
|
54
|
+
|
|
55
|
+
```markdown
|
|
56
|
+
Write file: .feature-factory/agents/{agent}-{$MY_UUID}.md
|
|
57
|
+
Content:
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
id: "{$MY_UUID}"
|
|
62
|
+
agent: {your-agent-name}
|
|
63
|
+
title: "{task title}"
|
|
64
|
+
description: "{task description}"
|
|
65
|
+
folder: "{working directory}"
|
|
66
|
+
status: in-progress
|
|
67
|
+
started: "{ISO timestamp}"
|
|
68
|
+
session: {session ID}
|
|
69
|
+
parent: null
|
|
70
|
+
delegated_to: []
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Task Context
|
|
75
|
+
|
|
76
|
+
{Full context of what you're working on}
|
|
77
|
+
|
|
78
|
+
## Progress
|
|
79
|
+
|
|
80
|
+
- [x] Task started
|
|
81
|
+
- [ ] Analysis complete
|
|
82
|
+
- [ ] Implementation pending
|
|
83
|
+
|
|
84
|
+
## Delegated Work
|
|
85
|
+
|
|
86
|
+
No delegated work yet.
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Step 3: Identify Parallel Opportunities
|
|
90
|
+
|
|
91
|
+
Ask: "What work can happen simultaneously?"
|
|
92
|
+
|
|
93
|
+
Common parallel tasks:
|
|
94
|
+
|
|
95
|
+
- **Research** + **Planning** (research tech while planning architecture)
|
|
96
|
+
- **Security audit** + **Architecture review** (different perspectives)
|
|
97
|
+
- **Multiple file modifications** (if in different modules)
|
|
98
|
+
- **Test writing** + **Documentation** (while implementation continues)
|
|
99
|
+
|
|
100
|
+
### Step 4: Select Agents
|
|
101
|
+
|
|
102
|
+
Use this matrix:
|
|
103
|
+
|
|
104
|
+
| Task Type | Primary Agent | Fallback | Coordination |
|
|
105
|
+
| -------------- | -------------------- | -------- | ------------ |
|
|
106
|
+
| Security audit | @ff-security | @general | Parallel |
|
|
107
|
+
| Code quality | @ff-review | @general | Parallel |
|
|
108
|
+
| Architecture | @ff-well-architected | @general | Parallel |
|
|
109
|
+
| Requirements | @ff-acceptance | @explore | Blocking |
|
|
110
|
+
| Research | @research | @general | Async |
|
|
111
|
+
| Exploration | @explore | @general | Parallel |
|
|
112
|
+
| Implementation | @general | N/A | Sequential |
|
|
113
|
+
|
|
114
|
+
### Step 5: Delegate in Parallel
|
|
115
|
+
|
|
116
|
+
Generate child UUIDs and delegate:
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
Generate child UUIDs:
|
|
120
|
+
- $CHILD_1 = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"
|
|
121
|
+
- $CHILD_2 = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"
|
|
122
|
+
- $CHILD_3 = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"
|
|
123
|
+
|
|
124
|
+
Delegate simultaneously:
|
|
125
|
+
Task(ff-security): "Security audit: Check OAuth implementation for CSRF vulnerabilities. Write context to .feature-factory/agents/ff-security-{$CHILD_1}.md"
|
|
126
|
+
Task(research): "Research: Find best OAuth libraries for Node.js. Write context to .feature-factory/agents/research-{$CHILD_2}.md"
|
|
127
|
+
Task(ff-acceptance): "Validate: Check if acceptance criteria are clear. Write context to .feature-factory/agents/ff-acceptance-{$CHILD_3}.md"
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Update your context with delegated agents:
|
|
131
|
+
|
|
132
|
+
```markdown
|
|
133
|
+
Update file: .feature-factory/agents/{agent}-{$MY_UUID}.md
|
|
134
|
+
delegated_to:
|
|
135
|
+
|
|
136
|
+
- "{$CHILD_1}"
|
|
137
|
+
- "{$CHILD_2}"
|
|
138
|
+
- "{$CHILD_3}"
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Step 6: Monitor Progress
|
|
142
|
+
|
|
143
|
+
Use ff-agents-current to check status:
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
ff-agents-current()
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Example response:
|
|
150
|
+
|
|
151
|
+
```json
|
|
152
|
+
{
|
|
153
|
+
"count": 4,
|
|
154
|
+
"agents": [
|
|
155
|
+
{
|
|
156
|
+
"id": "550e8400-e29b-41d4-a716-446655440000",
|
|
157
|
+
"agent": "planning",
|
|
158
|
+
"title": "Implement OAuth",
|
|
159
|
+
"status": "in-progress"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
|
|
163
|
+
"agent": "ff-security",
|
|
164
|
+
"title": "OAuth security audit",
|
|
165
|
+
"status": "completed",
|
|
166
|
+
"parent": "550e8400-e29b-41d4-a716-446655440000"
|
|
167
|
+
}
|
|
168
|
+
]
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Step 7: Read Results
|
|
173
|
+
|
|
174
|
+
View specific agent details:
|
|
175
|
+
|
|
176
|
+
```
|
|
177
|
+
ff-agents-show(id: "6ba7b810-9dad-11d1-80b4-00c04fd430c8")
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Or read the context file directly:
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
Read file: .feature-factory/agents/ff-security-6ba7b810-9dad-11d1-80b4-00c04fd430c8.md
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Step 8: Aggregate and Act
|
|
187
|
+
|
|
188
|
+
Combine findings from all delegated agents:
|
|
189
|
+
|
|
190
|
+
```markdown
|
|
191
|
+
## Summary of Delegated Work
|
|
192
|
+
|
|
193
|
+
### Security Audit (@ff-security)
|
|
194
|
+
|
|
195
|
+
- **Status:** Completed
|
|
196
|
+
- **Key Finding:** CSRF protection required
|
|
197
|
+
- **Recommendation:** Use state parameter in OAuth flow
|
|
198
|
+
|
|
199
|
+
### Research (@research)
|
|
200
|
+
|
|
201
|
+
- **Status:** Completed
|
|
202
|
+
- **Key Finding:** Passport.js is most popular library
|
|
203
|
+
- **Recommendation:** Use passport-oauth2 strategy
|
|
204
|
+
|
|
205
|
+
### Acceptance Validation (@ff-acceptance)
|
|
206
|
+
|
|
207
|
+
- **Status:** Completed
|
|
208
|
+
- **Result:** All criteria are clear and achievable
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Step 9: Clean Up
|
|
212
|
+
|
|
213
|
+
When ALL work is complete:
|
|
214
|
+
|
|
215
|
+
```
|
|
216
|
+
ff-agents-clear()
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
Or clear specific agents:
|
|
220
|
+
|
|
221
|
+
```
|
|
222
|
+
ff-agents-clear(id: "6ba7b810-9dad-11d1-80b4-00c04fd430c8")
|
|
223
|
+
ff-agents-clear(sessionID: "session-abc123")
|
|
224
|
+
ff-agents-clear(agent: "research")
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
## Example: Planning with Parallel Research
|
|
228
|
+
|
|
229
|
+
**Scenario:** Implementing OAuth authentication
|
|
230
|
+
|
|
231
|
+
```markdown
|
|
232
|
+
## My Workflow
|
|
233
|
+
|
|
234
|
+
1. **Generate my UUID**
|
|
235
|
+
- $MY_UUID = "550e8400-e29b-41d4-a716-446655440000"
|
|
236
|
+
|
|
237
|
+
2. **Document my context**
|
|
238
|
+
- Write to .feature-factory/agents/planning-550e8400-e29b-41d4-a716-446655440000.md
|
|
239
|
+
|
|
240
|
+
3. **Identify parallel tasks**
|
|
241
|
+
- Security audit (can run in parallel)
|
|
242
|
+
- Research OAuth libraries (can run in parallel)
|
|
243
|
+
- Validate acceptance criteria (can run in parallel)
|
|
244
|
+
|
|
245
|
+
4. **Generate child UUIDs**
|
|
246
|
+
- $SECURITY_UUID = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
|
|
247
|
+
- $RESEARCH_UUID = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"
|
|
248
|
+
- $ACCEPTANCE_UUID = "6ba7b812-9dad-11d1-80b4-00c04fd430c8"
|
|
249
|
+
|
|
250
|
+
5. **Delegate in parallel**
|
|
251
|
+
- Task(ff-security): "Audit OAuth..." (use $SECURITY_UUID)
|
|
252
|
+
- Task(research): "Research OAuth..." (use $RESEARCH_UUID)
|
|
253
|
+
- Task(ff-acceptance): "Validate..." (use $ACCEPTANCE_UUID)
|
|
254
|
+
|
|
255
|
+
6. **Update my context**
|
|
256
|
+
- Add delegated_to: [$SECURITY_UUID, $RESEARCH_UUID, $ACCEPTANCE_UUID]
|
|
257
|
+
|
|
258
|
+
7. **Monitor progress**
|
|
259
|
+
- ff-agents-current()
|
|
260
|
+
|
|
261
|
+
8. **Read results**
|
|
262
|
+
- ff-agents-show(id: $SECURITY_UUID)
|
|
263
|
+
- ff-agents-show(id: $RESEARCH_UUID)
|
|
264
|
+
- ff-agents-show(id: $ACCEPTANCE_UUID)
|
|
265
|
+
|
|
266
|
+
9. **Create informed plan**
|
|
267
|
+
- Use all findings to create comprehensive plan
|
|
268
|
+
|
|
269
|
+
10. **Clean up**
|
|
270
|
+
- ff-agents-clear()
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
## Best Practices
|
|
274
|
+
|
|
275
|
+
1. **Always document context first** - Other agents need to know what you're working on
|
|
276
|
+
2. **Generate UUIDs immediately** - Every agent instance needs a unique ID
|
|
277
|
+
3. **Prefer parallel over sequential** - Unless tasks have dependencies
|
|
278
|
+
4. **Use specific instructions** - Delegated agents need clear, actionable tasks
|
|
279
|
+
5. **Monitor with ff-agents-current** - Check status before proceeding
|
|
280
|
+
6. **Read full context** - Don't just check status, read the actual findings
|
|
281
|
+
7. **Clean up immediately** - Don't leave context files after completion
|
|
282
|
+
8. **Track parent-child relationships** - Use parent and delegated_to fields
|
|
283
|
+
|
|
284
|
+
## Common Mistakes to Avoid
|
|
285
|
+
|
|
286
|
+
- ❌ **Delegating without context** - Always write your context file first
|
|
287
|
+
- ❌ **Reusing UUIDs** - Generate a new UUID for every agent instance
|
|
288
|
+
- ❌ **Waiting sequentially** - Don't wait for one agent to finish before starting another
|
|
289
|
+
- ❌ **Forgetting cleanup** - Always call ff-agents-clear() when done
|
|
290
|
+
- ❌ **Vague instructions** - "Check security" is too vague; "Audit OAuth flow for CSRF vulnerabilities" is specific
|
|
291
|
+
- ❌ **Ignoring results** - Actually read the context files from delegated agents
|
|
292
|
+
- ❌ **Not updating delegated_to** - Track which agents you've delegated to
|
|
293
|
+
|
|
294
|
+
## Integration with Other Skills
|
|
295
|
+
|
|
296
|
+
Always use with:
|
|
297
|
+
|
|
298
|
+
- **ff-mini-plan** - For breaking down tasks before delegation
|
|
299
|
+
- **ff-todo-management** - For tracking parallel tasks
|
|
300
|
+
- **ff-report-templates** - For formatting aggregated results
|
|
301
|
+
|
|
302
|
+
## Fallback Strategy
|
|
303
|
+
|
|
304
|
+
If specialized agents are unavailable:
|
|
305
|
+
|
|
306
|
+
1. **@ff-security** → @general with security focus
|
|
307
|
+
2. **@ff-review** → @general with code review focus
|
|
308
|
+
3. **@ff-well-architected** → @general with architecture focus
|
|
309
|
+
4. **@ff-acceptance** → @explore for requirements gathering
|
|
310
|
+
5. **@research** → @general with research focus
|
|
311
|
+
6. **@explore** → @general with read-only tools
|
|
312
|
+
|
|
313
|
+
When falling back, be more specific in your instructions to compensate for the generalist nature of @general.
|