本文へ移動
cccskills
無料GitHub で公開

code-analyzer

Static code analysis and complexity metrics

インストール方法を見る

含まれるファイル(10)

  • SKILL.md5.8 KB
  • commands/code-analyzer.md113 B
  • hooks/post-execute.cjs862 B
  • hooks/pre-execute.cjs865 B
  • references/research-requirements.md320 B
  • rules/code-analyzer.md248 B
  • schemas/input.schema.json263 B
  • schemas/output.schema.json624 B
  • scripts/main.cjs1.6 KB
  • templates/implementation-template.md187 B

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Code Analyzer Skill

Installation

No separate download: the skill runs the in-repo tool .claude/tools/analysis/project-analyzer/analyzer.mjs.

  • Ensure Node.js (v18+) is installed: nodejs.org or winget install OpenJS.NodeJS.LTS (Windows), brew install node (macOS).
  • From the project root, the script is invoked automatically; no extra install steps.

Cheat Sheet & Best Practices

Metrics: Focus on cyclomatic complexity (decision paths), LOC, maintainability index, and duplicate blocks. Use ESLint complexity rule (e.g. "complexity": ["error", 15]) for JS/TS; optional chaining and default params add branches.

Process: Analyze before refactoring; run project-wide then drill into hotspots. Track trends over time (not one-off). Use max-depth, max-lines, max-nested-callbacks, max-params, max-statements alongside complexity.

Hacks: Start with project-analyzer output; filter by file type and threshold. Prioritize files with high complexity and high churn. Disable complexity rule only if you cannot set a sensible limit; prefer lowering the threshold over disabling.

Certifications & Training

No single cert; aligns with static analysis and ESLint complexity. ESLint: complexity rule, max-depth, max-lines, max-params. Skill data: Cyclomatic complexity, LOC, maintainability, duplicates; analyze before refactor; track hotspots and trends.

Hooks & Workflows

Suggested hooks: Pre-commit or CI: run project-analyzer/doctor for health; optional complexity gate. Use with developer (secondary), qa (secondary), code-reviewer (primary).

Workflows: Use with code-reviewer (primary), developer/ qa (secondary), c4-code (primary). Flow: run analyzer → filter hotspots → refactor or add tests. See code-review-workflow.md.

Overview

Static code analysis and metrics. 90%+ context savings.

Tools (Progressive Disclosure)

Analysis

ToolDescription
analyze-fileAnalyze single file
analyze-projectAnalyze entire project
complexityCalculate complexity metrics

Metrics

ToolDescription
locLines of code
cyclomaticCyclomatic complexity
maintainabilityMaintainability index
duplicatesFind duplicate code

Reporting

ToolDescription
summaryGet analysis summary
hotspotsFind complexity hotspots
trendsAnalyze metric trends

Agent Integration

  • code-reviewer (primary): Code review
  • refactoring-specialist (primary): Tech debt analysis
  • architect (secondary): Architecture assessment

Iron Laws

  1. ALWAYS run project-wide analysis before drilling into individual files — local analysis without context misses which files are actually the highest-priority hotspots; start broad, then focus.
  2. ALWAYS focus on high-complexity AND high-churn files — a complex but rarely-changed file is lower priority than a moderately complex but frequently-changed one; intersection matters most.
  3. NEVER set complexity thresholds above 20 — cyclomatic complexity >20 is demonstrably correlated with defects; teams that allow >20 accumulate unmaintainable code without noticing.
  4. ALWAYS track metrics over time, not just once — a single analysis snapshot is meaningless; track trends weekly to detect gradual degradation before it becomes a crisis.
  5. NEVER report metrics without actionable next steps — complexity numbers without refactoring targets provide no value; every high-complexity finding must include a specific suggested improvement.

Anti-Patterns

Anti-PatternWhy It FailsCorrect Approach
Analyzing only changed filesMisses cross-file complexity accumulationRun project-wide then filter to changed hot spots
Ignoring high-complexity files over timeGradual degradation invisible in point-in-time analysisTrack weekly trends; alert on any increase
Complexity threshold >20Research shows defect rate spikes sharply above 20Set ESLint complexity rule to ≤15 for enforcement
Reporting metrics without action itemsMetrics without remediation don't reduce complexityAttach specific refactoring suggestion per hotspot
Running analysis once and ignoring resultsTechnical debt silently accumulatesSchedule automated weekly analysis with trend reports

Memory Protocol (MANDATORY)

Before starting: Read .claude/context/memory/learnings.md

After completing:

  • New pattern -> .claude/context/memory/learnings.md
  • Issue found -> .claude/context/memory/issues.md
  • Decision made -> .claude/context/memory/decisions.md

ASSUME INTERRUPTION: If it's not in memory, it didn't happen.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Ensure accessibility in UI components including semantic HTML, ARIA attributes, keyboard navigation, and WCAG 2.2 AA compliance.

日本語の概要は準備中です。原文の説明を表示しています。

oimiragieo/agent-studio432026年7月14日 更新

Use when you want to improve response quality through meta-cognitive reasoning. Applies 15+ reasoning methods to reconsider and refine initial outputs.

日本語の概要は準備中です。原文の説明を表示しています。

oimiragieo/agent-studio432026年7月14日 更新

N-round opposing-stance debates for trade-off analysis. Assigns pro/con roles to agents, runs structured debate rounds with quality scoring, and produces a moderator synthesis with confidence-rated recommendation. Generalizable to architecture, technology, security, and design decisions.

日本語の概要は準備中です。原文の説明を表示しています。

oimiragieo/agent-studio432026年7月14日 更新

Force adversarial code review stance that eliminates confirmation bias — reviewer must find issues or re-analyze

日本語の概要は準備中です。原文の説明を表示しています。

oimiragieo/agent-studio432026年7月14日 更新

Creates specialized AI agents on-demand when no existing agent matches a request. Use when the Router cannot find a suitable agent for a task. Enables self-evolution by generating persistent agents.

日本語の概要は準備中です。原文の説明を表示しています。

oimiragieo/agent-studio432026年7月14日 更新

LLM-as-judge evaluation framework with 5-dimension rubric (accuracy, groundedness, coherence, completeness, helpfulness) for scoring AI-generated content quality with weighted composite scores and evidence citations

日本語の概要は準備中です。原文の説明を表示しています。

oimiragieo/agent-studio432026年7月14日 更新

oimiragieo のスキルをすべて見る

このスキルの問題を報告する