From grace
Safely refactors GRACE-governed code: rename, move, split, merge, or extract modules while synchronizing contracts, knowledge graph, verification plan, and semantic markup.
npx claudepluginhub osovv/grace-marketplace --plugin graceThis skill uses the workspace's default tool permissions.
Refactor a GRACE project without letting architecture or verification drift.
Synchronizes GRACE shared artifacts like knowledge-graph.xml and verification-plan.xml with codebase via targeted scans on changes or full tree scans after refactors or drift.
Refactors one module per session using Strangler Fig, Branch by Abstraction, and Expand-Migrate-Contract patterns. Use post-safeguard in rescue workflows for safe, tested changes.
Verifies behavior-preserving refactors (rename, split, merge, extract, inline, dead code delete) via dependency tree planning, symbol-set/AST diffs, full test suite, and call-site reference closure.
Share bugs, ideas, or general feedback.
Refactor a GRACE project without letting architecture or verification drift.
Do not use this skill for greenfield implementation. Use $grace-plan, $grace-execute, or $grace-multiagent-execute for new work.
docs/development-plan.xml must existdocs/knowledge-graph.xml must existdocs/verification-plan.xml should existdocs/operational-packets.xml exists, use its canonical packet and delta shapesA GRACE refactor is not just a code move.
It is an atomic migration across:
docs/development-plan.xmldocs/knowledge-graph.xmldocs/verification-plan.xmlThe refactor is not done until all six agree again.
Identify the exact refactor type:
renamemovesplitmergeextractinterface-tightenpath-onlyFor the requested change, capture:
If the change affects behavior, public contracts, or architecture boundaries, present the planned deltas and wait for approval.
Before editing, prepare a controller-owned packet containing:
When docs/operational-packets.xml exists, align the packet, graph delta, verification delta, and failure handoff to those canonical templates.
Work in the safest order for the refactor type.
Always:
[Module][function][BLOCK_NAME] markers when critical branches moveFor split and merge refactors:
Shared-doc rule:
After the code refactor, update the shared artifacts in one coherent pass.
Update docs/development-plan.xml for:
Update docs/knowledge-graph.xml for:
Update docs/verification-plan.xml for:
V-M-xxx entriesIf IDs changed, update every reference atomically. Do not leave temporary stale IDs unless the user explicitly requires compatibility handling.
Run verification at the smallest level that still protects correctness:
If the refactor causes failures, produce a structured failure handoff using the canonical FailurePacket shape when available.
Before declaring success:
$grace-reviewer pass on the changed files and shared-artifact deltas$grace-refresh on the touched modules and dependency surfaces