Pular para o conteúdo
Skillpedia
Segurança6,5 mil · #13900

patcher-overview

O que ela faz

Esta skill orienta um agente que corrige problemas de segurança confirmados com mudanças mínimas no código e depois executa uma verificação novamente. Ela é para desenvolvedores do pipeline de segurança Decepticon.

Quando usar

  • ✓Quando um scanner de segurança confirmou uma falha e ela precisa de uma correção pequena e focada.
  • ✓Quando você quer que uma correção proposta seja testada novamente antes de ser marcada como concluída.
  • ✓Quando uma correção causou uma regressão e precisa ser revertida e tentada de novo.

Link da skill

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/plugins/patcher/SKILL.md

Copie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.

Como usar

O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.

Mensagem pronta para colar

Use esta skill para me ajudar: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/plugins/patcher/SKILL.md Leia o arquivo SKILL.md desse link e siga as instruções dele na minha tarefa.
Quer que a sua IA encontre skills como esta sozinha?Instale o MCP grátis do Skillpedia: uma linha, e ela pesquisa entre 15.000+ skills antes de cada tarefa.Instalar em 1 minuto →

Exemplo do que pedir para a IA

“Confirmamos uma SQL injection na nossa página de busca. Você pode escrever a menor correção possível e verificar se ela funciona?”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

O agente lê o código ao redor de cada falha, propõe uma mudança mínima que usa um método seguro, aplica a mudança e executa de novo a prova de conceito e os testes antes de aceitá-la.

Conteúdo técnico (SKILL.md original)

Texto original do autor, em inglês, direto do GitHub.

Patcher Skill

You fix validated findings and prove the fix holds. Minimal diffs, one concern at a time, mandatory patch_verify before claiming done.

Iteration loop

while not patched and attempts < 3:
    1. kg_query(kind="vulnerability", min_severity="medium")
       → pick validated=True, patched!=True
    2. Read the function around (file, line)
    3. Design minimal fix (validate / escape / parameterize / safe API)
    4. patch_propose(vuln_id, diff, commit_message) → patch_id
    5. Apply diff via Edit or bash patch
    6. (optional) bash: run repo tests, abort on failure
    7. patch_verify(patch_id, poc_command, success_patterns,
                    test_cmd=optional)
    8. if status == "verified": done
       elif status == "tests_failed": revert, retry
       elif status == "regressed": revert, analyze, retry
    attempts += 1

Diff style

  • Unified diff. Use git diff --no-color output or write one by hand.
  • Minimal hunk. One concern. No formatting. No renames. No "while I'm here" cleanups. No new files (unless adding one regression test).
  • Safe-API preference.
Bug class Preferred fix
SQL injection Parameterized query / ORM.filter(), NOT escaping
Command injection Arg-list subprocess, shell=False
Path traversal os.path.realpath + prefix check
SSRF Allowlist + resolve → check not private/loopback
Deserialization Switch to safe loader (yaml.safe_load, JSON, etc.)
Broken auth Move check to pre-hook, not inside handler
Reflected XSS Framework auto-escape, remove Markup/safe
  • Add a regression test in the same diff when the repo has a test directory for the affected module. One test that exercises the fixed path is sufficient.

Commit message format

Conventional commits. Example:

fix(auth): use constant-time comparison in verify_hmac

Prevents timing side-channel recovery of the HMAC. CWE-208.

Decisive-completion rule

Only report "patched" after patch_verify.status == "verified". A green test suite is NOT sufficient — the PoC must actually fail.

If all 3 attempts fail, STOP on the finding, record a note via kg_add_node on the vuln (patch_attempts=3, last_failure=...) and return to the orchestrator. Do not spiral.

Perguntas frequentes

Ele reescreve arquivos inteiros?

Não. Ele trabalha em uma preocupação por vez, com mudanças mínimas e sem limpezas não relacionadas.

Qual é a correção preferida para SQL injection?

Usar uma consulta parametrizada ou um filtro de ORM, em vez de escapar a entrada manualmente.

O que acontece se um teste falhar?

O agente reverte a mudança, analisa o resultado e tenta de novo, em até três tentativas.

Detalhes

Descrição original do autor

Stage 4 patch generation playbook. Minimal diffs for validated findings with mandatory patch_verify. Load at patcher-agent startup.

repo: BitterSecurity/Decepticon

Popularidade

Estrelas no GitHub
6,5 mil
Posição no ranking
#13900
Licença
Apache-2.0
Atualizada em
01/11/2026

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas