convez.ai
SkillDesenvolvimento WebIntermediário
danhuaxiansheng

Claude Code Cleanup Skills

danhuaxiansheng/claude-code-cleanup-skills

Auditoria profunda de código desnecessário e simplificação de fluxos

Ver no GitHub
InicialPluginScore · de 0 a 100

Conjunto de três skills para agentes de código que identifica e remove código desnecessário além de simples análises de referências. Detecta wrappers sem propósito, camadas de compatibilidade obsoletas, branches defensivas e APIs públicas desatualizadas, oferecendo evidências para decisões de limpeza segura.

Instalação

$npx convez-ai danhuaxiansheng/claude-code-cleanup-skills

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
1
Forks
0
Acompanhando
0
Saúde
42%
Último commit
há 5 meses
Versão
—
Issues abertas
0
Contribuidores
1

Casos de uso

  • Identificar código morto que ferramentas padrão não detectam
  • Validar se código chamado é realmente necessário
  • Auditar fluxos de página e estado para duplicação
  • Remover wrappers, compatibilidade legada e branches defensivas

Veredito

Skills maduras e bem documentadas que vão além de análises superficiais de código morto. Ideal para equipes que querem limpeza agressiva mas segura, preservando estados reais e restrições de runtime. Requer análise cuidadosa das sugestões, não é totalmente automatizável.

README

A tradução para o português deste README ainda está na fila.

Claude Code Cleanup Skills

Agent Skills for code cleanup, dead-code audits, necessary-code review, and page-flow simplification.

Most dead-code checks stop at "has zero references." Real cleanup often starts after that: wrappers that only forward calls, compatibility APIs kept for history, defensive branches that hide impossible states, stale defaults, duplicate state sources, and public surfaces nobody should depend on anymore.

This repository provides three small skills that help any AI coding agent and any human reviewer make those calls with evidence.

Why Use This

Use these skills when you ask questions like:

  • "Does this module really need to exist?"
  • "This code is still called, but is it still necessary?"
  • "Remove defensive code and meaningless wrappers."
  • "Ignore backward compatibility for this cleanup."
  • "Continue deep cleanup until the flow is simple."
  • "Find what a normal unused-code audit would miss."

The Three-Skill System

necessary-code-audit is the main entrypoint.

It decides whether current code truly needs a file, export, wrapper, compatibility layer, fallback, default value, defensive branch, or public API.

unused-code-audit proves consumption.

It checks whether a directory, file, export, function, component, hook, type, or helper is still consumed before deletion.

page-flow-cleanup-audit handles user-visible behavior.

It audits pages and feature flows by tracing state sources, queries, mutations, permissions, errors, duplicated calculations, and defensive code.

What Normal Unused Audits Miss

Normal unused-code tools can say:

This function has callers.
Do not delete it.

These skills ask the next question:

Do those callers actually need this function,
or can they call a simpler existing primitive directly?

That difference catches code like:

  • logoutInvalidator.onLogout() that only calls cache.clear()
  • clearByPrefix() that only exists because a wrapper exists
  • debug config fields that no current caller uses
  • CacheStats APIs that were public once but no longer serve product behavior
  • try/catch blocks that silently hide corrupted state the team wants surfaced
  • page stores and query caches that both claim to own the same remote fact

What It Preserves

These skills are aggressive about meaningless code, but conservative about real constraints.

They should preserve:

  • loading, empty, error, and permission states
  • SSR and browser runtime constraints
  • storage quota and platform availability checks
  • external input boundaries
  • valid nullable domain states
  • deliberate UX fallbacks

Repository Layout

skills/
  necessary-code-audit/
    SKILL.md
    agents/openai.yaml
  unused-code-audit/
    SKILL.md
    agents/openai.yaml
    scripts/find-unused-export-candidates.mjs
  page-flow-cleanup-audit/
    SKILL.md
    agents/openai.yaml
examples/
  used-but-unnecessary-cache-wrapper.md

Installation

# Install all skills
npx add-skill danhuaxiansheng/claude-code-cleanup-skills

# Or install as a plugin collection in Claude Code
/plugin install danhuaxiansheng/claude-code-cleanup-skills

You can also copy the folders under skills/ into any AI tool or coding-agent setup that can read skill-style instruction folders.

The skills are plain Markdown playbooks with optional metadata. They are not tied to one specific AI product.

For Codex-style local installs, copy the specific skill folders you want:

skills/necessary-code-audit/
skills/unused-code-audit/
skills/page-flow-cleanup-audit/

SkillsMP Discovery

This repository follows the common SkillsMP-compatible layout used by public agent-skill collections:

claude-code-cleanup-skills/
├── .claude-plugin/
│   └── marketplace.json
├── skills/
│   ├── necessary-code-audit/
│   │   ├── SKILL.md
│   │   └── agents/openai.yaml
│   ├── unused-code-audit/
│   │   ├── SKILL.md
│   │   ├── agents/openai.yaml
│   │   └── scripts/find-unused-export-candidates.mjs
│   └── page-flow-cleanup-audit/
│       ├── SKILL.md
│       └── agents/openai.yaml
└── README.md

The GitHub repository should stay public and include skill-discovery topics such as:

claude-skills
claude-code-skill
agent-skills
ai-skills
code-cleanup
dead-code
refactoring
technical-debt

SkillsMP indexes public GitHub repositories that expose SKILL.md files with name and description frontmatter. If a newly published skill does not appear immediately, wait for the next index refresh before changing the repository layout.

Example Prompts

Use necessary-code-audit on src/cache.
Do not preserve backward compatibility. Remove wrappers, stale public APIs,
unused config, and defensive branches that current code does not need.
Use unused-code-audit on this component folder before deleting it.
Check imports, re-exports, public entrypoints, framework conventions, and generated files.
Use page-flow-cleanup-audit on this settings page.
Find duplicated state sources, defensive UI guards, stale query invalidation,
and compatibility branches that are no longer needed.
Ver o original no GitHub

Bom para

Relacionados