assets/skills/deprecation/SKILL.md
Deprecation workflow for safely removing features or code. Use when deprecating, removing features, sunsetting functionality, or when user says "deprecate", "remove feature", "sunset", "phase out", "delete feature".
npx skillsauth add phuthuycoding/moicle deprecationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Systematic workflow for safely deprecating and removing features or code without breaking user workflows.
Before deprecating anything, you MUST read the appropriate architecture reference:
~/.claude/architecture/
├── clean-architecture.md # Core principles for all projects
├── flutter-mobile.md # Flutter + Riverpod
├── react-frontend.md # React + Vite + TypeScript
├── go-backend.md # Go + Gin
├── laravel-backend.md # Laravel + PHP
├── remix-fullstack.md # Remix fullstack
└── monorepo.md # Monorepo structure
.claude/architecture/ # Project overrides
Understand dependencies and impact before deprecating.
| Phase | Agent | Purpose |
|-------|-------|---------|
| IDENTIFY | @refactor | Analyze dependencies and impact |
| IDENTIFY | @code-reviewer | Find all usages |
| PLAN | @clean-architect | Migration strategy |
| PLAN | @api-designer | API versioning (if applicable) |
| PLAN | @docs-writer | Deprecation notices |
| MIGRATE | @react-frontend-dev, @go-backend-dev, @laravel-backend-dev, @flutter-mobile-dev, @remix-fullstack-dev | Stack-specific migration |
| VERIFY | @test-writer | Migration tests |
| VERIFY | @code-reviewer | Final review |
┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
│1. IDENTIFY──▶│ 2. PLAN │──▶│3. MIGRATE│──▶│ 4. REMOVE│──▶│5. VERIFY │
└──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘
│ │ │ │
│ Timeline: │ │ │
│ ┌──────────────────────────────────┴──────────────┘
│ │
▼ ▼
Announce → Warn → Migrate → Remove → Monitor
(T-90) (T-60) (T-30) (T-0) (T+30)
Goal: Identify what to deprecate and its full impact
Identify project stack and read architecture doc
Define what to deprecate:
Analyze dependencies:
# Find all usages (adjust per stack)
# TypeScript/JavaScript
grep -r "deprecatedFunction" --include="*.ts" --include="*.tsx" --include="*.js"
# Go
grep -r "DeprecatedFunc" --include="*.go"
# PHP
grep -r "deprecatedMethod" --include="*.php"
# Dart
grep -r "deprecatedWidget" --include="*.dart"
Identify stakeholders:
Assess impact based on architecture:
Check version control history:
git log --oneline --all -- [deprecated-file]
git blame [deprecated-file]
## Deprecation Analysis
### Stack & Architecture
- Stack: [Flutter/React/Go/Laravel/Remix]
- Architecture Doc: [path to doc]
### What to Deprecate
- Type: [Feature/API/Class/Method/Module]
- Name: [full name/path]
- Reason: [why deprecating]
### Alternative Solution
- Recommended: [new approach]
- Migration path: [how to migrate]
### Usage Analysis
- Internal usages: [count] in [locations]
- External usages: [estimated count]
- Dependencies: [list affected modules]
### Affected Layers (from architecture)
- Layer 1: [impact description]
- Layer 2: [impact description]
### Stakeholders
- Teams: [list]
- External users: [estimated]
- Integrations: [list]
### Impact Assessment
- Breaking change: [Yes/No]
- Severity: [Critical/High/Medium/Low]
- Migration effort: [High/Medium/Low]
- Risk: [High/Medium/Low]
Goal: Create migration plan and timeline
Re-read architecture doc for migration patterns
Choose deprecation strategy:
Soft Deprecation (Gradual):
Hard Deprecation (Immediate):
Define timeline:
Recommended timelines:
Internal APIs:
- Announce: Now
- Warning: +2 weeks
- Removal: +4-6 weeks
Public APIs:
- Announce: Now
- Warning: +1 version (minor)
- Removal: +1 version (major)
- Total: 3-6 months minimum
Critical security issues:
- Announce: Now
- Removal: Next patch/ASAP
Create migration guide:
Plan communication:
Identify risks and mitigation:
## Deprecation Plan
### Architecture Reference
- Doc: [path to architecture doc]
- Affected patterns: [patterns from doc]
### Strategy
- Type: [Soft/Hard Deprecation]
- Reason: [justify choice]
### Timeline
| Phase | Date | Action |
|-------|------|--------|
| Announce | T-90 (YYYY-MM-DD) | Release notes, changelog, docs |
| Warn | T-60 (YYYY-MM-DD) | Add runtime warnings |
| Migrate | T-30 (YYYY-MM-DD) | Help users migrate |
| Remove | T-0 (YYYY-MM-DD) | Delete deprecated code |
| Monitor | T+30 (YYYY-MM-DD) | Watch for issues |
### Migration Path
From: [current usage]
To: [new approach following architecture doc]
#### Step-by-step migration:
1. [Step 1]
2. [Step 2]
3. [Step 3]
#### Code examples:
// Before (deprecated) [old code]
// After (recommended) [new code following architecture patterns]
### Communication Plan
- [ ] Changelog: [version]
- [ ] Release notes: [version]
- [ ] Documentation: [update pages]
- [ ] Email: [stakeholders]
- [ ] In-app: [warning messages]
- [ ] Migration guide: [write guide]
### Risks & Mitigation
| Risk | Likelihood | Impact | Mitigation |
|------|------------|--------|------------|
| [Risk 1] | [H/M/L] | [H/M/L] | [Plan] |
| [Risk 2] | [H/M/L] | [H/M/L] | [Plan] |
### Rollback Plan
If deprecation causes issues:
- [ ] How to revert
- [ ] Fallback option
- [ ] Communication plan
Goal: Help users migrate to the alternative
Announce deprecation (T-90):
Add to CHANGELOG.md:
## [Version] - YYYY-MM-DD
### Deprecated
- `[deprecated item]` is now deprecated and will be removed in [version/date]
- Reason: [why]
- Alternative: Use `[new item]` instead
- Migration guide: [link to guide]
Add deprecation markers in code (T-60):
TypeScript/JavaScript:
/**
* @deprecated Use newFunction() instead. Will be removed in v2.0.0
* @see newFunction
*/
function oldFunction() {
console.warn('oldFunction is deprecated. Use newFunction instead.');
// existing implementation
}
Go:
// Deprecated: OldFunc is deprecated, use NewFunc instead.
// It will be removed in v2.0.0.
func OldFunc() {
log.Println("WARNING: OldFunc is deprecated, use NewFunc")
// existing implementation
}
PHP (Laravel):
/**
* @deprecated 2.0.0 Use newMethod() instead
*/
public function oldMethod() {
trigger_error(
'oldMethod is deprecated, use newMethod instead',
E_USER_DEPRECATED
);
// existing implementation
}
Dart (Flutter):
@Deprecated('Use newWidget instead. Will be removed in v2.0.0')
class OldWidget extends StatelessWidget {
// existing implementation
}
Update documentation (T-60):
Create migration tools (if needed):
# Example: Automated migration script
# TypeScript/JavaScript
npx jscodeshift -t migrate-deprecated-api.js src/
# Go
go fix
# Create custom migration scripts
Proactive migration (T-30):
For internal code:
# Find all usages
grep -r "deprecated" --include="*.ts"
# Migrate one by one
# Test after each migration
# Commit frequently
For external users:
Monitor adoption:
# Track usage of deprecated code
# Add metrics/logging if possible
# Follow up with slow adopters
## Migration Progress
### Documentation
- [ ] CHANGELOG.md updated
- [ ] Release notes written
- [ ] Migration guide created
- [ ] API docs updated
- [ ] Examples updated
### Code Markers
- [ ] Deprecation decorators added
- [ ] Runtime warnings added
- [ ] IDE warnings visible
- [ ] Tests still passing
### Internal Migration
- [ ] Internal usages: [X/Y migrated]
- [ ] Tests updated
- [ ] Documentation updated
### External Communication
- [ ] Announcement sent
- [ ] Migration guide published
- [ ] Support channels ready
- [ ] FAQ prepared
### Adoption Tracking
- [ ] Metrics in place
- [ ] Adoption rate: [X%]
- [ ] Blockers identified
Goal: Safely delete the deprecated code
Pre-removal verification (T-0):
Check adoption:
# Verify deprecation warnings are logged
# Check metrics for usage
# Confirm migration targets met
Criteria for removal:
Create removal branch:
git checkout -b remove/deprecated-[feature-name]
Read architecture doc for affected layers
Remove deprecated code:
Remove in order (following architecture):
1. Tests for deprecated code
2. Deprecated implementation
3. Deprecated interfaces/types
4. Documentation references
5. Migration scripts (if no longer needed)
For each file:
# Remove the deprecated code
# Remove deprecation warnings
# Remove related tests
# Update imports/dependencies
# Run tests after each removal
[test command from architecture doc]
# Commit if successful
git add .
git commit -m "remove: [what was removed]"
Update version:
Breaking change requires major version bump:
Semantic Versioning:
- Major version: Breaking changes (X.0.0)
- Minor version: New features backward compatible (0.X.0)
- Patch version: Bug fixes (0.0.X)
Update documentation:
## Removal Progress
### Code Removed
- [ ] Deprecated implementation: [files]
- [ ] Deprecated tests: [files]
- [ ] Deprecated types/interfaces: [files]
- [ ] Documentation: [pages]
### Architecture Compliance (from doc)
- [ ] Layer boundaries still respected
- [ ] Dependencies flow correctly
- [ ] No broken imports
- [ ] Clean build
### Testing
- [ ] All tests pass
- [ ] No references to deprecated code
- [ ] Integration tests pass
- [ ] E2E tests pass
### Documentation
- [ ] API docs updated
- [ ] CHANGELOG updated
- [ ] Migration guide archived
- [ ] Version bumped: [X.Y.Z]
### Build & Release
- [ ] Clean build
- [ ] No warnings
- [ ] Ready for release
Goal: Ensure nothing is broken post-removal
Full test suite (command from architecture doc):
# Run all tests
flutter test # Flutter
flutter test --coverage
go test ./... # Go
go test -cover ./...
bun test # React/Remix
bun test --coverage
php artisan test # Laravel
php artisan test --coverage
Integration testing:
Build verification:
# Clean build test
rm -rf node_modules && npm install && npm run build # Node
go clean && go build ./... # Go
flutter clean && flutter build # Flutter
composer install && php artisan optimize # Laravel
Dependency check:
# Check for broken imports
# Verify all dependencies resolve
# No circular dependencies introduced
Monitor after release (T+30):
Handle issues:
If problems arise:
Severity assessment:
🔴 Critical - Rollback immediately
🟠 High - Hotfix within 24h
🟡 Medium - Fix in next patch
🟢 Low - Document workaround
## Post-Removal Verification
### Architecture Compliance: [Pass/Fail]
- Reference: [architecture doc path]
- Structure: [Pass/Fail]
- Dependencies: [Pass/Fail]
- Patterns: [Pass/Fail]
### Testing: [Pass/Fail]
| Test Type | Status | Coverage |
|-----------|--------|----------|
| Unit | [Pass/Fail] | [X%] |
| Integration | [Pass/Fail] | [X%] |
| E2E | [Pass/Fail] | [X%] |
### Build: [Pass/Fail]
- Clean build: [Pass/Fail]
- No warnings: [Pass/Fail]
- Dependencies: [Pass/Fail]
### Monitoring (T+30): [Pass/Fail]
| Metric | Before | After | Status |
|--------|--------|-------|--------|
| Error rate | X% | Y% | [✓/✗] |
| Performance | X ms | Y ms | [✓/✗] |
| Support tickets | X | Y | [✓/✗] |
### Issues Found
- [Issue 1]: [Severity] - [Status]
- [Issue 2]: [Severity] - [Status]
### Recommendation: [Success/Rollback/Hotfix Needed]
| Stack | Doc |
|-------|-----|
| All | clean-architecture.md |
| Flutter | flutter-mobile.md |
| React | react-frontend.md |
| Go | go-backend.md |
| Laravel | laravel-backend.md |
| Remix | remix-fullstack.md |
| Monorepo | monorepo.md |
Week 0: Announce + document
Week 2: Add warnings
Week 4: Migrate internal code
Week 6: Remove
Week 10: Monitor
Month 0: Announce in minor release
Month 1: Add warnings + migration guide
Month 3: Help users migrate
Month 6: Remove in major release
Month 7: Monitor
Day 0: Announce + provide alternative
Day 1: Add strong warnings
Day 3: Remove in patch release
Day 7: Monitor closely
/**
* @deprecated since v1.5.0, will be removed in v2.0.0
* Use newFunction() instead.
*
* Migration:
* ```
* // Before
* oldFunction(x, y)
*
* // After
* newFunction({ x, y })
* ```
*
* @see newFunction
*/
### Deprecated
- `oldFunction()` - Use `newFunction()` instead. Will be removed in v2.0.0.
- Reason: Inconsistent API design
- Migration guide: https://docs.example.com/migrate-to-v2
## Deprecations
### `oldFeature` is now deprecated
**What**: The `oldFeature` API is deprecated.
**Why**: It doesn't align with our architecture patterns and causes confusion.
**When**: Will be removed in v2.0.0 (estimated: YYYY-MM-DD)
**Migration**: Use `newFeature` instead:
```javascript
// Before
import { oldFeature } from 'package';
oldFeature.doSomething();
// After
import { newFeature } from 'package';
newFeature.doSomething();
Need help? See the migration guide or contact support.
#### Email Template
Subject: Deprecation Notice: [Feature Name] in [Product Name]
Hi [User],
We're writing to inform you about an upcoming change to [Product Name].
What's changing: [Feature/API name] is being deprecated and will be removed in [version/date].
Why: [Brief explanation]
What you need to do:
Need help?
Timeline:
Thank you, [Team Name]
### Phase Summary
| Phase | Duration | Key Actions |
|-------|----------|-------------|
| IDENTIFY | 1-2 days | Analyze impact, read arch doc |
| PLAN | 3-5 days | Timeline, migration guide, communication |
| MIGRATE | 30-90 days | Warnings, help users migrate |
| REMOVE | 1-2 days | Delete code, update docs |
| VERIFY | 7-30 days | Test, monitor, support |
### Deprecation Strategies
#### Soft Deprecation
**Use when:**
- Non-critical feature
- Time for gradual migration
- Backward compatibility important
- External users affected
**Approach:**
- Add warnings but keep functional
- Provide migration period
- Remove in future major version
#### Hard Deprecation
**Use when:**
- Security vulnerability
- Critical bug
- Technical debt removal
- Internal-only code
**Approach:**
- Breaking change in next major version
- Shorter timeline
- Force migration
### Communication Timeline
T-90: Announce ├── Changelog ├── Release notes ├── Documentation └── Email (if external)
T-60: Warn ├── Add runtime warnings ├── IDE warnings ├── Migration guide live └── Reminder emails
T-30: Support ├── Help users migrate ├── Office hours ├── Example PRs └── FAQ updates
T-0: Remove ├── Delete code ├── Major version bump ├── Final announcement └── Monitor
T+30: Monitor ├── Check metrics ├── Handle issues ├── Collect feedback └── Document learnings
### Success Criteria
Deprecation is successful when:
1. All stakeholders notified in advance
2. Migration path is clear and documented
3. Sufficient time given for migration
4. Deprecated code cleanly removed
5. No regressions introduced
6. Metrics remain stable post-removal
7. Minimal support burden
8. Architecture doc patterns followed
---
## Anti-Patterns to Avoid
### Silent Deprecation
DON'T: Remove without announcement DON'T: No warnings or migration guide DO: Clear communication at every step
### Rushed Timeline
DON'T: Remove before users can migrate DON'T: Skip migration period DO: Give adequate time based on impact
### No Alternative
DON'T: Deprecate without replacement DON'T: Force users into worse solution DO: Provide better alternative first
### Poor Communication
DON'T: Assume users read release notes DON'T: One-time announcement only DO: Multi-channel, repeated communication
### Breaking Without Warning
DON'T: Remove in minor/patch version DON'T: Surprise breaking changes DO: Follow semantic versioning DO: Breaking changes only in major versions
### Ignoring Feedback
DON'T: Ignore migration blockers DON'T: Proceed despite user concerns DO: Listen and adjust timeline if needed
development
Test-Driven Development workflow. Use when doing TDD, writing tests first, or when user says "tdd", "test first", "test driven", "red green refactor".
development
Thorough pull request review workflow with architecture compliance checks. Use when reviewing pull requests, checking code changes, or when user says "review pr", "check pr", "review code", "pr review", "review pull request".
development
Review local branch changes for architecture compliance, conventions, and code quality before pushing/PR. Stack-aware — detects the project stack and applies the matching rules. Use when user says "review changes", "review branch", "check branch", "check changes", "review my code", "review before pr".
testing
DDD architecture compliance review with automated checks and review loop. Use when user says "architect-review", "architecture review", "review architecture", "check architecture", "review ddd", "ddd review".