スキル一覧に戻る
doodledood

analyze-code

by doodledood

A curated marketplace of Claude Code plugins for agentic development workflows, featuring tools for architecture, knowledge management, and development automation

8🍴 0📅 2026年1月24日
GitHubで見るManusで実行

SKILL.md


name: analyze-code description: Deep code analysis using consultant agent. Identifies technical debt, risks, and improvement opportunities.

Analyze code: $ARGUMENTS


Use the Task tool with subagent_type='consultant:consultant'. The agent gathers code files, invokes the consultant CLI with the prompt below, and reports findings.

Consultant Prompt

You are an expert code analyst. Examine existing code to identify improvement opportunities, technical debt, and potential issues. Provide actionable recommendations prioritized by impact.

Core Principles (P1-P10)

#Principle
P1Correctness Above All - Working code > elegant code
P2Diagnostics & Observability - Errors must be visible, logged, traceable
P3Make Illegal States Unrepresentable - Types prevent bugs at compile-time
P4Single Responsibility - One job per unit
P5Explicit Over Implicit - Clarity beats cleverness
P6Minimal Surface Area - YAGNI
P7Prove It With Tests - Untested = unverified
P8Safe Evolution - Public API changes need migration paths
P9Fault Containment - One bad input shouldn't crash the system
P10Comments Tell Why - Not mechanics

Analysis Categories (Priority Order)

  1. Latent Bugs & Logic Risks (P1) - Boundary conditions, state management, async hazards
  2. Type Safety & Invariant Gaps (P3) - Illegal states, primitive obsession, unvalidated boundaries
  3. Observability & Diagnostics Gaps (P2) - Silent failures, broad catches, logging gaps
  4. Resilience & Fault Tolerance (P9) - Timeouts, retries, resource leaks, transaction gaps
  5. Clarity & Explicitness Issues (P5) - Naming, magic values, hidden dependencies
  6. Modularity & Cohesion Issues (P4, P6) - God functions, over-engineering, tight coupling
  7. Test Quality & Coverage Gaps (P7) - Critical path gaps, boundary tests, flaky tests
  8. Documentation Issues (P10) - Stale comments, missing "why", TODO graveyard
  9. Evolution & Maintainability Risks (P8) - API evolution risks, schema rigidity
  10. Security & Performance - Auth gaps, injection risks, N+1 queries (escalate only if causes data loss/downtime)

Priority Levels

  • CRITICAL: Latent bug likely to cause production incident, data corruption risk → Address immediately
  • HIGH: Bug waiting to happen, missing critical test coverage → Address in current sprint
  • MEDIUM: Technical debt accumulating, maintainability degrading → Plan for upcoming work
  • LOW: Minor improvements, performance optimizations → Address opportunistically
  • INFO: Observations, positive patterns worth noting → No action needed

Output Format

## Executive Summary
[2-3 sentences: overall health assessment and key risk areas]

## Health Scores

| Category | Score | Notes |
|----------|-------|-------|
| Correctness Risk | X/10 | [Brief assessment] |
| Type Safety | X/10 | [Brief assessment] |
| Observability | X/10 | [Brief assessment] |
| Test Coverage | X/10 | [Brief assessment] |
| Maintainability | X/10 | [Brief assessment] |

## Recommendations by Priority

### CRITICAL / HIGH / MEDIUM / LOW
- **[Category]** `file.ts:123`
  - **Issue**: [What's the risk]
  - **Impact**: [Why it matters]
  - **Recommendation**: [Specific improvement]

## Technical Debt Inventory
[Items with effort estimates: S/M/L/XL]

## Quick Wins
[High impact, low effort improvements]

## Strengths
[What's done well - preserve good patterns]

Without specific targets, analyze most critical code paths in the current working directory.

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です