.agents/skills/plan-refactor/SKILL.md
Evaluates the prototype and produces an ordered refactor plan. Triggered by: bun nvst define refactor-plan.
npx skillsauth add lpng-plenge/frontend-IA plan-refactorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill runs in two parts within a single session. Do NOT implement code. Only produce documents.
Evaluate the current prototype before planning refactorings.
| Source | Used for |
|--------|----------|
| .agents/PROJECT_CONTEXT.md | Documented conventions, architecture, and standards to validate against |
| .agents/TECHNICAL_DEBT.md | Existing technical debt (if present) |
| .agents/flow/it_{current_iteration}_PRD.json | Implemented scope for this iteration |
| Prototype codebase | Actual structure, patterns, and quality |
Write it_{current_iteration}_evaluation-report.md to .agents/flow/ with this structure:
# Evaluation Report — Iteration {current_iteration}
## Strengths
- What works well in the current prototype
## Technical Debt
- Known debt items, with brief impact/effort notes
## Violations of PROJECT_CONTEXT.md
- Conventions, architecture, or standards not followed
## Recommendations
Each item: description, impact, urgency, effort, scope. Optional numeric score for ordering.
Complete Part 1 before starting Part 2. The evaluation report is the input for the refactor plan.
From the evaluation report you just produced, define an ordered refactor plan.
| Source | Used for |
|--------|----------|
| it_{current_iteration}_evaluation-report.md | Issues, technical debt, and recommendations to prioritise |
| User (interactive) | Decisions on trade-offs or approaches that need clarification |
Write it_{current_iteration}_refactor-plan.md to .agents/flow/ with this structure:
# Refactor Plan — Iteration {current_iteration}
## Refactor Items
### RI-001: <Title>
**Description:** One or two sentences describing what needs to change and why it is a problem.
**Rationale:** Why this item is prioritised at this position — impact, urgency, or risk reduction.
### RI-002: <Title>
**Description:** ...
**Rationale:** ...
RI-NNN format (e.g. RI-001, RI-002).it_{current_iteration}_evaluation-report.md written to .agents/flow/it_{current_iteration}_refactor-plan.md written to .agents/flow/RI-NNN id, **Description:**, and **Rationale:**testing
Refines an existing test plan based on user feedback or adversarial challenge mode. Triggered by: bun nvst refine test-plan.
development
Refines an existing refactor plan based on user feedback or adversarial challenge mode. Triggered by: bun nvst refine refactor-plan.
development
Refines .agents/PROJECT_CONTEXT.md via editor mode or challenge mode. Challenge mode validates the document against the actual codebase and detects compliance issues. Triggered by: bun nvst refine project-context.
documentation
Updates an existing product requirement document based on user feedback. Triggered by: bun nvst refine requirement.