Skip to content

Commit dabaa6f

Browse files
authored
Merge pull request #2041 from bradygaster/bradygaster-automatic-squad-bootstrap
feat(gh-aw): automate Squad bootstrap
2 parents 5521c46 + 5deda1a commit dabaa6f

20 files changed

Lines changed: 1632 additions & 131 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@bradygaster/squad-cli": minor
3+
"@bradygaster/squad-sdk": minor
4+
---
5+
6+
Install a dedicated seventh Agentic Workflow that automatically creates one
7+
validated draft Cast pull request and one linked research-proposals issue after
8+
the workflow installation lands on the repository's default branch.

‎.github/agents.md‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ gh aw add \
3838
bradygaster/squad/workflows/squad-review.md@dev \
3939
bradygaster/squad/workflows/squad-deps-worker.md@dev \
4040
bradygaster/squad/workflows/squad-retro.md@dev \
41-
bradygaster/squad/workflows/squad-improvement-worker.md@dev
41+
bradygaster/squad/workflows/squad-improvement-worker.md@dev \
42+
bradygaster/squad/workflows/squad-bootstrap.md@dev
4243
```
4344

4445
This command:
@@ -49,10 +50,12 @@ This command:
4950

5051
### Verify installation
5152

52-
After running the command, confirm all six source/lock pairs exist and strict
53+
After running the command, confirm all seven source/lock pairs exist and strict
5354
compilation succeeds: Squad, Implement Worker, Review, Deps Worker, Retro and
54-
Improvement Worker. The improvement worker is standard but dormant until an
55-
exact human approval is relayed through the dispatcher.
55+
Improvement Worker, plus the dedicated Bootstrap workflow. The improvement
56+
worker is standard but dormant until an exact human approval is relayed through
57+
the dispatcher. Bootstrap wakes after the installation lands on the default
58+
branch and creates the linked draft Cast PR and research-proposals issue.
5659

5760
Retrospectives remain report/proposal-only by default. Ordinary auto-fixes need
5861
`"squadRetroAutoImplement": "allow"` in `.squad/config.json`. A proposal restricted

‎.github/workflows/squad-ci.yml‎

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -712,9 +712,9 @@ jobs:
712712
fi
713713
714714
# ── gh-aw strict compile gate ────────────────────────────────────────────
715-
# Compiles all six Squad-authored workflow sources with --strict against a
715+
# Compiles all seven Squad-authored workflow sources with --strict against a
716716
# pinned compiler so the delivered stack is always proven compilable. All
717-
# six workflows, including squad-improvement-worker, are distributed by the
717+
# seven workflows, including squad-improvement-worker and squad-bootstrap, are distributed by the
718718
# gh-aw-enlistment bootstrap skill/docs as part of the standard install --
719719
# squad-improvement-worker stays dormant (approval-gated) until a maintainer
720720
# authorizes a governance-scoped retrospective proposal, but it is not a
@@ -761,7 +761,7 @@ jobs:
761761
cp -r workflows/. "$COMPILE_DIR/.github/workflows/"
762762
git -C "$COMPILE_DIR" init --quiet
763763
764-
- name: Compile all six workflows (--strict) and verify lock files
764+
- name: Compile all seven workflows (--strict) and verify lock files
765765
# Failures accumulate rather than short-circuit so every result is
766766
# visible in one run. A compiler that exits 0 without emitting a lock
767767
# file is treated as failure — silent-success is a gate gap.
@@ -780,6 +780,15 @@ jobs:
780780
FAILED=$((FAILED + 1))
781781
fi
782782
done
783+
printf -- '--- Compiling squad-bootstrap ---\n'
784+
if (cd "$COMPILE_DIR" && gh aw compile squad-bootstrap --strict --approve --no-check-update 2>&1); then
785+
printf ' => OK\n'
786+
echo "✅ \`squad-bootstrap\`" >> "$GITHUB_STEP_SUMMARY"
787+
else
788+
echo "::error::gh aw compile squad-bootstrap --strict failed"
789+
echo "❌ \`squad-bootstrap\` compile failed" >> "$GITHUB_STEP_SUMMARY"
790+
FAILED=$((FAILED + 1))
791+
fi
783792
echo "" >> "$GITHUB_STEP_SUMMARY"
784793
echo "### Lock files" >> "$GITHUB_STEP_SUMMARY"
785794
for LOCK in squad.lock.yml squad-implement-worker.lock.yml squad-review.lock.yml squad-deps-worker.lock.yml squad-retro.lock.yml squad-improvement-worker.lock.yml; do
@@ -791,11 +800,18 @@ jobs:
791800
echo "✅ \`$LOCK\`" >> "$GITHUB_STEP_SUMMARY"
792801
fi
793802
done
803+
if [ ! -f "$COMPILE_DIR/.github/workflows/squad-bootstrap.lock.yml" ]; then
804+
echo "::error::squad-bootstrap.lock.yml not emitted — compiler exited 0 without writing output"
805+
echo "❌ missing: \`squad-bootstrap.lock.yml\`" >> "$GITHUB_STEP_SUMMARY"
806+
FAILED=$((FAILED + 1))
807+
else
808+
echo "✅ \`squad-bootstrap.lock.yml\`" >> "$GITHUB_STEP_SUMMARY"
809+
fi
794810
if [ "$FAILED" -gt 0 ]; then
795811
echo "" >> "$GITHUB_STEP_SUMMARY"
796812
echo "**❌ $FAILED failure(s) — gate fails closed**" >> "$GITHUB_STEP_SUMMARY"
797813
echo "::error::$FAILED failure(s) — gate fails closed"
798814
exit 1
799815
fi
800816
echo "" >> "$GITHUB_STEP_SUMMARY"
801-
echo "**✅ All six workflows compiled, all six lock files emitted**" >> "$GITHUB_STEP_SUMMARY"
817+
echo "**✅ All seven workflows compiled, all seven lock files emitted**" >> "$GITHUB_STEP_SUMMARY"

‎.squad-templates/skills/gh-aw-enlistment/SKILL.md‎

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ tools:
1111
when: "Every step: preflight identity/auth, enabling Actions-created PRs, opening and watching the bootstrap PR."
1212
- name: "gh aw"
1313
description: "GitHub Agentic Workflows extension (github/gh-aw) — installs and strictly compiles the Squad workflow set."
14-
when: "Installing the six @dev workflows and compiling them into deterministic .lock.yml files."
14+
when: "Installing the seven @dev workflows and compiling them into deterministic .lock.yml files."
1515
---
1616

1717
## Context
@@ -99,7 +99,7 @@ git switch -c chore/squad-gh-aw-bootstrap
9999
not part of the Squad set. `gh aw add` is additive; if you see it about to
100100
replace an unrelated workflow, **STOP**.
101101

102-
### 3. Install the six supported workflows — in order, dispatcher first
102+
### 3. Install the seven supported workflows — in order, dispatcher first
103103

104104
```bash
105105
gh aw add \
@@ -108,24 +108,28 @@ gh aw add \
108108
bradygaster/squad/workflows/squad-review.md@dev \
109109
bradygaster/squad/workflows/squad-deps-worker.md@dev \
110110
bradygaster/squad/workflows/squad-retro.md@dev \
111-
bradygaster/squad/workflows/squad-improvement-worker.md@dev
111+
bradygaster/squad/workflows/squad-improvement-worker.md@dev \
112+
bradygaster/squad/workflows/squad-bootstrap.md@dev
112113
```
113114

114115
Keep `squad.md` first: `gh aw add` discovers its worker/reviewer dependencies
115116
while compiling it, and the explicit entries confirm the full surface without
116-
creating duplicates. The installed top-level set is exactly:
117+
creating duplicates. Keep `squad-bootstrap.md` last because it is the dedicated
118+
post-install workflow rather than a dispatcher dependency. The installed
119+
top-level set is exactly:
117120

118121
- `squad.md` + `squad.lock.yml`
119122
- `squad-implement-worker.md` + `squad-implement-worker.lock.yml`
120123
- `squad-review.md` + `squad-review.lock.yml`
121124
- `squad-deps-worker.md` + `squad-deps-worker.lock.yml`
122125
- `squad-retro.md` + `squad-retro.lock.yml`
123126
- `squad-improvement-worker.md` + `squad-improvement-worker.lock.yml`
127+
- `squad-bootstrap.md` + `squad-bootstrap.lock.yml`
124128

125129
`squad-improvement-worker` is part of the standard, coherent install above —
126130
not a separate opt-in add-on. It stays dormant until a maintainer approves a
127131
governance-scoped retrospective proposal (see the gh-aw guide's retrospective
128-
auto-implementation section); installing it alongside the other five keeps the
132+
auto-implementation section); installing it alongside the other six keeps the
129133
full stack consistent and avoids a second bootstrap pass later.
130134

131135
Report/proposal-only is the default. Ordinary fixes require the explicit
@@ -179,22 +183,22 @@ gh aw compile --strict
179183
This must run after any first-install approval and before committing. Success
180184
criteria:
181185

182-
- All six workflows compile successfully.
186+
- All seven workflows compile successfully.
183187
- The **only** permitted warning is the known `squad.md` bot-trigger warning: it
184188
configures both slash-command and `github-actions[bot]` triggers, and the bot
185189
trigger is required for controlled worker-continuation dispatches.
186190
- **STOP** on any error, or on **any additional warning** beyond that single
187191
documented one.
188192

189-
### 6. Require all six source/lock pairs to exist
193+
### 6. Require all seven source/lock pairs to exist
190194

191195
```bash
192-
for workflow in squad squad-implement-worker squad-review squad-deps-worker squad-retro squad-improvement-worker; do
196+
for workflow in squad squad-implement-worker squad-review squad-deps-worker squad-retro squad-improvement-worker squad-bootstrap; do
193197
test -f ".github/workflows/${workflow}.md" || { echo "MISSING ${workflow}.md"; exit 1; }
194198
test -f ".github/workflows/${workflow}.lock.yml" || { echo "MISSING ${workflow}.lock.yml"; exit 1; }
195199
done
196200

197-
for runtime_module in squad-cast-validator squad-improvement-gate squad-retro-evidence squad-retro-provenance; do
201+
for runtime_module in squad-cast-validator squad-bootstrap-validator squad-improvement-gate squad-retro-evidence squad-retro-provenance; do
198202
test -f ".github/workflows/shared/${runtime_module}.mjs" || {
199203
echo "MISSING shared/${runtime_module}.mjs"
200204
exit 1
@@ -210,7 +214,7 @@ fi
210214
```
211215

212216
- **STOP** and rerun `gh aw compile --strict` if any `.lock.yml` is missing. Do not
213-
open or merge the bootstrap PR until all **twelve** files exist and strict
217+
open or merge the bootstrap PR until all **fourteen** files exist and strict
214218
compilation passes.
215219
- **STOP** if any required `shared/*.mjs` runtime module is missing. The
216220
dispatcher must install the complete transitive resource set; compile success
@@ -221,7 +225,7 @@ fi
221225

222226
> On Windows PowerShell, the `for`/`test -f` loop above is POSIX. Use an
223227
> equivalent guard (e.g. `Test-Path`) or run it under Git Bash; the *logic* — all
224-
> twelve files must exist — is what matters.
228+
> fourteen files must exist — is what matters.
225229
226230
### 7. Inspect generated files, then stage only the documented surfaces
227231

@@ -275,12 +279,13 @@ gh pr checks --watch
275279

276280
- **Never** merge the bootstrap PR yourself. Merge happens **only** after human
277281
approval.
278-
- Make the two-PR flow explicit to the user: `/squad cast` runs **only after the
279-
bootstrap PR merges**. Casting analyzes the codebase and opens a **separate,
280-
human-reviewed Cast PR** containing the team, routing, charters, the Copilot
281-
agent, and `meet-the-squad.md`. If a work command (`/squad implement`,
282-
`/squad review`) is run before a team exists, it auto-opens that Cast PR first —
283-
merge it and rerun the original command; do not start a second cast.
282+
- Make the two-PR flow explicit to the user: after the workflow-installation PR
283+
reaches the default branch, `squad-bootstrap` automatically creates one
284+
**draft, human-reviewed Cast PR** and one linked
285+
`[Research Proposals] Agent-discovered repo opportunities` issue from the same
286+
validated repository analysis. The user reviews and merges the Cast PR, then
287+
follows the issue's `/squad research`, `/squad triage`, `/squad plan`, and
288+
`/squad activate` instructions until assignable implementation issues exist.
284289

285290
## Examples
286291

@@ -300,7 +305,8 @@ gh aw add \
300305
bradygaster/squad/workflows/squad-review.md@dev \
301306
bradygaster/squad/workflows/squad-deps-worker.md@dev \
302307
bradygaster/squad/workflows/squad-retro.md@dev \
303-
bradygaster/squad/workflows/squad-improvement-worker.md@dev
308+
bradygaster/squad/workflows/squad-improvement-worker.md@dev \
309+
bradygaster/squad/workflows/squad-bootstrap.md@dev
304310

305311
# Safe-update report shows ONLY the two documented secrets + squad-init → approve once
306312
gh aw compile --strict --approve
@@ -361,6 +367,7 @@ gh pr merge --squash # auto-merge before human review. NEVER.
361367
- ❌ **Clobbering existing workflows.** The install is additive; preserve unrelated
362368
`.github/workflows/` files.
363369
- ❌ **Widening the default token.** Keep `default_workflow_permissions=read`.
364-
- ❌ **Auto-merging.** The bootstrap PR and the later Cast PR are both
365-
human-reviewed. `/squad cast` runs only after the bootstrap PR merges.
366-
- ❌ **Opening the PR before all twelve files exist and strict compile passes.**
370+
- ❌ **Auto-merging.** The workflow-installation PR and automatic Cast PR are
371+
both human-reviewed. The dedicated bootstrap wakes only after installation
372+
lands on the default branch.
373+
- ❌ **Opening the PR before all fourteen files exist and strict compile passes.**

‎README.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,8 @@ gh aw add \
568568
bradygaster/squad/workflows/squad-review.md@dev \
569569
bradygaster/squad/workflows/squad-deps-worker.md@dev \
570570
bradygaster/squad/workflows/squad-retro.md@dev \
571-
bradygaster/squad/workflows/squad-improvement-worker.md@dev
571+
bradygaster/squad/workflows/squad-improvement-worker.md@dev \
572+
bradygaster/squad/workflows/squad-bootstrap.md@dev
572573
git add -- \
573574
.github/aw/ \
574575
.github/skills/ \
@@ -597,7 +598,7 @@ Review the complete generated diff before you commit:
597598

598599
#### Retrospective auto-implementation (opt-in behavior)
599600

600-
`squad-improvement-worker` installs as part of the standard six-workflow
601+
`squad-improvement-worker` installs as part of the standard seven-workflow
601602
`gh aw add` command above — it is not a separate add-on. The two activation
602603
policies are separate: `squad-retro` can auto-dispatch `squad-implement-worker` on its
603604
own ordinary (non-proposal) action issues once you set

0 commit comments

Comments
 (0)