savinofiore/lexi/lexi-bug

Claude Code and agent skill by savinofiore/lexi

Trust tier 1
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

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.

Install

npx vskill@latest install savinofiore/lexi/lexi-bug

SKILL.md

The same SKILL.md was published earlier as savinofiore/lexi/lexi-bug.

Pi: invoke this skill with /skill:lexi-bug.

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 → invoke /skill:lexi-init.

Running the gate: .lexi.json has "gate_agent": true → dispatch to the lexi-gate subagent ({agent: "lexi-gate", task: "<gate command>", agentScope: "project"}) instead of running it in bash. Otherwise run the gate command directly.

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? Invoke /skill: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 /skill: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

  1. Allow — write the confirmed test paths into .lexi/allow, one per line.
  2. Rewrite tests — update their assertions to fail if the bug exists
  3. Run gate — must fail for the bug reason, not setup error
  4. 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

  1. 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.

  1. Run gate — all tests green
  2. 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.

  1. If a test is green without the fix → test was not rewriting the bug, go back

to step 4.

  1. 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 — required

Gate green → follow /skill:jev-code-review 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. No verdict (missing key, review.py error) → the task is not done: say why and stop, as the review skill does.

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.

Security

  • Security scanPassedPattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/savinofiore/lexi/lexi-bug/badge)](https://verified-skill.com/skills/savinofiore/lexi/lexi-bug)

Something wrong with this skill or its page? Tell us.