setup
Initialize squad in the current repository (or `quick`: board, labels and commands only, no deploys, in about two minutes): create or reuse the GitHub Projects board with the squad Status columns and Priority/Size/Wave/Agent/Attempts fields, create the labels, write .squad/config.yml, and configure merges, branch protection and .gitignore. Use the first time squad is used in a repository, when .squad/config.yml is missing, or when a board script reports missing ids.
- License 许可
- MIT
- 最近更新
- 2026-10-16
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- setup
- description
- Initialize squad in the current repository (or `quick`: board, labels and commands only, no deploys, in about two minutes): create or reuse the GitHub Projects board with the squad Status columns and Priority/Size/Wave/Agent/Attempts fields, create the labels, write .squad/config.yml, and configure merges, branch protection and .gitignore. Use the first time squad is used in a repository, when .squad/config.yml is missing, or when a board script reports missing ids.
03 SKILL.md 正文
squad: setup
Paths written as references/…, templates/… or scripts/… are inside ${CLAUDE_PLUGIN_ROOT} (the squad plugin folder), not the target repository.
Runs in the main session (PM). No subagent: it needs a few stakeholder decisions.
- Scripts:
${CLAUDE_PLUGIN_ROOT}/scripts/(call them by this full path) - Conventions:
${CLAUDE_PLUGIN_ROOT}/references/board-conventions.md - Talk to the stakeholder in their language; everything written to files and GitHub is English.
Inputs
- The current directory is a clone of the target repository with a GitHub remote.
- Optional: an existing project number to reuse (
--project N) or a project title. - Optional:
quick(/squad:setup quick): a two-minute setup to try squad. Run only steps 1, 2, 3, 4, 6, 7 and 9, with every question answered by its default (new board, delete conflicting workflows on it, detected commands), and setdeploy.platform: none(no deploy workflow, Environments or secrets:Doneends the flow). Skip branch protection (step 5) and tell the stakeholder that squad still never pushes tomain. Finish with step 10 (doctor; commit through a PR). Later,/squad:setupwithoutquickadds the rest.
Steps
-
Preflight. Run
gh auth status --activeand confirm the active account is the one the stakeholder wants to use. If its token scopes lackproject(orworkflow, needed for the deploy workflow), stop and ask the stakeholder to run:! gh auth refresh -h github.com -s project,workflow. Check thatjqandgitexist. -
Board. Ask whether to reuse an existing project (number) or create a new one, unless the stakeholder already said. Then run:
"${CLAUDE_PLUGIN_ROOT}/scripts/board.sh" bootstrap [--project N] [--title "<title>"]It creates
.squad/config.ymlfrom the template if missing, creates or reuses the project, links it to the repo, aligns the Status options (keeping existing option ids), creates the Priority, Size, Wave, Agent and Attempts fields, and writes every id into the config. It is idempotent: re-running it changes nothing when the board is already correct. -
Built-in project workflows. Run
board.sh workflows. Any entry with"conflicts": truesets Status behind squad's back (for example "Item closed" moves a task to Done when its PR merges, skipping QA). GitHub's API can only delete these workflows, not disable them, so:- New project created in step 2: run
board.sh workflows --fix. - Existing project: show the list to the stakeholder, explain the effect, and run
--fixonly after an explicit yes. Otherwise tell them to disable those workflows in the project's Workflows settings page. Keep "Auto-add sub-issues to project" and "Auto-close issue".
- New project created in step 2: run
-
Labels. Run
"${CLAUDE_PLUGIN_ROOT}/scripts/issue.sh" labels(creates or updates all 13). -
Repository settings. Squash merge only, and delete branches after merge:
gh repo edit <owner>/<repo> --enable-squash-merge --enable-merge-commit=false \ --enable-rebase-merge=false --delete-branch-on-mergeThen protect
main: PRs required, administrators included (so nobody, not even this account, can push tomaindirectly), no force pushes, linear history:echo '{"required_status_checks":null,"enforce_admins":true, "required_pull_request_reviews":{"required_approving_review_count":0}, "restrictions":null,"required_linear_history":true, "allow_force_pushes":false,"allow_deletions":false}' \ | gh api -X PUT repos/<owner>/<repo>/branches/main/protection --input -Approvals stay at 0 because every squad role uses the same GitHub account, and GitHub does not let an account approve its own PR: the Reviewer's verdict is a review comment plus the
review:passedlabel, and the Team Lead merges (seereferences/conventions/git.md). If the call fails (HTTP 403 on private repos without GitHub Pro/Team, or missing admin rights), do not stop: tell the stakeholder that squad will still follow the PR-only flow, and how to enable protection later (make the repo public or upgrade, then re-run setup). Once CI exists, add its check name torequired_status_checkswith"strict": true. -
Git hygiene. Ensure
.gitignorecontains.worktrees/and.squad/reports/(append if missing). -
Commands. Detect the stack (e.g.
package.jsonscripts,pyproject.toml,Makefile) and propose values forcommands.install,test,lint,e2e,buildandstart(QA runs the app with them on$PORT) in.squad/config.yml. Show them to the stakeholder and write them after confirmation. Leavee2eempty if there is none. -
Deploys (Railway, no tokens). DevOps uses the Railway CLI under the stakeholder's own login; GitHub holds no Railway secret.
- CLI:
railway --version; missing → ask the stakeholder to install it (https://docs.railway.com/cli). Login:railway whoami; not logged in → ask them to run! railway login(OAuth in the browser). - Project:
railway list --json; ask which project to use, or (after a yes) create one:railway init --name <repo>,railway environment new staging, then the app service (railway add --service web). Production uses Railway's defaultproductionenvironment. Writedeploy.railway.project(id),serviceandenvironments. - Check:
"${CLAUDE_PLUGIN_ROOT}/scripts/railway.sh" checklists both environments. - GATE 3: copy
${CLAUDE_PLUGIN_ROOT}/templates/release-gate.ymlto.github/workflows/release-gate.yml(it deploys nothing and needs no secrets) and create the GitHub Environmentproductionwith the stakeholder as required reviewer:gh api -X PUT repos/<owner>/<repo>/environments/production --input -with{"reviewers":[{"type":"User","id":<id>}]}. - URLs:
railway.sh domain staging(andproduction, with the stakeholder's yes) returns or generates the public URL; writedeploy.staging_urlandproduction_url. - Platform settings the app needs (database, pre-deploy migration command, variables) are
not set up here: the Team Lead plans them as
infratasks for DevOps.
- CLI:
-
CLAUDE.md. Add (or update) this section in the repo's
CLAUDE.md:## squad This repository is run by the squad plugin. Board, ids, commands and limits live in `.squad/config.yml`; the GitHub Projects board is the single source of truth for work state. Use `/squad:run` to continue work. Do not edit `ids:` in the config by hand.Permissions. Claude Code's auto mode refuses
gh pr mergeas "merge without review" (it cannot see squad's review). Ask the stakeholder whether to add"Bash(gh pr merge:*)"topermissions.allowin.claude/settings.json, so the Team Lead can merge after the Reviewer's PASS. Branch protection still guardsmain. -
Verify and commit. Run
"${CLAUDE_PLUGIN_ROOT}/scripts/doctor.sh": nofailmay remain (report eachwarnto the stakeholder; see thedoctorskill). Then commit.squad/config.yml,.gitignore,CLAUDE.md,.claude/settings.jsonand any workflow file on a branchchore/squad-setup, open a PR and squash-merge it after the stakeholder agrees. Never commit tomain.
Output
Tell the stakeholder, in their language: the board URL
(https://github.com/users/<owner>/projects/<n> or /orgs/<owner>/projects/<n>), what was
created versus reused, what could not be configured (protection, environment) and what they
must do by hand.
Done when
doctor.shreports nofail..squad/config.ymlhas every id underids:(status, priority and size options included).- All 13 labels exist; no conflicting built-in workflow remains enabled (or the stakeholder explicitly chose to keep it).
Never
- Delete project workflows on an existing board without the stakeholder's explicit yes.
- Edit ids in the config by hand; re-run
bootstrapinstead. - Store tokens or deploy secrets in the repository or in GitHub; handle Railway secrets.
- Use a GitHub account other than the one the stakeholder confirmed.
04 同仓库更多 Skills
run
PM orchestrator for squad: repeatedly read the board with next.sh and dispatch the right subagent for the highest-priority action (QA, Team Lead merge, review, rebase, planning, parallel developers by wave, deploy), relay gates and questions to the stakeholder, and stop at a requirements gate, when only GATE 3 is left, after max steps, or when nothing is left (then report). Use when the stakeholder says run, continue, or keep going, or on a schedule.
review
Code review procedure for one PR in In Review: check size and scope, verify every acceptance criterion and DoD item has a test, review correctness and security against the review checklist, and post the verdict as a review comment (PASS adds review:passed for the Team Lead to merge; CHANGES sends the task back). Never approves or merges. Use when a PR is waiting for review.
report
Progress report for the stakeholder: collect delivery metrics from the board and GitHub with metrics.sh (period or milestone), have the reporter draft a report with a 5-line plain-language summary and a metrics table where every number comes from the script, then publish it as a type:report issue and summarize it in the stakeholder's language. Use when the stakeholder asks how things are going, at the end of a run, or on a schedule.
qa
QA procedure: verify a merged task, bug or story in the QA column against every acceptance criterion and DoD item by running the full test suites, e2e and the real app on the latest main; pass it to Done with a test report, or file a bug sub-issue from the bug template and keep the task out of Done. Also re-verifies a task whose bugs are fixed and closes stories whose tasks are all Done. Use when items are waiting in QA.
plan
Team Lead procedure: split approved stories (Backlog), needs-split tasks and QA bugs into small XS/S technical tasks with Files (expected), dependencies and Definition of Done, group them into parallel waves on the board and post the dispatch plan; recompute waves when developer slots are idle (rewave); put stories the stakeholder wants released into a milestone (milestone); turn one small stakeholder request into a single quick-lane task (quick); or, in merge mode, do the final check of a PR labeled review:passed and squash-merge it. Use after GATE 2 story approval, when a task is labeled needs-split, when QA files bugs, or when a reviewed PR is waiting to merge.
fix
Quick lane for one small change: a bug against existing behavior, a text or style tweak, a small refactor or a dependency bump. Skips the BA, GATE 1/2 and story planning: the Team Lead turns the request into one XS/S task, then a developer, the reviewer, the Team Lead merge and a light QA check run as usual. Use when the stakeholder says fix, change, tweak, rename or bump something small; use the ba skill for new features or anything that needs product decisions.