Skip to content

Commit 04a5c23

Browse files
authored
Merge pull request #1702 from bradygaster/squad/1700-auto-cast-ux-guidance
docs(gh-aw): clarify Auto-Cast first-run UX, add canonical fallback, Cast PR return guidance (#1700)
2 parents f77286a + 4be3ace commit 04a5c23

4 files changed

Lines changed: 32 additions & 7 deletions

File tree

‎docs/demo-agentic-sdlc-walkthrough.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Merge the PR to activate your team. Run `/squad status` afterward to verify.
3333

3434
**Screen shows:** The PR merges. The casting issue remains open until the user closes it.
3535

36-
**Key point:** Casting is a one-time setup action — it gets its own issue that the user closes after merge. Your actual work intent goes in a separate issue that stays open throughout the SDLC lifecycle.
36+
**Key point:** This two-issue setup — a dedicated Cast issue followed by a separate work issue — is a deliberate **presenter variant** that makes each stage explicit. In everyday use you don't need to pre-cast: if you run a work command such as `/squad research` on a repo with no committed team, Squad auto-Casts on that same issue, pauses the original command, and tells you to merge the Cast PR and rerun. Either path works; the demo uses the explicit variant so each step is visible on screen.
3737

3838
---
3939

‎docs/src/content/docs/guide/gh-aw.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,8 @@ Squad performs a deep analysis of your repository in context of the issue, then
427427
posts structured findings as a comment. This is the discovery phase — no issues
428428
or PRs are created.
429429

430+
> **No team yet?** If you run `/squad research` (or any other work command) on a repo with no committed team, Squad automatically opens a Cast PR on the same issue, pauses your command for that run, and posts instructions to merge the Cast PR and rerun the original command. You don't need to pre-cast on a separate issue — Squad handles it inline.
431+
430432
The research comment includes:
431433
- **Current state** — architecture, patterns, dependency versions, code health
432434
- **Gap analysis** — what's missing or incomplete relative to the issue/goal

‎test/gh-aw-quality.test.ts‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,3 +1107,26 @@ describe('gh-aw: Cast PR dedup jq filter behavioral coverage (#1689 revision)',
11071107
expect(result).not.toContain('squad/cast-member-dev');
11081108
});
11091109
});
1110+
1111+
// ---------------------------------------------------------------------------
1112+
// gh-aw: Auto-Cast UX guidance — canonical fallback, paused-run wording,
1113+
// and Cast PR body return/rerun instruction (#1700)
1114+
//
1115+
// Focused contract assertions for the UX guidance added in #1700.
1116+
// Complements the broader auto-Cast coverage in the '#1689' describe blocks above.
1117+
// ---------------------------------------------------------------------------
1118+
describe('gh-aw: Auto-Cast UX guidance — canonical fallback and Cast PR body return instruction (#1700)', () => {
1119+
const squadContent = readFileSync(SQUAD_WORKFLOW, 'utf8');
1120+
1121+
it('canonical_mode definition includes safe fallback for unresolvable mode', () => {
1122+
expect(squadContent).toMatch(/if.*canonical_mode.*cannot be determined.*safe fallback|safe fallback.*\/squad/i);
1123+
});
1124+
1125+
it('first-run Auto-Cast comment tells user their command is paused this run', () => {
1126+
expect(squadContent).toMatch(/command.*paused this run|paused this run/i);
1127+
});
1128+
1129+
it('Cast PR body instructs user to return to originating issue and rerun canonical command', () => {
1130+
expect(squadContent).toMatch(/return to the originating issue and rerun.*\{canonical_command\}/s);
1131+
});
1132+
});

‎workflows/squad.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ The leading `sub(/\r$/,"")` normalizes CRLF line endings so Windows-formatted te
219219
### Auto-Cast Pivot
220220

221221
**Canonical command variables** (derived from Parse Command output — never from raw input):
222-
- `{canonical_mode}` — the parsed mode enum (e.g., `research`, `plan`, `plan-activate`)
223-
- `{canonical_command}` — reconstructed user-safe command: `/squad {canonical_mode}` with optional `phase {N}` suffix
222+
- `{canonical_mode}` — the parsed mode enum (e.g., `research`, `plan`, `plan-activate`); if the mode cannot be determined, substitute the literal string `squad` in prose
223+
- `{canonical_command}` — reconstructed user-safe command: `/squad {canonical_mode}` with optional `phase {N}` suffix; if `{canonical_mode}` cannot be determined, use `/squad` as the safe fallback
224224
- `{phase_n}` — numeric phase if present; omit the field otherwise
225225

226226
**Universal response invariant:** current state · result · one primary next action · recovery on ⚠️/🔴.
@@ -249,13 +249,13 @@ gh pr list --state open --json number,url,headRefName --jq '[.[] | select(.headR
249249
- The Cast PR body may reference the originating issue and canonical command in plain language, but MUST NOT contain `Fixes`, `Closes`, or `Resolves` closing keywords for the originating work issue.
250250
- Then `add-comment`:
251251
```
252-
🤖 Squad is assembling your team.
252+
🤖 Your `{canonical_mode}` command found no team yet — Squad has automatically opened a Cast PR to assemble one.
253253
254254
**Current state:** No team detected — Squad auto-pivoted to Cast.
255-
**Result:** A Cast PR has been opened. Check the **Pull Requests** tab to find and review it.
255+
**Result:** A Cast PR has been opened. Your `{canonical_mode}` command is paused this run — resume it after merging.
256256
**Next action:** Merge the Cast PR, then return to this issue and rerun: `{canonical_command}`
257257
258-
⚠️ The PR link is not available in this comment — find it in the **Pull Requests** tab.
258+
⚠️ A direct Cast PR link is not available in this comment. Find it in the **Pull Requests** tab.
259259
```
260260
- A closed or failed Cast PR is not durable team state. A later rerun with no committed roster and no open Cast PR MUST attempt Cast again.
261261
- Stop. Do not run the original command this run.
@@ -353,7 +353,7 @@ Create `meet-the-squad.md` at repo root with: title, universe name, team table (
353353

354354
##### Step 6: Open PR
355355

356-
`create-pull-request`: branch `squad/cast-{repo}`, title `[squad] Cast your Squad — {description}`, body with team summary. Files: `.squad/`, `.github/agents/squad.agent.md`, `meet-the-squad.md`. Stage only these.
356+
`create-pull-request`: branch `squad/cast-{repo}`, title `[squad] Cast your Squad — {description}`, body with team summary. Append to the PR body: "After merging, return to the originating issue and rerun `{canonical_command}` to resume your work." Files: `.squad/`, `.github/agents/squad.agent.md`, `meet-the-squad.md`. Stage only these.
357357

358358
##### Step 7: Post Completion
359359

0 commit comments

Comments
 (0)