patch
ما الذي تفعله
تحوّل هذه المهارة قائمة من نتائج الأمان المؤكدة إلى تعديلات مقترحة على الكود. لا تطبّقها أبداً على مشروعك. وهي مخصصة للمطورين الذين يريدون اقتراحات إصلاح لمراجعتها.
متى تستخدمها
- ✓عندما تملك قائمة بنتائج أمنية مؤكدة وتريد مسودات إصلاح لها.
- ✓عندما تريد قصر الإصلاحات على أخطر النتائج.
- ✓عندما تريد حفظ مقترحات الإصلاح لمراجعة بشرية بدلاً من تطبيقها تلقائياً.
رابط المهارة
https://github.com/anthropics/defending-code-reference-harness/blob/main/.claude/skills/patch/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“هل يمكنك كتابة مسودات إصلاح لأخطر المشكلات الأمنية في قائمة الفرز لديّ، وحفظها لأراجعها؟”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يكتب الوكيل لكل نتيجة تعديلاً مقترحاً، ويراجعه مراجع ثانٍ. تُحفظ النتائج كفروقات نصية يستطيع الشخص تطبيقها بعد قراءتها.
المحتوى التقني (ملف 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
الأسئلة الشائعة
هل تغيّر المهارة الكود الخاص بي؟
لا. النتيجة ملفات نصية فقط لتراجعها وتطبّقها بنفسك.
هل يمكنني اختيار النتائج التي تُصلح؟
نعم. يمكنك قصر العمل على أهم النتائج، أو على نتيجة واحدة بمعرّفها.
ما الملفات التي تقرؤها المهارة؟
تقرأ ملف فرز، أو ملف نتائج، أو ملف حادثة، أو مجلد نتائج المسار.
التفاصيل
الوصف الأصلي من المؤلف
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
- الترخيص
- —
- آخر تحديث
- 6/8/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
customize
7.7kيساعد وكيلك على تكييف مسار للبحث عن الثغرات الأمنية بالذكاء الاصطناعي مع نوع خطأ أو لغة أو هدف جديد، عبر إعادة كتابة الأجزاء الخاصة فقط.
dnr-hunt
7.7kيساعد وكيلك على البحث في سجلات الويب دون تنبيه مسبق، عن علامات الهجوم، وكتابة تقرير بأي حوادث يجدها.
dnr-respond
7.7kيساعد وكيلك على معالجة تنبيه أمني واحد أو مؤشر واحد، والتحقق من نجاح الهجوم ومدى انتشاره.
quickstart
7.7kيقدم لوكيلك دليلاً قصيراً لمجموعة أدوات فحص أمني، ويجيب عن أسئلة حول طريقة استخدام أدواتها.
مهارات مشابهة
reverse-engineer-anything
422kيساعد وكيلك على فحص التطبيقات والحزم المنشورة من الداخل ليشرح الميزات ويقارن الإصدارات ويرشد إلى إعادة البناء، باستخدام أداة REA.
1password
394kيساعد وكيلك على إعداد واجهة سطر أوامر 1Password وتسجيل الدخول، وقراءة الأسرار أو حقنها دون طباعة قيمها في المحادثة.
healthcheck
394kيساعد وكيلك على تدقيق جهاز OpenClaw أو خادمه أمنيًا، مثل SSH والجدار الناري والتحديثات، ويقترح إصلاحات آمنة قابلة للتراجع.