Project: pvybutler refactoring v1
Orchestrator: Qwen 3.6 35B MoE (110 tok/s, 128K ctx)
Date: 2026-07-26
Three teams, each with a focused scope. Teams hand off sequentially — Brand → Security → Perf-Routes → Code Review.
brand| Member | Agent Type | Model | Tools | Task |
|---|---|---|---|---|
brand-explorer |
explorer | Qwen 3.6 | read-only | Find all references to old brand across the codebase |
brand-worker |
worker | Qwen 3.6 | edit + execute | Apply renames per the brand-rename-checklist skill |
Spawn sequence:
[
{
"name": "swarm_spawn",
"arguments": {
"agent_type": "explorer",
"task": "Find ALL references to 'accomplish' (case-insensitive) in the pvybutler repo. Categorize them: package names, env vars, display strings, docs, CI/CD. Return a structured list with file:line for each.",
"team": "brand",
"description": "Map all brand references"
}
},
{
"name": "swarm_spawn",
"arguments": {
"agent_type": "worker",
"task": "Load skill brand-rename-checklist. Using the explorer's findings, rename all @accomplish/* packages to @pvybutler/* in package.json files. Then fix all import paths. Run pnpm typecheck after. Commit: refactor(brand): rename package names",
"team": "brand",
"description": "Rename package names"
}
}
]
Collection:
{
"name": "swarm_collect",
"arguments": { "team": "brand", "timeout": "600s" }
}
Handoff to security:
{
"name": "swarm_handoff",
"arguments": {
"task_id": "<brand-worker-task-id>",
"to_agent_type": "worker",
"note": "Brand rename complete. Now run the security audit on the renamed codebase. Use the security-audit specialist manifest and the security-scan skill."
}
}
security| Member | Agent Type | Model | Tools | Task |
|---|---|---|---|---|
security-auditor |
subagent | GLM-5.2 (Think High) | read-only | Deep security audit across 6 dimensions |
security-fixer |
worker | Qwen 3.6 | edit + execute | Apply fixes from audit findings (Critical + High only) |
Spawn sequence:
[
{
"name": "swarm_spawn",
"arguments": {
"agent_type": "subagent",
"task": "You are the security-audit specialist. Load skill security-scan. Audit the pvybutler codebase for: (1) AES-256-GCM crypto, (2) Electron context isolation, (3) IPC handler validation, (4) rate limiter, (5) secrets handling, (6) subprocess spawning. Produce a structured report with Critical/High/Medium/Low findings, each with file:line references.",
"team": "security",
"description": "Full security audit"
}
}
]
After audit completes, spawn the fixer with the findings:
{
"name": "swarm_spawn",
"arguments": {
"agent_type": "worker",
"task": "You are the security-fixer. The security auditor found these Critical and High findings: <paste findings here>. Fix each one. Run pnpm typecheck after each fix. Commit per fix: fix(security): <description>. Only fix Critical and High — leave Medium/Low as documented tech debt.",
"team": "security",
"description": "Apply security fixes"
}
}
Mailbox communication (if needed):
{
"name": "swarm_send",
"arguments": {
"to": "security-fixer",
"team": "security",
"subject": "Audit report ready",
"body": "Critical findings: C1 (IV reuse at secrets-service.ts:47), C2 (no context isolation at main.ts:23). High: H1 (no input validation on ipc:saveTask), H2 (rate limiter bypass on /api/tasks). Fix C1 and C2 first.",
"type": "notification"
}
}
Handoff to perf-routes:
{
"name": "swarm_handoff",
"arguments": {
"task_id": "<security-fixer-task-id>",
"to_agent_type": "worker",
"note": "Security fixes applied. Now run performance profiling and routes refactoring. Spawn the perf-profiler and routes-refactor specialists."
}
}
perf-routes| Member | Agent Type | Model | Tools | Task |
|---|---|---|---|---|
perf-profiler |
subagent | DeepSeek V4 Pro (Think Max) | read-only + execute | Profile all 6 performance dimensions, produce optimization plan |
routes-worker |
worker | Qwen 3.6 | edit + execute | Restructure daemon routes for REST conformance |
test-writer |
worker | Qwen 3.6 | edit + execute | Write/update tests for all changes across all tracks |
Spawn perf profiler and routes worker in parallel:
[
{
"name": "swarm_spawn",
"arguments": {
"agent_type": "subagent",
"task": "You are the perf-optimizer specialist. Load skill perf-profiler. Profile the pvybutler codebase: bundle size, IPC overhead, daemon route latency, scheduler, storage migrations, memory. Produce a structured optimization plan with P0/P1/P2/P3 priorities.",
"team": "perf-routes",
"description": "Performance profiling"
}
},
{
"name": "swarm_spawn",
"arguments": {
"agent_type": "worker",
"task": "You are the routes-refactor specialist. Load skill routes-api-conformance. Map all daemon routes in apps/daemon/src/daemon-routes.ts. Fix REST conformance violations one per commit. Standardize error format. Clean up task pipeline. Commit per fix: refactor(routes): <description>.",
"team": "perf-routes",
"description": "Routes refactoring"
}
}
]
After both complete, spawn test writer:
{
"name": "swarm_spawn",
"arguments": {
"agent_type": "worker",
"task": "You are the ts-test-writer specialist. Write tests for all modified modules across the brand, security, and routes refactoring tracks. Target 80%+ coverage on modified files. Run pnpm test after each file. Commit per test file: test(<scope>): add tests for <module>.",
"team": "perf-routes",
"description": "Write tests for all changes"
}
}
Final handoff to code review:
{
"name": "swarm_handoff",
"arguments": {
"task_id": "<test-writer-task-id>",
"to_agent_type": "code-review",
"note": "All refactoring tracks complete. Review all changes for correctness, regressions, and missing tests. Check git diff against the refactoring spec."
}
}
Start
│
├── swarm_collect(team="brand") ← wait for brand team
│
├── swarm_handoff → security
│
├── swarm_collect(team="security") ← wait for security team
│
├── swarm_handoff → perf-routes
│
├── swarm_collect(team="perf-routes") ← wait for perf-routes team
│
├── swarm_handoff → code-review
│
└── swarm_collect(team="perf-routes") ← wait for code review
│
└── Done — synthesize final report
{
"to": "<next-team-worker>",
"subject": "Track complete — handing off",
"body": "Track <name> is complete. Summary: <count> commits, <count> files changed, <status>. The next track is <track-name>. Key context: <anything the next team needs to know>.",
"type": "notification"
}
{
"to": "security-fixer",
"subject": "Finding: <severity> — <short description>",
"body": "File: <file:line>\nIssue: <description>\nRecommendation: <fix>\nSeverity: <Critical/High/Medium/Low>",
"type": "notification"
}
{
"to": "orchestrator",
"subject": "BLOCKER: <description>",
"body": "I cannot proceed because <reason>. I need <what's needed> to continue. Current progress: <X of Y tasks done>.",
"type": "notification"
}
In config.json:
{
"swarm": {
"maxTeamSize": 8
}
}
brand: 2 members (well within cap)security: 2 membersperf-routes: 3 members (profiler + routes worker + test writer)All teams run sequentially (brand → security → perf-routes), so max concurrent members at any time is 3.
If a swarm member fails (crashes, timeout):
swarm_status to check which members failedmaxMemberRestarts = 2)If swarm_collect times out:
swarm_status for stuck membersswarm_send to stuck member asking for statusswarm_handoff the task to a fresh memberIf a specialist runs out of context (128K for Qwen 3.6):
Violetta blocks — handled by ParseThinkTags