Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .changeset/rename-npm-packages-squad-scope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@squad/cli": major
"@squad/sdk": major
---

Rename the npm packages from `@bradygaster/squad-cli` and `@bradygaster/squad-sdk` to `@squad/cli` and `@squad/sdk`. `squad upgrade --self` and the update banner detect a legacy global install and remove it before installing the new package, and MCP config entries that use the old package name are still recognized as Squad-managed. Distribution names now come from `scripts/release/distribution-identity.json`, and `scripts/rename-distribution-identity.mjs` rewrites the repository when they change.
Comment on lines +2 to +6
8 changes: 4 additions & 4 deletions .copilot/skills/architectural-review/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ squad-sdk → NEVER depends on → squad-cli
```

**Check every new `import` statement in the PR:**
- CLI files may import from SDK (`@bradygaster/squad-sdk`)
- CLI files may import from SDK (`@squad/sdk`)
- SDK files must NEVER import from CLI
- If a PR adds an SDK import that pulls in CLI code, reject it

Expand Down Expand Up @@ -70,7 +70,7 @@ When a PR applies a codebase-wide pattern change (e.g., "convert all `fs` calls

1. **Protected Files checked** — None of the protected bootstrap files were converted
2. **Zero-dependency markers scanned** — Files with `— zero dependencies` headers were skipped
3. **Imports resolve** — Every `import { X } from '@bradygaster/squad-sdk'` references an export that actually exists in the SDK barrel file
3. **Imports resolve** — Every `import { X } from '@squad/sdk'` references an export that actually exists in the SDK barrel file
4. **Not blindly applied** — File-specific constraints were respected
5. **Batched testing** — Changes were tested in logical groups, not all 30 files at once

Expand Down Expand Up @@ -123,7 +123,7 @@ When reviewing changes to `core/` files:
**Example 1: Reject — SDK import in bootstrap file**
```
PR adds to detect-squad-dir.ts:
import { FSStorageProvider } from '@bradygaster/squad-sdk';
import { FSStorageProvider } from '@squad/sdk';

Finding: REJECT — detect-squad-dir.ts is a protected bootstrap file.
It runs before the SDK is loaded. This import will crash the CLI at startup.
Expand All @@ -133,7 +133,7 @@ Recommendation: Use node:fs directly. See Protected Files table.
**Example 2: Reject — Reverse dependency**
```
PR adds to packages/squad-sdk/src/storage.ts:
import { detectSquadDir } from '@bradygaster/squad-cli';
import { detectSquadDir } from '@squad/cli';

Finding: REJECT — SDK must never depend on CLI. Dependency direction is
CLI → SDK, not reverse. Move the shared logic to SDK or extract to a
Expand Down
4 changes: 2 additions & 2 deletions .copilot/skills/pr-lifecycle/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ For advanced scenarios (worktrees, multi-repo coordination), see `.copilot/skill
Or create manually at `.changeset/{descriptive-name}.md`:
```markdown
---
'@bradygaster/squad-cli': patch
'@squad/cli': patch
---

Brief description of the change
Expand Down Expand Up @@ -372,7 +372,7 @@ npm run build && npm test && npm run lint

# Changeset (required — touches packages/squad-sdk/src/)
npx changeset add
# Select: @bradygaster/squad-sdk, minor, "Add profile API"
# Select: @squad/sdk, minor, "Add profile API"

# Stage and commit
git add packages/squad-sdk/src/profile/index.ts packages/squad-sdk/src/index.ts .changeset/
Expand Down
2 changes: 1 addition & 1 deletion .copilot/skills/protected-files/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The `packages/squad-cli/src/cli/core/` directory contains a mix of early-startup
## Anti-Patterns

- Converting all `fs` calls to `StorageProvider` without checking this list first
- Adding `import { X } from '@bradygaster/squad-sdk'` to a bootstrap file
- Adding `import { X } from '@squad/sdk'` to a bootstrap file
- Assuming every file in `core/` can safely import SDK code

## Adding New Bootstrap Utilities
Expand Down
10 changes: 5 additions & 5 deletions .copilot/skills/release-process/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Before either channel:
git fetch origin dev main
git merge-base origin/dev origin/main
grep '"version"' package.json packages/squad-sdk/package.json packages/squad-cli/package.json
node -p "require('./packages/squad-cli/package.json').dependencies['@bradygaster/squad-sdk']"
node -p "require('./packages/squad-cli/package.json').dependencies['@squad/sdk']"
grep -F "## [$VERSION]" CHANGELOG.md
SKIP_BUILD_BUMP=1 npm run build
npx vitest run
Expand Down Expand Up @@ -128,10 +128,10 @@ publication.
## Verify

```bash
npm view @bradygaster/squad-sdk dist-tags.preview
npm view @bradygaster/squad-cli dist-tags.preview
npm view @bradygaster/squad-sdk dist-tags.latest
npm view @bradygaster/squad-cli dist-tags.latest
npm view @squad/sdk dist-tags.preview
npm view @squad/cli dist-tags.preview
npm view @squad/sdk dist-tags.latest
npm view @squad/cli dist-tags.latest
gh release view "v$VERSION"
```

Expand Down
2 changes: 1 addition & 1 deletion .github/actions/squad-init/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# works on runners that cannot reach registry.npmjs.org — self-hosted agents
# behind a corporate firewall, locked-down build machines, air-gapped mirrors.
#
# This is the npm-free replacement for the `npx @bradygaster/squad-cli init`
# This is the npm-free replacement for the `npx @squad/cli init`
# step in the gh-aw activation job (see the limitation documented in #1587,
# and the RFC in #1593).
#
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/squad-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ jobs:
sub(/^run:[[:space:]]*/, "", command)
if (command ~ /(^|&&|\|\||;)[[:space:]]*((if|then)[[:space:]]+)?([A-Za-z_][A-Za-z0-9_]*=[^[:space:]]+[[:space:]]+)*npm[[:space:]][^#;&|]*publish([[:space:]]|$)/ &&
command !~ /(^|[[:space:]])(-w|--workspace)(=|[[:space:]]|$)/ &&
command !~ /npm publish "\$PACKS_DIR\/bradygaster-squad-(sdk|cli)-\$\{VERSION\}\.tgz"/) {
command !~ /npm publish "\$PACKS_DIR\/(squad-sdk-\$\{VERSION\}\.tgz|squad-cli-\$\{VERSION\}\.tgz)"/) {
print NR ":" $0
}
}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/squad-insider-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ jobs:
exit 1
fi
echo "✅ npm registry is reachable"
if ! npm view @bradygaster/squad-sdk version 2>/dev/null; then
echo "::warning::Cannot verify @bradygaster/squad-sdk on registry — package may not exist yet or registry is degraded"
if ! npm view @squad/sdk version 2>/dev/null; then
echo "::warning::Cannot verify @squad/sdk on registry — package may not exist yet or registry is degraded"
else
echo "✅ @bradygaster package namespace is accessible"
fi
Expand Down Expand Up @@ -113,11 +113,11 @@ jobs:

# Query npm for the latest insider build number for this base version
# Fail hard if npm is unreachable — defaulting to 0 risks republishing an existing version
SDK_VERSIONS=$(npm view @bradygaster/squad-sdk versions --json 2>&1) || {
SDK_VERSIONS=$(npm view @squad/sdk versions --json 2>&1) || {
echo "::error::Failed to query npm for squad-sdk versions. Cannot safely compute insider version."
exit 1
}
CLI_VERSIONS=$(npm view @bradygaster/squad-cli versions --json 2>&1) || {
CLI_VERSIONS=$(npm view @squad/cli versions --json 2>&1) || {
echo "::error::Failed to query npm for squad-cli versions. Cannot safely compute insider version."
exit 1
}
Expand Down Expand Up @@ -160,8 +160,8 @@ jobs:
if: ${{ inputs.dry_run == 'true' }}
run: |
echo "🏜️ DRY RUN — would have published:"
echo " @bradygaster/squad-sdk@${{ steps.version.outputs.insider_version }}"
echo " @bradygaster/squad-cli@${{ steps.version.outputs.insider_version }}"
echo " @squad/sdk@${{ steps.version.outputs.insider_version }}"
echo " @squad/cli@${{ steps.version.outputs.insider_version }}"

release:
name: Create insider GitHub prerelease
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/squad-npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,9 @@ jobs:
[ -n "$NODE_AUTH_TOKEN" ] || { echo "::error::NPM_TOKEN is not configured"; exit 1; }
node "$RELEASE_SCRIPTS_ROOT/assert-publish-identity.mjs" --source-sha "$SOURCE_SHA" --dispatch-sha "${{ github.sha }}" --workflow-sha "${{ github.workflow_sha }}" --tag "$TAG" --evidence-dir "$PACKS_DIR"
if [ "$SDK_STATE" = present ]; then
npm dist-tag add "@bradygaster/squad-sdk@${VERSION}" "$STAGING_TAG"
npm dist-tag add "@squad/sdk@${VERSION}" "$STAGING_TAG"
elif [ "$SDK_STATE" = missing ]; then
npm publish "$PACKS_DIR/bradygaster-squad-sdk-${VERSION}.tgz" --ignore-scripts --access public --provenance --tag "$STAGING_TAG"
npm publish "$PACKS_DIR/squad-sdk-${VERSION}.tgz" --ignore-scripts --access public --provenance --tag "$STAGING_TAG"
else
echo "::error::SDK registry state must be present or missing, got '$SDK_STATE'"; exit 1
fi
Expand All @@ -357,9 +357,9 @@ jobs:
[ -n "$NODE_AUTH_TOKEN" ] || { echo "::error::NPM_TOKEN is not configured"; exit 1; }
node "$RELEASE_SCRIPTS_ROOT/assert-publish-identity.mjs" --source-sha "$SOURCE_SHA" --dispatch-sha "${{ github.sha }}" --workflow-sha "${{ github.workflow_sha }}" --tag "$TAG" --evidence-dir "$PACKS_DIR"
if [ "$CLI_STATE" = present ]; then
npm dist-tag add "@bradygaster/squad-cli@${VERSION}" "$STAGING_TAG"
npm dist-tag add "@squad/cli@${VERSION}" "$STAGING_TAG"
elif [ "$CLI_STATE" = missing ]; then
npm publish "$PACKS_DIR/bradygaster-squad-cli-${VERSION}.tgz" --ignore-scripts --access public --provenance --tag "$STAGING_TAG"
npm publish "$PACKS_DIR/squad-cli-${VERSION}.tgz" --ignore-scripts --access public --provenance --tag "$STAGING_TAG"
else
echo "::error::CLI registry state must be present or missing, got '$CLI_STATE'"; exit 1
fi
Expand All @@ -375,7 +375,7 @@ jobs:
run: |
set -euo pipefail
node "$RELEASE_SCRIPTS_ROOT/assert-publish-identity.mjs" --source-sha "$SOURCE_SHA" --dispatch-sha "${{ github.sha }}" --workflow-sha "${{ github.workflow_sha }}" --tag "$TAG" --evidence-dir "$PACKS_DIR"
npm dist-tag add "@bradygaster/squad-sdk@${VERSION}" "$DIST_TAG"
npm dist-tag add "@squad/sdk@${VERSION}" "$DIST_TAG"

- name: Promote CLI to the primary channel
if: steps.existing.outputs.set_cli_primary == 'true'
Expand All @@ -384,7 +384,7 @@ jobs:
run: |
set -euo pipefail
node "$RELEASE_SCRIPTS_ROOT/assert-publish-identity.mjs" --source-sha "$SOURCE_SHA" --dispatch-sha "${{ github.sha }}" --workflow-sha "${{ github.workflow_sha }}" --tag "$TAG" --evidence-dir "$PACKS_DIR"
npm dist-tag add "@bradygaster/squad-cli@${VERSION}" "$DIST_TAG"
npm dist-tag add "@squad/cli@${VERSION}" "$DIST_TAG"

- name: Verify primary channel
run: node scripts/release/npm-pair-verify.mjs --version "$VERSION" --tag "$DIST_TAG" --local-packs "$PACKS_DIR/local-packs.json" --out "$RECON_DIR/verify-${DIST_TAG}.json" --max-wait-seconds 900
Expand All @@ -396,7 +396,7 @@ jobs:
run: |
set -euo pipefail
node "$RELEASE_SCRIPTS_ROOT/assert-publish-identity.mjs" --source-sha "$SOURCE_SHA" --dispatch-sha "${{ github.sha }}" --workflow-sha "${{ github.workflow_sha }}" --tag "$TAG" --evidence-dir "$PACKS_DIR"
npm dist-tag add "@bradygaster/squad-sdk@${VERSION}" preview
npm dist-tag add "@squad/sdk@${VERSION}" preview

- name: Add preview alias to CLI
if: steps.existing.outputs.set_cli_preview == 'true'
Expand All @@ -405,7 +405,7 @@ jobs:
run: |
set -euo pipefail
node "$RELEASE_SCRIPTS_ROOT/assert-publish-identity.mjs" --source-sha "$SOURCE_SHA" --dispatch-sha "${{ github.sha }}" --workflow-sha "${{ github.workflow_sha }}" --tag "$TAG" --evidence-dir "$PACKS_DIR"
npm dist-tag add "@bradygaster/squad-cli@${VERSION}" preview
npm dist-tag add "@squad/cli@${VERSION}" preview

- name: Verify preview alias
if: inputs.add_preview_alias && inputs.dist_tag != 'preview'
Expand Down Expand Up @@ -434,7 +434,7 @@ jobs:
run: |
set -euo pipefail
node "$RELEASE_SCRIPTS_ROOT/assert-publish-identity.mjs" --source-sha "$SOURCE_SHA" --dispatch-sha "${{ github.sha }}" --workflow-sha "${{ github.workflow_sha }}" --tag "$TAG" --evidence-dir "$PACKS_DIR"
if npm dist-tag rm @bradygaster/squad-sdk "$STAGING_TAG"; then
if npm dist-tag rm @squad/sdk "$STAGING_TAG"; then
echo "outcome=success" >> "$GITHUB_OUTPUT"
else
status=$?
Expand All @@ -450,7 +450,7 @@ jobs:
run: |
set -euo pipefail
node "$RELEASE_SCRIPTS_ROOT/assert-publish-identity.mjs" --source-sha "$SOURCE_SHA" --dispatch-sha "${{ github.sha }}" --workflow-sha "${{ github.workflow_sha }}" --tag "$TAG" --evidence-dir "$PACKS_DIR"
if npm dist-tag rm @bradygaster/squad-cli "$STAGING_TAG"; then
if npm dist-tag rm @squad/cli "$STAGING_TAG"; then
echo "outcome=success" >> "$GITHUB_OUTPUT"
else
status=$?
Expand Down Expand Up @@ -642,12 +642,12 @@ jobs:
run: |
set -euo pipefail
node "$RELEASE_SCRIPTS_ROOT/assert-publish-identity.mjs" --source-sha "$SOURCE_SHA" --dispatch-sha "${{ github.sha }}" --workflow-sha "${{ github.workflow_sha }}" --tag "$TAG" --evidence-dir "$PACKS_DIR"
node scripts/promote-insider-tag.mjs @bradygaster/squad-sdk "$NEW_VERSION"
node scripts/promote-insider-tag.mjs @squad/sdk "$NEW_VERSION"
- name: Promote CLI insider dist-tag
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NEW_VERSION: ${{ inputs.version }}
run: |
set -euo pipefail
node "$RELEASE_SCRIPTS_ROOT/assert-publish-identity.mjs" --source-sha "$SOURCE_SHA" --dispatch-sha "${{ github.sha }}" --workflow-sha "${{ github.workflow_sha }}" --tag "$TAG" --evidence-dir "$PACKS_DIR"
node scripts/promote-insider-tag.mjs @bradygaster/squad-cli "$NEW_VERSION"
node scripts/promote-insider-tag.mjs @squad/cli "$NEW_VERSION"
8 changes: 4 additions & 4 deletions .github/workflows/squad-promote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ jobs:
fi

expected_sdk_dependency=">=${version}"
sdk_dependency="$(node -p "require('./packages/squad-cli/package.json').dependencies['@bradygaster/squad-sdk']")"
lock_dependency="$(node -p "require('./package-lock.json').packages['packages/squad-cli'].dependencies['@bradygaster/squad-sdk']")"
sdk_dependency="$(node -p "require('./packages/squad-cli/package.json').dependencies['@squad/sdk']")"
lock_dependency="$(node -p "require('./package-lock.json').packages['packages/squad-cli'].dependencies['@squad/sdk']")"
if [ "${sdk_dependency}" != "${expected_sdk_dependency}" ] || [ "${lock_dependency}" != "${expected_sdk_dependency}" ]; then
echo "::error::CLI SDK dependency floors must both be '${expected_sdk_dependency}'."
exit 1
Expand Down Expand Up @@ -267,8 +267,8 @@ jobs:
exit 1
fi
done
sdk_dependency="$(node -p "require('./packages/squad-cli/package.json').dependencies['@bradygaster/squad-sdk']")"
lock_dependency="$(node -p "require('./package-lock.json').packages['packages/squad-cli'].dependencies['@bradygaster/squad-sdk']")"
sdk_dependency="$(node -p "require('./packages/squad-cli/package.json').dependencies['@squad/sdk']")"
lock_dependency="$(node -p "require('./package-lock.json').packages['packages/squad-cli'].dependencies['@squad/sdk']")"
if [[ "$sdk_dependency" == *-* ]] || [[ "$lock_dependency" == *-* ]]; then
echo "::error::Stable promotion cannot retain a prerelease SDK dependency floor."
exit 1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/squad-release-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ on:
description: 'Name of the uploaded evidence artifact'
value: ${{ jobs.verify.outputs.evidence_artifact }}
sdk_sha256:
description: 'sha256 of the packed @bradygaster/squad-sdk tarball'
description: 'sha256 of the packed @squad/sdk tarball'
value: ${{ jobs.verify.outputs.sdk_sha256 }}
cli_sha256:
description: 'sha256 of the packed @bradygaster/squad-cli tarball'
description: 'sha256 of the packed @squad/cli tarball'
value: ${{ jobs.verify.outputs.cli_sha256 }}
pull_request:
branches: [dev, main]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/squad-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Squad Release
# verification bundle (squad-release-verify.yml) pass at that SHA.
#
# Preview releases (X.Y.Z-preview.N from dev) publish to the npm `insider` dist-tag by default
# because `squad upgrade --self --insider` resolves `@bradygaster/squad-cli@insider`; `preview`
# because `squad upgrade --self --insider` resolves `@squad/cli@insider`; `preview`
# is added as a compatibility alias once both packages verify. Both are inputs so the channel
# decision is a one-line change at dispatch time.
#
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/squad-upgrade-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ jobs:
target_version="$(node -p 'require("./preview-tarball-matrix-results/registry-preflight.json").version')"
test "$target_version" = "$SQUAD_PREVIEW_EXPECTED_VERSION"
registry_state="$(node -p 'require("./preview-tarball-matrix-results/registry-preflight.json").aggregate.versionState')"
insider_version="$(node -p 'require("./preview-tarball-matrix-results/registry-preflight.json").packages["@bradygaster/squad-cli"].distTags.values.insider || ""')"
insider_version="$(node -p 'require("./preview-tarball-matrix-results/registry-preflight.json").packages["@squad/cli"].distTags.values.insider || ""')"
echo "SQUAD_PREVIEW_TARGET_REGISTRY_STATE=$registry_state" >> "$GITHUB_ENV"
echo "SQUAD_PREVIEW_INSIDER_VERSION=$insider_version" >> "$GITHUB_ENV"
- name: Run exact preview-tarball matrix
Expand Down
2 changes: 1 addition & 1 deletion .squad-templates/model-selection-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Per-Agent Model Selection

Before spawning an agent, resolve its model with the central resolver (`resolveAgentModel` from `@bradygaster/squad-sdk/agents`, also exported there under its original name `resolveModel`; it returns the model with its `source` and `rationale`). The root `@bradygaster/squad-sdk` export `resolveModel` is a legacy adapter over the same resolver that reads `.squad/config.json` and returns only the model ID. Apply the precedence below; first match wins. Every result carries a **source** and a **rationale**, and both appear in the spawn acknowledgment.
Before spawning an agent, resolve its model with the central resolver (`resolveAgentModel` from `@squad/sdk/agents`, also exported there under its original name `resolveModel`; it returns the model with its `source` and `rationale`). The root `@squad/sdk` export `resolveModel` is a legacy adapter over the same resolver that reads `.squad/config.json` and returns only the model ID. Apply the precedence below; first match wins. Every result carries a **source** and a **rationale**, and both appear in the spawn acknowledgment.

Spawn guidance never names a model ID. It reasons in sources and tiers (`premium`, `standard`, `fast`); **Appendix A** is the only place that turns a tier into model IDs.

Expand Down
Loading
Loading