Langsung ke konten
Skillpedia
Keamanan8.0k · #12688

implement-patch

Fungsinya

Memandu perbaikan untuk satu bug yang sudah dikonfirmasi di basis kode lokal, dari aturan yang dilanggar hingga tes dan satu commit. Skill ini untuk developer dan peninjau yang sudah tahu bug itu nyata.

Kapan dipakai

  • ✓Saat bug yang sudah dikonfirmasi di proyek lokal perlu diperbaiki dengan benar.
  • ✓Saat developer perlu mencari tempat lain yang melanggar aturan yang sama.
  • ✓Saat tim menginginkan satu commit dengan tes regresi untuk bug yang sudah dikonfirmasi.

Link skill

https://github.com/trailofbits/skills/blob/main/plugins/patching-bugs/skills/implement-patch/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/trailofbits/skills/blob/main/plugins/patching-bugs/skills/implement-patch/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit →

Contoh permintaan ke AI

“Bug ini sudah dikonfirmasi. Perbaiki aturan yang mendasarinya, tambahkan tes regresi, dan buat satu commit.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Skill ini memeriksa temuan yang tersimpan terlebih dahulu, lalu mengidentifikasi aturan yang dilanggar dan mencari setiap contoh masalah yang sama. Skill ini menulis tes yang gagal sebelum perbaikan, membuat perubahan terkecil yang mudah ditinjau, dan menjalankan ulang suite.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Implement Patch

When to Use

Use after independent validation confirms one claim. Read the record contract. Before target commands, follow its project guidance.

When NOT to Use

Do not use for speculative bug hunting, proof of a completed patch, or a change that cannot be exercised by the local compiler or runtime.

Procedure

  1. Before editing, run uv run --no-project <script> check --before-repair <run-dir> with the record validator. If this check fails, stop and return its errors for an INCONCLUSIVE report. The gate requires finding.repair_scope with a usable case plan and a consistent attempt count. Use the declared scope as the repair brief. Identify the broken invariant and search within its boundary for every instance of the same violation. Read the threat model only to preserve intended behavior; it is not a gate.

  2. Run the project's existing suite and record its results. Write a regression test that fails on the baseline for the named bug and any fixed variant. Observe the failure. Fix the invariant within the repair brief with the smallest reviewable change.

  3. Run the regression test and full existing suite again. Compare before and after failures. Fix new failures or explain a pre-existing one from receipts.

  4. Record every variant as fixed or not_fixed with a reason. Produce exactly one local commit. Never push or open a PR. From the baseline, write fix.patch for production changes and tests.patch for test changes in patch/attempt-N/.

  5. Write patch.json with the two commit SHAs, changed-file and line counts, variants, suite results, and your agent identity. If the attempt produced no commit, record patch_commit: null and return it as failed. Manifest the entire attempt directory, including both patch files and the record, using uv run --no-project <script> manifest <patch-attempt-dir>. Check it with the record validator.

    Patch record schema:

{
  "schema_version": 1,
  "attempt": 1,
  "baseline_commit": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "patch_commit": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
  "files_changed": 2,
  "lines_added": 3,
  "lines_removed": 1,
  "variants": [],
  "suite_before": {"command": "pytest", "passed": 9, "failed": 1, "skipped": 0},
  "suite_after": {"command": "pytest", "passed": 10, "failed": 0, "skipped": 0},
  "agent": "patcher-1"
}

Rationalizations to Reject

Shortcut Required action
Only the reported line matters. Search for the same invariant violation.
Minimal means the fewest lines. Make the smallest reviewable invariant-level fix.
Tests pass after the patch. Show the regression test failed before it.
Pertanyaan umum

Apakah bisa memperbaiki bug yang hanya saya curigai?

Tidak. Skill ini untuk bug yang sudah dikonfirmasi secara independen.

Apakah hasil tes dibandingkan sebelum dan sesudah?

Ya. Skill ini mencatat hasil sebelum dan sesudah perbaikan untuk menangkap kegagalan baru.

Apakah skill ini menulis commit-nya?

Ya. Skill ini membuat satu commit lokal untuk perbaikan tersebut.

Detail

Deskripsi asli dari pembuat

Use when a confirmed local bug needs an invariant-level fix, variant search, tests, and one local commit.

repo: trailofbits/skills

Popularitas

Bintang GitHub
8.0k
Peringkat
#12688
Lisensi
CC-BY-SA-4.0
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa