Skip to content

feat: standalone squad migrate command for SDK-First conversion #250

Closed

Description

@bradygaster

Summary

Users with existing markdown-only squads (.squad/ directory with team.md, routing.md, agent charters) have no tooling to convert to the SDK-First authoring model. The only migration that exists is squad upgrade --migrate-directory which renames .ai-team/ to .squad/ but doesn't touch the config format.

Proposed Behavior

squad migrate # interactive: detects current state, proposes migration squad migrate --to sdk # explicit: convert markdown-only to SDK-First squad migrate --to markdown # reverse: strip TS config, keep markdown as source of truth squad migrate --dry-run # preview what would change

squad migrate --to sdk flow:

  1. Read existing .squad/team.md, .squad/routing.md, .squad/agents/*/charter.md
  2. Parse team roster, routing rules, agent definitions, casting config
  3. Generate squad.config.ts with defineSquad() builder syntax that reproduces the current state
  4. Validate: run squad build --check to confirm generated markdown matches existing
  5. Output: Migration complete. Your squad.config.ts is the new source of truth.

What gets migrated:

Source Target
.squad/team.md roster defineTeam({ members: [...] })
.squad/agents/*/charter.md defineAgent({ name, role, ... }) per agent
.squad/routing.md rules defineRouting({ rules: [...] })
.squad/ceremonies.md defineCeremony() entries
.squad/casting/policy.json defineCasting() block

What is preserved (NOT migrated):

  • decisions.md - append-only, stays as-is
  • agents/*/history.md - personal knowledge, stays as-is
  • orchestration-log/, log/ - append-only archives

Subsumes

Files to Change

  • New: packages/squad-cli/src/cli/commands/migrate.ts
  • New: packages/squad-sdk/src/config/migrate.ts (parsing + generation logic)
  • packages/squad-cli/src/cli/cli-entry.ts - wire the command
  • packages/squad-cli/src/cli/commands/migrate-directory.ts - refactor into new migrate command
  • Docs: docs/sdk-first-mode.md - add migration section

Acceptance Criteria

  • squad migrate --to sdk generates valid squad.config.ts from existing markdown
  • squad build --check passes after migration (round-trip fidelity)
  • squad migrate --dry-run shows preview without writing
  • squad migrate --from ai-team replaces upgrade --migrate-directory
  • Preserves decisions, history, and logs untouched
  • Tests cover: fresh markdown to SDK, ai-team to squad, already-SDK (no-op)
  • Documentation updated

Deferred from v0.8.21 to avoid release risk. Related: #249 (init --sdk), #231 (original community request).

Activity

  1. github-actions commented on Mar 7, 2026

    @github-actions
    Contributor

    📋 Assigned to Fenster (Core Dev)

    Issue: #250 — feat: standalone squad migrate command for SDK-First conversion

    Fenster will pick this up in the next Copilot session.

    For Copilot coding agent: If enabled, this issue will be worked automatically.
    Otherwise, start a Copilot session and say:
    Fenster, work on issue #250

  2. github-actions commented on Mar 7, 2026

    @github-actions
    Contributor

    🏗️ Squad Triage — Keaton (Lead)

    Issue: #250 — feat: standalone squad migrate command for SDK-First conversion
    Assigned to: Hockney (Tester)
    Reason: Issue relates to testing/quality work

    @copilot evaluation: No strong capability match — routed to squad member.

    Team roster:

    • Keaton (Lead) → label: squad:keaton
    • Verbal (Prompt Engineer) → label: squad:verbal
    • Fenster (Core Dev) → label: squad:fenster
    • Hockney (Tester) → label: squad:hockney
    • McManus (DevRel) → label: squad:mcmanus
    • Kujan (SDK Expert) → label: squad:kujan
    • Edie (TypeScript Engineer) → label: squad:edie
    • Kobayashi (Git & Release) → label: squad:kobayashi
    • Fortier (Node.js Runtime) → label: squad:fortier
    • Rabin (Distribution) → label: squad:rabin
    • Baer (Security) → label: squad:baer
    • Redfoot (Graphic Designer) → label: squad:redfoot
    • Strausz (VS Code Extension) → label: squad:strausz
    • Saul (Aspire & Observability) → label: squad:saul
    • Kovash (REPL & Interactive Shell) → label: squad:kovash
    • Marquez (CLI UX Designer) → label: squad:marquez
    • Cheritto (TUI Engineer) → label: squad:cheritto
    • Breedan (E2E Test Engineer) → label: squad:breedan
    • Nate (Accessibility Reviewer) → label: squad:nate
    • Waingro (Product Dogfooder) → label: squad:waingro
    • Ralph (Work Monitor) → label: squad:ralph
    • @copilot (Coding Agent) → label: squad:copilot

    To reassign, remove the current squad:* label and add the correct one.

  3. bradygaster commented on Mar 7, 2026

    @bradygaster
    CollaboratorAuthor

    ✅ Implemented in commit 412ce58 on dev.

    What shipped:

    • \squad migrate --to sdk\ — parses .squad/ markdown, generates squad.config.ts with defineSquad() builders
    • \squad migrate --to markdown\ — runs build, removes squad.config.ts
    • \squad migrate --from ai-team\ — subsumes upgrade --migrate-directory
    • \squad migrate --dry-run\ — preview without writing
    • Type-safe markdown parsing: team.md roster, routing.md rules, agent charters → typed config

    Files changed:

    • New: \packages/squad-cli/src/cli/commands/migrate.ts\ (523 lines)
    • \packages/squad-cli/src/cli-entry.ts\ — migrate command wiring

    Tests: 13 new tests in \ est/migrate.test.ts\ covering all 3 migration paths + dry-run. All 3768 tests passing.

    — Edie 👩‍💻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvementgo:needs-researchNeeds investigationrelease:v0.8.22Release v0.8.22squadSquad triage inbox — Lead will assign to a member

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions