Skip to content

Commit 68102fd

Browse files
committed
fix: update agents
1 parent db8aac7 commit 68102fd

3 files changed

Lines changed: 524 additions & 60 deletions

File tree

.agents/skills/implement-tasks/SKILL.md

Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ Before implementing, check for common issues:
9292
1. **All dependency IDs exist** — No dangling references
9393
2. **No circular dependencies** — The graph must be a DAG (can run a topological sort)
9494
3. **All tasks have acceptance criteria** — Cannot verify completion without them
95-
4. **Phase ordering is logical** — Foundation before features, core before polish
95+
4. **All tasks have agent and moeExperts** — Required for delegation (added by `prd-to-tasks` step 6)
96+
5. **Phase ordering is logical** — Foundation before features, core before polish
9697

9798
Run validation with:
9899

@@ -157,25 +158,31 @@ T001 → T002 → T003 → T004 → T005 → T006 → T007 → ...
157158

158159
Tasks with no dependencies can run in parallel. Tasks that depend on others must wait.
159160

160-
### Step 4: For Each Task, Select Expert Mix
161+
### Step 4: For Each Task, Read Agent and MoE Experts
161162

162-
Map task tags/domain to the optimal MoE expert panel. See the `mixture-of-experts` skill for expert definitions:
163+
Since `prd-to-tasks` v1.1+, every task already has explicit `agent` and
164+
`moeExperts` fields assigned. Read them directly from tasks.json — no inference
165+
needed:
163166

164-
| Task Domain (tags) | Expert Mix | Why |
165-
| --------------------------- | ------------------------------------------------------------------ | ------------------------- |
166-
| `setup`, `types`, `config` | `architect`, `maintainer` | Structure and conventions |
167-
| `auth`, `security` | `architect`, `security`, `maintainer` | Security-critical code |
168-
| `api`, `endpoint` | `architect`, `api-designer`, `security`, `performance` | API design + security |
169-
| `ui`, `component` | `maintainer`, `minimalist`, `performance`, `dx-specialist` | Frontend quality |
170-
| `db`, `schema`, `migration` | `data-modeler`, `performance`, `architect` | Data correctness |
171-
| `test` | `maintainer`, `security` | Test quality and coverage |
172-
| `docs` | `maintainer`, `dx-specialist` | Clarity and usefulness |
173-
| `performance`, `optimize` | `performance`, `architect` | Speed and scalability |
174-
| `a11y` | `maintainer`, `dx-specialist` | Accessibility standards |
175-
| Mixed / complex | `architect`, `security`, `performance`, `maintainer`, `minimalist` | Full coverage |
176-
| Unknown | `architect`, `maintainer`, `minimalist` | Safe default |
167+
```python
168+
# Read pre-assigned agent and experts
169+
task = tasks['T004']
170+
agent = task['agent'] # e.g., "backend-engineer"
171+
moe_experts = task['moeExperts'] # e.g., ["architect", "api-designer", "security"]
172+
```
173+
174+
The `agent` field determines who writes the code (the squad agent). The
175+
`moeExperts` field determines who reviews before implementation.
176+
177+
#### Fallback: Tasks Without Explicit Assignments
177178

178-
**Override rule:** If the task description or acceptance criteria suggest special concerns (e.g., high security, strict performance target), adjust the expert mix accordingly.
179+
If a task is missing `agent` or `moeExperts` (pre-v1.1 tasks.json or manually
180+
created), use the `mixture-of-experts` skill to select the appropriate experts
181+
based on the task's tags and domain. See `mixture-of-experts` → "Common Patterns"
182+
for the canonical tag-to-expert mapping table.
183+
184+
Prefer updating the tasks.json with explicit assignments — it's more reliable
185+
and reviewable than runtime inference.
179186

180187
### Step 5: Delegate via MoE
181188

@@ -201,19 +208,25 @@ When multiple tasks have no mutual dependencies, run them concurrently:
201208

202209
```bash
203210
# Tasks T004 and T005 are independent (both depend on T003 but not each other)
204-
# Spawn them in parallel tmux sessions
211+
# Read their moeExperts from tasks.json and spawn in parallel
212+
213+
# T004: moeExperts read from tasks.json, e.g., ["architect", "api-designer", "security"]
214+
EXPERTS_T004=$(python3 -c "
215+
import json
216+
t = [t for t in json.load(open('tasks.json'))['tasks'] if t['id']=='T004'][0]
217+
print(','.join(t['moeExperts']))
218+
")
205219

206-
# T004
207220
tmux new-session -d -s task-T004
208221
tmux send-keys -t task-T004 \
209222
"pi -p 'Implement task T004: [description]. Acceptance criteria: [criteria].
210-
Use MoE experts: architect, api-designer, security.'" C-m
223+
Use MoE experts: \$EXPERTS_T004.'" C-m
211224

212-
# T005
225+
# T005: same pattern
213226
tmux new-session -d -s task-T005
214227
tmux send-keys -t task-T005 \
215228
"pi -p 'Implement task T005: [description]. Acceptance criteria: [criteria].
216-
Use MoE experts: data-modeler, performance, architect.'" C-m
229+
Use MoE experts: \$EXPERTS_T005.'" C-m
217230
```
218231

219232
### Step 6: Verify Completion
@@ -374,29 +387,17 @@ echo ""
374387

375388
# Execute each task
376389
for TID in $ORDER; do
377-
# Get task details
390+
# Get task details including pre-assigned agent and MoE experts
378391
TITLE=$(python3 -c "import json; [print(t['title']) for t in json.load(open('$TASKS_FILE'))['tasks'] if t['id']=='$TID']")
379392
DESC=$(python3 -c "import json; [print(t['description']) for t in json.load(open('$TASKS_FILE'))['tasks'] if t['id']=='$TID']")
380-
TAGS=$(python3 -c "import json; [print(' '.join(t.get('tags',[]))) for t in json.load(open('$TASKS_FILE'))['tasks'] if t['id']=='$TID']")
393+
AGENT=$(python3 -c "import json; [print(t['agent']) for t in json.load(open('$TASKS_FILE'))['tasks'] if t['id']=='$TID']")
394+
EXPERTS=$(python3 -c "import json; [print(','.join(t['moeExperts'])) for t in json.load(open('$TASKS_FILE'))['tasks'] if t['id']=='$TID']")
381395
CRITERIA=$(python3 -c "import json; [print('\n'.join('- ' + a for a in t['acceptanceCriteria'])) for t in json.load(open('$TASKS_FILE'))['tasks'] if t['id']=='$TID']")
382396

383397
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
384398
echo "📋 $TID: $TITLE"
385-
echo " Tags: $TAGS"
386-
echo ""
387-
388-
# Select expert mix based on tags (simplified)
389-
EXPERTS="architect maintainer"
390-
case "$TAGS" in
391-
*auth*|*security*) EXPERTS="architect security maintainer" ;;
392-
*api*) EXPERTS="architect api-designer security performance" ;;
393-
*ui*) EXPERTS="maintainer minimalist performance dx-specialist" ;;
394-
*db*) EXPERTS="data-modeler performance architect" ;;
395-
*test*) EXPERTS="maintainer security" ;;
396-
*docs*) EXPERTS="maintainer dx-specialist" ;;
397-
esac
398-
399-
echo " Experts: $EXPERTS"
399+
echo " Agent: $AGENT"
400+
echo " MoE Experts: $EXPERTS"
400401
echo ""
401402

402403
# Build MoE prompt
@@ -435,7 +436,7 @@ echo " $TOTAL/$TOTAL tasks done"
435436
- **Verify each task against acceptance criteria** — Don't mark done without checking
436437
- **Fix problems at the source** — If T005 fails because T002 is buggy, fix T002
437438
- **Report progress clearly** — Phase + task status so the user knows what's happening
438-
- **Adjust expert mix per task**Auth tasks need `security`, UI tasks don't
439+
- **Use explicit agent and moeExperts from tasks.json**Read them directly, don't infer. They were assigned during `prd-to-tasks` step 6 for a reason.
439440
- **Keep the user in the loop** — Especially when a task is blocked or needs clarification
440441

441442
### DON'Ts
@@ -481,7 +482,7 @@ Last Updated: 2026-04-27 14:30
481482
create-prd → Produces PRD
482483
prd-to-tasks → Produces tasks.json
483484
implement-tasks → Executes tasks.json
484-
├── Uses: mixture-of-experts (for each task)
485+
├── Uses: mixture-of-experts (expert definitions, spawn/aggregate patterns)
485486
├── Uses: terminal-multiplexer (for parallel tasks)
486487
├── Uses: grill-me (when blocked by ambiguity)
487488
└── Uses: project-files (for status tracking)

0 commit comments

Comments
 (0)