feat(cli): prompt to add @copilot during squad init (#1147)#1199
Open
obit91 wants to merge 3 commits into
Open
feat(cli): prompt to add @copilot during squad init (#1147)#1199obit91 wants to merge 3 commits into
obit91 wants to merge 3 commits into
Conversation
During interactive `squad init`, offer to add @copilot as an autonomous team member. Answering yes adds the roster entry and copies .github/copilot-instructions.md inline, closing the UX gap where users had to know about the separate `squad copilot` step. Adds --copilot / --no-copilot flags for non-interactive control; non-interactive runs without an explicit flag skip silently (unchanged). Extracts addCopilotToTeam/copyCopilotInstructions helpers shared by the `squad copilot` command and init. Closes bradygaster#1147 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Merge --sdk and --roles onto one help line to offset the new --copilot/--no-copilot entry, keeping `squad --help` within the 130-line speed gate (test/speed-gates.test.ts). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds an explicit, tri-state @copilot opt-in flow to squad init, including CLI flags and tests to ensure non-interactive runs don’t silently modify repos.
Changes:
- Add
--copilot / --no-copilotsupport tosquad init, with interactive prompting only when attached to a TTY. - Extract shared “add
@copilot+ copy instructions” logic into a reusable helper used by bothinitandcopilotcommands. - Add CLI tests covering default behavior, explicit opt-in/out, and idempotency.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test/cli/init.test.ts | Adds coverage for @copilot opt-in/out and idempotency during init. |
| packages/squad-cli/src/cli/core/init.ts | Introduces tri-state copilot option and interactive prompt behavior after scaffolding. |
| packages/squad-cli/src/cli/commands/copilot.ts | Extracts shared helpers for adding @copilot and copying instructions template. |
| packages/squad-cli/src/cli-entry.ts | Adds flags/help text and wires parsed copilot tri-state into runInit. |
| packages/squad-cli/README.md | Documents squad init --copilot usage. |
| .changeset/init-copilot-opt-in.md | Declares a minor release and documents the new opt-in behavior/flags. |
- Use fileURLToPath(import.meta.url) for robust cross-platform template path resolution - Place copilot-instructions.md at the git root (agentFileRoot) in monorepo layouts - Clarify --copilot / --no-copilot help text and the skip comment in promptCopilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1147
Problem
Running
squad initscaffolds the team but never creates.github/copilot-instructions.md— that file (and the@copilotroster entry) was only produced by the separatesquad copilotcommand. New users who didn't know about that step got a confusing Copilot first-run experience, since Copilot had no Squad context.Change
During interactive
squad init(after scaffolding completes), Squad now prompts:@copilotroster entry and copies.github/copilot-instructions.mdinlinesquad copilotNew flags
--copilot/--no-copilotskip the prompt for scripted/non-interactive use (e.g. E2E).Implementation
addCopilotToTeamandcopyCopilotInstructionshelpers incopilot.ts, now shared by thesquad copilotcommand and init.squad copilotbehavior is unchanged.runInitgains acopilot?: booleanoption (tri-state) and apromptCopilotstep.@copilotopt-in is skipped for--global(personal squad) and when@copilotis already on the team (idempotent re-init).Tests
test/cli/init.test.ts: default non-interactive does not add @copilot;copilot: falseskips;copilot: trueadds roster + instructions; re-init is idempotent.npm run buildpasses; init + copilot suites green (25 tests).Notes
minorchangeset for@bradygaster/squad-cli.squad copilot(the issue'ssquad copilot enablephrasing); messaging usessquad copilot.