Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Redevkit Debug?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/reprograme-redevkit-debug)
---
name: redevkit-debug
description: Fix a failure - reproduce, root cause, regression test first, fix, bug record; then retest.
short-description: Fix a bug with a regression test
argument-hint: "[--auto] <symptom, error or failing test>"
---
# redevkit-debug
**Input:** {{ARGS}}
Flags: `--auto` continues to the command this run hands back to. The rest of the input describes the symptom
(error message, failing test, unexpected behavior). With no input, take the failing tests of
the latest `FAIL` run of the active feature (`test-report.md`, or `verification.md` when the
Failing scope is `global`). Write artifacts in {{LANG}};
answer the user in the user's language.
## Purpose
Investigate and fix one problem with evidence (D26): reproduce it, find the root cause, write
a regression test that fails, fix, confirm. Every step leaves a file in
`.redevkit/bugs/<slug>/`. The run hands back to the loop that sent the failure (`active.md` ›
Last results › `- Failing scope:`): `spec` → the test command, `global` → the verify command;
outside a loop it asks. The loops and their limits are defined in
`{{SKILLDIR:redevkit-test}}/references/loops.md`.
## Preconditions
- Memory initialized. If not, suggest `{{CMD:redevkit-new}}` and stop.
- A symptom: the input, or a `FAIL` run in `test-report.md` or `verification.md`. If neither exists, ask for the
error, the steps to reproduce and the expected vs actual behavior.
- G5 check: if the Test cycle or the Correction cycle line names the active feature and says
G5 was reached, present the G5 question before starting (answers at a precondition:
`loops.md` § G5).
- Templates resolve per T10: `.redevkit/templates/overrides/reports/<name>` if it exists,
otherwise `.redevkit/templates/reports/<name>` (`bug-assessment.md`, `bug-fix.md`,
`bug-test.md`).
## Memory phase 1
Recall per `{{SKILL:redevkit-memanager}}`: `MEMORY.md`, `active.md` (Known issues, Last
results: Failing scope, Test cycle, Correction cycle), the invariants in `system.md`, `tech.md` (build and test commands). Read
`.redevkit/memory/constitution.md`. Print `📖 Memory loaded. Last entry: YYYY-MM-DD.`
## Questions
Ask before assuming, but only what changes the investigation: one question at a time, at most
3 options with the recommended one first and marked "(Recommended)", at most 5 questions in
this run. Record every assumption in `assessment.md`. Personas never ask the user: they return
the question to you. In `--auto` or non-interactive runs, adopt the recommendation and record
it as an assumption, except at gates.
{{ASK}}
## Steps
### 1. Slug
Short name of the symptom, following the slug rule of `{{SKILL:redevkit-assess-intake}}`. An
**open bug** is one listed as `- Bug <slug>: open` in `active.md` › Known issues. When an open
bug matches the symptom:
- its folder lacks `fix.md` or `test.md` (an interrupted debug) → ask to continue it
(Recommended) or open a new one; continuing resumes at the first missing file
(`assessment.md` → step 2, `fix.md` → step 3, `test.md` → step 4) and never rewrites an
existing one;
- its `test.md` exists (any result) → open a new bug linked to it (**Related bug** in
`assessment.md`); the old folder is never rewritten.
### 2. Assess
Follow `{{SKILL:redevkit-bug-assess}}` with the debugging persona and
`{{SKILL:systematic-debugging}}`: {{DELEGATE:debugger}}.
- Gather: error message, reproduction steps, expected vs actual, recent changes
(`git log`, `git diff`, read-only).
- Reproduce with a command and record its output.
- List hypotheses ordered by likelihood; test each one; eliminate with evidence.
- Root cause explained (why, not only what).
- `assessment.md` links to the feature (`specs/NNN-short-name/spec.md`) and to the
`test-report.md` run that exposed the problem.
Cannot reproduce: record what was tried and ask for more information; do not guess a fix. In
`--auto` or a non-interactive run, stop the chain here with the question pending: no fix, no
handoff. Memory: only `- Bug <slug>: open` in Known issues, no `- Debug:` line and no
counter change (nothing was changed).
Verdict `invalid` (expected behavior, misuse, duplicate): stop. Write no `- Debug:` or
`- Bug` line, report the reason and suggest `{{CMD:redevkit-status}}`; no handoff.
Not a bug in the code (decide it here, before any fix, and write no `- Debug:` or `- Bug`
line):
- **The test is wrong** (it contradicts the spec, or fails by its own error): stop and hand
the test back, with the evidence (test name, spec scenario or error, also written to
`assessment.md`), to the loop that sent it, as § Handoff does after a fix: Failing scope
`spec` → `{{CMD:redevkit-test}}`; `global` → `{{CMD:redevkit-verify}}`, whose step 1 runs
the whole suite again (never the stale `FAIL`), so the disputed test is judged again. The
test procedure corrects test defects, and asks the user when it disagrees. This handback
counts as a debug round of that loop (Test cycle or Correction cycle, `loops.md`), so a
repeated disagreement reaches the question or G5.
- **The behavior was never built** (it belongs to an open `[ ]` or blocked `[!]` task of
`tasks.md`): stop and hand off to `{{CMD:redevkit-create}}`. With Failing scope `spec` or
`global` this handoff counts as a debug round of that loop too, so a failure that keeps
coming back through the create command still reaches G5.
- **The suite cannot run** (missing dependency or tool, timeout, port in use): stop and name
what must be fixed in the environment.
### 3. Fix
Follow `{{SKILL:redevkit-bug-fix}}`:
1. Write the regression test first; run it; record that it fails for the root cause.
2. Apply the smallest fix that addresses the root cause. When the fix belongs to another
domain, choose its persona with `{{SKILL:redevkit-route}}`.
3. Run the regression test; record that it passes.
4. Add prevention (validation, guard, test) when the root cause can recur.
A fix that would violate the constitution stops the run (G3). A destructive or irreversible
step (data migration, deleting data or files) needs explicit confirmation (G4).
### 4. Confirm
Follow `{{SKILL:redevkit-bug-test}}`: run the regression test, the related tests and the
original reproduction. `test.md` records the result: `verified`, `partial` or `failed`.
### 5. Light verification (D25)
On the changed files, with evidence: build or type check, touched tests, lint. This is not the
test run: the command this run hands back to runs the tests next (the spec tests, or the
whole suite and the full verification).
## Gates that apply
| Gate | Where |
| --- | --- |
| G3 | Step 3, the fix would violate the constitution |
| G4 | Step 3, destructive or irreversible actions |
| G5 | Preconditions, G5 reached and not answered yet |
## Artifacts
- `.redevkit/bugs/<slug>/assessment.md`, `fix.md`, `test.md`.
- The regression test and the fix in the code.
## Memory phase 3
Save per `{{SKILL:redevkit-memanager}}`: `active.md` › Last results › Debug (active feature, bug
slug, date and time read from the system clock, `test.md` result, link to the bug folder),
+1 debug round of the loop of the Failing scope on every handoff this run makes inside it, to
the test, verify or create command, whatever it changed (Test cycle for `spec`, Correction
cycle for `global`; rules in `loops.md`; delete
an obsolete `- Verify pending:` line) and Known issues (`- Bug <slug>: open — .redevkit/bugs/<slug>/`; only a `converged+verified`
verify of that feature closes it; a bug debugged with no active feature is closed by the user
through `{{SKILL:redevkit-memanager}}`), `changelog.md`
(Unreleased › Fixed, only when `test.md` says `verified`), `system.md` when the root cause
reveals a pattern (a new invariant only after confirmation), `MEMORY.md`. Print
`💾 Memory updated (files).`
## Evidence rule
The reproduction, the failing regression test, the passing test after the fix and the light
verification each show the command and its observed output. No hypothesis is called the root
cause without a test that confirms it.
## Handoff
- Cannot reproduce or `invalid` (step 2) → no handoff; the run ends with the question or the
reason.
- Not a bug in the code (step 2) → for a wrong test, the command of the Failing scope as
below (`spec` → `{{CMD:redevkit-test}}`, `global` → `{{CMD:redevkit-verify}}`, otherwise
ask); `{{CMD:redevkit-create}}` for behavior never built; no command for an environment
problem. `--auto` continues to those commands and stops on the environment problem.
- Otherwise, by the Failing scope of the active feature (whatever `test.md` says):
- `spec` → `{{CMD:redevkit-test}}`: it runs the spec tests on the fixed code; its `PASS`
leads to the verify.
- `global` → `{{CMD:redevkit-verify}}`: it runs the whole suite on the fixed code, then the
full verification.
- `none`, another feature or no line (a debug outside a loop) → ask where to go, with the
recommendation taken from the context: `{{CMD:redevkit-verify}}` (Recommended) when the
symptom came from a verify run, a build, a flow, an audit, a test of another feature or
production; `{{CMD:redevkit-test}}` (Recommended) when it came from a test of the active
spec or from the user's description of its behavior. In `--auto` or a non-interactive run,
adopt the recommendation and record it in `fix.md`.
- The deploy is never next: only a verify that ends in `converged+verified` opens it.
- `--auto`: continue with the chosen command `--auto`.