| name | outfitter-upgrade |
| version | 2.0.0 |
| description | Manages @outfitter/* package upgrades โ handles version detection, dependency bumps, mechanical codemods, and test verification. Use when upgrading dependencies, migrating breaking changes, or running outfitter upgrade. |
| allowed-tools | Read, Write, Edit, Grep, Glob, Bash, Skill, AskUserQuestion |
| related-skills | outfitter-atlas, outfitter-check, outfitter-start, tdd-fieldguide |
Outfitter Upgrade
Upgrade @outfitter/* packages with structured migration โ from version detection through codemod execution to test verification.
Steps
- Detect โ Run
outfitter upgrade --json to discover installed versions and available updates.
- Decide โ Present findings. Choose interactive or autonomous mode based on scope.
- Apply โ Run
outfitter upgrade to bump deps, install, and run mechanical codemods (interactive prompt by default; use --yes to skip).
- Migrate โ For remaining changes not covered by codemods, apply code transforms manually using structured change metadata.
- Verify โ Run tests. If failures, diagnose using migration docs as context, fix, re-verify.
- Confirm โ Load
outfitter-check for final compliance scan.
Mode Selection
| Condition | Mode | Rationale |
|---|
| No breaking changes | Auto | Bump, install, run tests โ no code changes expected |
| Breaking changes with codemods | Autonomous | CLI handles mechanical transforms, agent verifies |
| Breaking changes, no codemods | Interactive | Agent needs judgment for code migration |
| Major version jump (>2 minor) | Interactive | Too many changes to auto-apply safely |
Autonomous Loop
When in autonomous mode, follow this cycle:
detect โ apply โ codemod โ migrate โ test โ fix โ repeat
โ
(green) โ confirm โ done
Step-by-step
- Run
outfitter upgrade --json to get structured output
- Parse the
packages array for updates, check hasBreaking
- Run
outfitter upgrade --yes (or --all --yes if breaking changes are expected)
- CLI bumps deps, installs, discovers codemods, runs them automatically
- Parse
codemods summary from output โ check errors array
- Run
outfitter upgrade --guide --json to fetch structured migration guides
- For each
guide in the guide output with changes:
- Skip changes where
change.codemod exists (already handled)
- Apply remaining changes using the structured metadata (see Decision Framework)
- Run
bun test (or bun run test from repo root)
- If tests fail:
a. Read failure output
b. Cross-reference with migration doc guidance (
outfitter upgrade --guide)
c. Fix the issue
d. Re-run tests
e. If still failing after 3 attempts, escalate to user
- When green: load
outfitter-check skill for compliance verification
CLI Reference
outfitter upgrade
outfitter upgrade --json
outfitter upgrade --guide
outfitter upgrade --guide @outfitter/cli
outfitter upgrade
outfitter upgrade --yes
outfitter upgrade --all
outfitter upgrade --dry-run
outfitter upgrade --no-codemods
JSON Output Shape
interface UpdateResult {
packages: PackageVersionInfo[];
total: number;
updatesAvailable: number;
hasBreaking: boolean;
applied: boolean;
appliedPackages: string[];
skippedBreaking: string[];
guides?: MigrationGuide[];
codemods?: CodemodSummary;
}
See references/structured-changes.md for full type definitions and parsing examples.
Decision Framework
By Change Type
change.type | Agent Action |
|---|
moved | Update import paths: from โ to |
renamed | Find-and-replace: from โ to in imports and usages |
removed | Find usages of from, replace with alternative from detail |
signature-changed | Update call sites per detail description |
deprecated | Optional: migrate now or add TODO for later |
added | No action needed โ informational |
By Update Type
| Update Type | Action |
|---|
| Patch (0.1.0 โ 0.1.1) | Bump, test โ no code changes expected |
| Minor (0.1.0 โ 0.2.0) | Review migration doc for new APIs, adopt if beneficial |
| Breaking (flagged) | Follow migration guide, apply codemods, update code, test |
Dependency Order
When updating multiple packages, follow the tier order:
- Foundation: contracts, types
- Runtime: cli, mcp, config, logging, file-ops, state, index, daemon, schema, tui
- Tooling: testing, outfitter (umbrella CLI)
Update lower tiers first โ runtime packages depend on foundation changes.
Migration Docs
Migration guides are at ${CLAUDE_PLUGIN_ROOT}/shared/migrations/ with naming:
outfitter-<package>-<version>.md
Each doc has YAML frontmatter with structured changes:
---
package: "@outfitter/cli"
version: 0.4.0
breaking: true
changes:
- type: moved
from: "@outfitter/cli/render"
to: "@outfitter/tui/render"
codemod: "cli/0.4.0-move-tui-imports.ts"
- type: renamed
from: "formatOutput"
to: "renderOutput"
---
Changes with a codemod field are handled automatically during upgrade. The remaining changes need manual migration.
Codemods
Codemod scripts live at ${CLAUDE_PLUGIN_ROOT}/shared/codemods/ organized by package:
codemods/
cli/
0.4.0-move-tui-imports.ts
contracts/
adopt-result-types.ts
Each exports a transform(options) function. The CLI discovers and runs them automatically during upgrade. Agents should not run codemods directly โ let the CLI handle it.
Error Recovery
| Failure | Recovery |
|---|
| Upgrade fails on install | Check network, verify package exists on npm |
| Codemod reports errors | Read the errors array, fix manually, re-run |
| Tests fail after migration | Read failure, cross-reference migration doc, fix code |
| 3+ test fix attempts fail | Escalate to user with evidence |
Related Skills
outfitter-atlas โ Patterns and templates for current package versions
outfitter-check โ Compliance verification after updates
outfitter-start โ Full adoption workflow (for new or first-time setup)
tdd-fieldguide โ Test-driven development methodology for the verify loop