Corrige bugs locais confirmados implementando reparos em nível de invariante, escrevendo testes de regressão e gerando registros de patch estruturados.
- Estrelas no GitHub
- 8.136
- Arquivos
- 1
- Último commit
- 11 de nov. de 2026
- Licença
- CC-BY-SA-4.0
- Ferramentas permitidas
- —
O que a skill implement-patch faz?
implement-patch é uma Agent Skill. Corrige bugs locais confirmados implementando reparos em nível de invariante, escrevendo testes de regressão e gerando registros de patch estruturados.
Resumo gerado a partir do SKILL.md da skill.
Sobre a skill implement-patch
Reparar bugs locais confirmados por meio de correções em nível de invariante e testes de regressão é a função principal desta skill. Desenvolvedores a utilizam quando um bug já foi validado de forma independente e requer um processo de reparo estruturado em vez de uma busca especulativa. O agente segue um procedimento rigoroso que começa executando uma verificação com o record validator usando uv run para garantir que o escopo do reparo e o plano de caso sejam utilizáveis.
Assim que a invariante quebrada é identificada, o agente busca todas as instâncias da violação dentro de seu limite. Ele escreve um teste de regressão que falha na baseline antes de aplicar a menor alteração revisável para corrigir a invariante. O processo é concluído gerando dois arquivos específicos, fix.patch e tests.patch, dentro de um diretório de patch. Por fim, o agente produz um registro patch.json contendo SHAs de commit, estatísticas de arquivos e resultados da suíte, que é então manifestado usando o comando manifest e verificado com o record validator.
O que um agente pode fazer com ela
- 1Correção de bugs locais validadosAplique um reparo em nível de invariante a um bug que já foi confirmado por meio de validação independente.
- 2Criação de testes de regressãoDesenvolva um novo teste que falhe na baseline atual para garantir que o bug e suas variantes sejam tratados.
- 3Geração de registros de patch estruturadosProduza um arquivo patch.json contendo detalhes do commit, contagem de linhas alteradas e resultados da suíte de testes.
- 4Busca por violações de invarianteIdentifique cada instância de uma violação específica dentro dos limites de uma invariante quebrada.
Escrito a partir do SKILL.md da skill. Cada caso de uso é verificado com uma citação dele.
Como instalar a skill implement-patch
Cada comando copia a pasta da skill para o diretório de skills do cliente. Reinicie o cliente ou inicie uma nova sessão para carregá-la.Instalar a skill implement-patch no Plugin
/plugin marketplace add trailofbits/skills /plugin install patching-bugs@trailofbits
Instalar a skill implement-patch no Claude Code
~/.claude/skills/implement-patch/SKILL.md
$ npx degit trailofbits/skills/plugins/patching-bugs/skills/implement-patch ~/.claude/skills/implement-patchInstalar a skill implement-patch no Claude Code (project)
.claude/skills/implement-patch/SKILL.md
$ npx degit trailofbits/skills/plugins/patching-bugs/skills/implement-patch .claude/skills/implement-patchInstalar a skill implement-patch no Codex
~/.agents/skills/implement-patch/SKILL.md
$ npx degit trailofbits/skills/plugins/patching-bugs/skills/implement-patch ~/.agents/skills/implement-patchInstalar a skill implement-patch no Gemini CLI
~/.gemini/skills/implement-patch/SKILL.md
$ npx degit trailofbits/skills/plugins/patching-bugs/skills/implement-patch ~/.gemini/skills/implement-patchInstalar a skill implement-patch no Claude.ai
npx degit trailofbits/skills/plugins/patching-bugs/skills/implement-patch implement-patch && zip -r implement-patch.zip implement-patch # claude.ai → Customize → Skills → + → Create skill → Upload a skill → implement-patch.zip
Verificações automatizadas
Executado em 14 de nov. de 2026Relatório completo →Passou nas nossas verificações automáticas. Não é uma auditoria de segurança: leia os scripts antes de deixar um agente executá-los. Como as verificações funcionam
- Repositório de origem vinculado e acessíveltrailofbits/skills/plugins/patching-bugs/skills/implement-patch is public and reachablegithub.com/trailofbits/skills/tree/HEAD/plugins/patching-bug ↗Passou
- Licença de código aberto (OSI)CC-BY-SA-4.0 is not OSI-approvedspdx.org/licenses/CC-BY-SA-4.0.html ↗Problema encontrado
- Commit ou release no último anoLast commit 2026-11-11github.com/trailofbits/skills/commits ↗Passou
- Sem baixar e executar nem roubo de credenciais nos scriptsNo scripts in the skill folderPassou
- Sem instruções ocultas no SKILL.mdNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/trailofbits/skills/blob/HEAD/plugins/patching-bug ↗Passou
- Ferramentas pré-aprovadas são restritasNo pre-approved tools; the agent asks before using onegithub.com/trailofbits/skills/blob/HEAD/plugins/patching-bug ↗Passou
SKILL.md
Ver no GitHubImplement 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
-
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 requiresfinding.repair_scopewith 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. -
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.
-
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.
-
Record every variant as
fixedornot_fixedwith a reason. Produce exactly one local commit. Never push or open a PR. From the baseline, writefix.patchfor production changes andtests.patchfor test changes inpatch/attempt-N/. -
Write
patch.jsonwith the two commit SHAs, changed-file and line counts, variants, suite results, and your agent identity. If the attempt produced no commit, recordpatch_commit: nulland return it as failed. Manifest the entire attempt directory, including both patch files and the record, usinguv run --no-project <script> manifest <patch-attempt-dir>. Check it with the record validator.
{
"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. |
Arquivos desta skill
1Perguntas sobre a skill implement-patch
Como instalo a skill implement-patch no Claude Code?
Execute npx degit trailofbits/skills/plugins/patching-bugs/skills/implement-patch ~/.claude/skills/implement-patch. O Claude Code carrega skills de ~/.claude/skills (todos os projetos) ou .claude/skills (um projeto) e usa uma skill quando a descrição dela corresponde à tarefa.
Quais clientes podem usar a skill implement-patch?
Qualquer cliente que leia o formato Agent Skills: Claude Code, Codex, Gemini CLI e claude.ai (envie como ZIP). Scripts da skill são executados apenas onde o cliente permite execução de código.
Quando devo usar a skill implement-patch?
Use esta skill após uma validação independente confirmar um bug e você precisar realizar um reparo em nível de invariante, buscar variantes e criar um commit local.
Posso usar esta skill para busca especulativa de bugs?
Não, a skill não deve ser usada para busca especulativa de bugs ou para provar que um patch foi concluído.
O que devo fazer se a verificação inicial do record validator falhar?
Se a verificação falhar, você deve parar e retornar os erros como um relatório INCONCLUSIVE.
Devo enviar minhas alterações para um repositório remoto?
Não, você deve produzir exatamente um commit local e nunca fazer push ou abrir um pull request.