migration-sweep
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMigration Sweep
Migration Sweep
移行コード()の寿命チェックを機械化するスキル。
期限切れ・情報不足の移行コードを検出し、レポート形式で出力する。
TODO(migration)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
- ユーザーが を実行
/migration-sweep - "移行コード", "migration TODO", "期限切れTODO" に言及
- User executes
/migration-sweep - Mentions of "migration code", "migration TODO", "expired TODO"
実行手順
Execution Steps
1. TODO(migration) の収集
1. Collect TODO(migration) entries
bash
undefinedbash
undefinedrepo全体から TODO(migration) を検索
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 "該当なし"
undefinedgrep -rn "TODO(migration)" --include=".ts" --include=".tsx" --include="*.py" src/ tests/ e2e/ python_backend/ 2>/dev/null || echo "No matches"
undefined2. メタデータの解析
2. Metadata parsing
各 TODO(migration) について以下を抽出:
| フィールド | パターン | 必須 |
|---|---|---|
| Issue ID | | YES |
| 期限 | | YES |
| 削除条件 | 自由記述(TODOコメントの次行以降) | YES |
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. 判定ルール
3. Judgment Rules
| 状態 | 条件 | 重要度 |
|---|---|---|
| EXPIRED | | P0 (即対応) |
| MISSING_META | Issue ID / expires / 削除条件のいずれかが欠落 | P0 (情報補完) |
| WARNING | expires まで30日以内 | P1 (計画) |
| OK | expires まで30日超 | 情報のみ |
| 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. レポート出力
4. Report Output
markdown
undefinedmarkdown
undefinedMigration Sweep Report (YYYY-MM-DD)
Migration Sweep Report (YYYY-MM-DD)
P0: 即対応 (X件)
P0: Immediate Action Required (X entries)
| ファイル:行 | 状態 | 期限 | Issue | 内容 |
|---|---|---|---|---|
| EXPIRED | 2026-01-15 | #123 | Remove old admin check |
| MISSING_META | - | - | TODO(migration) but no metadata |
| File:Line | Status | Expiration Date | Issue | Content |
|---|---|---|---|---|
| EXPIRED | 2026-01-15 | #123 | Remove old admin check |
| MISSING_META | - | - | TODO(migration) but no metadata |
P1: 計画 (X件)
P1: Planned Action (X entries)
| ファイル:行 | 期限 | 残日数 | Issue | 内容 |
|---|---|---|---|---|
| 2026-03-15 | 21日 | #456 | Deprecate legacy API |
| File:Line | Expiration Date | Days Remaining | Issue | Content |
|---|---|---|---|---|
| 2026-03-15 | 21 days | #456 | Deprecate legacy API |
OK (X件)
OK (X entries)
(省略可能)
(Can be omitted)
サマリー
Summary
- 総数: X件
- P0 (即対応): X件
- P1 (計画): X件
- OK: X件
undefined- Total: X entries
- P0 (Immediate Action Required): X entries
- P1 (Planned Action): X entries
- OK: X entries
undefined5. 追加アクション提案
5. Additional Action Suggestions
- EXPIRED: 「このコードを削除してよいか?」と確認し、削除を提案
- MISSING_META: テンプレート形式でメタデータ補完を提案
typescript
// TODO(migration)[ISSUE-XXX][expires=YYYY-MM-DD]: // <削除条件を記述> - WARNING: Issue のステータス確認を促す
- 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.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
AI Assistant Instructions
このスキルが有効化された時:
- grep で TODO(migration) を全件収集: ,
src/,tests/,e2e/を対象python_backend/ - メタデータ解析: Issue ID, expires, 削除条件を抽出
- 判定ルールに従い分類: EXPIRED / MISSING_META / WARNING / OK
- レポート出力: 上記フォーマットに厳密に従う
- 追加アクション提案: EXPIRED には削除提案、MISSING_META にはテンプレート提供
Always:
- 全件レポートする(フィルタしない)
- P0 は件数ゼロでも「P0: 0件」と明記する
- EXPIRED の削除提案は「コードを読んで安全性を確認してから」の条件付き
Never:
- 自動削除しない(レポートのみ、修正はユーザー確認後)
- TODO(migration) 以外のTODO(TODO(fix), TODO(refactor) 等)をスコープに含めない
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
- — 移行コード管理セクション
.claude/rules/dead-code-cleanup.md - — push前Done条件(type-checkが最終防衛線)
CLAUDE.md
- — Migration code management section
.claude/rules/dead-code-cleanup.md - — Pre-push done conditions (type-check is the final defense line)
CLAUDE.md