Logo de Codebase Audit

Codebase Audit

Comunidade
majiayu000
codebase-audit

Auditoria completa de código — análise aprofundada e paralela adaptativa de contratos entre frontend e backend, integridade de dados, tratamento de erros e segurança, arquitetura e dívida técnica, configuração e cache. Gera findings estruturados, validação adversarial e comparação com a linha de base, além de um relatório consolidado ordenado por gravidade e um roteiro de correções. Inclui um modo quick para uma avaliação rápida. Use quando o usuário pedir para auditar, analisar ou revisar uma codebase inteira em busca de problemas de design, encontrar bugs ocultos, verificar a saúde da arquitetura ou disser “revisão completa”, “auditoria de código”, “analisar problemas de design”, “audit codebase”, “health check”, “quais são os problemas” ou “avaliação rápida”. Acione também quando o usuário quiser encontrar degradações silenciosas, pontos de ruptura no fluxo de dados, incompatibilidades de tipos entre frontend e backend ou entender a dívida técnica de um projeto.

Add to TypingMind

Visão geral

Publicado pormajiayu000
Repositóriospellbook
Nome da habilidadecodebase-audit
Estrelas
280
Forks
26
Arquivos incluídos
6
LicençaMIT
Links
  • Instruções em Markdown

    Um arquivo SKILL.md que o modelo carrega sob demanda, consumindo tokens apenas quando uma solicitação é realmente relevante para a habilidade.

  • Funciona com qualquer LLM

    As habilidades de IA são escritas em Markdown simples, não em código específico de um provedor. Por isso, funcionam com GPT, Claude, Gemini, Grok ou um modelo local.

  • Arquivos incluídos: 6

    Scripts, templates e referências que o modelo pode ler enquanto trabalha. Os arquivos são somente para leitura e nunca são executados.

  • Código aberto

    Publicada por majiayu000 no GitHub. Leia os arquivos da habilidade antes de instalá-la.

Instalação

Instale a habilidade de IA Codebase Audit no TypingMind para usá-la com qualquer LLM ou adicione-a a outro agente que leia SKILL.md.

1

Instalar no TypingMind

O TypingMind instala uma habilidade diretamente da pasta dela no GitHub — lê o arquivo SKILL.md, reúne os arquivos de recursos em um pacote e armazena o resultado localmente.

  1. Abra o app e vá para Plugins → Habilidades.
  2. Escolha "Instalar do GitHub".
  3. Cole a URL abaixo, que aponta para a pasta da habilidade, e confirme.
    https://github.com/majiayu000/spellbook/tree/main/skills/codebase-audit
  4. Ative a habilidade em cada chat em que quiser disponibilizá-la.
Plugins → Habilidades → Adicionar habilidade → Via URL do GitHub. Depois, cole a URL da pasta e pressione Continuar.
2

Instalar em outro agente

Qualquer agente que leia o formato Agent Skills pode usar esta habilidade — copie a pasta para o diretório de habilidades desse agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/majiayu000/spellbook.git /tmp/spellbook
mkdir -p .claude/skills
cp -r /tmp/spellbook/skills/codebase-audit .claude/skills/codebase-audit
Reinicie Claude Code após copiar para que a nova habilidade seja reconhecida.

Use no TypingMind

Ative Codebase Audit em qualquer chat do TypingMind e o modelo cuida do resto. O nome e a descrição da habilidade ficam no prompt do sistema e, assim que uma solicitação relevante aparece, o modelo carrega as instruções completas automaticamente — sem precisar de acionamento manual e sem consumir tokens até que ela seja realmente usada.

O modelo carrega Codebase Audit automaticamente assim que uma solicitação é relevante para essa habilidade.

Funciona com qualquer modelo de IA

Habilidades de IA são instruções em Markdown simples, não código específico de um provedor. Por isso, Codebase Audit não fica vinculada ao modelo para o qual foi criada. Instale-a uma vez no TypingMind e use-a com GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou um modelo local executado por conta própria — tudo com suas próprias chaves de API.

  • Carregada apenas quando necessário

    O prompt do sistema contém apenas o nome e a descrição. As instruções são buscadas na primeira solicitação relevante, então uma habilidade sem uso não gera custo.

  • Troque de modelo durante a conversa

    Como a habilidade é composta de instruções, não de código, trocar de modelo não afeta seu funcionamento — o próximo modelo lê o mesmo arquivo SKILL.md.

Instruções da habilidade

Este é o conteúdo de SKILL.md que o modelo carrega. Leia antes de instalar — uma habilidade é um conjunto de instruções que seu modelo seguirá.

Codebase Audit — Adaptive Deep Analysis

Comprehensive codebase audit that adapts its agent configuration to the project's tech stack, forces structured findings, adversarially verifies Critical/High findings before they enter the report, diffs against the previous audit's ledger (resolved / still-open / new), and outputs a severity-sorted report plus a phased repair roadmap.

Core Principles

  1. READ-ONLY — Audit agents must never create, modify, or delete files in the target. Every agent prompt starts with the read-only preamble in references/agent-prompts.md.
  2. Inherit the session model — Omit the model param on all agents so they inherit the session model (usually the strongest available). Only override upward if the session model is clearly weak for cross-file reasoning. Never hardcode a specific model name in this skill.
  3. Depth over breadth — Fewer agents with broader merged scopes beat many shallow agents. Each agent traces issues across file boundaries.
  4. Adaptive — Agent count and dimensions vary by stack and mode.
  5. Verified findings — Critical/High findings must survive an adversarial verify pass. Medium findings pass through but are labeled unverified in the report.

Operating Contract

  • Direct actions: read-only inspection, local dependency audits, report writing under the target, and ledger updates under <target>/.audit/ after the user invokes this skill.
  • Escalate before: editing audited project source files, dependency manifests, .gitignore, CI config, remote issues, PR state, or anything outside the requested audit/report scope.
  • Evidence-backed pushback: challenge "all clear" or "resolved" only with file evidence, dependency-audit output, verifier results, or ledger spot-checks.
  • Feedback loop: promote repeated misses into prompt updates, ledger matching rules, or fixture eval cases rather than leaving them as session-only notes.

Gotchas

  • Dependency-audit commands must run from {TARGET_DIR}, not the assistant's incidental cwd.
  • Finder agents must not read evals/expected-findings.json or eval README files when auditing the planted-bug fixture.
  • A previous ledger miss is not proof that a finding was resolved; spot-check the file before marking an old finding resolved.

Modes

ModeTriggerAgentsVerify passLedger
full (default)plain invocation, "全面审查"3–5 by stack (+ optional dims)yesyes
quick"quick" in args, "快速体检"2 (Silent Degradation & Security; Data Integrity & Registry)no — all findings labeled unverifiedyes

Optional dimensions (full mode only, enable when user asks or the repo obviously needs them):

  • tests — test quality: assertion strength, skip markers, coverage of critical paths (Agent 6)
  • concurrency — races, blocking calls in async, leaked tasks/goroutines (Agent 7)

Workflow

Phase 0: Detect & Prepare

  1. Stack detection: package.json/tsconfig.json → TS/JS; pyproject.toml/requirements.txt → Python; Cargo.toml → Rust; go.mod → Go; multiple → full-stack.
  2. Size estimate: tokei <target> (fallback: find <target> -name '*.<ext>' | xargs wc -l), excluding vendored/generated code. If effective size ≥ 400K LOC, split each agent's scope by top-level directory and note the split in the report.
  3. Exclusions (always, in every agent prompt): node_modules/, vendor/, target/, dist/, build/, .git/, lockfiles, generated code.
  4. Ledger: read <target>/.audit/findings.json if it exists — this is the previous audit baseline (format: references/ledger-format.md).
  5. Deterministic dependency audit: from {TARGET_DIR} (never the assistant's incidental cwd), run each matching tool and feed raw output to the Error Handling & Security prompt:
    • Rust: cargo audit
    • Node: npm audit
    • Python metadata (pyproject.toml / setup.py): pip-audit .
    • Python requirements (requirements.txt): pip-audit -r requirements.txt
    • Python fallback with no project files: pip-audit .
    • Go: govulncheck ./... If a required tool is unavailable, the report must state 依赖审计降级跳过: <tool>; never omit the degradation silently.

Phase 1: Assemble Dimensions

Pick the configuration by detected stack. Full prompt templates in references/agent-prompts.md; prepend the read-only preamble and inject {TARGET_DIR} / {STACK_INFO} into each.

Full-Stack (5 agents) — frontend + backend both present:

#DimensionScope (merged)
1Frontend-Backend ContractType consistency + rendering pipeline + serialization boundaries. Reads BOTH sides.
2Data Integrity & FlowEnd-to-end pipeline tracing, field dropping, declaration-execution gaps, registry coverage alignment.
3Error Handling & SecuritySilent degradation, exception patterns, secrets, injection, unsafe deserialization.
4Architecture & Code QualityLayer violations, god objects, duplication/drift, extension cost, registry cross-reference.
5Config & PersistenceConfig completeness, cache key/integrity, DB schema, temp files, state persistence.

Backend-Only (4 agents): replace #1 with "API Contract & Data Integrity" (which absorbs #2's data-flow/registry scope — do NOT also dispatch #2); keep #3–#5. Frontend-Only (3 agents): Component Architecture & Rendering; Error Handling & Code Quality; Config & Build. Quick mode (2 agents): Silent Degradation & Security (= #3); Data Integrity & Registry (= #2 core).

Fallback-path agent types (when using the Agent tool instead of Workflow): agent availability is environment-specific — check the subagent registry visible in the current session and use only type names that appear there. Never invent aliases (there is no generic reviewer type). If no specialized type matches, use general-purpose (or the environment's default catch-all) for every dimension; the prompts are self-contained. See the example mapping in references/agent-prompts.md.

Phase 2: Orchestrate

Preferred — Workflow tool (skill invocation is the user's opt-in): use the script in references/workflow-template.md. It schema-forces every finder's output into structured findings, then pipelines each dimension's Critical/High findings straight into adversarial verify agents (no barrier — verification starts while other dimensions are still scanning).

Fallback — Agent tool (if Workflow is unavailable): launch all finder agents in a SINGLE message; prompts already demand the same JSON output. After they return, launch one verify agent per Critical/High finding (also batched in one message), using the verify prompt from references/workflow-template.md.

Phase 3: Dedup & Ledger Diff

Dedup:

  • Same file + same line → merge.
  • Same root cause found by multiple agents → keep the most detailed, note cross-agent confirmation (raises confidence).
  • Severity conflicts → use the highest.

Verification results:

  • confirmed=false findings do NOT enter the main report; list them in an appendix "Refuted by verification" with the refutation reason (keeps the work auditable).
  • Verifier failed/absent → keep the finding, label unverified.

Ledger diff (skip if no previous ledger — everything is new):

  • Match previous ↔ current findings by (category, file, root-cause summary) — never by line number (lines drift).
  • Previous finding with no current match → open the file and spot-check before marking resolved; if still present but missed, re-add as still-open.
  • Classify every current finding: new / still-open.
  • Write the updated ledger to <target>/.audit/findings.json. If the repo is tracked and .audit/ isn't ignored, suggest adding it to .gitignore (don't edit .gitignore yourself).

Phase 4: Report

Write the full report to <target>/audit-report-YYYY-MM-DD.md, then post a chat summary: counts per severity, top Criticals, ledger delta (N resolved / N still-open / N new), dependency-audit status, and the roadmap.

Report body requirements:

  • Use Chinese for problem descriptions, impact analysis, and repair advice; keep code identifiers, paths, and error messages in their original form.
  • Separate each finding into fact / inference / recommendation: the finding itself is a fact with file:line; impact is an inference with confidence; repair advice is a recommendation with stated assumptions.
  • Inferred-only findings cannot be higher than Medium unless a verifier confirms user-visible or security impact.

Report structure:

markdown
# [Project] Codebase Audit Report
> Date / Target / Stack / Mode / Agents / Dependency audit / Previous audit: date or "none"

## Summary
| Level | Count | Verified | Key Areas |

## Delta vs Previous Audit   (omit if first audit)
Resolved: N (list) | Still-open: N | New: N

## Critical (Fix Immediately)
Per finding: file:line, code snippet, risk, fix suggestion, verify status.

## High / P1 (Fix This Week)     — grouped by category
## Medium / P2 (Plan to Fix)     — labeled unverified where applicable

## Refuted by Verification       — appendix: finding + refutation reason

## Repair Roadmap
| Phase | Scope | Est. Files |

Severity Classification

LevelCriteria
CriticalData loss, rendering failure, security vulnerability, complete feature breakage affecting users NOW
High/P1Silent degradation (user sees wrong/incomplete output), type mismatches causing data truncation, missing config causing empty output, architectural violations blocking development
Medium/P2Code duplication, inconsistent patterns, suboptimal error handling, tech debt that slows development but doesn't break features

References

  • references/agent-prompts.md — read-only preamble + prompt templates (Agents 1–7)
  • references/stack-patterns.md — per-stack search patterns
  • references/workflow-template.md — Workflow script, finding/verdict schemas, verify prompt
  • references/ledger-format.md — ledger JSON schema and matching rules
  • evals/ — planted-bug fixture; evals measure recall against evals/expected-findings.json

Arquivos incluídos

O modelo lê esses arquivos sob demanda enquanto a habilidade está carregada. Eles são disponibilizados para leitura e nunca são executados.

Perguntas frequentes

O que a habilidade de IA Codebase Audit faz?

Auditoria completa de código — análise aprofundada e paralela adaptativa de contratos entre frontend e backend, integridade de dados, tratamento de erros e segurança, arquitetura e dívida técnica, configuração e cache. Gera findings estruturados, validação adversarial e comparação com a linha de base, além de um relatório consolidado ordenado por gravidade e um roteiro de correções. Inclui um modo quick para uma avaliação rápida. Use quando o usuário pedir para auditar, analisar ou revisar uma codebase inteira em busca de problemas de design, encontrar bugs ocultos, verificar a saúde da arq...

Por que usar Codebase Audit no TypingMind?

Porque basta instalar uma vez para usar com qualquer modelo. A habilidade Codebase Audit é escrita em Markdown simples, e não em código específico de um provedor, então a mesma habilidade funciona com GPT-5, Claude, Gemini, Grok ou um modelo local — e é possível trocar de modelo no meio do chat sem que ela deixe de funcionar. No TypingMind, você usa suas próprias chaves de API e paga diretamente aos provedores, em vez de pagar uma assinatura por licença de usuário. Suas habilidades e chats permanecem no seu próprio armazenamento.

Como instalar Codebase Audit no TypingMind?

Abra Plugins → Habilidades → Instalar do GitHub no TypingMind e cole https://github.com/majiayu000/spellbook/tree/main/skills/codebase-audit. O TypingMind lê o arquivo SKILL.md, reúne os arquivos da habilidade e a instala para que possa ser ativada em cada chat.

Quais modelos de IA podem usar Codebase Audit?

Qualquer modelo conectado no TypingMind. As habilidades de IA são instruções em Markdown simples, e não código específico de um provedor. Assim, GPT, Claude, Gemini, Grok e modelos locais podem carregar esta habilidade quando uma solicitação corresponder a ela.

Quantos modelos de IA posso usar com Codebase Audit?

Quantos quiser. Desde que o modelo ofereça suporte a habilidades, é possível usar Codebase Audit com ele — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e outros — tudo no TypingMind com suas próprias chaves de API.

A habilidade de IA Codebase Audit é gratuita?

Sim. A habilidade é publicada no GitHub por majiayu000 sob a licença MIT. O pagamento é feito apenas ao seu provedor de IA pelos tokens usados.

O que são habilidades de IA?

Uma habilidade de IA é um conjunto reutilizável de instruções que ensina um modelo de IA a realizar uma tarefa específica. Ela segue o formato aberto Agent Skills: um arquivo SKILL.md com nome e descrição, além de scripts, templates ou arquivos de referência de que o modelo possa precisar. O modelo lê as instruções apenas quando sua solicitação corresponde à habilidade, então uma habilidade instalada não gera custos até ser usada.

Qual é a diferença entre habilidades de IA e plugins ou servidores MCP?

Um plugin ou servidor MCP oferece ao modelo novas ferramentas que ele pode acionar — código que é executado em algum lugar e retorna um resultado. Já uma habilidade de IA dá ao modelo o conhecimento e as orientações de que ele precisa: como abordar uma tarefa, quais etapas seguir e como deve ser um bom resultado. As habilidades são escritas em Markdown simples, por isso não precisam de servidor, chave de API nem ambiente de execução, e funcionam com qualquer modelo.

Ver lista completa

Crie seu próprio espaço de trabalho com IA agora

Inscreva-se na nossa newsletter para receber avisos sobre novos recursos e futuros sorteios 👇