Skip to content

Upgrade swarm: role-aware dispatch, specialist roles & structured system prompts#352

Merged
justrach merged 1 commit intomainfrom
feat/swarm-roles-grid-prompts
Mar 24, 2026
Merged

Upgrade swarm: role-aware dispatch, specialist roles & structured system prompts#352
justrach merged 1 commit intomainfrom
feat/swarm-roles-grid-prompts

Conversation

@justrach
Copy link
Copy Markdown
Owner

@justrach justrach commented Mar 24, 2026

Summary

  • Fix: workers now use orchestrator-assigned roles — previously all workers ran as fixer regardless of what the orchestrator decomposed. Now workerFn passes args.worker.role to resolveWithProbe(), so each agent gets the right system prompt, model tier, and read/write permissions.
  • Orchestrator is role-aware — prompt now lists all 12 available roles with descriptions and read/write capabilities. Also dispatches as "orchestrator" role (picks up bolt/gpt-5.4 from grid).
  • 4 new specialist roles added to roles.zig and grid.zig:
    • safety_auditor (opus) — memory safety: UAF, double-free, allocator mismatch, silent OOM
    • zig_specialist (sonnet, writable) — errdefer, slice ownership, allocator lifecycle
    • api_reviewer (sonnet) — ownership semantics, return lifetimes, doc accuracy
    • test_writer (sonnet, writable) — regression tests with leak detection
  • All 12 role prompts rewritten with structured format:
    • WHEN TO USE / GUIDELINES / RULES sections
    • Checklists for reviewers and auditors
    • "Simple-first, reuse-first, read-before-write" for fixers
    • Scope limits and post-edit verification gates
    • Severity-ranked output (HIGH/MEDIUM/LOW)

Test plan

  • zig build test passes locally
  • CI zig build test check

🤖 Generated with Claude Code

…les & Amp-inspired system prompts

- Fix workerFn to use orchestrator-assigned role instead of hardcoded "fixer"
- Orchestrator now dispatches as "orchestrator" role (picks up bolt/gpt-5.4 from grid)
- Orchestrator prompt lists all available roles with read/write capabilities
- Add 4 specialist roles: safety_auditor (opus), zig_specialist, api_reviewer, test_writer
- Rewrite all 12 role system prompts inspired by Amp/Claude Code/Windsurf patterns:
  - Structured WHEN TO USE / GUIDELINES / RULES format
  - Checklists for reviewers and auditors
  - "Simple-first, reuse-first, read-before-write" for fixers
  - Scope limits and verification gates
  - Severity-ranked output format

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@justrach justrach force-pushed the feat/swarm-roles-grid-prompts branch from 4c9b9d8 to a42fc7e Compare March 24, 2026 06:33
@justrach justrach merged commit dfd27dd into main Mar 24, 2026
2 checks passed
@justrach justrach deleted the feat/swarm-roles-grid-prompts branch March 24, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant