Skip to content

feat(gh-aw): ship Squad modes with verified consumer bootstrap (#1613-#1618) - #1622

Merged
bradygaster merged 11 commits into
devfrom
squad/1614-cast-mode
Aug 7, 2026
Merged

feat(gh-aw): ship Squad modes with verified consumer bootstrap (#1613-#1618)#1622
bradygaster merged 11 commits into
devfrom
squad/1614-cast-mode

Conversation

@bradygaster

@bradygaster bradygaster commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Summary

Ships the complete /squad Agentic Workflow prompt for Cast, Connect, Adopt, Cast Member, Retire, and Status modes, including tailored team scaffolding and meet-the-squad.md.

This revision also applies the consumer configuration proven end-to-end in bradygaster/squad-gh-aw-test:

  • Accepts /squad from issue bodies, issue comments, PR review comments, and manual dispatch.
  • Initializes with npx --yes "@bradygaster/squad-cli@${SQUAD_CLI_VERSION:-0.11.0}" init --preset default --state-backend local in the unrestricted activation job.
  • Defaults SQUAD_CLI_VERSION to 0.11.0, with a repository-variable override.
  • Constrains pull-request output to Squad-owned files, permits required protected paths, caps patches at 500 files, and expires staged output after 14 days.
  • Allows dynamic PR bases only for squad/* branches, which Cast Member and Retire use for follow-up PRs against an existing Squad branch.
  • Keeps engine.version: 1.0.78 while this source is compiled with gh-aw v0.85.4; the toolcache executable-path fix in github/gh-aw#50908 first appears in v0.86.0.
  • Restores .github/actions/squad-init/action.yml to the base branch. The workflow does not use the composite action because Squad v0.11.0 has no release assets.

The successful consumer run opened bradygaster/squad-gh-aw-test#19.

Copilot setup steps remain a separate repository prerequisite. This workflow intentionally does not create or modify .github/workflows/**, avoiding the GitHub App-only workflows: write permission required by gh-aw's allow-workflows mode.

Security review

The compiled workflow references the optional restricted secrets SQUAD_GITHUB_APP_PRIVATE_KEY and SQUAD_GITHUB_TOKEN. Both were reviewed: the private key is consumed only by actions/create-github-app-token@v3.2.0, and the fallback token is exposed only as GH_TOKEN to the activation bootstrap. No redirect changes were introduced. Agent writes remain mediated by gh-aw safe outputs and the explicit file allowlist.

Validation

  • gh aw compile workflows/squad.md --no-emit --approve (gh-aw v0.85.4)
  • node --test test/workflows.test.cjs (27 passing)
  • npm run build --ignore-scripts

Closes #1613
Closes #1614
Closes #1615
Closes #1616
Closes #1617
Closes #1618

Implements the Cast mode agent instructions in workflows/squad.md — the main
event for the /squad slash command. When triggered, the Copilot agent:

1. Parses the /squad command to detect mode (default = cast)
2. Analyzes the target repo (languages, structure, CI, patterns)
3. Composes a tailored team using Squad's casting intelligence
4. Generates full .squad/ scaffolding with customized charters
5. Creates meet-the-squad.md introducing the cast
6. Opens a PR via safe-outputs

Also addresses Copilot reviewer feedback on shared/squad.md:
- Pin squad-init action ref from @dev to @main (stable distribution)
- Change if-no-files-found from ignore to error (fail fast)

Closes #1614
Closes #1613

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 5, 2026 19:59
@bradygaster bradygaster added enhancement New feature or improvement gh-aw GitHub Agentic Workflows integration labels Aug 5, 2026
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🛫 PR Readiness Check

ℹ️ This comment updates on each push. Last checked: commit d6e5ce5

PR Scope: 🔧 Infrastructure

⚠️ 3 item(s) to address before review

Status Check Details
Single commit 11 commits — consider squashing before review
Not in draft Ready for review
Branch up to date Up to date with dev
Copilot review No Copilot review yet — it may still be processing
Changeset present No source files changed — changeset not required
Scope clean No .squad/ or docs/proposals/ files
No merge conflicts No merge conflicts
Copilot threads resolved 1 active Copilot thread(s) resolved (3 outdated skipped)
CI passing 7 check(s) failing: sdk-exports-validation, samples-build, Policy Gates, test, docs-quality, Changeset Drift, changes

Files Changed (2 files, +649 −59)

File +/−
workflows/shared/squad.md +11 −21
workflows/squad.md +638 −38

Total: +649 −59


This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🟢 Impact Analysis — PR #1622

Risk tier: 🟢 LOW

📊 Summary

Metric Count
Files changed 2
Files added 0
Files modified 2
Files deleted 0
Modules touched 1

🎯 Risk Factors

  • 2 files changed (≤5 → LOW)
  • 1 module(s) touched (≤1 → LOW)

📦 Modules Affected

root (2 files)
  • workflows/shared/squad.md
  • workflows/squad.md

This report is generated automatically for every PR. See #733 for details.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the gh-aw /squad workflow to include a full Cast-mode instruction spec (repo analysis → team composition → universe/name allocation → scaffolding → PR creation) and adjusts the shared bootstrap component to use a more stable action ref and fail fast when expected bootstrap outputs are missing.

Changes:

  • Implement detailed Cast-mode coordinator instructions in workflows/squad.md, including repo analysis, casting, scaffolding, and PR creation guidance.
  • Update bootstrap to use squad-init@main instead of @dev.
  • Fail fast in bootstrap artifact upload when expected files are missing (if-no-files-found: error).
Show a summary per file
File Description
workflows/squad.md Adds comprehensive Cast-mode behavior/instructions and updates mode parsing + status-mode behavior guidance.
workflows/shared/squad.md Pins the bootstrap init action to @main and makes missing bootstrap outputs fail the activation job.

Review details

Suppressed comments (1)

workflows/squad.md:285

  • The Cast-mode intro says Scribe, Ralph, and Rai are always-on agents, but the meet-the-squad template’s Always-On Support table omits Rai. This will cause the generated intro doc to disagree with the rest of the Cast-mode scaffolding rules.
| Name | Role | Notes |
|------|------|-------|
| Scribe | Session Logger | Tracks all agent sessions silently |
| Ralph | Work Monitor | Watches the backlog and alerts on stale work |
  • Files reviewed: 2/2 changed files
  • Comments generated: 4
  • Review effort level: Lite

Comment thread workflows/squad.md
Comment thread workflows/squad.md Outdated
Comment thread workflows/squad.md
Comment thread workflows/shared/squad.md Outdated
…eps (#1618, #1619)

Enhances the Cast mode output:

- meet-the-squad.md template now includes:
  - 4-column team table (emoji+name, role, specialty, interaction method)
  - "How to Work With Your Squad" section (labels, commands, routing)
  - Mode-specific "What Happened Here" rationale block
  - Cast/Connect/Adopt variations

- copilot-setup-steps.yml auto-inclusion:
  - Checks if .github/workflows/copilot-setup-steps.yml exists
  - If missing, generates language-appropriate setup (Node/Python/Go/other)
  - Never overwrites existing file
  - Mentions in PR body when included

Also fixes step ordering (setup-steps check now runs before PR creation).

Closes #1618
Closes #1619

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bradygaster

Copy link
Copy Markdown
Owner Author

Expanded scope (commit 2)

This PR now also addresses:

Both are in the second commit. The Closes keywords are in the commit message.

…1617)

Replaces all remaining TODO stubs in workflows/squad.md with full agent
instructions:

Connect mode (/squad from org/repo):
- Parse and validate source URL via gh API
- Write lightweight .squad/config.json pointer only
- Generate meet-the-squad.md noting external management
- Open PR with minimal footprint (no squad files committed)

Adopt mode (/squad adopt org/repo):
- Parse, validate, and fetch full source squad
- Install scaffolding locally with ownership transfer
- Adapt repo-specific references in routing
- Include copilot-setup-steps.yml if missing
- Open PR with full squad committed

Cast Member (/squad cast-member):
- Natural language member addition with casting intelligence
- Modify/rename existing members preserving identity
- Universe-aware name allocation avoiding conflicts
- Context-aware PR behavior (push to existing or open new)

Retire (/squad retire):
- Flexible matching by name, role, or ID
- Archive charter to _alumni/ (never delete)
- Update all squad files (registry, team, routing)
- Context-aware PR behavior

The /squad command workflow is now feature-complete for all 7 modes.

Closes #1615
Closes #1616
Closes #1617

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bradygaster

Copy link
Copy Markdown
Owner Author

Commit 3: All remaining modes implemented

This PR now closes the ENTIRE epic (#1612). All 7 modes are implemented:

Mode Command Issue
✅ Cast /squad or /squad cast #1614
✅ Connect /squad from org/repo #1615
✅ Adopt /squad adopt org/repo #1616
✅ Cast Member /squad cast-member <spec> #1617
✅ Retire /squad retire <name> #1617
✅ Status /squad status (included in Cast)
✅ meet-the-squad.md (all modes) #1618
✅ copilot-setup-steps (Cast + Adopt) #1619
✅ Bootstrap fixes shared/squad.md #1613

The workflows/squad.md file is now feature-complete — all TODO stubs are replaced with full agent instructions.

bradygaster and others added 7 commits August 5, 2026 21:17
Fixes 4 of 5 findings from the in-depth review:

1. workflow_dispatch now declares a 'command' input so manual dispatch
   can supply mode arguments (fixes #1626)

2. Cast mode team.md template now includes the ## Coding Agent section
   with @copilot row and auto-assign marker (fixes #1623)

3. Retire mode archives the entire agent directory to
   _alumni/{lowercase-name}/ instead of a flat file (fixes #1624)

4. Standardized on cast name (lowercase) as the canonical identifier
   for registry keys, labels, charter paths, and meet-the-squad
   references — eliminates role-id vs name ambiguity (fixes #1625)

The 5th finding (#1627 — Connect mode bootstrap lacks remote squad
resolution) requires a design decision about where that logic lives
(shared/squad.md vs squad-init action). Tracked separately.

Closes #1623
Closes #1624
Closes #1625
Closes #1626

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Teaches the squad-init composite action to handle Connect mode:

- New inputs: mode (default|connect) and source (owner/repo)
- When mode=connect: fetches .squad/ files from remote source via gh API
  (team.md, routing.md, agent charters, squad.agent.md)
- Writes .squad/config.json pointer with squadSource and connectedAt
- Existing 'squad init' step is gated on mode != connect
- Input validation extended for new parameters

Also updates shared/squad.md bootstrap to detect existing .squad/config.json
and pass mode/source to the action automatically.

Closes #1627

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Enables gh aw add from feature branch during development.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
gh-aw doesn't recognize this field in safe-outputs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… mode

gh-aw strict mode rejects contents:write, issues:write, and
pull-requests:write. Switch to safe-outputs pattern: add-comment
and create-issue declarations alongside existing create-pull-request.
Convert direct git push in Cast-Member and Retire modes to use
create-pull-request safe-output.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…tmatter

Add issues:read and pull-requests:read permissions required by
the issues and pull_requests toolsets. Fix ambient-folders
frontmatter field in shared/squad.md that gh-aw doesn't recognize.

Ref #1630

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Closes #1613
Closes #1614
Closes #1615
Closes #1616
Closes #1617
Closes #1618
Closes #1619

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@bradygaster bradygaster changed the title feat(gh-aw): Cast mode implementation + bootstrap fixes (#1614, #1613) feat(gh-aw): ship Squad modes with verified consumer bootstrap (#1613-#1619) Aug 7, 2026
Closes #1613

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@bradygaster bradygaster changed the title feat(gh-aw): ship Squad modes with verified consumer bootstrap (#1613-#1619) feat(gh-aw): ship Squad modes with verified consumer bootstrap (#1613-#1618) Aug 7, 2026
@bradygaster
bradygaster merged commit 60032b5 into dev Aug 7, 2026
15 of 24 checks passed
@bradygaster
bradygaster deleted the squad/1614-cast-mode branch August 7, 2026 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or improvement gh-aw GitHub Agentic Workflows integration

Projects

None yet

2 participants