| 1 | # Copilot Coding Agent — Squad Instructions |
| 2 | |
| 3 | You are working on a project that uses **Squad**, an AI team framework. When picking up issues autonomously, follow these guidelines. |
| 4 | |
| 5 | ## Coordinator Canary Check |
| 6 | |
| 7 | **IMPORTANT — run this check on EVERY session start, before doing any work:** |
| 8 | |
| 9 | Look for the exact token `SQUAD_COORDINATOR_CANARY_a8f3` in your `agent_instructions`. This token is placed at the end of `squad.agent.md`. If it is missing, the coordinator file is missing or truncated. |
| 10 | |
| 11 | **When the token is missing, you MUST:** |
| 12 | 1. **STOP** — do not proceed with standard Squad behavior. |
| 13 | 2. **WARN the user** with this exact message: |
| 14 | ``` |
| 15 | ⚠️ Squad coordinator (squad.agent.md) appears to be missing or truncated. The canary token was not found. Do NOT proceed with standard Squad behavior — Squad's safety rails are not loaded. Please restart your session. |
| 16 | ``` |
| 17 | 3. Do not continue with normal Squad routing, spawning, PR, or branch-protection behavior after emitting the warning. |
| 18 | |
| 19 | ## Team Context |
| 20 | |
| 21 | Before starting work on any issue: |
| 22 | |
| 23 | 1. Read `.squad/team.md` for the team roster, member roles, and your capability profile. |
| 24 | 2. Read `.squad/routing.md` for work routing rules. |
| 25 | 3. If the issue has a `squad:{member}` label, read that member's charter at `.squad/agents/{member}/charter.md` to understand their domain expertise and coding style — work in their voice. |
| 26 | |
| 27 | ## Capability Self-Check |
| 28 | |
| 29 | Before starting work, check your capability profile in `.squad/team.md` under the **Coding Agent → Capabilities** section. |
| 30 | |
| 31 | - **🟢 Good fit** — proceed autonomously. |
| 32 | - **🟡 Needs review** — proceed, but note in the PR description that a squad member should review. |
| 33 | - **🔴 Not suitable** — do NOT start work. Instead, comment on the issue: |
| 34 | ``` |
| 35 | 🤖 This issue doesn't match my capability profile (reason: {why}). Suggesting reassignment to a squad member. |
| 36 | ``` |
| 37 | |
| 38 | ## Branch Naming |
| 39 | |
| 40 | Use the squad branch convention: |
| 41 | ``` |
| 42 | squad/{issue-number}-{kebab-case-slug} |
| 43 | ``` |
| 44 | Example: `squad/42-fix-login-validation` |
| 45 | |
| 46 | ## PR Guidelines |
| 47 | |
| 48 | When opening a PR: |
| 49 | - Reference the issue: `Closes #{issue-number}` |
| 50 | - If the issue had a `squad:{member}` label, mention the member: `Working as {member} ({role})` |
| 51 | - If this is a 🟡 needs-review task, add to the PR description: `⚠️ This task was flagged as "needs review" — please have a squad member review before merging.` |
| 52 | - Follow any project conventions in `.squad/decisions.md` |
| 53 | |
| 54 | ## Decisions |
| 55 | |
| 56 | If you make a decision that affects other team members, write it to: |
| 57 | ``` |
| 58 | .squad/decisions/inbox/copilot-{brief-slug}.md |
| 59 | ``` |
| 60 | The Scribe will merge it into the shared decisions file. |