review-codebase
Acerca de
Esta habilidad realiza una revisión exhaustiva y multifásica de un código completo, analizando arquitectura, seguridad, calidad del código y UX/accesibilidad en una única pasada coordinada. Genera una tabla estructurada de hallazgos priorizados con niveles de severidad, formateada para conversión directa en incidencias de GitHub. Úsala para una auditoría profunda y holística, no para revisar cambios aislados o dominios individuales.
Instalación rápida
Claude Code
Recomendadonpx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/review-codebaseCopia y pega este comando en Claude Code para instalar esta habilidad
Documentación
Review Codebase
Multi-phase deep codebase review producing severity-rated findings with fix-order recommendations. Unlike review-pull-request (scoped to a diff) or single-domain reviews (security-audit-codebase, review-software-architecture), this skill covers entire project or subproject across all quality dimensions in one pass.
When Use
- Whole-project or subproject review (not PR-scoped)
- New codebase onboarding — building mental model of what exists and what needs attention
- Periodic health checks after sustained development
- Pre-release quality gate across architecture, security, code quality, UX
- When output should feed direct into issue creation or sprint planning
Inputs
- Required:
target_path— root directory of codebase or subproject to review - Optional:
scope— which phases to run:full(default),security,architecture,quality,uxoutput_format—findings(table only),report(narrative),both(default)severity_threshold— minimum severity to include:LOW(default),MEDIUM,HIGH,CRITICAL
Steps
Step 1: Census
Inventory codebase to establish scope and identify review targets.
- Count files by language/type:
find target_path -type f | sort by extension - Measure total line counts per language
- ID test directories and estimate test coverage (files with tests vs files without)
- Check dependency state: lockfiles present, outdated dependencies, known vulnerabilities
- Note build system, CI/CD configuration, documentation state
- Record census as opening section of report
Got: Factual inventory — file counts, languages, test presence, dependency health. No judgments yet.
If fail: Target path empty or inaccessible? Stop and report. Specific subdirectories inaccessible? Note them and continue with what is available.
Step 2: Architecture Review
Assess structural health: coupling, duplication, data flow, separation of concerns.
- Map module/directory structure. ID primary architectural pattern
- Check for code duplication — repeated logic across files, copy-paste patterns
- Assess coupling — how many files must change for single feature modification
- Evaluate data flow — clear boundaries between layers (UI, logic, data)?
- ID dead code, unused exports, orphaned files
- Check for consistent patterns — does codebase follow its own conventions?
- Rate each finding: CRITICAL, HIGH, MEDIUM, or LOW
Got: List of architectural findings with severity ratings and file references. Common findings: mode dispatch duplication, missing abstraction layers, circular dependencies.
If fail: Codebase too small for meaningful architecture review (< 5 files)? Note this and skip to Step 3. Architecture review needs enough code to have structure.
Step 3: Security Audit
Identify security vulnerabilities and defensive coding gaps.
- Scan for injection vectors: HTML injection (
innerHTML), SQL injection, command injection - Check authentication and authorization patterns (if applicable)
- Review error handling — errors silently swallowed? Error messages leak internals?
- Audit dependency versions against known CVEs
- Check for hardcoded secrets, API keys, credentials
- Review Docker/container security: root user, exposed ports, build secrets
- Check localStorage/sessionStorage for sensitive data storage
- Rate each finding: CRITICAL, HIGH, MEDIUM, or LOW
Got: List of security findings with severity, affected files, remediation guidance. CRITICAL findings include injection vulnerabilities and exposed secrets.
If fail: No security-relevant code exists (pure documentation project)? Note this and skip to Step 4.
Step 4: Code Quality
Evaluate maintainability, readability, defensive coding.
- ID magic numbers and hardcoded values that should be named constants
- Check for consistent naming conventions across codebase
- Find missing input validation at system boundaries
- Assess error handling patterns — consistent? Provide useful messages?
- Check for commented-out code, TODO/FIXME markers, incomplete implementations
- Review test quality — tests testing behavior or implementation details?
- Rate each finding: CRITICAL, HIGH, MEDIUM, or LOW
Got: List of quality findings focused on maintainability. Common findings: magic numbers, inconsistent patterns, missing guards.
If fail: Codebase generated or minified? Note this and adjust expectations. Generated code has different quality criteria than hand-written code.
Step 5: UX and Accessibility (if frontend exists)
Evaluate user experience and accessibility compliance.
- Check ARIA roles, labels, landmarks on interactive elements
- Verify keyboard navigation — can all interactive elements be reached via Tab?
- Test focus management — does focus move logical when panels open/close?
- Check responsive design — test at common breakpoints (320px, 768px, 1024px)
- Verify color contrast ratios meet WCAG 2.1 AA standards
- Check screen reader compatibility — dynamic content changes announced?
- Rate each finding: CRITICAL, HIGH, MEDIUM, or LOW
Got: List of UX/a11y findings with WCAG references where applicable. No frontend exists? This step produces "N/A — no frontend code detected."
If fail: Frontend code exists but cannot be rendered (missing build step)? Audit source code statically and note that runtime testing was not possible.
Step 6: Findings Synthesis
Compile all findings into prioritized summary.
- Merge findings from all phases into single table
- Sort by severity (CRITICAL first, then HIGH, MEDIUM, LOW)
- Within each severity level, group by theme (security, architecture, quality, UX)
- For each finding, include: severity, phase, file(s), one-line description, suggested fix
- Produce recommended fix order that considers dependencies between fixes
- Summarize: total findings by severity, top 3 priorities, estimated effort level
Got: Findings table with columns: #, Severity, Phase, File(s), Finding, Fix. Fix-order recommendation that accounts for dependencies (e.g., "refactor architecture before adding tests").
If fail: No findings produced? This is itself a finding — either codebase exceptionally clean or review too shallow. Re-examine at least one phase with deeper inspection.
Checks
- All requested phases completed (or explicit skipped with justification)
- Every finding has severity rating (CRITICAL/HIGH/MEDIUM/LOW)
- Every finding references at least one file or directory
- Findings table sorted by severity
- Fix-order recommendations account for dependencies between findings
- Summary includes total counts by severity
- If
output_formatincludesreport, narrative sections accompany table
Scaling with Rest
Between review phases, use /rest as checkpoint — especially between phases 2-5, which need different analytical perspectives. Checkpoint rest (brief, transitional) prevents momentum of one phase from biasing next. See rest skill "Scaling Rest" section for guidance on checkpoint vs full rest.
Pitfalls
- Boil the ocean: Review every line of large codebase produces noise. Focus on high-impact areas: entry points, security boundaries, architectural seams
- Severity inflation: Not every finding is CRITICAL. Reserve CRITICAL for exploitable vulnerabilities and data-loss risks. Most architectural issues are MEDIUM
- Miss the forest for the trees: Individual code quality issues matter less than systemic patterns. Magic numbers appear in 20 files? That is one architectural finding, not 20 quality findings
- Skip the census: Census (Step 1) seems bureaucratic but prevents reviewing code that does not exist or missing entire directories
- Phase bleed: Security findings during architecture review, or quality findings during security audit. Note them for correct phase rather than mix concerns — produces cleaner findings table
See Also
security-audit-codebase— deep-dive security audit when review-codebase security phase reveals complex vulnerabilitiesreview-software-architecture— detailed architecture review for specific subsystemsreview-ux-ui— comprehensive UX/accessibility audit beyond what phase 5 coversreview-pull-request— diff-scoped review for individual changesclean-codebase— implements code quality fixes identified by this reviewcreate-github-issues— converts findings table into tracked GitHub issues
Repositorio GitHub
Habilidades relacionadas
content-collections
MetaEsta habilidad proporciona una configuración probada en producción para Content Collections, una herramienta centrada en TypeScript que transforma archivos Markdown/MDX en colecciones de datos con tipado seguro mediante validación Zod. Úsala al construir blogs, sitios de documentación o aplicaciones Vite + React con mucho contenido para garantizar seguridad de tipos y validación automática de contenido. Abarca todo, desde la configuración del plugin de Vite y compilación MDX hasta la optimización de despliegue y validación de esquemas.
polymarket
MetaEsta habilidad permite a los desarrolladores crear aplicaciones con la plataforma de mercados de predicción Polymarket, incluyendo la integración de API para operaciones y datos de mercado. También proporciona transmisión de datos en tiempo real a través de WebSocket para monitorear operaciones en vivo y actividad del mercado. Úsela para implementar estrategias de trading o crear herramientas que procesen actualizaciones de mercado en tiempo real.
creating-opencode-plugins
MetaEsta habilidad ayuda a los desarrolladores a crear complementos de OpenCode que se conectan a más de 25 tipos de eventos, como comandos, archivos y operaciones LSP. Proporciona la estructura del complemento, las especificaciones de la API de eventos y los patrones de implementación para módulos en JavaScript/TypeScript. Úsala cuando necesites interceptar, monitorear o extender el ciclo de vida del asistente de IA de OpenCode con lógica personalizada basada en eventos.
sglang
MetaSGLang es un framework de alto rendimiento para el servicio de LLM que se especializa en generación rápida y estructurada para JSON, expresiones regulares y flujos de trabajo de agentes utilizando su caché de prefijos RadixAttention. Ofrece una inferencia significativamente más rápida, especialmente para tareas con prefijos repetidos, lo que lo hace ideal para salidas complejas y estructuradas, y conversaciones multiturno. Elige SGLang sobre alternativas como vLLM cuando necesites decodificación restringida o estés construyendo aplicaciones con uso extensivo de prefijos compartidos.
