-
Notifications
You must be signed in to change notification settings - Fork 0
[Bug] squad.agent.md roster not synced when agents are added to team.md #83
Description
Summary
When new agents are added to `.squad/team.md\ (via \squad cast\ or manual edit), the \.github/agents/squad.agent.md`\ file is NOT updated. This causes the Squad coordinator to be unaware of agents that exist on the team, leading to:
- Invisible agents — the coordinator never routes work to them
- Missing reviews — PR reviews don't include their perspective
- Stale routing — routing summary doesn't reflect actual team structure
Reproduction
- Create a Squad team with initial agents (e.g., 6 agents)
- Add new agents later: `squad cast Riley "Architect"`\
- Observe: `.squad/team.md
\ shows 8 agents, \.github/agents/squad.agent.md`\ still shows 6 - Start a new session — coordinator only knows about the original 6
Real-world impact
In `diberry/microsoft-mcp-doc-generation`:
- Riley (Architect) was added March 22 via `squad cast`\
- Cameron (Test Lead) was added same day
- `.squad/team.md
\ was updated correctly (commits \374259c\, \6acb8e5\, \045759b`) - `.github/agents/squad.agent.md
\ was NEVER updated (last touched at initial Squad setup \69ca6eb`) - Result: Riley's architecture review (squad command not found after install bradygaster/squad#187) sat for 5+ days without being routed
- Manual fix required: PR fix: add Riley and Cameron to Squad agent roster microsoft-mcp-doc-generation#313
Root cause
`.github/agents/squad.agent.md\ hardcodes the team roster and routing summary. It's generated once during Squad init but never regenerated when the team changes. \.squad/team.md\ is the source of truth but \squad.agent.md`\ doesn't derive from it.
Expected behavior
When agents are added/removed/renamed in `team.md`:
- `squad.agent.md`\ should auto-regenerate the Team Roster table
- `squad.agent.md`\ should auto-regenerate the Routing Summary based on agent roles
- OR the coordinator should read `team.md
\ at runtime instead of relying on hardcoded roster in \squad.agent.md`\
Suggested fix options
Option A (recommended): During `squad cast\ / \squad release\ / \squad promote\, regenerate the Team Roster and Routing Summary sections of \squad.agent.md\ from \team.md`.
Option B: Add a `squad sync\ command that regenerates \squad.agent.md\ from \team.md`. Run automatically after any team mutation.
Option C: Change the coordinator prompt to read `team.md\ directly instead of hardcoding the roster in \squad.agent.md`. The agent instructions would say "Read .squad/team.md for the current roster" instead of listing agents inline.
Files involved
- `.github/agents/squad.agent.md`\ — Coordinator prompt (hardcoded roster)
- `.squad/team.md`\ — Source of truth (updated by cast/release commands)
- `.squad/routing.md`\ — Routing rules (also potentially stale)