bugmagnet

A code-review skill for finding bugs and missing test cases in one code module. It examines the implementation and existing tests, then writes tests for edge cases and error paths.

In plain words
What is it for?
Use it to explore boundary conditions, check test coverage, run new tests, and document bugs revealed by those tests.
Why use it?
It exposes behaviour that normal tests may miss while leaving the implementation unchanged.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/nikeyes/stepwise-dev/bugmagnet
Any agent
npx skills add nikeyes/stepwise-dev --skill bugmagnet
Clone the repo
git clone --depth 1 https://github.com/nikeyes/stepwise-dev

Made for: Claude Code, Codex.

Per session 76 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 506 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00076 $0.00506
Opus 5 $0.00038 $0.00253
Sonnet 5 $0.00015 $0.00101
Haiku 4.5 $0.00008 $0.00051

Measured 2d ago against content hash bdd11a799390, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

bugmagnet scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

core/skills/bugmagnet/SKILL.md · 64 lines

What it actually says

BugMagnet

Analyze a code module, write comprehensive edge-case tests, and document discovered bugs.

Attribution: Adapted from BugMagnet AI Assistant by Gojko Adzic (MIT License).

Usage

/bugmagnet <implementation-file-path>

Workflow

  1. Read the implementation file and its existing tests
  2. Identify untested edge cases, boundary conditions, and error paths
  3. Write tests — run each one immediately after writing
  4. When a test reveals a bug, document it as a skipped test (see format below), then explore nearby: bugs cluster together
  5. Summarize findings

Do NOT modify the implementation file. Only write tests.

Bug Documentation Format

When a test reveals unexpected behavior, create a skipped test using the framework's skip mechanism with "- BUG" in the test name:

test.skip('normalizeEmail crashes on input without @ - BUG', () => {
    /*
     * ROOT CAUSE: destructuring email.split("@") fails when no @ present
     * CODE LOCATION: src/validator.ts:49
     * PROPOSED FIX: guard with if (!email.includes("@")) before split
     * EXPECTED: throws or returns input unchanged
     * ACTUAL: TypeError: Cannot read properties of undefined
     */
    expect(() => normalizeEmail("nodomain")).not.toThrow();
});

Every skipped BUG test must include: ROOT CAUSE, CODE LOCATION, PROPOSED FIX, EXPECTED vs ACTUAL.

Summary Format

After all tests are written, provide:

## Test Coverage Summary

**Tests Added:** N total
- Category 1 (X tests)
- Category 2 (Y tests)

**Results:** X passing, Y skipped (bugs)

**Bugs Discovered:**
1. Bug name — file:line
   - Root cause: ...
   - Proposed fix: ...
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 64 lines · 76 tokens per session scan A bdd11a799390

Subscribe to this mod's changes

bugmagnet is a skill published in the GitHub repository nikeyes/stepwise-dev (24 stars, last pushed 13d ago), licensed Apache-2.0. It adds 76 tokens to every session and 506 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

improving-frontend-coverage

Runs frontend unit tests with coverage, analyzes coverage reports, and implements meaningful tests to increase coverage by 0.2%. Use when you want to systematically improve frontend test coverage with high-value test cases.

streamlit/streamlit · 48 tokens

run-helix-tests

Submit and monitor .NET MAUI unit tests on Helix infrastructure. Supports running XAML, Resizetizer, Core, Essentials, and other unit test projects on distributed Helix queues.

dotnet/maui · 45 tokens

prowler-test-api

Testing patterns for Prowler API: JSON:API, Celery tasks, RLS isolation, RBAC. Trigger: When writing tests for api/ (JSON:API requests/assertions, cross-tenant isolation, RBAC, Celery tasks, viewsets/serializers).

prowler-cloud/prowler · 62 tokens

qt-qml-test-run

Builds and runs Qt Quick Test (qmltestrunner / CTest) for a QML project, then writes a Markdown report. Use for "run qml tests", "run qmltestrunner".

mavlink/qgroundcontrol · 50 tokens

ordering-and-flakes

Control spec ordering and manage flaky specs — Serial, Ordered containers with BeforeAll/AfterAll/ContinueOnFailure, OncePerOrdered, SpecPriority, plus FlakeAttempts/--flake-attempts, MustPassRepeatedly, --repeat, and --until-it-fails. Use when specs must run in a fixed order, you need once-per-group setup, you're…

onsi/ginkgo · 111 tokens

golang-testing

Production-ready Golang tests — table-driven tests, testify suites and mocks, parallel tests, fuzzing, fixtures, goroutine leak detection with goleak, snapshot testing, code coverage, integration tests, idiomatic test naming. Use when writing or reviewing Go tests, choosing a testing approach, setting up Go test CI…

samber/cc-skills-golang · 115 tokens