| name | python-project-retrofit |
| description | Retrofit an existing Python repository from a locked Retrofit V2 `retrofit-plan.md`, with risk-alignment blocking, mandatory human gates, destructive preview for HIGH-risk plans, and acceptance handoff through `sense_env.py`. |
| complexity | high |
| risk_profile | ["destructive_action","multi_agent_handoff","code_modification"] |
| inputs | ["target repository root","locked Retrofit V2 retrofit-plan.md path","current filesystem state, including existing entrypoints, packages, and config remnants","current Git working-tree state before any move, deletion, or overwrite",{"parsed yaml [migration-strategy] fields":"risk_level, destructive_actions, and backup_required"},"explicit human decisions for Gate 1 and Gate 2, plus any HIGH-risk destructive authorization when a clean or backed-up path is ready","provenance destination at `.codex/skills-provenance.json`"] |
| outputs | ["existing Python project restructured to the approved Retrofit V2 target","explicit human gate outcomes for shadow files, implicit configs, and destructive paths","Sensing Delta Report JSON artifact with before/after facts and MOVED / CREATED / MODIFIED / DELETED operations","provenance recorded in `.codex/skills-provenance.json`","acceptance handoff result or a concrete blocking error"] |
| use_when | ["an existing Python repository already has an approved Retrofit V2 retrofit-plan.md","the task is to execute retrofit work rather than author the retrofit contract","the workflow must detect shadow files, mine implicit configuration remnants, enforce risk alignment, and emit a Sensing Delta Report before acceptance","the retrofit must hand off immediately to sense-env-scaffold acceptance via sense_env.py"] |
| do_not_use_when | ["the repository is greenfield or baseline-only; use python-project-init-greenfield","retrofit-plan.md is missing, malformed, still under negotiation, or still uses pre-V2 headings","the task is to author or review the retrofit plan itself","the user expects the agent to auto-merge conflicting config files or guess through ambiguous structure changes"] |