patch
What it does
This skill turns a list of checked security findings into proposed code changes. It never applies them to your project. It is for developers who want fix suggestions to review.
When to use it
- ✓When you have a list of verified security findings and want draft fixes.
- ✓When you want to limit fixes to the most severe findings.
- ✓When you want fix proposals saved for human review rather than applied automatically.
Skill link
https://github.com/anthropics/defending-code-reference-harness/blob/main/.claude/skills/patch/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Can you draft fixes for the most serious security issues in my triage list and save them for me to review?”
5 new skills a week. 1 minute to read.
How it works
For each finding, the agent writes a proposed change and has a second review check it. The results are saved as text diffs that a person can apply after reading them.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
patch
Third leg of the static pipeline (/vuln-scan → /triage → /patch).
Turns a ranked list of verified findings into candidate diffs.
The skill never applies a diff to the target repo. Output is inert text
in ./PATCHES/ for a human to review and apply out-of-band — see
docs/patching.md#reviewing-generated-patches. There is no --apply or
--approve flag by design: the capability isn't present, so it can't be
prompt-injected into use.
Invoke with /patch <findings-path> [--repo PATH] [--top N] [--id fNNN] [--model M] [--fresh].
Arguments (parse from $ARGUMENTS):
- findings path (first positional, required):
TRIAGE.json,VULN-FINDINGS.json, a pipelineresults/<target>/<ts>/directory, or any JSON the/triageingest table recognizes. --repo PATH: target codebase, read-only (default cwd). Required for static mode; the skill stops if cited files don't resolve under it.--top N: patch only the N highest-severity true positives (static mode).--id fNNN: patch only the finding with this id.--model M: passed through tovuln-pipeline patchin execution-verified mode. Ignored in static mode (subagents inherit the orchestrator's model).--fresh: ignore./.patch-state/checkpoint and start over.
Tools. Prefer Read, Glob, Grep, Write, Task. Some sessions do not
provision Glob or Grep; allowed-tools is a permission filter, not a loader.
When they are unavailable, fall back to the read-only Bash commands
whitelisted above: rg/grep for search, ls for enumeration,
head/file/wc for sniffing, jq for JSON ingest. Bash is otherwise
permitted only for python3 .claude/skills/_lib/checkpoint.py (state I/O)
and vuln-pipeline patch (execution-verified delegate). find is NOT
permitted.
Write scope. The Write tool may target ONLY paths under ./PATCHES/ and
./.patch-state/. Never write into --repo, never git apply, never
patch, never edit target source. If a step seems to require it, the step is
wrong.
Checkpointing (runs before Phase 0 and after every phase)
State persists to ./.patch-state/ so a fresh /patch session resumes
without re-spawning patch or reviewer subagents. All checkpoint I/O goes
through python3 .claude/skills/_lib/checkpoint.py (atomic, JSON-validated).
The Write→--from pattern keeps repo-derived bytes out of Bash argv; never
pass payload via heredoc or stdin.
State files: progress.json (single source of truth: {"status": "running"|"complete", "phase_done": N, "shards_done": [...]}),
phaseN.json, _chunk.tmp.
Start of run. Bash:
python3 .claude/skills/_lib/checkpoint.py load ./.patch-state
status == "absent"OR"complete", OR--freshin$ARGUMENTS→ fresh start. Bash:python3 .claude/skills/_lib/checkpoint.py reset ./.patch-state, proceed to Phase 0.status == "running"withphase_done == N→ resume. Readphase0.json..phaseN.jsonin order (and anyshard_*.jsonlisted inshards_done), merge into working state, printResuming from checkpoint: Phase N complete, skip to Phase N+1. Do not re-spawn any subagent whose output is already checkpointed.
End of every phase N. Write tool → ./.patch-state/_chunk.tmp with the
phase's JSON, then Bash:
python3 .claude/skills/_lib/checkpoint.py save ./.patch-state <N> <name> --from ./.patch-state/_chunk.tmp
End of run. After writing PATCHES.md and PATCHES.json, Bash:
python3 .claude/skills/_lib/checkpoint.py done ./.patch-state 4
Phase 0: Parse arguments and detect mode
0a. Parse $ARGUMENTS
Extract findings path (first positional), --repo (default .), --top,
--id, --model, --fresh. If no findings path, stop and ask.
0b. Detect mode
Inspect the findings path:
- execution-verified mode when the path is a directory containing
reports/manifest.jsonlORfound_bugs.jsonlORrun_*/result.json(pipeline output) — unless anINCIDENTS.jsonis present anywhere in it: D&R run dirs also containrun_*/result.json, and their incidents route static. The findings have PoC bytes + ASAN traces + reproduction commands; the pipeline's verification ladder applies. - static mode otherwise:
TRIAGE.json,VULN-FINDINGS.json,INCIDENTS.json(the/dnr-*output), generic finding JSON, or markdown. No PoC; the oracle is a fresh-context reviewer.
Record mode in working state. The two modes share Phase 1 ingest then fork
at Phase 2.
**Checkpoi
FAQ
Does it change my code?
No. The output is only text files for you to review and apply yourself.
Can I choose which findings to patch?
Yes. You can limit the work to the top findings or to one finding by its ID.
What files does it read?
It reads a triage file, a findings file, an incident file or a pipeline results folder.
Details
Original description by the author
Generate candidate fixes for verified security findings. Consumes TRIAGE.json (preferred), VULN-FINDINGS.json, INCIDENTS.json, or a vuln-pipeline results directory. Pipeline input is delegated to the execution-verified `vuln-pipeline patch` ladder; static-analysis input gets a per-finding patch subagent + independent reviewer and is written as inert diffs for human review. Writes PATCHES/bug_NN/{patch.diff,patch_result.json}, PATCHES.md, and PATCHES.json. Use when asked to "fix the findings", "patch these vulns", "generate fixes", or "close the loop on triage".
Popularity
- GitHub stars
- 7.7k
- Ranking position
- #13103
- License
- —
- Updated
- 8/6/2026
Comments
- …
More skills from this repository
customize
7.7kHelps your agent adapt an AI vulnerability-finding pipeline to a new bug type, language or target, by rewriting the parts that are specific.
dnr-hunt
7.7kHelps your agent hunt through web logs with no alert in hand, looking for signs of attack and writing up any incidents it finds.
dnr-respond
7.7kHelps your agent work through one security alert or indicator, checking whether an attack worked and how far it reached.
quickstart
7.7kGives your agent a short guide to a security scanning toolkit and answers questions about how to use its tools.
Similar skills
reverse-engineer-anything
422kHelps your agent look inside shipped apps and packages to explain features, compare versions, or guide a rebuild, using the REA tool.
1password
394kHelps your agent set up the 1Password CLI, sign in, and read or inject secrets without printing their values into chat.
healthcheck
394kHelps your agent audit the computer or server that runs OpenClaw for security risks, such as SSH, firewall, updates, and backups, then suggest safe fixes.