スキル一覧に戻る

review-codebase

pjt222
更新日 Yesterday
1 閲覧
17
2
17
GitHubで表示
メタgeneral

について

このスキルは、アーキテクチャ、セキュリティ、コード品質、UX/アクセシビリティを単一の調整されたパスで包括的にレビューする、マルチフェーズのコードベースレビューを実行します。優先順位付けされた発見事項の表を重大度評価付きで生成し、create-github-issuesスキルを通じて直接GitHubの課題に変換できます。プロジェクト全体またはサブプロジェクトの、あらゆる品質次元にわたる深く包括的なレビューにご利用ください。

クイックインストール

Claude Code

推奨
メイン
npx skills add pjt222/agent-almanac -a claude-code
プラグインコマンド代替
/plugin add https://github.com/pjt222/agent-almanac
Git クローン代替
git clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/review-codebase

このコマンドをClaude Codeにコピー&ペーストしてスキルをインストールします

ドキュメント

Review Codebase

Multi-phase deep codebase review producing severity-rated findings w/ fix-order rec. Unlike review-pull-request (scoped to diff) or single-domain reviews (security-audit-codebase, review-software-architecture), covers entire project/subproject across all quality dims in one pass.

Use When

  • Whole-project or subproject review (not PR-scoped)
  • New codebase onboarding — building mental model of what exists + needs attention
  • Periodic health checks after sustained dev
  • Pre-release quality gate across architecture, security, code quality, UX
  • Output should feed directly into issue creation or sprint planning

In

  • Required: target_path — root dir of codebase/subproject
  • Optional:
    • scope — phases to run: full (default), security, architecture, quality, ux
    • output_formatfindings (table only), report (narrative), both (default)
    • severity_threshold — min severity: LOW (default), MEDIUM, HIGH, CRITICAL

Do

Step 1: Census

Inventory codebase → est scope + ID review targets.

  1. Count files by lang/type: find target_path -type f | sort by extension
  2. Measure total line counts per lang
  3. ID test dirs + estimate coverage (files w/ tests vs without)
  4. Check dep state: lockfiles present, outdated deps, known vulns
  5. Note build system, CI/CD config, docs state
  6. Record census as opening section of report

→ Factual inventory — file counts, langs, test presence, dep health. No judgments yet.

If err: target empty/inaccessible → stop + report. Specific subdirs inaccessible → note + continue w/ available.

Step 2: Architecture Review

Assess structural health: coupling, duplication, data flow, separation of concerns.

  1. Map module/dir structure + ID primary architectural pattern
  2. Check code duplication — repeated logic across files, copy-paste
  3. Assess coupling — how many files must change for single feature mod
  4. Eval data flow — clear boundaries between layers (UI, logic, data)?
  5. ID dead code, unused exports, orphaned files
  6. Check consistent patterns — codebase follows own conventions?
  7. Rate each: CRITICAL, HIGH, MEDIUM, LOW

→ List of architectural findings w/ severity + file refs. Common: mode dispatch duplication, missing abstraction layers, circular deps.

If err: codebase too small for meaningful review (<5 files) → note + skip Step 3. Architecture review needs enough code to have structure.

Step 3: Security Audit

ID security vulns + defensive coding gaps.

  1. Scan injection vectors: HTML (innerHTML), SQL, command injection
  2. Check authn + authz patterns (if applicable)
  3. Review error handling — silently swallowed? Leak internals?
  4. Audit dep versions vs known CVEs
  5. Check hardcoded secrets, API keys, creds
  6. Review Docker/container security: root user, exposed ports, build secrets
  7. Check localStorage/sessionStorage for sensitive data
  8. Rate each: CRITICAL, HIGH, MEDIUM, LOW

→ List of security findings w/ severity, affected files, remediation. CRITICAL = injection vulns + exposed secrets.

If err: no security-relevant code (pure docs project) → note + skip Step 4.

Step 4: Code Quality

Eval maintainability, readability, defensive coding.

  1. ID magic numbers + hardcoded values should be named consts
  2. Check consistent naming across codebase
  3. Find missing input validation at system boundaries
  4. Assess error handling — consistent? Useful messages?
  5. Check commented-out code, TODO/FIXME, incomplete impls
  6. Review test quality — testing behavior or impl details?
  7. Rate each: CRITICAL, HIGH, MEDIUM, LOW

→ List of quality findings → maintainability. Common: magic numbers, inconsistent patterns, missing guards.

If err: codebase generated/minified → note + adjust expectations. Generated code has diff quality criteria than hand-written.

Step 5: UX + a11y (if frontend exists)

Eval UX + a11y compliance.

  1. Check ARIA roles, labels, landmarks on interactive
  2. Verify keyboard nav — all interactive reachable via Tab?
  3. Test focus mgmt — focus moves logically when panels open/close?
  4. Check responsive — test at common breakpoints (320px, 768px, 1024px)
  5. Verify color contrast meets WCAG 2.1 AA
  6. Check screen reader compat — dynamic content changes announced?
  7. Rate each: CRITICAL, HIGH, MEDIUM, LOW

→ List of UX/a11y findings w/ WCAG refs. No frontend → "N/A — no frontend code detected."

If err: frontend exists but can't render (missing build step) → audit source code statically + note runtime testing not possible.

Step 6: Findings Synthesis

Compile all findings → prioritized summary.

  1. Merge findings from all phases → single table
  2. Sort by severity (CRITICAL first, then HIGH, MEDIUM, LOW)
  3. Within each severity, group by theme (security, architecture, quality, UX)
  4. Each finding: severity, phase, file(s), one-line description, suggested fix
  5. Produce rec fix order considering deps between fixes
  6. Summarize: total findings by severity, top 3 priorities, est effort level

→ Findings table w/ columns: #, Severity, Phase, File(s), Finding, Fix. Fix-order rec accounting for deps (e.g. "refactor architecture before adding tests").

If err: no findings produced → finding itself — codebase exceptionally clean or review too shallow. Re-examine ≥1 phase deeper.

Check

  • All requested phases done (or explicitly skipped w/ justification)
  • Every finding has severity rating (CRITICAL/HIGH/MEDIUM/LOW)
  • Every finding refs ≥1 file or dir
  • Findings table sorted by severity
  • Fix-order recs account for deps between findings
  • Summary has total counts by severity
  • If output_format includes report, narrative sections accompany table

Scaling w/ Rest

Between review phases, use /rest as checkpoint — esp between phases 2-5 needing diff analytical perspectives. Checkpoint rest (brief, transitional) prevents momentum of one phase biasing next. See rest "Scaling Rest" for guidance on checkpoint vs full rest.

Traps

  • Boiling ocean: Reviewing every line of large codebase produces noise. Focus high-impact: entry points, security boundaries, architectural seams.
  • Severity inflation: Not every finding CRITICAL. Reserve CRITICAL for exploitable vulns + data-loss risks. Most architectural = MEDIUM.
  • Missing forest for trees: Individual code quality matters less than systemic patterns. Magic numbers in 20 files = 1 architectural finding not 20 quality.
  • Skip census: Census (Step 1) seems bureaucratic but prevents reviewing code that doesn't exist or missing entire dirs.
  • Phase bleed: Security findings during architecture, or quality during security audit. Note for correct phase, no mix concerns — produces cleaner table.

  • security-audit-codebase — deep-dive when review-codebase security phase reveals complex vulns
  • review-software-architecture — detailed architecture review for specific subsystems
  • review-ux-ui — comprehensive UX/a11y audit beyond phase 5
  • review-pull-request — diff-scoped review for individual changes
  • clean-codebase — impl code quality fixes ID'd by this review
  • create-github-issues — convert findings → tracked GH issues

GitHub リポジトリ

pjt222/agent-almanac
パス: i18n/caveman-ultra/skills/review-codebase
0
agentsagentskillsai-assisted-developmentclaude-codeskillsteams

関連スキル

content-collections

メタ

このスキルは、Content Collections(Markdown/MDXファイルを型安全なデータコレクションに変換するTypeScriptファーストのツール)の本番環境でテストされた設定を提供します。Zodバリデーションによる型安全性を実現し、ブログ、ドキュメントサイト、コンテンツ重視のVite + Reactアプリケーション構築時にご利用ください。Viteプラグインの設定、MDXコンパイルから、デプロイ最適化、スキーマバリデーションまで、すべてを網羅しています。

スキルを見る

polymarket

メタ

このスキルは、開発者がPolymarket予測市場プラットフォームを活用したアプリケーション構築を可能にします。API統合による取引や市場データの取得に加え、WebSocketを介したリアルタイムデータストリーミングにより、ライブ取引や市場活動を監視できます。取引戦略の実装や、ライブ市場更新を処理するツールの作成にご利用ください。

スキルを見る

creating-opencode-plugins

メタ

このスキルは、開発者がコマンド、ファイル、LSP操作など25種類以上のイベントタイプにフックするOpenCodeプラグインを作成することを支援します。JavaScript/TypeScriptモジュール向けに、プラグイン構造、イベントAPI仕様、および実装パターンを提供します。カスタムイベント駆動ロジックでOpenCode AIアシスタントのライフサイクルをインターセプト、監視、または拡張する必要がある場合にご利用ください。

スキルを見る

sglang

メタ

SGLangは、高性能なLLMサービングフレームワークであり、RadixAttentionプレフィックスキャッシュを活用したJSON、正規表現、エージェントワークフロー向けの高速で構造化された生成を特長とします。特にプレフィックスが繰り返されるタスクにおいて、大幅に高速な推論を実現し、複雑な構造化出力やマルチターン対話に最適です。制約付きデコードが必要な場合や、広範なプレフィックス共有を伴うアプリケーションを構築する場合は、vLLMなどの代替案ではなくSGLangを選択してください。

スキルを見る