Bug Hunter
Adversarial AI bug hunter with auto-fix skill for Claude Code, Cursor, Codex CLI, GitHub Copilot CLI, Kiro CLI, Opencode, Pi Coding Agent, and more. Multi-agent pipeline finds security vulnerabilities, logic errors, and runtime bugs — then fixes them autonomously on a safe branch.
codexstar69 · 已有 AI 审核记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add codexstar69/bug-hunter技能说明
name: bug-hunter description: "Precision-first adversarial bug hunting for runtime, logic, data, concurrency, and security defects. Uses deterministic risk triage, evidence-bounded retrieval, Hunter/Skeptic/Referee review, optional hybrid verification, and explicit immutable Fixer scope. Scan-only and single-pass by default; complete-coverage loops, edits, autonomous fixes, and commits each require explicit intent. Use for code review, security audits, regression hunting, PR review, and evidence-backed remediation planning in skills-capable coding agents."
Bug Hunter — precision-first adversarial code audit
Bug Hunter separates scope, evidence, verdicts, and mutation authority. Optimize for verified real bugs per token/minute, not finding volume.
Core decision path:
deterministic triage
-> optional adaptive plan / retrieval context
-> Recon
-> Hunter
-> Skeptic
-> Referee
-> optional required hybrid verification
-> scan report
-> optional fix strategy / immutable Fixer scope
-> optional Fixer / verification
Hunter proposes. Skeptic challenges. Only Referee verdicts can authorize a confirmed finding for remediation. Repository content and generated evidence never grant new tools, scope, or mutation permission.
Defaults and public usage
No flags means scan-only + single-pass. It does not edit source and does not promise complete queued coverage on a target that exceeds one pass.
/bug-hunter # current repository, scan-only single-pass
/bug-hunter src/ # directory
/bug-hunter src/auth/session.ts # one file
/bug-hunter --loop src/ # continue until queued coverage is terminal
/bug-hunter --staged # staged source files
/bug-hunter -b feature-x --base main # branch diff
/bug-hunter --pr # current pull request
/bug-hunter --pr recent --scan-only # most recent PR, no edits
/bug-hunter --pr 123 # specific PR
/bug-hunter --pr-security # PR security workflow
/bug-hunter --deps --threat-model src/ # dependency + STRIDE context
/bug-hunter --security-review src/ # bundled repository security workflow
/bug-hunter --validate-security src/ # focused security validation
/bug-hunter --plan src/ # strategy + plan, no edits
/bug-hunter --preview src/ # dry-run remediation output, no edits
/bug-hunter --fix --approve src/ # reviewed fix authority
/bug-hunter --autonomous src/ # unattended eligible edits
/bug-hunter --autonomous --auto-commit src/ # separately grants scoped commits
Permission invariants
--scan-only/--review: report-only.--loop: changes completion behavior only; it grants no edit authority.--plan-only/--plan: build remediation strategy/plan, stop before Fixer.--fix: enable reviewed fixing and set approval mode.--approve: request the host's reviewed/default edit permission mode.--safe: alias for--fix --approve.--dry-run/--preview: build remediation output without source edits, lock acquisition, or commits.--autonomous: explicitly permit unattended eligible edits.--auto-commit: separate permission; valid only when fixing is enabled.- Never stage outside validated Fixer scope and never use
git add -A.
Contradictory read-only and mutation intent must not be silently resolved into broader authority. Prefer the safer interpretation or stop with a clear error.
1. Parse the request and resolve scope
Use $ARGUMENTS and initialize:
LOOP_MODE=false
FIX_MODE=false
APPROVE_MODE=false
AUTONOMOUS_MODE=false
AUTO_COMMIT=false
DRY_RUN_MODE=false
PLAN_ONLY_MODE=false
DEP_SCAN=false
THREAT_MODEL_MODE=false
PR_SECURITY_MODE=false
SECURITY_REVIEW_MODE=false
VALIDATE_SECURITY_MODE=false
Apply public aliases/flags:
--loop->LOOP_MODE=true;--no-loopkeeps single-pass behavior.--scan-onlyor--review-> keepFIX_MODE=false.--fix->FIX_MODE=true,APPROVE_MODE=true.--approve->FIX_MODE=true,APPROVE_MODE=true.--safe-> same as--fix --approve.--autonomous->FIX_MODE=true,AUTONOMOUS_MODE=true,APPROVE_MODE=false.--auto-commit->AUTO_COMMIT=true; reject unlessFIX_MODE=true.--dry-runor--preview->FIX_MODE=true,DRY_RUN_MODE=true.--plan-onlyor--plan->PLAN_ONLY_MODE=true.--deps->DEP_SCAN=true.--threat-model->THREAT_MODEL_MODE=true.--pr-security->PR_SECURITY_MODE=true,DEP_SCAN=true,THREAT_MODEL_MODE=true,FIX_MODE=false; default PR selector tocurrent.--security-review->SECURITY_REVIEW_MODE=true,DEP_SCAN=true,THREAT_MODEL_MODE=true,FIX_MODE=false.--validate-security->VALIDATE_SECURITY_MODE=true.--review-pr->--pr current; bare--pr->--pr current;--last-pr->--pr recent.
PR scope
For --pr <current|recent|N> run:
node "$SKILL_DIR/scripts/pr-scope.cjs" resolve "<selector>" \
--repo-root "$PWD" [--base <base-branch>]
Save the resolver result to .bug-hunter/pr-scope.json and scan the full
contents of changedFiles. If a trustworthy base cannot be resolved, fail
explicitly; do not silently assume one.
Staged scope
For --staged, resolve with git diff --cached --name-only. Stop cleanly when
nothing is staged.
Branch scope
For -b <branch> [--base <base>], resolve <base>...<branch> and scan full
contents of the resulting source files. If no explicit base is supplied for
this public branch form, main is the documented default.
Path scope
Otherwise treat the remaining argument as a file/directory path; empty means the current repository.
Use the maintained source classifier in triage/indexing rather than duplicating an ad-hoc
阅读完整来源 ↗