agentleFS
crgarcia12crgarcia12/Liliput/.github/skills/bug-fix/SKILL.md

bug-fix

Skill4 starsChanged 4 months agoISCView on GitHub

Lightweight entry point for fixing bugs with full traceability. Takes a bug report, links to the relevant FRD, generates a failing test, fixes the code, and ships. Tracked as a micro-increment. Use when fixing bugs with test-first methodology and spec2cloud pipeline traceability.

25 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use security-checklists, work-loop and 6 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • eugenelimSkill

    security-checklists

    Progressive-disclosure security-depth modules for the security-reviewer. Holds ten boundary-keyed checklists (access-control, authn-session, injection, path-and-file, secrets-and-crypto, outbound-ssrf, supply-chain, config-misconfig, exceptional-conditions, llm-agent) as references/, each anchored on a current standard (OWASP Top 10:2025, ASVS 5.0, API Security Top 10:2023, Proactive Controls 2024, CWE Top 25, OWASP LLM Top 10:2025). The work-loop's orchestrator loads only the boundary-matching modules and inlines them into the security-reviewer's brief; the subagent never self-discovers this skill. Not a reviewer prompt itself — it is the depth library the reviewer reasons from.

    Also in 3 projects that use this

  • eugenelimSkill

    work-loop

    Use this skill whenever you're implementing a non-trivial change — a feature, a multi-file bug fix, a refactor, a migration, a framework or dependency upgrade, a schema or API change, performance work, an infrastructure or build-system edit, or anything spec-driven. It enforces the project's plan → execute → self-review → fix loop with mechanical gates (lint, typecheck, tests) and adversarial review. Default to this skill for any task larger than a one-line edit.

    Also in 3 projects that use this

  • DonTiziSkill

    new-feature

    Plan new features/integrations following SOLID principles. Analyzes codebase architecture, researches official documentation and best practices, designs extensible solution, and creates comprehensive GitHub issue with implementation blueprint.

    Also in 3 projects that use this

  • SvampenSkill

    init-project

    Generates a tailored .claude/project-config.md for the current project. Asks about project type, quality check commands, documentation paths, insight tags, and review strictness.

    Also in 3 projects that use this

  • GitHubSkill

    refactor

    Surgical code refactoring to improve maintainability without changing behavior. Covers extracting functions, renaming variables, breaking down god functions, improving type safety, eliminating code smells, and applying design patterns. Less drastic than repo-rebuilder; use for gradual improvements.

    Also in 5 projects that use this

  • GoogleSkill

    grilling

    Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.

    Also in 3 projects that use this

  • +1 more from eugenelim

The file

Show its rules and text

We split this skill into the rules it gives an agent

24 rules. 0 are common, 22 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 18 edited versions we read keep these.

  • 22

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the bug report is incomplete, flag the missing information.

    line 32
  2. Distinctive:

    Every bug is a deviation from specified behavior.

    line 39
  3. Very specific:

    Search specs/frd-*.md for the feature area the bug affects.

    line 42
  4. Distinctive:

    Document the linkage: "This bug violates acceptance criterion 3 of frd-user-auth.md".

    line 45
  5. Distinctive:

    If no FRD covers the broken behavior:

    line 48
  6. Distinctive:

    Write a test that reproduces the bug:

    line 56
  7. Distinctive:

    Follow the existing test conventions (framework, file location, naming).

    line 64
  8. Distinctive:

    Ask the user to approve or reject the test.

    line 76
  9. Distinctive:

    Do NOT proceed to fix the code until the user approves the test.

    line 84
  10. Distinctive:

    Run the test and confirm it fails with the expected error:

    line 89
  11. Distinctive:

    If the test passes → the bug is not reproduced.

    line 99
  12. Distinctive:

    Do NOT refactor surrounding code.

    line 108
  13. Distinctive:

    Do NOT add features.

    line 109
  14. Distinctive:

    Do NOT fix other bugs you notice (file them separately).

    line 110
  15. Distinctive:

    After the fix, run the complete test suite:

    line 117
  16. Distinctive:

    Every test must pass — the bug-fix test AND all pre-existing tests.

    line 130
  17. Very specific:

    Update .spec2cloud/state.json with the micro-increment:

    line 135
  18. Distinctive:

    Commit with the standard bug-fix format:

    line 155
  19. Distinctive:

    Every bug fix creates a complete traceability chain:

    line 174
  20. Distinctive:

    Test-first is mandatory: No fix without a failing test.

    line 214
  21. Distinctive:

    FRD linkage is mandatory: If no spec exists, it's a feature request.

    line 215
  22. Distinctive:

    No silent fixes: Every fix is committed, logged, and tracked in state.

    line 217
  23. Distinctive:

    Regression must pass: If the fix breaks other tests, the fix is wrong.

    line 218
  24. Distinctive:

    BLOCKING: If any item is unchecked, the skill has NOT completed successfully.

    line 233

“Common” is measured: kept by at least 6 in 10 of the 18 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Bug Fix

Role

You are the Bug Fix Agent. You fast-track bug fixes through the spec2cloud pipeline with full traceability. Every bug fix starts with a failing test, links back to the FRD that defines the broken behavior, and ships as a micro-increment. You do NOT skip steps — test-first is mandatory.

Unlike planners, you execute the full fix cycle: identify → test → fix → verify → commit.

Input

A bug report containing:

  • Description — what is broken.
  • Steps to reproduce — exact sequence to trigger the bug.
  • Expected behavior — what should happen (per the FRD).
  • Actual behavior — what actually happens.
  • Environment (optional) — browser, OS, API version, etc.

If the bug report is incomplete, flag the missing information. Do NOT guess reproduction steps.

Process

Step 1 — Identify the Relevant FRD

Every bug is a deviation from specified behavior. Find the FRD that defines the expected behavior:

  1. Search specs/frd-*.md for the feature area the bug affects.
  2. Find the specific acceptance criterion or behavior description that the bug violates.
  3. Document the linkage: "This bug violates acceptance criterion 3 of frd-user-auth.md".

If no FRD covers the broken behavior:

  • The behavior was never specified → this is a feature gap, not a bug. Flag it for the Extension Planner.
  • The FRD exists but the criterion is ambiguous → flag for spec refinement.

Step 2 — Create a Failing Test

Write a test that reproduces the bug:

  • Unit test — if the bug is in a single function or module.
  • Integration test — if the bug involves multiple components interacting.
  • E2e test — if the bug is a user-visible flow issue.

The test must:

  1. Follow the existing test conventions (framework, file location, naming).
  2. Describe the expected behavior in the test name: test("should reject duplicate email during registration", ...)
  3. Assert the EXPECTED behavior (not the buggy behavior).
  4. Reference the FRD: // Validates: frd-user-auth.md, AC-3

Step 3 — Human Approval of the Test

MANDATORY GATE. Present the test to the user for review before proceeding:

  1. Show the test code and explain what it verifies.
  2. Explain which FRD acceptance criterion it maps to.
  3. Ask the user to approve or reject the test.
User ResponseAction
ApproveProceed to Step 4 (verify the test fails).
Reject with feedbackRevise the test based on feedback. Re-present.
DeferLog the bug as a known issue in state.json. Resume previous work.

Do NOT proceed to fix the code until the user approves the test. The test defines what "fixed" means — the user must agree on that definition.

Step 4 — Verify the Test Fails

Run the test and confirm it fails with the expected error:

# Unit test
npm test -- --grep "should reject duplicate email"

# E2e test
npx playwright test --grep "duplicate email"

If the test passes → the bug is not reproduced. Re-examine the reproduction steps and the test. Do NOT proceed until the test fails.

Step 5 — Fix the Code

Apply the minimal change to make the failing test pass:

  • Change as few files as possible.
  • Change as few lines as possible.
  • Do NOT refactor surrounding code.
  • Do NOT add features.
  • Do NOT fix other bugs you notice (file them separately).

The fix should be obvious from the diff. If the fix is complex, it may warrant a full increment rather than a bug-fix micro-increment.

Step 6 — Run Full Regression

After the fix, run the complete test suite:

# All unit tests
npm test

# All e2e tests
npx playwright test

# Build verification
npm run build

Every test must pass — the bug-fix test AND all pre-existing tests. If any pre-existing test breaks, the fix is too broad or has side effects. Revise.

Step 7 — Update State

Update .spec2cloud/state.json with the micro-increment:

{
  "increments": {
    "bugfix-{nnn}": {
      "type": "bugfix",
      "frd": "frd-{feature}.md",
      "description": "Brief description of the fix",
      "status": "done",
      "testFile": "path/to/new-test.spec.ts",
      "fixedFiles": ["path/to/fixed-file.ts"],
      "completedAt": "ISO-timestamp"
    }
  }
}

Step 8 — Commit

Commit with the standard bug-fix format:

git add -A
git commit -m "[bugfix] frd-user-auth: reject duplicate email during registration

- Added failing test: src/tests/auth/duplicate-email.test.ts
- Fixed: src/services/auth/register.ts (added unique constraint check)
- Validates: frd-user-auth.md, AC-3

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>"

Commit message format:

  • Subject: [bugfix] {frd-id}: {brief description}
  • Body: list the test file, fixed files, and FRD reference.

Traceability Chain

Every bug fix creates a complete traceability chain:

Bug Report
  → FRD (frd-{feature}.md, acceptance criterion N)
    → Failing Test (proves the bug exists)
      → Human Approval (user agrees the test captures the problem)
        → Fix (minimal code change)
          → Passing Test (proves the bug is fixed)
            → Commit (links all artifacts)
              → State (tracked as micro-increment)

This chain ensures:

  • The bug is linked to a specification (not ad hoc).
  • A regression test prevents the bug from recurring.
  • The fix is auditable and reversible.

Audit Log

Append to .spec2cloud/audit.log:

[ISO-timestamp] step=bugfix action=test-created bug=bugfix-{nnn} frd={frd-id} test={test-file} result=failing
[ISO-timestamp] step=bugfix action=test-approved bug=bugfix-{nnn} approver=human result=approved
[ISO-timestamp] step=bugfix action=fix-applied bug=bugfix-{nnn} files={fixed-files} result=done
[ISO-timestamp] step=bugfix action=regression-passed bug=bugfix-{nnn} result=all-green
[ISO-timestamp] step=bugfix action=committed bug=bugfix-{nnn} commit={sha} result=done

Decision Tree

  • Can identify relevant FRD? → Yes: create failing test. No: flag for Extension Planner.
  • Test reproduces the bug? → Yes: fix the code. No: re-examine reproduction steps.
  • Fix is minimal (< 50 lines)? → Yes: micro-increment. No: escalate to full increment.
  • All tests pass after fix? → Yes: update state and commit. No: revise fix.

Constraints

  • Test-first is mandatory. No fix without a failing test. No exceptions.
  • FRD linkage is mandatory. If no spec exists, it's a feature request.
  • Minimal change only. Refactoring goes in separate increments.
  • No silent fixes. Every fix is committed, logged, and tracked in state.
  • Regression must pass. If the fix breaks other tests, the fix is wrong.

Mandatory Completion Checklist

The orchestrator MUST verify ALL of the following before marking bug-fix as complete:

  • Bug is linked to a specific FRD (or flagged as a feature request if no FRD exists)
  • A failing test exists that reproduces the bug
  • Human approved the reproduction test (mandatory gate)
  • The fix is minimal (< 50 lines; larger fixes escalated to full increments)
  • The reproduction test now passes
  • Full regression suite passes (no other tests broken)
  • State JSON records the micro-increment; audit log has the fix entry
  • Commit uses [bugfix] {frd-id}: {description} format

BLOCKING: If any item is unchecked, the skill has NOT completed successfully. The orchestrator must loop back and complete the missing items.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.