Write, debug, and tune Playwright specs with locator strategy, trace diagnosis, and CI-aware timeouts.
Coding
Refactoring Validation
Try itUse when proving that a frontend refactoring preserved existing behavior, selecting an appropriate safety net, validating each structural step, or assigning a PASS, PARTIAL, or NOT PROVEN preservation verdict.
What it does
Define the observable contract and the smallest credible evidence needed to prove that structural edits preserved existing frontend behavior.
The skill document
Skill: Refactoring Validation
Purpose
Define the observable contract and the smallest credible evidence needed to prove that structural edits preserved existing frontend behavior.
Procedure
- Record the relevant behavior contract before substantial edits.
- Classify safety-net coverage as A, B, or C.
- Run and record the pre-change baseline.
- Match verification to the current refactoring risk and affected boundary.
- After every structural step, run the narrowest sufficient check immediately.
- If a newly introduced failure appears, revert that step before broader repair.
- At the end, run the broad gates justified by the affected surface.
- Assign PASS, PARTIAL, or NOT PROVEN from evidence, not optimism.
Pure structural work uses GREEN → REFACTOR → GREEN.
Safety-Net Levels
| Level | Evidence | Execution guidance |
|---|---|---|
| A — Strong | Existing tests cover relevant behavior | Use tests as the primary safety net |
| B — Partial | Important behavior is only partly covered | Add focused characterization of current behavior before risky steps |
| C — None | No useful automated behavior coverage | Do not auto-install a framework; keep CAUTION/DANGER plan-only unless a minimal safety net is authorized |
Frontend Contract Checklist
Check relevant items, not every item mechanically:
- function inputs, outputs, exceptions, and error mapping;
- DOM structure that consumers depend on, visible states, focus, keyboard flow, and accessibility semantics;
- props, emits, slots, hook/composable return values, and event ordering;
- requests, payloads, cancellation, retries, cache keys, and loading/error transitions;
- store state, persistence, object identity, memoization, refs/reactivity, and lifecycle timing;
- routes, URLs, guards, package exports, serialized fields, and backend-facing DTOs.
References
- Load behavior-preservation.md for contract construction and proof levels.
- Load refactoring-test-checklist.md for targeted verification by frontend risk.
Constraints
- Passing unrelated tests does not prove preservation.
- A green test written only after the change is weaker evidence than a pre-change baseline or characterization test.
- Do not rewrite expected values simply because the refactor changed behavior.
- Do not hide missing proof behind a PASS label.
- Do not install a new test framework without explicit authorization.
Expected Output
A behavior-preservation record containing baseline status, safety-net level, per-step checks, final validation, unresolved coverage gaps, and a PASS/PARTIAL/NOT PROVEN verdict.
Related skills
Find why your productivity system keeps failing, then apply the smallest fix — capacity math, bottleneck routing, durable local notes.
Stores durable facts in a categorized, plain-markdown vault on disk, alongside your agent's built-in memory.
Generate and edit Draw.io, Mermaid, and Excalidraw diagrams from natural language using a structured JSON spec.
Run Git operations — commits, branches, merges, rebases, conflict resolution, and recovery — with safety rules enforced.
Join a video meeting as an AI bot with voice, avatar, and screenshare across four operating modes.
More from bovinphang
Browse all skillsGenerate or edit diagrams, visual assets, and image workflows with reviewable PNG self-checks and bounded self-repair.
Use when creating editable technical diagrams with draw.io / diagrams.net sources, including architecture diagrams, ERD, UML, sequence diagrams, flowcharts, ML model diagrams, official shape lookup, brand symbols, Graphviz auto-layout, codebase structure maps, .drawio validation, or draw.io CLI expo
Use when building, reviewing, or improving frontend UI that needs product-specific design direction, design-system generation, Master/Page overrides, distinctive visual identity, anti-generic interface choices, first-screen hierarchy, UI polish, chart UX, interaction states, responsive behavior, or
Use when creating or reviewing Next.js 14+ App Router projects, file routes, layouts, server/client component boundaries, SSR/SSG/ISR, streaming, metadata, middleware, server actions, or Next-specific data fetching. For generic client React component architecture, apply the project's React conventio
Use when creating, reviewing, or restructuring frontend monorepos with pnpm workspace, Turborepo, Nx, multi-package dependency boundaries, task orchestration, package naming, or package publishing; Chinese triggers include monorepo, workspace, multi-package.
Use when creating or reviewing Nuxt 3 projects, file routes, pages, layouts, SSR/SSG/SPA behavior, Nuxt data fetching, route middleware, plugins, modules, server routes, or Nuxt-specific Vue 3 conventions. For generic Vue component architecture, apply the project's Vue conventions separately; Chines