ワンクリックで
working-with-legacy-code
Use when touching code without reliable automated tests or with nondeterminism such as time, randomness, or I/O.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Use when touching code without reliable automated tests or with nondeterminism such as time, randomness, or I/O.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
Use when finishing a branch or PR after verification and review, including merge, PR publication, keep, discard, cleanup, local sync, and reporting merge or PR URLs with current git state.
Use when handling received code-review feedback on a PR or diff, including requested changes, inline comments, approvals, non-blocking notes, and disputed suggestions. Separates accepted fixes, refutations, deferrals, clarification needs, and merge handoff.
Use when preparing a focused code-review request for a PR or diff after implementation evidence exists, especially to package scope, reviewer focus, PR URL, verification, known risks, and deferred work without deciding final submit readiness.
Use before every submission to decide whether required checks, artifacts, and branch evidence are complete enough to submit.
Use when work is complex, long-running, multi-step, cross-boundary, likely to span multiple PRs/sessions, or needs handoff-ready planning under plans/.
Use when adding or changing Agent-facing workflows, generated prompts, collect plans, executable handoff artifacts, CLI workflows, controller/target-local workflow chains, or validation artifacts consumed by downstream reports. Do not use for ordinary code changes without an Agent-facing workflow or generated instruction surface.
| name | working-with-legacy-code |
| description | Use when touching code without reliable automated tests or with nondeterminism such as time, randomness, or I/O. |
| metadata | {"short-description":"Working with legacy code safely"} |
Use this skill to change legacy code safely: code with weak tests, no tests, or behavior that is hard to make deterministic.
The goal is not to “make it perfect” immediately. The goal is to create safety, then change behavior in small steps. Rewrite is a last resort after characterization, seams, and small refactors are insufficient.
Invoke this skill before refactoring if any of the following is true:
Open references/working-with-legacy-code.md. Pick the headings that match your situation and follow the order.
references/working-with-legacy-code-cpp.mdreferences/working-with-legacy-code-py.mdreferences/working-with-legacy-code-ts.mdCreate a safety net first:
Only after the safety net is green:
build / format / static analysis / tests green at every step.Treat rewrite as a last resort. If proposed, record why characterization + seams + small refactors are insufficient, which accumulated behaviors stay protected, and the rollback path.
If you cannot add a safety net, stop and explain why. Provide a reproducible manual procedure and the risk.
## Legacy Change Safety Record
- Touched behavior:
- Existing coverage:
- Safety-net test(s):
- Characterized current behavior:
- Preserved behavior / accumulated edge cases:
- Introduced seam(s):
- Refactor sequence:
- Intended behavior change:
- Rewrite avoided or justified:
- Verification commands/results: