python-retrofit-plan-review
Review a Python Retrofit V2 plan for schema, risk, locatability, and executable acceptance assertions.
SKILL.mdskills/python-retrofit-plan-review/SKILL.md
GitHubPurpose
Review an authored Retrofit V2 retrofit-plan.md and return a contract-quality verdict before executor handoff.
Trigger / When to use
Use this skill when:
- a drafted Retrofit V2
retrofit-plan.mdalready exists and needs review before execution - the workflow needs a domain-specific check for locked section order,
migration-strategyvalidity, supported sensing assertion kinds, risk alignment, and locatability - the expected output is a review verdict with blocking issues rather than plan authoring or retrofit execution
Do not use this skill when:
- the task is to author or repair the retrofit plan; use
python-retrofit-plan-authoring - the task is to execute a valid retrofit plan; use
python-project-retrofit - the task is to review a skill folder, topic plan, or implementation diff
- the repository is actually greenfield or baseline-only and needs the blueprint lane instead of retrofit-plan review
Inputs
- the target
retrofit-plan.mdpath - the locked Retrofit V2 review rules already consumed by
python-project-retrofit - the current supported
sense_env.pyassertion-kind subset - any concrete repository facts needed to judge retrofit-versus-greenfield lane fit
- the authored contract text needed to assess risk alignment, runtime-boundary violations, and locatability
Process
- Confirm the task is Retrofit V2 contract review only.
- Reject authoring, execution, skill-folder review, topic-plan review, and implementation-diff review.
- If the contract is really greenfield-shaped or belongs in another lane, return a blocking reroute instead of absorbing the job.
- Read the target
retrofit-plan.mdand all local review references before judging it. - Review the authored plan against the locked Retrofit V2 heading contract.
- Confirm the required headings exist and stay in this exact order:
## Survey Summary## Gap Analysis## Target Transformation## Migration Strategy## Acceptance Criteria
- Reject missing headings, reordered headings, old-heading compatibility attempts, or mixed heading sets.
- Confirm the required headings exist and stay in this exact order:
- Validate
## Migration Strategystrictly.- Require a parseable fenced
yaml [migration-strategy]block. - Require at least
risk_level,destructive_actions, andbackup_required. - Allow only
LOWorHIGHforrisk_level; blockMEDIUMand any other unsupported value. - Require
destructive_actionsto stay a YAML sequence, even when empty. - Require
backup_requiredto be the YAML booleantrueorfalse. - Treat the YAML block as the execution-facing source of truth; prose must not override it.
- Require a parseable fenced
- Validate
## Acceptance Criteriastrictly.- Require a parseable fenced
yaml [sensing-assertions]block. - Require every assertion record to include
kind,target, andexpected. - Allow only
path_exists,path_type, andcommand_available. - Reject malformed assertions, unsupported kinds, or attempts to widen the current
sense_env.pycontract.
- Require a parseable fenced
- Run risk, boundary, and locatability checks across the full contract.
- Fail
LOWplans whose target transformation, migration prose, or destructive surfaces imply moves, deletes, overwrites, reshaping, or toolchain replacement. - Fail destructive plans whose
destructive_actionslist is empty or incomplete for the written strategy. - Reject language that uses planning prose as if it already chose runtime outcomes such as
move,delete,coexist,migrate,preserve, or destructive authorization. - Require concrete source paths, target paths, entrypoints, config surfaces, and tool names instead of abstract phrases.
- Fail
- Return exactly one JSON object and no trailing prose:
verdict:approvedorneeds-reworkblocking_issues: array of objects withissue,section, andfix
- Stop at review.
- Do not rewrite the retrofit plan on behalf of the author.
- Do not execute retrofit steps.
- Do not broaden the schema, supported risk values, or supported assertion kinds.
Examples
- Positive: Review a drafted
retrofit-plan.mdthat uses the locked Retrofit V2 order, contains validyaml [migration-strategy]andyaml [sensing-assertions]blocks, keepsLOWplans additive orHIGHplans explicitly destructive, names concrete paths such asapp.pyandsrc/weather_service/main.py, and return JSON with"verdict": "approved"when no blocking issues remain. - Negative: Approve a plan that uses old headings, sets
risk_level: MEDIUM, listsconfig_key_existsinyaml [sensing-assertions], says only “modernize the layout”, treatsMigration Directionas permission to delete files automatically, or responds with rewritten plan text instead of a JSON verdict.
Outputs
- exactly one machine-consumable JSON verdict object
verdict:approvedorneeds-reworkblocking_issues: concrete contract failures with the failing section and required fix- reroute guidance only as part of a blocking issue fix when the plan belongs in another lane
Validation
Required Checks
retrofit-plan.mdis provided and its path is readable- locked Retrofit V2 section order is intact: Survey Summary → Gap Analysis → Target Transformation → Migration Strategy → Acceptance Criteria
## Migration Strategycontains a parseable fencedyaml [migration-strategy]block withrisk_level,destructive_actions, andbackup_required;risk_levelisLOWorHIGHonly;destructive_actionsis a YAML sequence;backup_requiredis a YAML boolean## Acceptance Criteriacontains a parseable fencedyaml [sensing-assertions]block; every assertion record includeskind,target, andexpected; everykindvalue is withinpath_exists,path_type, orcommand_available
Quality Checks (best effort)
risk_levelis consistent with thedestructive_actionslist (e.g.,LOWplans should not list moves, deletes, or overwrites)- no
TBD, placeholder text, or abstract wording appears in contract-critical fields such as source paths, target paths, entrypoints, or tool names
On Soft Fail
- mark review as INCOMPLETE
- return
verdict: needs-reworkwithblocking_issuespopulated for each failing check - list each missing or malformed section explicitly so the author knows exactly what to repair
Failure Handling
Missing Context
- BLOCKED — if
retrofit-plan.mdis not provided or cannot be read, stop and ask for the correct path before proceeding; do not attempt a partial review against an absent or unreadable contract
Ambiguous Requirement
- if a section is present but its content is ambiguous on a non-schema dimension (e.g., prose wording is unclear but structurally compliant), record it as a non-blocking observation in a
blocking_issuesentry with"issue": "WARNING: <description>"so executors can distinguish it from hard failures - block only when the ambiguity directly violates a schema rule (e.g., unreadable YAML block, unsupported assertion kind, missing required field)
Execution Limitation
- if
yaml [sensing-assertions]references file paths or commands that cannot be verified in the current environment, note the limitation explicitly in the verdict; assess schema compliance only and do not fabricate runtime verification results - do not infer missing YAML fields from prose context; require them to be present in the fenced block
Verification
- confirm the review stays inside authored
retrofit-plan.mdcontract review scope - confirm the section order is exactly Survey Summary -> Gap Analysis -> Target Transformation -> Migration Strategy -> Acceptance Criteria
- confirm
## Migration Strategycontains a parseableyaml [migration-strategy]block with supportedrisk_level, sequencedestructive_actions, and booleanbackup_required - confirm
## Acceptance Criteriacontains a parseableyaml [sensing-assertions]block and every assertion includeskind,target, andexpected - confirm every sensing assertion
kindstays withinpath_exists,path_type, orcommand_available - confirm
LOWis not contradicted by destructive reality and destructive plans do not hide or truncatedestructive_actions - confirm planning prose does not pre-authorize runtime gate answers owned by
python-project-retrofit - confirm paths, entrypoints, config surfaces, and tool names are concrete and locatable enough for executor handoff without guesswork
- confirm wrong-lane requests are rejected or rerouted instead of absorbed
- confirm the final output is exactly one JSON object using the local verdict contract
Red Flags
- the plan adds, renames, or reorders Retrofit V2 headings
risk_levelisMEDIUMor any value outsideLOW/HIGHdestructive_actionsis missing, not a sequence, or too incomplete for the written destructive scopeyaml [sensing-assertions]contains a kind outsidepath_exists,path_type, orcommand_availableMigration Directionor similar prose is being treated as runtime consent- target transformation uses phrases such as “modernize”, “clean up”, or “reorganize” without concrete locators
- the review response drifts into authoring or execution instead of verdict-only review
Common Rationalizations
- “
MEDIUMis close enough until execution decides.” - “The executor can infer the missing destructive actions later.”
- “If the plan says replace the old entrypoint, Gate 1 choices are already decided.”
- “The target structure is obvious, so abstract wording is fine.”
- “Adding a new sensing assertion kind in review is harmless.”
- “Suggestions are enough even if the output is not valid JSON.”
Boundaries
- Do not author or repair the retrofit plan.
- Do not execute
python-project-retrofit. - Do not invent a new Retrofit schema or compatibility layer.
- Do not tolerate unsupported
risk_levelvalues or unsupported sensing assertion kinds. - Do not let planning prose substitute for runtime gate choices.
- Do not accept abstract or contradictory locators that the executor would need to guess.
- Do not review skill folders, topic plans, or implementation diffs with this skill.
- Do not emit anything except the single JSON verdict object.
Local references
examples.md: approved and needs-rework retrofit-plan review scenarios, including schema, risk, boundary, locatability, and lane-mismatch caseschecklist.md: repeatable higher-risk review checks before returning the final verdictreferences/retrofit-v2-review-checks.md: locked section-order, machine-readable block, and supported-schema review rules for Retrofit V2references/review-verdict-contract.md: JSON verdict shape, blocking-issue expectations, and review-output boundariesreferences/risk-boundary-and-locatability-checks.md: risk-alignment review rules, authoring-versus-executor boundaries, and locatability checksreferences/lane-fit-and-reroute.md: retrofit-lane fit criteria and reroute expectations for wrong-lane requests