lead-bug-hunt — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited lead-bug-hunt (Agent Skill) and scored it 96/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 1 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 1 flagged
The text {match} tells the agent to skip the normal "ask the user first" gate. Used adversarially it removes the human-in-the-loop check before destructive or sensitive actions, turning a normally-gated agent into a fire-and-forget executor.
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Drives a codebase toward "no bugs above severity floor" without operator involvement between startup and termination. The operator states scope, severity floor, constraints, and finisher preference at startup; the skill then loops /bug-hunt → triage → /implement-batch until two consecutive hunt passes produce no findings above the floor, or until a hard cap or andon cord halts the run.
This skill is a narrower sibling of /lead-project. /lead-project takes open-ended commander's intent and decides which skills to invoke from a broad repertoire. /lead-bug-hunt has a fixed loop shape (hunt → fix → re-hunt) and a bounded sub-skill repertoire. It exists because "iterate until bugs converge" is a recurring workflow worth canonizing.
This skill implements the autonomy discipline documented in references/autonomy.md. The shared discipline governs the five levers (altitude rule, pre-loaded options, pre-rebutted recommendation, commander's intent, risk budgets), the cascade rule, the no-unilateral-breaking-changes guardrail, and the shared handoff template. Skill-specific shape (the hunt-cycle structure, convergence criteria, severity-floor triage) is layered on top.
Bugs below a stated severity floor do not block termination. They are recorded as deferred items in the completion report. The operator chooses the floor at startup; defaults to High (fix Critical and High; defer Medium and below).
This is the dominant judgment call this skill exposes. Setting the floor too low produces a loop that never converges (/bug-hunt always finds something at Low). Setting it too high produces a run that ships with real bugs unaddressed. The floor is elicited explicitly so the operator owns this trade-off.
/bug-hunt commits reproducing tests as it works. Those tests outlive the run — they become permanent regression tests in the suite. Their quality matters more than typical test code because they will catch regressions for years and bias future test authors who read them as examples.
This skill therefore treats test review as part of its core contract, not as adjacent cleanup. At termination (after convergence, after any /refactor finisher), the skill invokes /review-test scoped to the test files modified during this run, auto-approves any quality-finding ticket proposals at or above the severity floor, and fixes them via /implement-batch. Findings below the floor are deferred to the completion report.
/bug-hunt produces findings backed by reproducing tests. This skill trusts findings with passing reproducing tests against current HEAD — they are real bugs by /bug-hunt's evidence contract. The skill does not silently dismiss findings. If the skill genuinely believes a finding is wrong (the reproducing test asserts wrong behavior, the "bug" is intentional), that is an andon trigger ("contested finding"), not a unilateral disregard.
No escape hatches: the skill cannot rationalize bugs away to make the loop converge.
/bug-hunt and /review-test are advisory; their ticket proposals are auto-approved under /lead-bug-hunt per the orchestrator-family contract documented in references/autonomy.md § "Auto-approval of sub-skill ticket proposals". The commander's-intent severity floor (field 2) is applied at the triage step (1b), not at the approval moment. The completion report lists every ticket created.
The skill may: invoke /bug-hunt, /implement-batch, /implement, /bug-fix, /think-diagnose, /refactor, /review-test (at termination, scoped to the run's new tests); create tickets via auto-approved proposals; commit fix work via sub-skills; create and modify the working branch.
The skill may NOT without explicit authorization: push or merge to main/master, force-push, propose breaking changes (see references/autonomy.md § "No unilateral breaking changes"), invoke /review-* skills other than the scoped /review-test at termination (out-of-axis — use /lead-project if you want broader review-driven work), install dependencies, run irreversible destructive operations.
┌──────────────────────────────────────────────────────────────────┐
│ LEAD-BUG-HUNT WORKFLOW │
├──────────────────────────────────────────────────────────────────┤
│ 0. Startup │
│ ├─ 0a. Branch and working-tree check │
│ ├─ 0b. Resume existing run or start fresh │
│ ├─ 0c. Elicit commander's intent (4 fields) │
│ └─ 0d. Seed LEAD_BUG_HUNT_STATE.md │
│ │
│ 1. Hunt cycle (repeat until convergence or andon cord) │
│ ├─ 1a. Hunt — invoke /bug-hunt, gather findings │
│ ├─ 1b. Triage — apply severity floor, screen for contests │
│ ├─ 1c. Decide — form batch, escalate, or terminate │
│ ├─ 1d. Act — invoke /implement-batch (or /implement, etc.) │
│ ├─ 1e. Verify — tests pass, reproducing tests now pass │
│ └─ 1f. Convergence check │
│ │
│ 2. Termination │
│ ├─ 2a. Optional /refactor finisher (if opted in) │
│ ├─ 2b. /review-test on new reproducing tests │
│ │ (auto-approved, fix above-floor findings) │
│ ├─ 2c. Final verification pass │
│ └─ 2d. Completion report │
└──────────────────────────────────────────────────────────────────┘Follow the shared startup protocol in references/lead-startup.md. Skill-specific values:
lead-bug-hunt/<date> (e.g., lead-bug-hunt/2026-05-12).LEAD_BUG_HUNT_STATE.md. "Resume as-is" semantic: re-run a hunt before forming the next batch.references/autonomy.md § "Commander's-intent schemas per skill / /lead-bug-hunt". Push-back examples specific to this skill: "Find all the bugs" is not a scope — ask which modules; "Whatever severity" is not a floor — push for Critical+High at minimum, or ask why broader makes sense.Repeat until convergence (1f), andon cord, or hard cap (10 hunt-cycles).
Each cycle has six phases. Keep phase transitions visible in the state doc.
#### 1a. Hunt
Invoke /bug-hunt with auto-answered prompts:
When /bug-hunt reaches its ticket-proposal step, auto-approve. Record in the cycle log: ticket IDs proposed, scope of the proposal, and the fact that auto-approval was applied per commander's intent.
/bug-hunt also commits its reproducing tests. Confirm those commits exist in the cycle log.
#### 1b. Triage
For each finding produced by the hunt:
/bug-hunt's contract — proceed to classification. If no (the test does not actually fail on current code), the finding is stale or wrong — log it in ## Contested findings in the state doc and pull the andon cord.## Deferred findings with severity and a one-line summary.## Contested findings and proceed to andon cord at the end of triage (see § "Andon Cord Protocol").references/autonomy.md § "No unilateral breaking changes"), record in ## Breaking-change findings and proceed to andon cord. Do not auto-fix.#### 1c. Decide
Three possible outcomes:
Batch formation: tickets created by /bug-hunt this cycle are the batch. Do not co-mingle with prior cycles' tickets — each cycle handles its own batch, so the verification loop is tight.
Record the chosen outcome and rationale in the cycle log.
#### 1d. Act
Execute the batch. Sub-skill choice:
/implement-batch would be ceremony./implement from the ticket alone would be cargo-culting toward a fix./bug-fix's diagnosis phase would benefit from structured reasoning.When invoking a sub-skill that supports autonomous mode, use it. When a sub-skill requires interactive input, answer using engineering judgment anchored to commander's intent.
Sub-skill escalations cascade up per references/autonomy.md § "Cascade rule." /implement-batch's andon-cord pulls become this skill's responsibility to either resolve (next cycle's diagnosis) or escalate further (pull this skill's own andon cord).
#### 1e. Verify
After the batch completes:
Update the findings ledger: tickets fixed this cycle move from "fix-list" to "resolved" with commit SHAs.
#### 1f. Convergence check
Convergence: two consecutive cycles produce no findings above the severity floor.
If empty-pass counter reaches 2 → proceed to termination (step 2). Otherwise → return to 1a for the next cycle.
Caveat on convergence. /bug-hunt is non-deterministic — different hunters may explore different paths each pass. Two empty passes is a strong signal (the assessor's hotspot list is reasonably stable across passes), but not a proof. The completion report makes this caveat explicit to the operator.
#### 2a. Optional /refactor finisher
If commander's intent field 4 specified a finisher aggression:
/refactor with the specified aggression ceiling, scoped to the bug-hunt scope (field 1).If field 4 was "no finisher": skip this step.
The finisher is opt-in because it is not the core action of this skill. Bug-elimination is the contract; cleanup is adjacent and may be a separate concern for the operator.
#### 2b. /review-test on new reproducing tests
Always runs (not opt-in). The reproducing tests committed by /bug-hunt during the run are durable regression artifacts; their quality matters.
git diff --name-only <base SHA>..HEAD filtered to test files. If the set is empty (no new tests this run, which would be unusual), skip this step and log it in the cycle log./review-test's scope prompt with "specific files" + the collected list. The skill's other prompts answered using engineering judgment anchored to commander's intent.references/autonomy.md § "No unilateral breaking changes."/implement-batch (or /implement for single tickets). Sub-skill escalations cascade up per references/autonomy.md § "Cascade rule."Record outcome in the state doc under ## Test review section.
Why this is always-on: the reproducing tests are this skill's unique durable output. Bug fixes are valuable but transient (the bug is gone either way); the tests stay forever. Treating their quality as adjacent rather than core would be inconsistent with the skill's framing.
Why no re-hunt after this step: if the test-review's fixes have changed behavior enough to introduce new bugs above the floor, the test suite catches it during the verify step. Otherwise we'd be susceptible to an infinite loop (re-hunt → find → fix → re-review → re-hunt …).
#### 2c. Final verification pass
Before declaring done:
If any check fails, treat as a blocker — return to the loop (cycle counter does not increment).
#### 2d. Completion report
## Lead-Bug-Hunt Complete
### Commander's intent
[All four fields, verbatim]
### Outcome
[One paragraph: did the loop converge? At what cycle? Did the finisher run?
Any caveats the operator should know about — non-determinism of /bug-hunt,
deferred findings below floor, etc.]
### Convergence evidence
- Cycles run: N of 10
- Final two passes: <findings count per pass, all below floor>
- Reproducing tests in tree: N
- Total tickets fixed: N
### Top things to scrutinize
[Three to five items where the skill's judgment is most likely to need
review. Each item: one sentence + artifact (SHA, ticket ID, file:line).
Examples: triage calls on borderline findings, batches with multiple
attempts, the finisher's net diff, areas the hunters flagged as
uncertain.]
### Tickets created and fixed
- [#N] <title> — fix SHA <short> — reproducing test <file:line>
- [#N+1] <title> — fix SHA <short> — reproducing test <file:line>
- ...
### Test review outcome
- Tests reviewed: <list of test files reviewed in step 2b>
- Quality tickets created: N (list IDs)
- Quality tickets fixed: N
- Deferred quality findings (below floor): N — see Deferred section
- Contested or breaking quality findings: N — see Andon section (if any)
### Deferred findings (below severity floor)
[Findings not gated by the floor. Operator may run another iteration
with a lower floor to address them.]
- [Low | cycle 3 | /bug-hunt] <description> — see finding artifact
- [Low | cycle 5 | /bug-hunt] <description>
- [Low | termination 2b | /review-test] <description> — test quality
- ...
### Contested or breaking-change findings (if any escalated)
[Findings that were escalated rather than auto-fixed.]
- [contested | cycle 4] <description> — andon-cord SHA <short> in state doc
- ...
### Constraint adherence
[Confirm no violations. If any close calls, name them with commit SHAs.]
### Changes summary
- Branch: <branch name> (SHA <short>)
- Base: <base branch> (SHA <short>)
- Commits on branch: N
- Net lines: +X/-Y
- Finisher: <none | conservative | moderate | aggressive>
### Run metadata
- Hunt cycles: N of 10
- Empty passes at termination: 2 consecutive
- Andon-cord pulls during run: N (each with handoff in state doc)
- Duration (wall-clock, approximate)The operator decides whether to merge, run another iteration (e.g., with a lower severity floor), or pause.
Same shape as /bug-hunt's scope question. Examples:
vendor/ and gen/."pkg/auth and pkg/session — recent rewrite, want focused coverage."pkg/payments and pkg/billing (high-stakes areas)."The lowest severity that gates termination. Options:
| Floor | Effect |
|---|---|
| Critical only | Loops only on Critical findings. Fastest convergence; ships with High+Medium+Low deferred. Use for emergency sweeps. |
| Critical + High | Default. Loops on real-impact findings; defers polish and edge-case opportunities to follow-up. |
| Critical+High+Med | Loops longer; addresses moderate-severity issues. May not converge in 10 cycles for large codebases. |
| All severities | Not recommended. /bug-hunt tends to find Low-severity opportunities indefinitely; convergence is unlikely. |
Hard limits beyond the always-on guardrails (no breaking changes, no main/master writes). Examples:
auth."gen/."Aggression ceiling for the optional finisher. Options (matching /refactor's vocabulary):
| Setting | Effect |
|---|---|
| no finisher | Default. Bug fixes ship as-is. Operator may run /refactor separately. |
| conservative | Cleanup of obviously-redundant code introduced by fixes. Low diff. |
| moderate | Standard /refactor aggression. Moderate diff. |
| aggressive | Maximum aggression — significant restructuring permitted. High diff. The "MAXIMUM aggression" the ad-hoc want. |
Triage is mechanical, not judgment-based. The severity floor is the only knob.
The skill does NOT:
/bug-hunt's severity classifications. The hunter's judgment stands.Follow the shared handoff template and per-skill extension protocol in references/autonomy.md § "Shared handoff template" and § "Per-skill handoff extensions". Skill-specific values:
## Andon Cord — /lead-bug-hunt — Cycle NEmpty-pass counter: <N>Findings ledger: <K fixed, M deferred, L contested>State doc pointer: see LEAD_BUG_HUNT_STATE.md cycles N-2 through NPull the cord when:
/bug-hunt finding is wrong on substance — the reproducing test asserts wrong behavior, the "bug" is documented intentional behavior, or the finding contradicts a constraint in commander's intent. Surface the finding, the reproducing test, and the disagreement.references/autonomy.md § "No unilateral breaking changes"). List the finding, the breaking-change option, and the non-breaking alternative (if any)./implement-batch, /implement, or /bug-fix pulled its own cord for a reason this skill cannot resolve./bug-hunt finding's reproducing test does not actually fail on current HEAD. This indicates either the hunter was wrong or the test exercises the wrong path. Worth operator review before continuing./review-test proposed a change the skill believes is wrong on substance (e.g., delete a test that is genuinely load-bearing, rewrite an assertion in a way that weakens coverage)./review-test quality fix would alter test signatures or imports in ways that affect external consumers — rare for test files but possible for shared test helpers./bug-hunt's assessment surfaced high-risk hotspots but hunters could not produce confirmed findings. The skill should not declare convergence in this case; operator should decide whether to deepen the hunt or accept the uncertainty.LEAD_BUG_HUNT_STATE.mdMaintained at the repo root. Gitignored. Survives across invocations.
Structure:
# Lead-Bug-Hunt State
Started: <timestamp>
Branch: <branch-name>
Branch SHA at startup: <short SHA>
Base branch: <main-branch>
Base SHA at startup: <short SHA>
Last cycle HEAD: <short SHA>
Cycle: N
Empty-pass counter: <0 | 1 | 2>
Status: <active | paused-on-andon | complete>
## Commander's Intent
### Scope
<verbatim>
### Severity floor
<Critical only | Critical+High | Critical+High+Medium | All>
### Constraints
- <constraint 1>
### Refactor finisher
<no finisher | conservative | moderate | aggressive>
## Cycle log
### Cycle N — <timestamp> — HEAD <short SHA>
- Hunt: <findings count by severity>, tickets proposed <#N..#M>
- Triage: <count above floor | below floor | contested | breaking>
- Decide: <form batch | escalate | skip to convergence check>
- Act: <skill invoked, outcome, fix SHAs>
- Verify: <tests pass / fail, repro tests passing>
- Convergence: <empty-pass counter after this cycle>
## Findings ledger
### Fixed
- [cycle 2 | ticket #14] <description> — fix SHA <short> — repro test passing
- ...
### Deferred (below floor)
- [Low | cycle 3] <description>
- [Medium | cycle 4] <description> — (if floor is Critical+High)
- ...
### Contested
- [cycle 4] <description> — andon cord pulled, see § Andon Cord history
### Breaking-change-required
- [cycle 5] <description> — andon cord pulled, see § Andon Cord history
## Test review (termination 2b)
Scope: <test files reviewed, from `git diff --name-only <base SHA>..HEAD`>
Findings above floor: N — tickets <#N..#M>, fixed at SHAs <short>..<short>
Findings below floor: N — see § Findings ledger / Deferred
Contested findings: N — see § Andon cord history (if any)
Outcome: <clean | fixes applied | andon cord pulled>
## Andon cord history
### Cycle N pull
<full handoff text, pasted>
## Open questions
- <question>Update at every phase transition. The state doc is the durable orientation — losing it means losing the agent's memory.
.gitignoreEnsure LEAD_BUG_HUNT_STATE.md is ignored. Commit the .gitignore change on the working branch at startup if needed.
/bug-hunt + one batch-implementation. Heavier than /lead-project's OODA cycles, so the cap is lower. Hitting it pulls the andon cord./implement-batch (or /implement / /bug-fix) fails on the same finding 3 times across different attempts, pull the andon cord.references/autonomy.md § "Risk budgets."Relationship to `/bug-hunt`:
/lead-bug-hunt invokes /bug-hunt as its workhorse. /bug-hunt remains advisory in its native contract — it produces ticket proposals and commits reproducing tests, but does not implement fixes. /lead-bug-hunt auto-approves the ticket proposals (per the autonomy contract) and chains /implement-batch to do the fix work. Run /bug-hunt directly when you want a single advisory pass with operator-approved tickets; run /lead-bug-hunt when you want the full hunt → fix → re-hunt loop unattended.
Relationship to `/lead-project`:
/lead-project is the open-ended orchestrator — it takes broad commander's intent and decides which skills to invoke. /lead-bug-hunt is a fixed-shape loop for one specific outcome. Use /lead-project when bug-hunting is one of several concerns; use /lead-bug-hunt when bug elimination is the sole objective. /lead-project may invoke /lead-bug-hunt as a sub-skill when its Decide phase identifies a bug-sweep as the next move.
Relationship to `/refactor` and `/lead-refactor`:
The optional finisher invokes /refactor (not /lead-refactor) — bug-fix cleanup does not benefit from /lead-refactor's architectural-review loop. If you want comprehensive cleanup after bug elimination, run /lead-refactor separately after /lead-bug-hunt completes.
Relationship to `/review-test`:
Invoked once at termination, scoped to the test files modified during this run. /review-test's ticket proposals are auto-approved (same contract shift as /bug-hunt). Findings above the severity floor are fixed via /implement-batch; below-floor findings are deferred. Contested findings or breaking test changes pull the andon cord. /review-test remains a directly-invokable advisory skill — use it outside /lead-bug-hunt for broader test-suite reviews.
Out-of-axis skills:
Other /review-* skills, /scope-project, /test-mutation, /tidy-docs, /tidy-git are not in this skill's repertoire. If your goal is "review → refactor → test → ship," use /lead-project instead. /lead-bug-hunt is deliberately narrower.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.