agentleFS
abevzabevz/devops-skills/skills/go-bugfix/SKILL.md

go-bugfix

Skill0 starsChanged 41 days agoMITView on GitHub

Use when fixing a bug in Go code. Mention "fix this go bug", "this go function is broken", "go bugfix" as triggers.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    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:

    Do not patch only the downstream panic when the bad value originates earlier.

    line 22
  2. Distinctive:

    Follow the Workflow, Safety rules, and Quality checklist below.

    line 26
  3. Distinctive:

    Use when a Go program has a specific, identifiable bug (wrong output, panic, failing test, deadlock) that needs a fix.

    line 36
  4. Distinctive:

    Add a regression test that fails before the fix and passes after it.

    line 53
  5. Very specific:

    Run the focused test(s) (go test -run <TestName> ./...) to confirm, then run the broader package tests to check for regressions.

    line 54
  6. Distinctive:

    Do not refactor unrelated code, rename things, or "clean up while you're in there" — fix only the bug.

    line 59
  7. Very specific:

    Do not silently swallow the error the bug caused (recover() without acting on it, ignoring an error return) — fix the cause, not the …

    line 61
  8. Distinctive:

    If the root cause is unclear after investigation, say so rather than applying a fix that only masks the symptom.

    line 63

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Go Bugfix

TL;DR checklist

  • Reproduce or precisely state the wrong behavior.
  • Trace from the symptom to the root cause and make a minimal fix.
  • Add a regression check and run focused package tests.

Key read-only checks

  • Inspect the failing output, call path, and nearby tests before editing.

Common pitfalls

  • Do not patch only the downstream panic when the bad value originates earlier.

Agent procedure

Follow the Workflow, Safety rules, and Quality checklist below.

Quick references

  • Workflow below.

Last verified: unverified

When to use

Use when a Go program has a specific, identifiable bug (wrong output, panic, failing test, deadlock) that needs a fix.

Goal

Fix the actual bug with a minimal, correct change, backed by a regression test — without refactoring unrelated code.

Workflow

  1. Reproduce or precisely understand the failing behavior: run the failing test, reproduce the panic, or get the exact wrong output from the user.
  2. Inspect existing tests around the affected code to understand intended behavior and existing coverage.
  3. Trace the code path to find the root cause (not just where the symptom surfaces — e.g. a nil pointer panic three calls downstream from where a value was never initialized).
  4. Implement the minimal fix at the root cause.
  5. Add a regression test that fails before the fix and passes after it.
  6. Run the focused test(s) (go test -run <TestName> ./...) to confirm, then run the broader package tests to check for regressions.

Safety rules

  • Do not refactor unrelated code, rename things, or "clean up while you're in there" — fix only the bug.
  • Do not silently swallow the error the bug caused (recover() without acting on it, ignoring an error return) — fix the cause, not the symptom.
  • If the root cause is unclear after investigation, say so rather than applying a fix that only masks the symptom.

Output format

## Bug
<what's wrong, how it manifests>

## Root cause
<file:line, why it happens>

## Fix
<the diff/change, minimal and scoped to the bug>

## Regression test
<the test added, and confirmation it failed before / passes after>

## Test run result

Quality checklist

  • The fix addresses the root cause, not just where the symptom appeared
  • A regression test was added and shown to fail before the fix
  • No unrelated code was refactored or renamed
  • Focused tests were run and pass after the fix
  • Errors are handled, not silently discarded

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.

Reviews can't be read right now.

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.