Skip to content

feat: support --sdk switch with built-in base roles (#378)#424

Merged
bradygaster merged 1 commit intodevfrom
squad/378-sdk-roles-switch
Mar 16, 2026
Merged

feat: support --sdk switch with built-in base roles (#378)#424
bradygaster merged 1 commit intodevfrom
squad/378-sdk-roles-switch

Conversation

@bradygaster
Copy link
Copy Markdown
Owner

Summary

When squad init --roles --sdk is used, generates TypeScript config files using useRole() from the SDK's role catalog instead of plain defineAgent() calls.

What changed

SDK (packages/squad-sdk/src/config/init.ts):

  • Added roles?: boolean to InitOptions
  • New generateSDKBuilderConfigWithRoles() function emits useRole() calls for base role agents and defineAgent() for system agents (scribe, ralph)
  • Default starter team (lead, backend, frontend, tester) generated when no explicit base-role agents provided

CLI (packages/squad-cli/src/cli/core/init.ts):

  • Passes --roles flag through to SDK InitOptions

Tests (test/init-sdk.test.ts):

  • 8 new tests covering: sdk+roles generates useRole, non-role agents keep defineAgent, role catalog comment, valid export, explicit role agents, sdk-only unchanged, roles-only unchanged

How it works

squad init --sdk --roles generates a squad.config.ts like:

\\ ypescript
import {
defineSquad,
defineTeam,
defineAgent,
useRole,
} from '@bradygaster/squad-sdk';

const lead = useRole('lead', { name: 'lead' });
const backend = useRole('backend', { name: 'backend' });
const frontend = useRole('frontend', { name: 'frontend' });
const tester = useRole('tester', { name: 'tester' });

const scribe = defineAgent({ name: 'scribe', ... });
const ralph = defineAgent({ name: 'ralph', ... });

export default defineSquad({ ... });
\\

Test results

  • Build: clean (0 errors)
  • Tests: 4,206 passed, 5 skipped, 46 todo (baseline was 4,199 + 8 new = 4,207, minus 1 pre-existing aspire Docker failure)

Working as EECOM (Core Dev).

Closes #378

When `squad init --roles --sdk` is used, generates TypeScript
source files under squad/ using defineAgent()/defineSquad() API
with base role definitions via useRole().

- Added `roles` option to SDK InitOptions interface
- Created generateSDKBuilderConfigWithRoles() that emits
  useRole() calls for base role agents and defineAgent()
  for non-role system agents (scribe, ralph)
- Default starter team (lead, backend, frontend, tester)
  generated when no base-role agents are explicitly provided
- CLI passes --roles flag through to SDK init
- 8 new tests covering sdk+roles, sdk-only, and roles-only paths

Closes #378

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bradygaster bradygaster merged commit bace6c5 into dev Mar 16, 2026
2 checks passed
@bradygaster bradygaster deleted the squad/378-sdk-roles-switch branch March 16, 2026 10:55
tamirdresher pushed a commit to tamirdresher/squad that referenced this pull request Mar 16, 2026
…r#438)

* chore(squad): quality review findings — 7 issues filed

Quality audit complete: 5 agents assessed CLI across testing, coverage, stability, accessibility, UX.
Results: 4 P0 blockers (bradygaster#365bradygaster#368), 3 P1 items (bradygaster#369bradygaster#371).
Blocking: Waingro dead sessions, ErrorBoundary, dropped input; Marquez help text consistency.

Changes:
- Logged session summary to .squad/log/2026-02-24T0205-quality-review-complete.md
- Updated .squad/identity/now.md with quality review findings and new issue numbers

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

* chore(squad): merge decision — Marquez UX audit findings

Quality assessment merged from inbox (Grade B): 11 improvements (3 P0, 4 P1, 4 P2). help text, stub commands, vocabulary, separators, roster.

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

* Fix bradygaster#419/bradygaster#424: Restructure /help for scannability

Show 3-5 most essential commands by default, with clear pointer to /help full for complete reference.

Default /help now fits in ~5 lines:
- Commands: /status, /history, /agents, /quit
- Type /help full for complete docs

/help full shows the complete list with descriptions, matching previous behavior.

Closes bradygaster#419, bradygaster#424

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

* Fix bradygaster#421: Lead with default behavior in --help

The CLI help now leads with 'Just type — squad routes your message to the right agent automatically' before listing commands. This makes it clear that the primary way to use squad is to run it with no args and talk naturally.

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
diberry pushed a commit to diberry/squad that referenced this pull request Mar 19, 2026
…er#429, bradygaster#424, bradygaster#417, bradygaster#415, bradygaster#412, bradygaster#411)

Documents features and changes from recent PRs that shipped without
corresponding docs updates:

- bradygaster#429: Update model catalog with Sonnet 4.6, Opus 4.6, GPT-5.4 defaults
- bradygaster#424: Document --sdk switch for TypeScript config generation
- bradygaster#412: Document --roles flag for opt-in base roles
- bradygaster#411: Note Ralph in init + @copilot routing template removal
- bradygaster#442: Add Session Recovery skill documentation
- bradygaster#417: Document CastingEngine character casting
- bradygaster#415: Add rework rate OTEL metrics reference

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
diberry pushed a commit to diberry/squad that referenced this pull request Mar 19, 2026
…er#429, bradygaster#424, bradygaster#417, bradygaster#415, bradygaster#412, bradygaster#411)

Documents features and changes from recent PRs that shipped without
corresponding docs updates:

- bradygaster#429: Update model catalog with Sonnet 4.6, Opus 4.6, GPT-5.4 defaults
- bradygaster#424: Document --sdk switch for TypeScript config generation
- bradygaster#412: Document --roles flag for opt-in base roles
- bradygaster#411: Note Ralph in init + @copilot routing template removal
- bradygaster#442: Add Session Recovery skill documentation
- bradygaster#417: Document CastingEngine character casting
- bradygaster#415: Add rework rate OTEL metrics reference

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
bradygaster pushed a commit that referenced this pull request Mar 20, 2026
* docs: fill content gaps from 7 recent PRs (#442, #429, #424, #417, #415, #412, #411)

Documents features and changes from recent PRs that shipped without
corresponding docs updates:

- #429: Update model catalog with Sonnet 4.6, Opus 4.6, GPT-5.4 defaults
- #424: Document --sdk switch for TypeScript config generation
- #412: Document --roles flag for opt-in base roles
- #411: Note Ralph in init + @copilot routing template removal
- #442: Add Session Recovery skill documentation
- #417: Document CastingEngine character casting
- #415: Add rework rate OTEL metrics reference

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

* fix: remove duplicate gpt-5.1-codex-mini from Fast/Cheap tier

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant