Brownfield Upgrade - Upgrade all dependencies and modernize the application while maintaining spec-driven control. Runs after Gear 6 for brownfield projects with modernize flag enabled. Updates deps, fixes breaking changes, improves test coverage, updates specs to match changes.
Inherits all available tools
Additional assets for this skill
This skill inherits all available tools. When active, it can use any tool Claude has access to.
Optional Step after Gear 6 for Brownfield projects with modernize: true flag.
Estimated Time: 2-6 hours (depends on dependency age and breaking changes) Prerequisites: Gears 1-6 completed, 100% spec coverage established Output: Modern dependency versions, updated tests, synchronized specs
Use this skill when:
modernize: true flag setTrigger Conditions:
path: "brownfield" AND modernize: trueSystematically upgrades the entire application to modern dependency versions:
Document current state:
# Create upgrade baseline
cat package.json > .modernize/baseline-package.json
# Run tests to establish baseline
npm test > .modernize/baseline-test-results.txt
# Document current coverage
npm run test:coverage > .modernize/baseline-coverage.txt
Analyze upgrade scope:
# Check for available updates
npm outdated > .modernize/upgrade-plan.txt
# Identify major version bumps (potential breaking changes)
# Highlight security vulnerabilities
# Note deprecated packages
Tech stack detection (from analysis-report.md):
For Node.js/TypeScript:
# Update all dependencies
npm update
# Or for major versions:
npx npm-check-updates -u
npm install
# Check for security issues
npm audit fix
For Python:
# Update all dependencies
pip install --upgrade -r requirements.txt
pip freeze > requirements.txt
# Or use pip-upgrader
pip-upgrade requirements.txt
For Go:
# Update all dependencies
go get -u ./...
go mod tidy
For Rust:
# Update dependencies
cargo update
# Check for outdated packages
cargo outdated
Run tests after upgrade:
# Run full test suite
npm test
# Capture failures
npm test 2>&1 | tee .modernize/post-upgrade-test-results.txt
# Compare to baseline
diff .modernize/baseline-test-results.txt .modernize/post-upgrade-test-results.txt
Identify breaking changes:
For each breaking change:
Identify affected feature:
Review spec requirements:
Fix with spec guidance:
Update tests:
Verify spec alignment:
Check if upgrades changed behavior:
Some dependency upgrades change API behavior:
If behavior changed:
If only implementation changed:
Goal: Achieve 85%+ coverage on all modules
Run coverage report:
npm run test:coverage
Identify gaps:
Add tests with spec guidance:
Validate:
npm run test:coverage
# All modules should be 85%+
Run complete validation suite:
Build succeeds:
npm run build
# No errors
All tests pass:
npm test
# 0 failures
Coverage meets threshold:
npm run test:coverage
# 85%+ on all modules
Specs validated:
/speckit.analyze
# No drift, all specs match implementation
Dependencies secure:
npm audit
# No high/critical vulnerabilities
Upgrade Report (.modernize/UPGRADE_REPORT.md):
# Dependency Modernization Report
**Date**: {date}
**Project**: {name}
## Summary
- **Dependencies upgraded**: {X} packages
- **Major version bumps**: {X} packages
- **Breaking changes**: {X} fixed
- **Tests fixed**: {X} tests
- **New tests added**: {X} tests
- **Coverage improvement**: {before}% → {after}%
- **Specs updated**: {X} specs
## Upgraded Dependencies
| Package | Old Version | New Version | Breaking? |
|---------|-------------|-------------|-----------|
| react | 17.0.2 | 18.3.1 | Yes |
| next | 13.5.0 | 14.2.0 | Yes |
| ... | ... | ... | ... |
## Breaking Changes Fixed
1. **React 18 Automatic Batching**
- Affected: User state management
- Fix: Updated useEffect dependencies
- Spec: No behavior change
- Tests: Added async state tests
2. **Next.js 14 App Router**
- Affected: Routing architecture
- Fix: Migrated pages/ to app/
- Spec: Updated file paths
- Tests: Updated route tests
## Spec Updates
- Updated technical requirements with new versions
- Updated file paths for App Router migration
- No functional spec changes (behavior preserved)
## Test Coverage
- Before: 78%
- After: 87%
- New tests: 45 tests added
- All modules: ✅ 85%+
## Validation
- ✅ All tests passing
- ✅ Build successful
- ✅ /speckit.analyze: No drift
- ✅ npm audit: 0 high/critical
- ✅ Coverage: 87% (target: 85%+)
## Next Steps
Application is now:
- ✅ Fully modernized (latest dependencies)
- ✅ 100% spec coverage maintained
- ✅ Tests passing with high coverage
- ✅ Specs synchronized with implementation
- ✅ Ready for ongoing spec-driven development
The modernize flag is set during Gear 1:
{
"path": "brownfield",
"modernize": true,
"metadata": {
"modernizeRequested": "2024-11-17T12:00:00Z",
"upgradeScope": "all-dependencies",
"targetCoverage": 85
}
}
In Cruise Control:
modernize: trueIn Manual Mode:
/stackshift.modernize or skill auto-activatesModernization complete when:
Perfect for teams that want to modernize without full rewrites. Get the benefits of modern tooling while maintaining existing features.
Specs as Safety Net:
Incremental Upgrades:
Coverage as Quality Gate:
Spec Synchronization:
Result: A fully modernized application under complete spec-driven control!