agentleFS
phant0umphant0um/claude-skills/skills/simplify-code/SKILL.md

simplify-code

Skill0 starsChanged 19 days agoMITView on GitHub

Use when: unidade de trabalho de código fechou (antes de review, commit ou handoff) e o diff tem 10 ou mais linhas substantivas; refino em 3 eixos com verificação de comportamento. Rubrica 5E com veredito SHIP/REFACTOR é code-optimize; revisão de diff é code-review.

40 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use document-to-action-items, competitor-news-monitor and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • Samin12Skill

    document-to-action-items

    Extract cited obligations, deadlines, tasks from documents.

    Also in 7 projects that use this

  • Samin12Skill

    competitor-news-monitor

    Watch named companies for material news; cited digests.

    Also in 7 projects that use this

  • nobodyohm-webSkill

    blocked-page-recovery

    Recover blocked/paywalled/WAF'd pages via fallbacks.

    Also in 7 projects that use this

  • jabbott-iiiSkill

    build-course

    Build a complete course from a short description: syllabus, objectives, Markdown readings, interactive Jupyter labs, LaTeX problem sets, exams, and answer keys.

    Also in 3 projects that use this

  • jabbott-iiiSkill

    build-language-packs

    Translate an app's user-facing text into Mandarin Chinese, Hindi, Spanish, Arabic, French, Bengali, Portuguese, Indonesian, and Urdu, as checked language packs.

    Also in 3 projects that use this

  • michaellam26Skill

    sdlc-review

    Trigger stage-specific reviews for an SDLC project and save results to reviews/

    Also in 5 projects that use this

  • +5 more from jabbott-iii

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 39 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Verify SEMPRE antes de declarar pronto (Karpathy #4).

    line 77
  2. Distinctive:

    Verify-proof cita saída real do comando (verifier-setup: artefato de prova > afirmação).

    line 78

“Common” is measured: kept by at least 6 in 10 of the 39 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Simplify Code

Refino de código no boundary. 3 reviewers paralelos + verificação que preserva comportamento. Corta complexidade sem quebrar nada.

Quando rodar (completion-boundary)

Rodar quando unidade coerente de trabalho fecha — antes de review, commit, ou handoff. NÃO a cada edit (briga com trabalho em andamento).

Hard-gates — PULAR (não é inferência, é regra):

  • Mudança só-docs / só-markdown
  • Diff mecânico (format, lint, deps, lockfile)
  • Arquivos gerados / vendored
  • Código marcado explícito "keep as-is"
  • < ~10 linhas substantivas de código (piso; 30 p/ mudanças grandes)

Se cair em gate → não rodar, dizer por quê em 1 linha.

Steps

  1. Delimitar o diff. Identificar só o código recém-alterado (git diff, ou escopo explícito). NÃO varrer o repo inteiro.
  2. 3 reviewers em paralelo (subagents — 1 por eixo, contexto isolado, retorno ≤ síntese curta):
    • Reuse — duplicação, código que já existe no projeto, abstração faltando
    • Quality — clareza, nomes, edge cases não tratados, complexidade acidental, shallow modules (deletion test: interface ~tão complexa quanto impl → deletar concentra ou só move complexidade? só move = candidato a deepening)
    • Efficiency — trabalho redundante, N+1, alocação desnecessária, hot-path Cada um retorna: findings ranqueados (critical/warning/nit) + fix concreto.
  3. Aplicar fixes dos critical + warning. Nits só se baratos.
  4. Verificar preservação de comportamento (obrigatório, por construção):
    • typecheck passa
    • lint passa
    • testes no escopo passam
    • NÃO enfraquecer testes/tipos, NÃO remover safety check pra "simplificar" Se verify falha → reverter o fix que quebrou, reportar.

Output Format

## Simplify — <escopo>

### Aplicado
- [arquivo:linha] [eixo] — <mudança> → <por quê>

### Verify (proof — saída real, não afirmação)
- `<comando rodado>` → `<saída: N passed / 0 errors>` (cita resultado real do comando, nunca "✅" sem ter rodado)
- typecheck / lint / testes no escopo

### Não aplicado (proposto, decisão tua)
- [arquivo:linha] — <sugestão> (motivo de não aplicar auto)

Modo report (diagnóstico sem aplicar)

Invocação simplify-code --report (ou chamada por outra skill pedindo diagnóstico): rodar só passos 1-2 (delimitar diff + 3 reviewers paralelos). NÃO aplicar fixes (pula 3-4), NÃO rodar verify. Retorna findings ranqueados (critical/warning/nit) por eixo, cada um com fix proposto — quem chamou decide aplicar. Usado por pipeline-ads etapa 3 (review report-only, apply fica na etapa 4).

Constraints

  • NÃO rodar a cada edit — só em boundary (unidade fechada).
  • NÃO refatorar fora do diff recente. Escopo = mudança, não repo.
  • NÃO enfraquecer testes ou tipos pra passar verify. Preservação de comportamento é invariante.
  • NÃO remover safety checks, validações, ou tratamento de erro em nome de "simplicidade".
  • NÃO rodar se cair em hard-gate. Reportar o gate.
  • Verify SEMPRE antes de declarar pronto (Karpathy #4). Sem verify = incompleto.
  • Verify-proof cita saída real do comando (verifier-setup: artefato de prova > afirmação). "Passou ✅" sem output rodado é alegação, não verificação.
  • Modo default: oferecer antes de rodar. Auto-run só se usuário pedir explícito.

Anti-racionalização (não pular verify por desculpa)

Desculpa comumContra
"código já roda, não precisa verify"Rodar ≠ comportamento preservado após refactor. Verify é invariante (Karpathy #4).
"sem tempo pra testar"Sem verify = incompleto, não "pronto sem testes". Reporta cobertura parcial, não pula.
"esse fix é óbvio/seguro"Fix óbvio quebra teste tanto quanto fix complexo. Roda typecheck+lint mesmo assim.
"enfraquecer o teste simplifica"Nunca. Enfraquecer teste/tipo pra passar é violação de invariante, não simplificação.

Edge Cases

  • Sem suite de testes: rodar typecheck+lint; avisar que cobertura comportamental é parcial.
  • Diff enorme (>30 arquivos): subir piso, focar nos arquivos com mais lógica nova, avisar escopo reduzido.
  • Projeto FIAP/Java: encaixa como etapa do pipeline-ads (refatoração cirúrgica). Pode ser chamada standalone ou dentro do pipeline.

Linhagem

  • Upstream: ce-simplify-code (Every Inc / compound-engineering) — completion-boundary automation + 3 reviewers paralelos + verify by construction.
  • Original (vault): hard-gates (docs/mecânico/gerado/<10 ln), piso adaptativo por tamanho de diff, deletion-test no eixo quality (Pocock), tabela anti-racionalização (addyosmani/agent-skills), verify-proof (AI-Builder-Club/verifier-setup: artefato de prova), modo "oferecer antes".
  • Critério: mecanismo > autor. Fonte rastreável, não privilegiada. Alinhado a Karpathy 4P.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.