patch
하는 일
이 스킬은 검증된 보안 발견 사항 목록을 제안된 코드 변경으로 바꿉니다. 프로젝트에는 직접 적용하지 않습니다. 검토할 수 있는 수정 제안을 원하는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓검증된 보안 발견 사항 목록이 있고 수정안을 원할 때.
- ✓가장 심각한 발견 사항에만 수정을 한정하고 싶을 때.
- ✓수정 제안을 자동으로 적용하지 않고 사람의 검토를 위해 저장하고 싶을 때.
스킬 링크
https://github.com/anthropics/defending-code-reference-harness/blob/main/.claude/skills/patch/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“분류 목록에 있는 가장 심각한 보안 문제에 대한 수정안을 작성해서 검토할 수 있게 저장해 주실 수 있나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 각 발견 사항마다 수정안을 작성하고, 두 번째 검토 단계가 이를 확인합니다. 결과는 사람이 읽은 뒤 직접 적용할 수 있는 텍스트 diff로 저장됩니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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
자주 묻는 질문
내 코드를 바꾸나요?
아니요. 결과는 검토하고 직접 적용할 수 있는 텍스트 파일일 뿐입니다.
어떤 발견 사항을 수정할지 고를 수 있나요?
네. 상위 발견 사항으로 작업을 제한하거나, ID로 하나만 선택할 수 있습니다.
어떤 파일을 읽나요?
분류 파일, 발견 사항 파일, 사건 파일 또는 파이프라인 결과 폴더를 읽습니다.
상세 정보
작성자의 원본 설명
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".
인기도
- GitHub 스타
- 7.7k
- 순위
- #13103
- 라이선스
- —
- 업데이트
- 2026. 8. 6.
댓글
- …
이 저장소의 다른 스킬
customize
7.7k에이전트가 AI 취약점 탐지 파이프라인에서 대상에 특화된 부분만 새 버그 유형, 언어, 대상에 맞게 고치도록 돕습니다.
dnr-hunt
7.7k에이전트가 경보 없이 웹 로그에서 공격의 흔적을 찾고, 발견한 사건을 정리하도록 돕습니다.
dnr-respond
7.7k에이전트가 보안 경보나 침해 지표 하나를 검토해 공격이 성공했는지, 어디까지 퍼졌는지 확인하도록 돕습니다.
quickstart
7.7k에이전트가 보안 스캔 도구 모음을 짧게 소개하고, 도구 사용법에 대한 질문에 답하도록 돕습니다.