본문으로 건너뛰기
Skillpedia
보안8.0k · #12688

implement-patch

하는 일

로컬 코드베이스에서 이미 확인된 버그 하나를 깨진 규칙부터 테스트, 커밋 하나까지 고치는 과정을 안내합니다. 버그가 실제라는 것을 이미 아는 개발자와 검토자를 위한 것입니다.

사용하는 경우

  • ✓로컬 프로젝트의 확인된 버그를 제대로 고쳐야 할 때.
  • ✓개발자가 같은 규칙을 깨는 다른 곳을 찾아야 할 때.
  • ✓팀이 확인된 버그에 대해 회귀 테스트가 포함된 커밋 하나를 원하는 경우.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/trailofbits/skills/blob/main/plugins/patching-bugs/skills/implement-patch/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 버그는 확인되었습니다. 근본 규칙을 고치고, 회귀 테스트를 추가하고, 커밋 하나를 만들어 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 스킬은 저장된 발견 사항을 먼저 확인한 다음, 깨진 규칙을 찾고 같은 문제의 모든 사례를 찾습니다. 수정 전에 실패하는 테스트를 쓰고, 검토하기 쉬운 가장 작은 변경을 한 다음, 테스트 스위트를 다시 실행합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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.
자주 묻는 질문

의심만 되는 버그도 고칠 수 있나요?

아니요. 이 스킬은 이미 독립적으로 확인된 버그를 위한 것입니다.

수정 전후 테스트 결과를 비교하나요?

네. 수정 전후의 결과를 기록해서 새로운 실패를 잡아냅니다.

커밋도 만드나요?

네. 수정을 위해 로컬 커밋 하나를 만듭니다.

상세 정보

작성자의 원본 설명

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

repo: trailofbits/skills

인기도

GitHub 스타
8.0k
순위
#12688
라이선스
CC-BY-SA-4.0
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬