From grace
Отладка и исправление проблемы через GRACE-семантическую навигацию с паттерном Prove-It. Использовать при встрече с багами, ошибками или неожиданным поведением — пройти по графу, плану верификации и семантическим блокам, написать ПАДАЮЩИЙ тест, который доказывает баг, применить точечное исправление, убедиться в прохождении теста и защититься от регрессии.
How this skill is triggered — by the user, by Claude, or both
Slash command
/grace:grace-fixThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Debug and fix an issue using GRACE semantic navigation — with a **failing test written before the fix**.
Debug and fix an issue using GRACE semantic navigation — with a failing test written before the fix.
A bug that is not reproduced in a test is not proven. A fix that does not flip a test from red to green is not verified. Every bug fix produced by this skill goes through the following pipeline:
Locate → Prove (write RED test) → Fix → Verify (test goes GREEN) → Guard (regression entry)
Skipping any phase is drift. In particular: fixing before writing a failing test is forbidden.
From the error/description, identify which module is likely involved:
docs/knowledge-graph.xml for module overviewdocs/verification-plan.xml for relevant scenarios, test files, or log markers if availabledocs/operational-packets.xml for the canonical FailurePacket shape if availableIf the optional grace CLI is available, you may use:
grace module find <query> --path <project-root> to resolve likely module IDs from stack traces, paths, verification refs, or dependency namesgrace module show M-XXX --path <project-root> --with verification to pull the shared/public module and verification snapshotgrace file show <path> --path <project-root> --contracts --blocks when you already know the governed file and need its local/private navigation surfaceIf the error contains a log reference like [Module][function][BLOCK_NAME]:
START_BLOCK_BLOCK_NAME in the codebase — this is the exact locationIf the failure came from a named verification scenario or test:
V-M-xxx entry in docs/verification-plan.xmlIf no log reference:
Read the identified block, its CONTRACT, and relevant verification entry. Determine:
Distinguish root cause from symptom. Never fix a symptom while the root cause remains ("dedupe in UI" is a patch; "fix the JOIN" is a fix).
This step is not optional. A bug that is not reproduced in a test is not proven.
V-M-xxx)."regression: GH#123 duplicate rows in list endpoint")FailurePacket evidence.If the bug is deep inside a block that cannot be reached from a unit test, add a narrower integration test or a property-based case. Do not skip the RED step by claiming "this cannot be tested".
Apply the fix WITHIN the semantic block boundaries. Do NOT restructure blocks unless the fix requires it. Keep the change scoped to the root cause — no drive-by refactors, no adjacent cleanup.
Re-run the test written in Step 4. It MUST pass. If it still fails, the fix is wrong — return to Step 5. If it passes, run the full module-local verification suite to confirm no neighboring tests regressed.
After the fix is verified:
docs/knowledge-graph.xml CrossLinks.docs/verification-plan.xml for the affected module:
<scenarios> block$grace-verification to strengthen automated checks before considering the issue fully closed.Produce a single commit containing:
Commit message format:
grace(MODULE_ID): fix <short description>
Regression test: tests/<file>::<test-name>
Root cause: <one sentence>
Verification: V-M-xxx updated with <scenario>
Thoughts that mean STOP — you are about to skip the Prove-It discipline.
| Rationalization | Reality |
|---|---|
| "The fix is trivial, a regression test is overkill" | Trivial bugs reappear. Without the test the fix is only temporary. The test IS the fix's guarantee. |
| "I'll reproduce it in my head" | If it is not in code it is not reproduced. Head-reproduction is how wrong fixes ship. |
| "I already see the bug, writing a test is wasted time" | Writing the test takes 2-5 minutes and often reveals that the bug is NOT where you thought. |
| "The test is hard to write because of setup" | That is a signal the module has testability debt. Adding the test surfaces the debt for the next engineer. |
| "I'll add the test after" | You will not. By the time the fix is committed, the failure mode is gone and you cannot verify the RED step. |
| "The bug is in a third-party library, no test needed" | Write a test at YOUR boundary that pins the observed-external-behavior contract. When the third party fixes it upstream, your test will flag the change. |
| "Root cause is unclear, so I'll patch the symptom first" | Patching the symptom buries the root cause. Either invest to find the root cause, or label the PR as a short-term workaround and open a follow-up ticket. |
| "Updating the verification plan is bureaucracy" | Verification plan is the only thing that stops this exact bug from regressing silently in a year. |
Stop immediately if any of the below apply — you are off the rails:
docs/verification-plan.xml."it works" mean you did not understand the bug).$grace-plan + $grace-execute or $grace-refactor instead.Before claiming this skill is complete, confirm every box:
docs/knowledge-graph.xml (verification: name the M-xxx id)docs/verification-plan.xml updated with regression entry (verification: grep for the new test name)npx claudepluginhub baho73/grace-marketplace-2 --plugin graceDebugs issues in GRACE-structured projects via semantic navigation of knowledge graphs, verification plans, and blocks to analyze mismatches and apply targeted fixes.