migration-sweep
Original:🇨🇳 Chinese
Translated
Automate lifecycle checks for migration code (TODO(migration)). Detect expired or insufficiently documented migration code and output results in report format. It is used for checking remaining TODO(migration) entries in the codebase, cleaning up expired migration code, and taking inventory of technical debt. This is a mechanism to prevent leaving "to be deleted later" code unattended.
1installs
Sourceyusuketsunoda/ppt-trans
Added on
NPX Install
npx skill4agent add yusuketsunoda/ppt-trans migration-sweepTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →Migration Sweep
A skill that automates lifecycle checks for migration code ().
It detects expired or insufficiently documented migration code and outputs results in report format.
TODO(migration)Triggers
- User executes
/migration-sweep - Mentions of "migration code", "migration TODO", "expired TODO"
Execution Steps
1. Collect TODO(migration) entries
bash
# Search for TODO(migration) across the entire repo
grep -rn "TODO(migration)" --include="*.ts" --include="*.tsx" --include="*.py" src/ tests/ e2e/ python_backend/ 2>/dev/null || echo "No matches"2. Metadata parsing
Extract the following information for each TODO(migration):
| Field | Pattern | Required |
|---|---|---|
| Issue ID | | YES |
| Expiration Date | | YES |
| Deletion Condition | Free description (lines following the TODO comment) | YES |
3. Judgment Rules
| Status | Condition | Severity |
|---|---|---|
| EXPIRED | | P0 (Immediate action required) |
| MISSING_META | Any of Issue ID / expiration date / deletion condition is missing | P0 (Information completion required) |
| WARNING | Within 30 days before expiration date | P1 (Plan required) |
| OK | More than 30 days before expiration date | Info only |
4. Report Output
markdown
## Migration Sweep Report (YYYY-MM-DD)
### P0: Immediate Action Required (X entries)
| File:Line | Status | Expiration Date | Issue | Content |
|------------|------|------|-------|------|
| `src/foo.ts:42` | EXPIRED | 2026-01-15 | #123 | Remove old admin check |
| `src/bar.ts:88` | MISSING_META | - | - | TODO(migration) but no metadata |
### P1: Planned Action (X entries)
| File:Line | Expiration Date | Days Remaining | Issue | Content |
|------------|------|--------|-------|------|
| `src/baz.ts:15` | 2026-03-15 | 21 days | #456 | Deprecate legacy API |
### OK (X entries)
(Can be omitted)
### Summary
- Total: X entries
- P0 (Immediate Action Required): X entries
- P1 (Planned Action): X entries
- OK: X entries5. Additional Action Suggestions
- EXPIRED: Confirm "Is it acceptable to delete this code?" and propose deletion
- MISSING_META: Propose metadata completion using the template format
typescript
// TODO(migration)[ISSUE-XXX][expires=YYYY-MM-DD]: // <Describe deletion conditions> - WARNING: Prompt to check the status of the associated Issue
Template (for new migration code)
typescript
// TODO(migration)[ISSUE-1234][expires=2026-05-31]:
// Remove after role-based admin check is fully deployed
// and logs show 0 hits for 14 days.AI Assistant Instructions
When this skill is enabled:
- Collect all TODO(migration) entries with grep: Target directories ,
src/,tests/,e2e/python_backend/ - Metadata parsing: Extract Issue ID, expiration date, deletion conditions
- Classify per judgment rules: EXPIRED / MISSING_META / WARNING / OK
- Output report: Strictly follow the format specified above
- Propose additional actions: Suggest deletion for EXPIRED entries, provide completion template for MISSING_META entries
Always:
- Report all entries (do not filter)
- Explicitly state "P0: 0 entries" even if there are no P0 items
- Deletion suggestions for EXPIRED entries must be conditional on "confirm safety after reviewing the code"
Never:
- Do not delete code automatically (only generate reports, modifications require user confirmation)
- Do not include TODO entries other than TODO(migration) (e.g. TODO(fix), TODO(refactor)) in the scope
Related Rules
- — Migration code management section
.claude/rules/dead-code-cleanup.md - — Pre-push done conditions (type-check is the final defense line)
CLAUDE.md