Skip to content

feat: add routing.md to squad export/import functionality - #1129

Merged
bradygaster merged 5 commits into
devfrom
bradygaster/squad-1123-add-routing-to-export-import
May 18, 2026
Merged

bradygaster merged 5 commits into
devfrom
bradygaster/squad-1123-add-routing-to-export-import

Conversation

@bradygaster

Copy link
Copy Markdown
Collaborator

Summary

Adds routing.md to the Squad export/import functionality so it is included when users export or import their Squad configuration.

Previously, only structured routing rules (pattern → agent mappings) were extracted during export. The full routing.md file—including tables, module ownership, comments, and routing principles—was lost. This PR preserves the complete file content during export and restores it faithfully on import.

Changes

SDK layer (packages/squad-sdk/src/sharing/)

  • export.ts: Added routingFile optional field to ExportBundle interface; reads and includes the raw routing.md content (with anonymization support)
  • import.ts: Prefers routingFile (raw content) over formatted routingRules when writing routing.md on import

CLI layer (packages/squad-cli/src/cli/commands/)

  • export.ts: Added routing field to ExportManifest; reads .squad/routing.md during export
  • import.ts: Writes routing.md to .squad/ during import; reports routing import in output

Tests

  • Added 5 new tests covering routing file export (presence, absence, anonymization) and import (raw content preservation, routingFile-only bundles)

Verification

  • All 51 sharing tests pass ✅
  • All 54 sharing-advanced tests pass ✅
  • SDK type-checks cleanly ✅

Closes #1123

Include the full routing.md file content in both the SDK-level and
CLI-level export/import flows. Previously only structured routing
rules (pattern → agent) were extracted; now the complete file with
tables, comments, and routing principles is preserved during
export and faithfully restored on import.

- SDK export: adds routingFile field to ExportBundle
- SDK import: prefers raw routingFile over formatted rules
- CLI export: includes routing.md content in manifest
- CLI import: writes routing.md to .squad/ on import

Closes #1123

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

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

Adds routing.md preservation to Squad export/import flows so full routing context can round-trip alongside existing structured routing data.

Changes:

  • Adds routingFile support to SDK sharing export/import bundles.
  • Adds routing support to CLI export/import manifests.
  • Adds SDK sharing tests for raw routing content export/import and anonymization.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/squad-sdk/src/sharing/export.ts Includes raw .ai-team/routing.md content in exported bundles.
packages/squad-sdk/src/sharing/import.ts Prefers raw routing content when importing routing files.
packages/squad-cli/src/cli/commands/export.ts Adds .squad/routing.md content to CLI export manifests.
packages/squad-cli/src/cli/commands/import.ts Writes imported routing content into the destination squad.
test/sharing.test.ts Adds SDK tests for routing file preservation and anonymization.
.changeset/add-routing-to-export-import.md Records package release notes for SDK and CLI changes.

Copilot AI added 2 commits May 18, 2026 10:13
Address review feedback:
- SDK import: check bundle.routingFile !== undefined (preserves empty files)
- CLI import: check manifest.routing !== undefined (same reason)
- Add CLI integration test for routing.md export/import round-trip

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

Copy link
Copy Markdown
Collaborator Author

@copilot resolve the merge conflicts in this pull request

Copilot AI and others added 2 commits May 18, 2026 19:44
- Drop redundant 'routing' field; origin/dev already handles routing_md
- Use origin/dev's refactored buildManifest/applyManifest with return
- Bring in ExportRepoOptions/ImportRepoOptions and repo export/import
- Both routing.md round-trip tests pass (14/14)

Co-authored-by: bradygaster <41929050+bradygaster@users.noreply.github.com>
Agent-Logs-Url: https://github.com/bradygaster/squad/sessions/a692277d-db4b-42c9-928f-ade11b4a91e0

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

Copilot AI commented May 18, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved in fcbf2b8. The conflicts were in export.ts and import.ts — origin/dev had already added routing_md support as part of its buildManifest/applyManifest refactor, so I dropped the redundant routing field from my branch and adopted origin/dev's structure. All 14 CLI export-import tests pass, including both routing round-trip tests.

@bradygaster
bradygaster merged commit a9b8b59 into dev May 18, 2026
@bradygaster
bradygaster deleted the bradygaster/squad-1123-add-routing-to-export-import branch August 8, 2026 08:38
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.

Petition to add routing.md to squad export / import functionality

4 participants