with one click
grace-refactor
Refactor GRACE-governed code safely: rename, move, split, merge, or extract modules while keeping contracts, graph, verification, and semantic markup synchronized.
Menu
Refactor GRACE-governed code safely: rename, move, split, merge, or extract modules while keeping contracts, graph, verification, and semantic markup synchronized.
Operate the optional `grace` CLI against a GRACE project. Use when you want to lint GRACE artifacts, explain/remediate lint issues, check autonomy readiness, inspect project or module health, inspect verification entries, resolve modules from names or file paths, inspect shared/public module context, or inspect file-local/private markup through `grace lint`, `grace status`, `grace module`, `grace verification`, and `grace file show`.
Complete GRACE methodology reference. Use when explaining GRACE to users, onboarding new projects, or when you need to understand the GRACE framework - its principles, semantic markup, knowledge graphs, contracts, testing, and unique tag conventions.
Bootstrap GRACE framework structure for a new project. Use when starting a new project with GRACE methodology - creates docs/ directory, AGENTS.md, and XML templates for requirements, technology, development plan, verification plan, knowledge graph, and operational packet contracts.
Execute the full GRACE development plan step by step with controller-managed context packets, verification-plan excerpts, scoped reviews, level-based verification, and commits after validated sequential steps.
Execute a GRACE development plan in controller-managed parallel waves with selectable safety profiles, verification-plan excerpts, batched shared-artifact sync, and scoped reviews.
Create GRACE subagent presets for the current agent shell. Use when you want GRACE worker and reviewer agent files scaffolded for Claude Code, OpenCode, Codex, or another shell.
| name | grace-refactor |
| description | Refactor GRACE-governed code safely: rename, move, split, merge, or extract modules while keeping contracts, graph, verification, and semantic markup synchronized. |
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