patch
Skill này làm gì
Skill này biến danh sách phát hiện bảo mật đã kiểm tra thành các thay đổi code đề xuất. Nó không bao giờ áp dụng chúng vào dự án của bạn. Skill dành cho lập trình viên muốn có gợi ý sửa lỗi để xem lại.
Khi nào nên dùng
- ✓Khi bạn có danh sách phát hiện bảo mật đã xác minh và muốn có bản sửa nháp.
- ✓Khi bạn muốn giới hạn việc sửa chỉ ở những phát hiện nghiêm trọng nhất.
- ✓Khi bạn muốn đề xuất sửa được lưu để người xem xét, thay vì tự động áp dụng.
Liên kết skill
https://github.com/anthropics/defending-code-reference-harness/blob/main/.claude/skills/patch/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Bạn có thể soạn bản sửa cho các vấn đề bảo mật nghiêm trọng nhất trong danh sách phân loại của tôi và lưu để tôi xem lại không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Với mỗi phát hiện, agent viết một thay đổi đề xuất và một người rà soát thứ hai kiểm tra lại. Kết quả được lưu dưới dạng diff văn bản để một người có thể đọc rồi tự áp dụng.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
Câu hỏi thường gặp
Nó có thay đổi code của tôi không?
Không. Kết quả chỉ là file văn bản để bạn xem lại và tự áp dụng.
Tôi có thể chọn phát hiện nào để sửa không?
Có. Bạn có thể giới hạn công việc ở các phát hiện hàng đầu hoặc một phát hiện theo ID.
Nó đọc những file nào?
Nó đọc một file phân loại, file phát hiện, file sự cố hoặc thư mục kết quả pipeline.
Chi tiết
Mô tả gốc của tác giả
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".
Độ phổ biến
- Sao GitHub
- 7.7k
- Vị trí xếp hạng
- #13103
- Giấy phép
- —
- Cập nhật
- 6/8/2026
Bình luận
- …
Thêm skill từ kho mã này
customize
7.7kGiúp agent của bạn điều chỉnh một pipeline tìm lỗ hổng bảo mật bằng AI cho loại lỗi, ngôn ngữ hoặc mục tiêu mới, bằng cách viết lại các phần đặc thù.
dnr-hunt
7.7kGiúp agent của bạn săn tìm trong log web khi chưa có cảnh báo nào, tìm dấu hiệu tấn công và ghi lại các sự cố phát hiện được.
dnr-respond
7.7kGiúp agent của bạn xử lý một cảnh báo hoặc dấu hiệu bảo mật, kiểm tra cuộc tấn công có thành công không và đã lan rộng đến đâu.
quickstart
7.7kCho agent của bạn một hướng dẫn ngắn về bộ công cụ quét bảo mật và trả lời các câu hỏi về cách dùng những công cụ đó.
Skill tương tự
reverse-engineer-anything
422kGiúp agent của bạn xem bên trong các app và package đã phát hành để giải thích tính năng, so sánh phiên bản hoặc hướng dẫn dựng lại bằng công cụ REA.
1password
394kGiúp agent của bạn cài đặt CLI của 1Password, đăng nhập, và đọc hoặc đưa thông tin bí mật vào mà không in giá trị ra cuộc trò chuyện.
healthcheck
394kGiúp agent của bạn rà soát bảo mật máy tính hoặc máy chủ đang chạy OpenClaw, như SSH, tường lửa, cập nhật và sao lưu, rồi đề xuất cách sửa an toàn.