Subchapter 54.49
workflow-wiring-guide.mdMarkdown14 KBView on GitHub
How to wire up new team members, reviewer gates, and custom workflows so they actually get enforced by the coordinator — even in a clean session with no prior memory.
The Squad framework (squad.agent.md) provides generic orchestration primitives. It does not prescribe a specific workflow. Your project’s workflow — whether that’s “all code goes through PRs and reviews” or “just commit to main” — must be wired into project-level configuration files.
If a workflow rule exists only in someone’s memory, in a chat transcript, or in decisions.md but NOT in a configuration file the coordinator reads at decision time — it will not be followed in a clean session.
The Squad framework already has concepts for routing tables, reviewer roles, and ceremonies. But having these concepts does NOT mean they work automatically:
Adding a reviewer to the roster ≠ enforcing reviews. A reviewer can be on the roster with “Reviewer” as their role and never review a single PR — because no RULE in routing.md tells the coordinator to route PRs to them. The roster says WHO exists. Rules say WHAT they enforce.
Capturing a decision ≠ enforcing it. decisions.md may contain “every change must go through a PR” and “only {ReviewerName} closes PRs.” These can get buried in a large file that the coordinator reads for context but doesn’t treat as enforcement rules. A decision is a historical record. A routing rule is an enforceable constraint.
Describing a lifecycle ≠ wiring it. squad.agent.md describes issue→branch→PR→review→merge. But if the After Agent Work section (the flow the coordinator actually follows after every agent completes) has no push/PR/review step, the lifecycle is described conceptually but never connected to the coordinator’s actual decision flow.
The pattern that works: A numbered rule in routing.md → Rules section. The coordinator reads this section, treats each rule as a constraint, and follows them. If your workflow isn’t a numbered rule, it’s a suggestion.
The coordinator reads these files to decide how to behave. If your workflow isn’t encoded in one of these, it doesn’t exist.
| File | What It Controls | Read When |
|---|---|---|
routing.md | WHO handles what, behavioral RULES, reviewer GATES | Every session start, before every routing decision |
ceremonies.md | Auto-triggered ceremonies (before/after work batches) | Before spawning work batches, after completion |
templates/issue-lifecycle.md | Git workflow: push, PR, review, merge, issue closure | When spawning agents for issue-linked work |
Agent charter.md | Per-agent identity, boundaries, behavior | Inlined into every spawn prompt |
team.md | Roster, member capabilities | Session start |
decisions.md | Captured decisions and directives | Read by agents at spawn time |
User request arrives
→ Coordinator reads routing.md (WHO handles this?)
→ Coordinator checks ceremonies.md (any auto-triggered "before" ceremony?)
→ Coordinator reads agent charter.md (inline into spawn prompt)
→ If issue-linked: coordinator reads issue-lifecycle.md (add ISSUE CONTEXT to spawn prompt)
→ Agent works
→ Coordinator follows After Agent Work flow
→ Coordinator checks ceremonies.md (any auto-triggered "after" ceremony?)
→ Coordinator checks routing.md Rules section (any post-work rules to enforce?)The critical insight: routing.md Rules section and ceremonies.md are the two enforcement mechanisms. If a rule isn’t in one of these, the coordinator has no way to know about it.
.squad/agents/{name}/
charter.md ← Identity, role, boundaries, what they own
history.md ← Seeded with project context from team.mdAdd a row to the ## Members table:
| {emoji} {Name} | {Role} | `.squad/agents/{name}/charter.md` | ✅ Active |Add a row to the routing table:
| {Work Type} | {emoji} {Name} | {Output Location} | {Examples} |Add to the Issue Routing table in routing.md:
| squad:{name} | {Description of work} | {emoji} {Name} |Update .squad/casting/registry.json with the new entry.
This is the step most people miss. If the new member should review or gate other members’ work, you need to wire enforcement. See “How to Wire Up a Reviewer Gate” below.
A reviewer gate means: “Agent X must review Agent Y’s output before it proceeds.” The framework supports this but does NOT automatically enforce it. You must wire it.
Add to routing.md → ## Rules section:
N. **{GateName} Gate** — Every {output type} from {Author} MUST be reviewed by {ReviewerName} before {next step}. The coordinator routes {Author}'s output to {ReviewerName} (sync spawn), collects the verdict, and only proceeds if approved. On rejection, {Author} revises based on {ReviewerName}'s feedback.Example — reviewer for all PRs:
9. **{ReviewerName} PR Gate** — Every PR created by any agent MUST be reviewed by {ReviewerName} before merge. The coordinator spawns {ReviewerName} (sync) with the PR diff, collects APPROVE/REJECT verdict. On rejection, the original author addresses feedback.Example — design review gate:
10. **{DesignReviewer} Design Gate** — Every design doc produced by the architect MUST be reviewed by {DesignReviewer} before implementation begins. {DesignReviewer} always rejects the first draft on concept/approach. Implementation is BLOCKED until {DesignReviewer} approves.Why this works: The coordinator reads the Rules section before and after every work batch. Rules are behavioral constraints the coordinator must follow.
Add to ceremonies.md using the Markdown table format the file uses:
## Design Review
| Field | Value |
|-------|-------|
| **Trigger** | auto |
| **When** | before |
| **Condition** | task involves implementing a design doc |
| **Facilitator** | {DesignReviewer} |
| **Participants** | Architect, {DesignReviewer} |
| **Time budget** | focused |
| **Enabled** | ✅ yes |
**Agenda:**
1. Read the design doc
2. Challenge the premise and approach
3. Demand alternatives and evidence
4. Verdict: APPROVE or REJECTWhy this works: The coordinator checks ceremonies.md for before ceremonies whose condition matches the current task. If matched, the ceremony runs before work begins.
| Use Case | Use Routing Rule | Use Ceremony |
|---|---|---|
| Simple 1-on-1 review (reviewer → author) | ✅ | Overkill |
| Multi-participant alignment (3+ agents) | Too simple | ✅ |
| Needs structured facilitation | No | ✅ |
| Must run automatically before specific work | Either works | ✅ |
| One-line behavioral constraint | ✅ | Overkill |
This is where you define what happens after an agent completes work on a GitHub issue. The framework references .squad/templates/issue-lifecycle.md but does NOT create it — you must create it yourself.
⚠️ This file is required if your project uses GitHub Issues Mode. Without it, the coordinator has no post-work steps for push/PR/review and will treat agent commit as “done.”
See .squad/templates/issue-lifecycle.md for the full template if your project already has one. If not, create it following the pattern below.
Create .squad/templates/issue-lifecycle.md with your project’s git workflow. At minimum it should include:
Add numbered rules to the ## Rules section that reference the lifecycle:
N. **Issue lifecycle enforcement** — all issue-linked work follows the lifecycle
in `.squad/templates/issue-lifecycle.md`. The coordinator adds the ISSUE CONTEXT
block to spawn prompts and follows the post-work steps (verify push → verify PR
→ route to reviewer → merge on approval). Read `issue-lifecycle.md` before
spawning any agent for issue work.
N+1. **{ReviewerName} PR Gate** — every PR created by any agent MUST be reviewed
by {ReviewerName} before merge. The coordinator spawns {ReviewerName} (sync)
with the PR diff. On REJECT, the original author addresses feedback. On APPROVE,
the coordinator merges. No PR merges without {ReviewerName}'s approval.
N+2. **Issue closure restriction** — issues that produced files (code, docs, scripts,
designs, tests) close ONLY via PR merge auto-close ("Closes #N" in PR body).
Never use `gh issue close` for file-producing work. Exception: tracking/strategic
issues and superseded issues may be closed with a comment.
N+3. **Worktree for all file-producing work** — every task that creates or modifies
files (including documentation) requires a worktree. Exceptions: read-only queries,
Scribe (.squad/ state), pure analysis producing no files.After creating both files, run the verification checklist (below) to confirm a clean session coordinator would follow the lifecycle.
If you need something that isn’t a reviewer gate or issue lifecycle — for example, “always run tests before pushing” or “docs must be reviewed by the author before merge” — here’s where to put it:
→ Add to routing.md → ## Rules section
→ Add to ceremonies.md as a before or after ceremony
→ Add to the agent’s charter.md under a new section
→ Add to templates/issue-lifecycle.md
→ Capture as a decision in decisions.md (via directive or decision inbox)
After wiring any new member, gate, or workflow, verify:
templates/issue-lifecycle.md exist? Does routing.md reference it?Adding a reviewer to the roster but not wiring a gate. Having a reviewer on the team doesn’t mean they review anything. You must add a rule in routing.md that says “route PRs to {ReviewerName}.”
Closing issues via gh issue close instead of PR merge. If your project uses PRs, issue closure should happen via “Closes #N” in the PR body. Wire this in issue-lifecycle.md.
Writing docs/scripts directly on main. If your project requires branches for all changes, the worktree gate must apply to ALL file-producing work — including docs. Make this explicit in routing.md Rules.
Assuming the coordinator remembers verbal instructions. Each session starts fresh. If you told the coordinator “always use opus” in session 1, session 2 won’t know unless it’s in decisions.md or routing.md.
Not creating issue-lifecycle.md. The framework references it but doesn’t create it. If your project uses GitHub Issues Mode, create this template.
Capturing a decision but never encoding it as a rule. decisions.md is a historical record. The coordinator reads it for context but doesn’t treat entries as enforceable constraints. If a decision should be enforced, it must become a numbered rule in routing.md Rules section.
Periodically scan decisions.md for directives that should be routing rules but aren’t:
This prevents decisions.md from becoming a graveyard of good intentions that the coordinator reads but doesn’t act on.
For detailed end-to-end walkthroughs of specific wiring scenarios, see:
Appendix A: Wiring a Code Reviewer — Full walkthrough of adding a code reviewer member and wiring their gate so it actually gets enforced. Includes every file that needs modification with exact content.
Appendix B: Wiring a Documenter/Librarian — Full walkthrough of adding a documenter role that ensures all significant changes are documented. Shows a follow-up trigger pattern rather than a gate pattern.