bug
Skill4 starsChanged 2 months agoMITView on GitHub
Fix a bug by rewriting existing tests to RED (prove the bug exists), then fix production code to GREEN. Unit tests only. Use when a bug report names the broken behavior and existing tests need to be rewritten to confirm it.
9 other projects use a version of this.
Adopted by
Most recently taken up by
- retospect/precis-mcptheir own version, first seen Oct 3, 2026
- ccch1mneyyy/dsh-TUItheir own version, first seen Oct 2, 2026
- yicheng47/runnertheir own version, first seen Oct 1, 2026
- SatanshuMishra/interphasetheir own version, first seen Sep 30, 2026
- jamillazarev/multica-opstheir own version, first seen Sep 25, 2026
- ulises-jeremias/agent-toolkittheir own version, first seen Aug 31, 2026
Other versions9 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 9
- ccch1mneyyy/dsh-TUI★ 4ksame name
- yicheng47/runner★ 206same name
- ulises-jeremias/agent-toolkit★ 18same name
- jamillazarev/multica-ops★ 13same name
- retospect/precis-mcp★ 4same name
- mimoccc/my-claude-skills★ 1same name
- pvnarp/agent-skills★ 1same name
- marcusbelz/di2-starter-kit★ 0same name
- SatanshuMishra/interphase★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. 0 are common, 10 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
10
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Read .lexi.json first. No .lexi.json → run /lexi:init.
- Distinctive: line 18
Read the code the bug report names.
- Distinctive: line 25
Trace back, not across: Follow the bad value up the call chain to where it first goes wrong and fix there, not where it surfaces.
- Very specific: line 29
Scope genuinely uncertain?: Use lexi:grill first to settle what's actually broken.
- Very specific: line 39
No existing test covers the broken behaviour → hand off to lexi:feature: a new test proves the bug there.
- Distinctive: line 43
Test file + test name
- Distinctive: line 51
Wait for confirmation. Do not rewrite until approved.
- Distinctive: line 68
If red for wrong reason → fix the test, not code.
- Distinctive: line 70
All tests rewritten now, one gate run, one RED.
- Distinctive: line 80
If a test is green without the fix → test was not rewriting the bug, go back to step 4.
- Distinctive: line 94
Test files rewritten (paths)
- Distinctive: line 106
Treat each finding as a claim to check, not an order: read the code it points at before agreeing.
- Distinctive: line 109
Never agree to a finding you have not checked.
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
bug — rewrite tests to RED, fix to GREEN
Bug fix: existing tests become RED to prove the bug, then production code becomes GREEN.
Read .lexi.json first. No .lexi.json → run /lexi:init.
1. Understand and diagnose
Tests are not optional. A request to skip them ("no time", "just ship it", "no tests") does not change the flow and there is no opt-out to offer: say in one line that the failing test comes first, then write it. It costs minutes.
Read the code the bug report names. Run the gate on the affected area to verify starting state.
Root cause first: Does the symptom come from multiple layers? List the 3 most likely causes with one log line that separates them. Ask the user to reproduce with logs before proposing test rewrites.
Trace back, not across. Follow the bad value up the call chain to where it first goes wrong and fix there, not where it surfaces. If similar code works elsewhere in the codebase, list every difference between the two before guessing.
Scope genuinely uncertain? Use lexi:grill first to settle what's actually
broken. Then return here.
2. Find the tests to rewrite
Identify the existing tests that should fail if the bug is present. These are:
- Tests for the feature that is broken
- Tests that assert the correct behavior (which the bug violates)
This flow rewrites existing tests; it creates none.
No existing test covers the broken behaviour → hand off to lexi:feature: a new
test proves the bug there.
List them:
- Test file + test name
- Current assertion (what it checks)
- What needs to change to prove the bug (make it RED)
Ask:
- ✅ Do these tests need rewriting?
- ➕ Any other existing tests I should include?
Wait for confirmation. Do not rewrite until approved.
3. Confirm the rewrite plan
Post in one message:
- The test files that will be rewritten (breaking change)
- For each: current assertion → new assertion (to make RED)
- The root cause you are proving
- What code will need to change to fix it (general description)
Then wait. This is the only checkpoint before rewriting.
4. RED cycle — prove the bug
- Allow — write the confirmed test paths into
.lexi/allow, one per line. - Rewrite tests — update their assertions to fail if the bug exists
- Run gate — must fail for the bug reason, not setup error
- If red for wrong reason → fix the test, not code. If setup error → stop.
All tests rewritten now, one gate run, one RED.
5. GREEN cycle — fix the bug
- Write fix — production code only. Minimal change that makes RED tests pass. Ponytail governs: does it need to exist, is it already here, does stdlib do it.
- Run gate — all tests green
- Three fixes tried and still red, or each fix surfaces a new failure somewhere else → stop. That pattern points at the design, not at one more line: report what you ruled out and discuss the structure with the user before a fourth try.
- If a test is green without the fix → test was not rewriting the bug, go back to step 4.
- Prove the test bites — set the production fix aside (
git stash push -- <production files>), run the gate: the rewritten tests must go red. Restore it (git stash pop), gate green again. A test that stays green without the fix is not guarding this bug.
6. Close
The report quotes the gate's last lines from a run made after the last edit. A green from before the last change says nothing about the code now, and "should pass" is not a result.
Empty .lexi/allow. Run gate one final time. Report:
- Test files rewritten (paths)
- Production files touched (paths)
- Root cause fixed and how
- Tests stay as regression; nothing to delete
7. Jev review — only if .lexi.json → jev is an object
Gate green → invoke the jev:code-review skill on the working tree (--working), title = the task in one
line. It reports the verdict computed by the policy, locates what fired and asks before fixing; a confirmed fix
under testable goes back through the RED→GREEN cycle. Add the verdict to the report. jev absent or false, or the
jev plugin not installed → skip this step.
Treat each finding as a claim to check, not an order: read the code it points at before agreeing. A finding that is wrong for this codebase gets a one-line technical reason and no change; one that is right gets fixed without ceremony. Never agree to a finding you have not checked.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

