원클릭으로
squad-lifecycle
Team setup, casting, member management, and integration flows. Read when .squad/ needs initialization or roster changes.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Team setup, casting, member management, and integration flows. Read when .squad/ needs initialization or roster changes.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Keep prompt template behavior consistent across CLI and cron by reusing one resolver pipeline.
Prevent gateway projects from taking compile-time dependencies on extension assemblies.
Standard collaboration protocol for all squad agents
Prevent refresh regressions by paging conversation history from newest entries
Fast session investigation using BotNexus Probe CLI (preferred) or Python helper scripts. Use when debugging session state, resuming issues, message routing, checking what sessions exist for an agent, reviewing gateway logs for errors, or correlating events across logs/sessions/traces.
Use when creating GitHub issues, opening worktrees, naming branches, or managing the full lifecycle of a work item on sytone/botnexus. Enforces consistent issue titles, label application, worktree creation, branch naming, PR linking, and cleanup. Triggers on: "create an issue", "open a worktree", "start work on", "file a bug", "add an issue for", "new feature issue", "track this as an issue".
| name | squad-lifecycle |
| description | Team setup, casting, member management, and integration flows. Read when .squad/ needs initialization or roster changes. |
| domain | orchestration |
| confidence | high |
| source | extracted from squad.agent.md v0.9.1 |
Run this check when the coordinator references this skill:
.squad/team.md exist? (fall back to .ai-team/team.md for repos migrating from older installs)## Members?| Result | Action |
|---|---|
No team.md found | → Run Init Mode (Phase 1 below) |
team.md exists but ## Members is empty | → Run Init Mode (treat as unconfigured) |
team.md exists with roster entries but no .squad/casting/ | → Run Casting Migration (see below) |
team.md exists with roster entries and casting state | → ✅ Configured. Return to coordinator — Team Mode is ready. |
If GitHub workflows are not installed, note it:
.github/workflows/squad-*.yml exist?.squad/templates/workflows/ to .github/workflows/ to enable issue triage, label sync, and heartbeat automation."No team exists yet. Propose one — but DO NOT create any files until the user confirms.
git config user.name to learn who you're working with. Use their name in conversation (e.g., "Hey Brady, what are you building?"). Store their name (NOT email) in team.md under Project Context. Never read or store git config user.email — email addresses are PII and must not be written to committed files.🏗️ {CastName1} — Lead Scope, decisions, code review
⚛️ {CastName2} — Frontend Dev React, UI, components
🔧 {CastName3} — Backend Dev APIs, database, services
🧪 {CastName4} — Tester Tests, quality, edge cases
📋 Scribe — (silent) Memory, decisions, session logs
🔄 Ralph — (monitor) Work queue, backlog, keep-alive
ask_user tool to confirm the roster. Provide choices so the user sees a selectable menu:
["Yes, hire this team", "Add someone", "Change a role"]⚠️ STOP. Your response ENDS here. Do NOT proceed to Phase 2. Do NOT create any files or directories. Wait for the user's reply.
Trigger: The user replied to Phase 1 with confirmation ("yes", "looks good", or similar affirmative), OR the user's reply to Phase 1 is a task (treat as implicit "yes").
If the user said "add someone" or "change a role," go back to Phase 1 step 3 and re-propose. Do NOT enter Phase 2 until the user confirms.
.squad/ directory structure (see .squad/templates/ for format guides or use the standard structure: team.md, routing.md, ceremonies.md, decisions.md, decisions/inbox/, casting/, agents/, orchestration-log/, skills/, log/).Casting state initialization: Copy .squad/templates/casting-policy.json to .squad/casting/policy.json (or create from defaults). Create registry.json (entries: persistent_name, universe, created_at, legacy_named: false, status: "active") and history.json (first assignment snapshot with unique assignment_id).
Seeding: Each agent's history.md starts with the project description, tech stack, and the user's name so they have day-1 context. Agent folder names are the cast name in lowercase (e.g., .squad/agents/ripley/). The Scribe's charter includes maintaining decisions.md and cross-agent context sharing.
Team.md structure: team.md MUST contain a section titled exactly ## Members (not "## Team Roster" or other variations) containing the roster table. This header is hard-coded in GitHub workflows (squad-heartbeat.yml, squad-issue-assign.yml, squad-triage.yml, sync-squad-labels.yml) for label automation. If the header is missing or titled differently, label routing breaks.
Merge driver for append-only files: Create or update .gitattributes at the repo root to enable conflict-free merging of .squad/ state across branches:
.squad/decisions.md merge=union
.squad/agents/*/history.md merge=union
.squad/log/** merge=union
.squad/orchestration-log/** merge=union
The union merge driver keeps all lines from both sides, which is correct for append-only files. This makes worktree-local strategy work seamlessly when branches merge — decisions, memories, and logs from all branches combine automatically.
Say: "✅ Team hired. Try: '{FirstCastName}, set up the project structure'"
Post-setup input sources (optional — ask after team is created, not during casting):
Agent names are drawn from a single fictional universe per assignment. Names are persistent identifiers — they do NOT change tone, voice, or behavior. No role-play. No catchphrases. No character speech patterns. Names are easter eggs: never explain or document the mapping rationale in output, logs, or docs.
On-demand reference: Read .squad/templates/casting-reference.md for the full universe table, selection algorithm, and casting state file schemas. Only loaded during Init Mode or when adding new team members.
Rules (always loaded):
After selecting a universe:
.squad/casting/registry.json..squad/casting/history.json.If agent_count grows beyond available names mid-assignment, do NOT switch universes. Apply in order:
Existing agents are NEVER renamed during overflow.
On-demand reference: Read .squad/templates/casting-reference.md for the full JSON schemas of policy.json, registry.json, and history.json.
The casting system maintains state in .squad/casting/ with three files: policy.json (config), registry.json (persistent name registry), and history.json (universe usage history + snapshots).
When .squad/team.md exists but .squad/casting/ does not:
legacy_named: true in the registry..squad/casting/ with default policy.json, a registry.json populated from existing agents, and empty history.json.If the user says "I need a designer" or "add someone for DevOps":
.squad/casting/history.json). If the universe is exhausted, apply overflow handling (see Casting & Persistent Naming → Overflow Handling)..squad/plugins/marketplaces.json exists and contains registered sources, browse each marketplace for plugins matching the new member's role or domain (e.g., "azure-cloud-development" for an Azure DevOps role). Use the CLI: squad plugin marketplace browse {marketplace-name} or read the marketplace repo's directory listing directly. If matches are found, present them: "Found '{plugin-name}' in {marketplace} — want me to install it as a skill for {CastName}?" If the user accepts, copy the plugin content into .squad/skills/{plugin-name}/SKILL.md or merge relevant instructions into the agent's charter. If no marketplaces are configured, skip silently. If a marketplace is unreachable, warn ("⚠ Couldn't reach {marketplace} — continuing without it") and continue..squad/casting/registry.json with the new agent entry.If the user wants to remove someone:
.squad/agents/_alumni/{name}/.squad/casting/registry.json: set the agent's status to "retired". Do NOT delete the entry — the name remains reserved.On-demand reference: Read .squad/templates/plugin-marketplace.md for marketplace state format, CLI commands, installation flow, and graceful degradation when adding team members.
Core rules (always loaded):
.squad/plugins/marketplaces.json during Add Team Member flow (after name allocation, before charter).squad/skills/{plugin-name}/SKILL.md, log to history.mdSquad can connect to a GitHub repository's issues and manage the full issue → branch → PR → review → merge lifecycle.
Before connecting to a GitHub repository, verify that the gh CLI is available and authenticated:
gh --version. If the command fails, tell the user: "GitHub Issues Mode requires the GitHub CLI (gh). Install it from https://cli.github.com/ and run gh auth login."gh auth status. If not authenticated, tell the user: "Please run gh auth login to authenticate with GitHub."gh CLI. Prefer MCP tools when available; fall back to gh CLI.| User says | Action |
|---|---|
| "pull issues from {owner/repo}" | Connect to repo, list open issues |
| "work on issues from {owner/repo}" | Connect + list |
| "connect to {owner/repo}" | Connect, confirm, then list on request |
| "show the backlog" / "what issues are open?" | List issues from connected repo |
| "work on issue #N" / "pick up #N" | Route issue to appropriate agent |
| "work on all issues" / "start the backlog" | Route all open issues (batched) |
Squad can ingest a PRD and use it as the source of truth for work decomposition and prioritization.
On-demand reference: Read .squad/templates/prd-intake.md for the full intake flow, Lead decomposition spawn template, work item presentation format, and mid-project update handling.
| User says | Action |
|---|---|
| "here's the PRD" / "work from this spec" | Expect file path or pasted content |
| "read the PRD at {path}" | Read the file at that path |
| "the PRD changed" / "updated the spec" | Re-read and diff against previous decomposition |
| (pastes requirements text) | Treat as inline PRD |
Core flow: Detect source → store PRD ref in team.md → spawn Lead (sync, premium bump) to decompose into work items → present table for approval → route approved items respecting dependencies.
Humans can join the Squad roster alongside AI agents. They appear in routing, can be tagged by agents, and the coordinator pauses for their input when work routes to them.
On-demand reference: Read .squad/templates/human-members.md for triggers, comparison table, adding/routing/reviewing details.
Core rules (always loaded):
"📌 Still waiting on {Name} for {thing}."The GitHub Copilot coding agent (@copilot) can join the Squad as an autonomous team member. It picks up assigned issues, creates copilot/* branches, and opens draft PRs.
On-demand reference: Read .squad/templates/copilot-agent.md for adding @copilot, comparison table, roster format, capability profile, auto-assign behavior, lead triage, and routing details.
Core rules (always loaded):
copilot-instructions.md.<!-- copilot-auto-assign: true/false --> in team.md.When worktree mode is enabled, the coordinator creates dedicated worktrees for issue-based work. This gives each issue its own isolated branch checkout without disrupting the main repo.
Worktree mode activation:
worktrees: true in project config (squad.config.ts or package.json squad section)SQUAD_WORKTREES=1 set in environment variablesfalse (backward compatibility — agents work in the main repo)Creating worktrees:
{repo-parent}/{repo-name}-{issue-number}
C:\src\squad → worktree at C:\src\squad-42squad/{issue-number}-{kebab-case-slug} (created from base branch, typically main)Dependency management:
node_modules from the main repo to avoid reinstallingcmd /c "mklink /J {worktree}\node_modules {main-repo}\node_modules"ln -s {main-repo}/node_modules {worktree}/node_modulesnpm install in the worktreeReusing worktrees:
git worktree list shows all active worktreesgit pull to sync)Cleanup:
git worktree remove {path} + git branch -d {branch}When spawning an agent for issue-based work (user request references an issue number, or agent is working on a GitHub issue):
1. Check worktree mode:
SQUAD_WORKTREES=1 set in the environment?worktrees: true?2. If worktrees enabled:
a. Determine the worktree path:
#42, issue 42, GitHub issue assignment){repo-parent}/{repo-name}-{issue-number}C:\src\squad, issue #42 → C:\src\squad-42b. Check if worktree already exists:
git worktree list to see all active worktreessquad/{issue-number}-*)cd to the worktree pathgit pull to sync latest changesc. Create the worktree:
squad/{issue-number}-{kebab-case-slug} (derive slug from issue title if available)main, check default branch if needed)git worktree add {path} -b {branch} {baseBranch}git worktree add C:\src\squad-42 -b squad/42-fix-login maind. Set up dependencies:
node_modules from main repo to avoid reinstalling:
cmd /c "mklink /J {worktree}\node_modules {main-repo}\node_modules"ln -s {main-repo}/node_modules {worktree}/node_modulescd {worktree} && npm installe. Include worktree context in spawn:
WORKTREE_PATH to the resolved worktree pathWORKTREE_MODE to true3. If worktrees disabled:
WORKTREE_PATH to "n/a"WORKTREE_MODE to falsegit checkout -b flow (no changes to current behavior)On-demand reference: Read .squad/templates/multi-agent-format.md for the full assembly structure, appendix rules, and diagnostic format when multiple agents contribute to a final artifact.
Core rules (always loaded):
On-demand reference: Read .squad/templates/constraint-tracking.md for the full constraint tracking format, counter display rules, and example session when constraints are active.
Core rules (always loaded):
📊 Clarifying questions used: 2 / 3ask_user tool during Init Mode## Team Roster instead of ## Members (breaks GitHub workflows)git config user.email (PII violation).squad/ state during init (skip-if-exists pattern)