You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+35-1Lines changed: 35 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,10 +5,43 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
8
+
## [3.0.5] — 2026-03-11
9
+
10
+
### Added
11
+
-`agents/openai.yaml` UI metadata for skill lists and quick-invoke prompts
12
+
13
+
### Changed
14
+
-`SKILL.md` frontmatter now validates cleanly against the `skill-creator` validator
15
+
-`evals/evals.json` now matches the current `.bug-hunter/*` JSON-first pipeline, default loop/fix behavior, and modern flags like `--deps`, `--threat-model`, `--dry-run`, and `--autonomous`
16
+
- npm package files now include the `agents/` directory so `openai.yaml` ships with the published skill
17
+
8
18
## [Unreleased]
9
19
20
+
### Highlights
21
+
- PR review is now a first-class workflow with `--pr`, `--pr current`, `--pr recent`, `--pr 123`, `--last-pr`, and `--pr-security`.
22
+
- Bug Hunter now emits both `fix-strategy.json` and `fix-plan.json` before fix execution so remediation stays reviewable and confidence-gated.
23
+
- The enterprise security pack now ships inside the repository under `skills/`, making PR security review and full security audits portable.
24
+
- Fix execution is now safer through schema-validated planning, atomic lock handling, safer worktree cleanup, stash preservation, and shell-safe templating.
25
+
10
26
### Added
11
27
- GitHub Actions npm publish workflow on release publish or manual dispatch, with version/tag verification before `npm publish`
28
+
- bundled local security skills under `skills/`: `commit-security-scan`, `security-review`, `threat-model-generation`, and `vulnerability-validation`
29
+
- enterprise security entrypoints: `--pr-security`, `--security-review`, and `--validate-security`
30
+
- regression tests and eval coverage for integrated local security-skill routing
31
+
-`schemas/fix-plan.schema.json` plus validation coverage for canonical fix-plan artifacts
32
+
- focused regressions for lock-token ownership, atomic lock acquisition, stale artifact clearing, shell-safe worker paths, failed-chunk fix-plan suppression, managed worktree cleanup, and stash-ref preservation
33
+
34
+
### Changed
35
+
- portable security capabilities now live inside the repository under `skills/` instead of depending on external machine-specific skill paths
36
+
- package metadata now ships the `skills/` directory for self-contained distribution
37
+
- main Bug Hunter orchestration now routes into the bundled local security skills for PR security review, threat-model generation, enterprise security review, and vulnerability validation
38
+
- fix-lock now uses owner tokens for renew/release, atomic acquisition under contention, and safe recovery from corrupted lock files
39
+
- run-bug-hunter now shell-quotes templated command arguments, clears stale artifacts before retries, validates fix-plan artifacts, and skips fix-plan emission when chunks fail
40
+
- worktree cleanup/status now preserve unrelated directories, preserve stash metadata from defensive harvests, and avoid reporting manifest-only worktrees as dirty
41
+
- current-PR git fallback now diffs against the discovered `origin/<default-branch>` ref when the base branch comes from `origin/HEAD`
42
+
- README now opens with a short “New in This Update” and PR-first quick-start section
43
+
-`llms.txt` and `llms-full.txt` now describe the PR review flow, bundled local security pack, current fix artifacts, and the current regression-test coverage
44
+
-`skills/README.md` now explains how the bundled security skills map into Bug Hunter workflows
12
45
13
46
## [3.0.4] — 2026-03-11
14
47
@@ -167,7 +200,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
167
200
- Coverage enforcement — partial audits produce explicit warnings
168
201
- Large codebase strategy with domain-first tiered scanning
Copy file name to clipboardExpand all lines: SKILL.md
+68-12Lines changed: 68 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,6 @@
1
1
---
2
2
name: bug-hunter
3
3
description: "Adversarial bug hunting with a sequential-first pipeline (Recon, Hunter, Skeptic, Referee) that can optionally use safe read-only parallel triage. Finds, verifies, and auto-fixes real bugs by default (with --scan-only opt-out) using checkpointed verification and resume state for large codebases. Use this skill whenever the user wants bug finding, security audits, regression checks, or code review focused on runtime behavior."
/bug-hunter --validate-security src/ # Force vulnerability-validation for security findings
58
70
/bug-hunter --deps --threat-model src/ # Full security audit
59
71
/bug-hunter --fix --dry-run src/ # Preview fixes without editing files
60
72
```
@@ -75,24 +87,46 @@ The raw arguments are: $ARGUMENTS
75
87
0g. If arguments contain `--deps`: strip it and set `DEP_SCAN=true`. Dependency scanning runs package manager audit tools and checks if vulnerable APIs are actually called in the codebase.
76
88
0h. If arguments contain `--threat-model`: strip it and set `THREAT_MODEL_MODE=true`. Generates a STRIDE threat model at `.bug-hunter/threat-model.md` if one doesn't exist, then feeds it to Recon + Hunter for targeted security analysis.
77
89
0i. If arguments contain `--dry-run`: strip it and set `DRY_RUN_MODE=true`. Forces `FIX_MODE=true`. In dry-run mode, Phase 2 builds the fix plan and the Fixer reads code and outputs planned changes as unified diff previews, but no file edits, git commits, or lock acquisition occur. Produces `fix-report.json` with `"dry_run": true`.
90
+
0j. If arguments contain `--preview`: strip it, set `DRY_RUN_MODE=true`, and force `FIX_MODE=true`. Treat it as a memorable alias for `--fix --dry-run`.
91
+
0k. If arguments contain `--plan-only`: strip it and set `PLAN_ONLY_MODE=true`. The pipeline still scans, verifies, and builds `fix-strategy.json` + `fix-plan.json`, but it stops before the Fixer edits code.
92
+
0l. If arguments contain `--plan`: strip it and set `PLAN_ONLY_MODE=true`. Treat it as a memorable alias for `--plan-only`.
93
+
0m. If arguments contain `--review-pr`: strip it and treat it as `--pr current`.
94
+
0n. If arguments contain `--pr` with no selector after it, treat it as `--pr current`.
95
+
0o. If arguments contain `--last-pr`: strip it and treat it as `--pr recent`.
96
+
0p. If arguments contain `--review`: strip it and set `FIX_MODE=false`. Treat it as a memorable alias for `--scan-only`.
97
+
0q. If arguments contain `--safe`: strip it, set `FIX_MODE=true`, and set `APPROVE_MODE=true`. Treat it as a memorable alias for `--fix --approve`.
98
+
0r. If arguments contain `--pr-security`: strip it, set `PR_SECURITY_MODE=true`, force `DEP_SCAN=true`, force `THREAT_MODEL_MODE=true`, force `FIX_MODE=false`, and if no explicit `--pr` selector was provided treat it as `--pr current`.
99
+
0s. If arguments contain `--security-review`: strip it, set `SECURITY_REVIEW_MODE=true`, force `DEP_SCAN=true`, force `THREAT_MODEL_MODE=true`, and force `FIX_MODE=false`.
100
+
0t. If arguments contain `--validate-security`: strip it and set `VALIDATE_SECURITY_MODE=true`.
101
+
102
+
1. If arguments contain `--pr <selector>`: this is **PR review mode**.
103
+
- Valid selectors: `current`, `recent`, or a PR number like `123`.
104
+
- If `--base <base-branch>` is present, pass it through for current-branch git fallback.
- If it fails, report the error to the user and stop.
110
+
- Save the JSON result to `.bug-hunter/pr-scope.json`for later reporting.
111
+
- Use `changedFiles` from the JSON output as the scan target (scan full file contents, not just the diff).
78
112
79
-
1. If arguments contain `--staged`: this is **staged file mode**.
113
+
2. If arguments contain `--staged`: this is **staged file mode**.
80
114
- Run `git diff --cached --name-only` using the Bash tool to get the list of staged files.
81
115
- If the command fails, report the error to the user and stop.
82
116
- If no files are staged, tell the user there are no staged changes to scan and stop.
83
117
- The scan target is the list of staged files (scan their full contents, not just the diff).
84
118
85
-
2. If arguments contain `-b <branch>`: this is **branch diff mode**.
119
+
3. If arguments contain `-b <branch>`: this is **branch diff mode**.
86
120
- Extract the branch name after `-b`.
87
121
- If `--base <base-branch>` is also present, use that as the base branch. Otherwise default to `main`.
88
122
- Run `git diff --name-only <base>...<branch>` using the Bash tool to get the list of changed files.
89
123
- If the command fails (e.g. branch not found), report the error to the user and stop.
90
124
- If no files changed, tell the user there are no changes to scan and stop.
91
125
- The scan target is the list of changed files (scan their full contents, not just the diff).
92
126
93
-
3. If arguments do NOT contain `-b` or `--staged`: treat the entire argument string as a **path target** (file or directory). If empty, scan the current working directory.
127
+
4. If arguments do NOT contain `--pr`, `-b`, or `--staged`: treat the entire argument string as a **path target** (file or directory). If empty, scan the current working directory.
94
128
95
-
**After resolving the file list (for modes 1and 2), filter out non-source files:**
129
+
**After resolving the file list (for modes 1, 2, and 3), filter out non-source files:**
96
130
97
131
Remove any files matching these patterns — they are not scannable source code:
98
132
- Docs/text: `*.md`, `*.txt`, `*.rst`, `*.adoc`
@@ -169,7 +203,7 @@ Before doing anything else, verify the environment:
169
203
170
204
5. **Verify helper scripts exist**:
171
205
```
172
-
ls "$SKILL_DIR/scripts/run-bug-hunter.cjs" "$SKILL_DIR/scripts/bug-hunter-state.cjs" "$SKILL_DIR/scripts/delta-mode.cjs" "$SKILL_DIR/scripts/payload-guard.cjs" "$SKILL_DIR/scripts/fix-lock.cjs" "$SKILL_DIR/scripts/triage.cjs" "$SKILL_DIR/scripts/doc-lookup.cjs"
206
+
ls "$SKILL_DIR/scripts/run-bug-hunter.cjs" "$SKILL_DIR/scripts/bug-hunter-state.cjs" "$SKILL_DIR/scripts/delta-mode.cjs" "$SKILL_DIR/scripts/payload-guard.cjs" "$SKILL_DIR/scripts/fix-lock.cjs" "$SKILL_DIR/scripts/triage.cjs" "$SKILL_DIR/scripts/doc-lookup.cjs" "$SKILL_DIR/scripts/pr-scope.cjs"
173
207
```
174
208
If any are missing, stop and tell the user to update/reinstall the skill.
175
209
Note: `code-index.cjs` is optional — enables cross-domain dependency analysis for boundary audits in large-codebase mode, but the pipeline works fully without it.
@@ -249,10 +283,10 @@ Before doing anything else, verify the environment:
249
283
250
284
### Step 1: Parse arguments, resolve target, and run triage
251
285
252
-
Follow the rules in the **Target** section above. If in branch diff or staged mode, run the appropriate git command now, collect the file list, and apply the filter.
286
+
Follow the rules in the **Target** section above. If in PR review, branch diff, or staged mode, run the appropriate resolver command now, collect the file list, and apply the filter.
### Step 1b: Generate threat model (if --threat-model)
305
339
306
340
If `THREAT_MODEL_MODE=true`:
307
-
1. Check if `.bug-hunter/threat-model.md` already exists.
341
+
1. Read the bundled local skill `SKILL_DIR/skills/threat-model-generation/SKILL.md` before generating the threat model. This keeps the enterprise security pack end-to-end connected to the main Bug Hunter flow.
342
+
2. Use the bundled skill's Bug Hunter-native artifact conventions (`.bug-hunter/threat-model.md`, `.bug-hunter/security-config.json`).
343
+
344
+
3. Check if `.bug-hunter/threat-model.md` already exists.
308
345
- If it exists and was modified within the last 90 days: use it as-is. Set `THREAT_MODEL_AVAILABLE=true`.
309
346
- If it exists but is >90 days old: warn user ("Threat model is N days old — regenerating"), regenerate.
310
347
- If it doesn't exist: generate it.
@@ -321,7 +358,10 @@ If `THREAT_MODEL_MODE=false` but `.bug-hunter/threat-model.md` exists:
321
358
322
359
### Step 1c: Dependency scan (if --deps)
323
360
324
-
If `DEP_SCAN=true`:
361
+
If `DEP_SCAN=true` or `SECURITY_REVIEW_MODE=true` or `PR_SECURITY_MODE=true`:
362
+
- Read the bundled local skill `SKILL_DIR/skills/security-review/SKILL.md` when running the broader enterprise security workflow.
@@ -335,15 +375,23 @@ If `.bug-hunter/dep-findings.json` exists with REACHABLE findings, include them
335
375
336
376
### Step 2: Read prompt files on demand (context efficiency)
337
377
378
+
**Security-pack routing:**
379
+
- If `PR_SECURITY_MODE=true`, read `SKILL_DIR/skills/commit-security-scan/SKILL.md` before the normal PR-review scan.
380
+
- If `SECURITY_REVIEW_MODE=true`, read `SKILL_DIR/skills/security-review/SKILL.md` before the broader security audit flow.
381
+
- If `VALIDATE_SECURITY_MODE=true`, read `SKILL_DIR/skills/vulnerability-validation/SKILL.md` before finalizing confirmed security findings.
382
+
338
383
**MANDATORY**: You MUST read prompt files using the Read tool before passing them to subagents or executing them yourself. Do NOT skip this or act from memory. Use the absolute SKILL_DIR path resolved in Step 0.
339
384
340
385
**Load only what you need for each phase — do NOT read all files upfront:**
341
386
342
387
| Phase | Read These Files |
343
388
|-------|-----------------|
344
-
| Threat Model (Step 1b) |`prompts/threat-model.md` (only if THREAT_MODEL_MODE=true) |
389
+
| PR security review |`skills/commit-security-scan/SKILL.md` (if `PR_SECURITY_MODE=true` or the user asks for PR-focused security review) |
390
+
| Security review |`skills/security-review/SKILL.md` (if `SECURITY_REVIEW_MODE=true` or the user asks for an enterprise/full security audit) |
391
+
| Threat Model (Step 1b) |`skills/threat-model-generation/SKILL.md` + `prompts/threat-model.md` (only if THREAT_MODEL_MODE=true) |
345
392
| Recon (Step 4) |`prompts/recon.md` (skip for single-file mode) |
0 commit comments