statamic-upgrade-major
| Type | Skill |
| Plugin | awl-web · v0.0.6 |
| Invoke | /awl-web:statamic-upgrade-major |
| Tools | Bash(composer:), Bash(php:) |
| Source | plugins/awl-web/skills/statamic-upgrade-major/SKILL.md |
When Claude uses it
Section titled “When Claude uses it”Upgrades a Statamic CMS site to the next major version following the official upgrade guide — bumps statamic/cms and Laravel constraints, migrates addons and config, runs tests. Use when asked to “upgrade statamic”, “statamic 5”, “bump statamic major”, or when composer.json pins an outdated statamic/cms major. Not for plain Laravel apps (use laravel-upgrade-major).
Trigger phrases: upgrade statamic · statamic 5 · bump statamic major
Definition
Section titled “Definition”Upgrades a Statamic CMS application to the next major version following official upgrade guides.
Instructions
Section titled “Instructions”Step 1: Detect Current Version
Section titled “Step 1: Detect Current Version”-
Read composer.json for Statamic version:
Terminal window cat composer.json | grep -A1 '"statamic/cms"' -
Extract major version (e.g.,
^4.0→ 4,^5.48→ 5) -
Calculate target version: current + 1
- Statamic 4 → 5
- Statamic 5 → 6
- NEVER skip versions
Step 2: Fetch Upgrade Guide
Section titled “Step 2: Fetch Upgrade Guide”WebFetch the official upgrade documentation:
https://statamic.dev/upgrade-guide/{CURRENT}-to-{TARGET}Example for upgrading from Statamic 4 to 5:
https://statamic.dev/upgrade-guide/4-to-5Special version formats:
Versions before 4 did not follow semver and incremented from 3.1 → 3.2 with breaking changes.
Some guides use format like 3-4-to-4-0. Try alternate patterns if primary URL fails.
IMPORTANT: Read the ENTIRE guide. Do not skim or assume changes don’t apply.
Step 3: Check Laravel Compatibility
Section titled “Step 3: Check Laravel Compatibility”CRITICAL: This command does NOT upgrade Laravel.
- Read current Laravel version from
composer.json - Check upgrade guide for minimum Laravel version required by Statamic {TARGET}
- Compare versions
If Laravel version is incompatible: STOP.
Laravel {CURRENT_LARAVEL} is installed, but Statamic {TARGET} requires Laravel {REQUIRED_LARAVEL}+.
Run `/laravel-upgrade-major` first to upgrade Laravel, then re-run `/statamic-upgrade-major`.If Laravel version is compatible: Continue to Step 4.
Step 4: Pre-Upgrade Gate (Tests Must Pass)
Section titled “Step 4: Pre-Upgrade Gate (Tests Must Pass)”Tests must be green before proceeding. Run tests in quiet mode (exit code only, output omitted to save context):
php artisan test -qOr if using PHPUnit directly:
./vendor/bin/phpunit -qIf tests fail: STOP. Report failures to user and do not proceed with upgrade.
- Upgrading with failing tests makes it impossible to verify upgrade success
- Ask user to fix tests first, then re-run
/statamic-upgrade-major
If tests pass: Continue to Step 5.
Step 5: Identify Statamic Addons
Section titled “Step 5: Identify Statamic Addons”Scan composer.json for Statamic-related packages:
-
Official addons -
statamic/*namespace:statamic/seo-prostatamic/eloquent-driverstatamic/collaboration- etc.
-
Third-party addons - Package name contains “statamic”:
appswithlove/statamic-charfielddoublethreedigital/runway- etc.
List all identified addons for updating in Step 6.
Step 6: Update Dependencies
Section titled “Step 6: Update Dependencies”Use composer require with all packages in a single command. Omit version for addons to let composer install latest compatible version.
composer require statamic/cms:^{TARGET}.0 statamic/seo-pro vendor/statamic-addon --update-with-dependenciesBuilding the Command
Section titled “Building the Command”- Start with
statamic/cms:^{TARGET}.0 - Add all addons identified in Step 4 (no version suffix)
- Include
--update-with-dependenciesflag
Example (upgrading to Statamic 5 with addons):
composer require statamic/cms:^5.0 statamic/seo-pro appswithlove/statamic-charfield --update-with-dependenciesIf conflicts occur:
- Read the composer error output carefully
- If third-party addon blocker: STOP and report to user with exact error message
- Do NOT search the web to check if addons support Statamic {TARGET}
- Do NOT try to force or work around the conflict
Step 7: Apply Code Changes
Section titled “Step 7: Apply Code Changes”CRITICAL: Check EVERY item in the upgrade guide against the project. No assumptions.
For EACH breaking change listed in the guide:
- Search the codebase for affected code (use Grep/Glob)
- Verify whether the project uses the affected feature
- Apply fix if affected, or confirm not affected if clean
Do NOT assume a breaking change doesn’t apply without searching the codebase first.
Common areas to check:
Section titled “Common areas to check:”- Config Files - Compare with new defaults, update/publish as needed
- Blueprints/Fieldtypes - Search for deprecated field types
- Tags/Modifiers - Check for renamed or removed tags
- Antlers Templates - Search for syntax changes
- Control Panel Customizations - Check for CP API changes
- Middleware - Apply any middleware changes
- Service Providers - Update if needed
Use Edit tool for each change. Explain what’s changing and why.
Step 8: Post-Upgrade Verification
Section titled “Step 8: Post-Upgrade Verification”Clear all caches:
php artisan optimize:clearClear Statamic caches:
php artisan statamic:stache:clearphp artisan statamic:static:clearRun tests (quiet mode, exit code only):
php artisan test -qOptionally run linting:
./vendor/bin/pint --test -qOptionally run static analysis:
./vendor/bin/phpstan analyse -qStep 9: Report Results
Section titled “Step 9: Report Results”Output summary:
## Statamic Upgrade Complete: {CURRENT} → {TARGET}
### Files Changed- composer.json- [list other changed files]
### Packages Updated- statamic/cms: ^{CURRENT}.0 → ^{TARGET}.0- [other packages]
### Addons Updated- [addon]: [old version] → [new version]
### Blockers Encountered- [package]: [reason]
### Test Results- Passed: X- Failed: X- [failure details if any]
### Manual Steps Remaining- [if any]Constraints
Section titled “Constraints”- NEVER skip major versions - Always current + 1
- NEVER upgrade Laravel - Abort if incompatible, user must run
/laravel-upgrade-majorfirst - NEVER force-update addons that block - Report as blockers
- NEVER assume a breaking change doesn’t apply - Search the codebase first
- ALWAYS check EVERY item in the upgrade guide against the project
- ALWAYS run tests before and after
- ALWAYS explain changes - User should understand what changed
- Backup first - Ensure git status is clean before starting
- NO WEB SEARCHES for addon compatibility - Do NOT search the web to check if addons support the target Statamic version. Let composer determine compatibility:
- Run
composer requireand let it fail if incompatible - Read error output to identify blocking packages
- Report blockers to user with the exact composer error
- Run
Example
Section titled “Example”User: /statamic-upgrade-major
- Read composer.json → Statamic 4.48
- Target: Statamic 5
- WebFetch statamic.dev/upgrade-guide/4-to-5
- Check Laravel version compatible with Statamic 5 requirements
- Run pre-upgrade tests
- Identify addons: statamic/seo-pro, appswithlove/statamic-charfield
- Run
composer require statamic/cms:^5.0 statamic/seo-pro appswithlove/statamic-charfield --update-with-dependencies - Apply breaking changes from guide
- Clear caches, run tests, report results

