Skip to content
Development
Skill

/analyze

Analyzes code quality, complexity, patterns across codebase. Triggers: quality report, hotspot scan, code analysis, architecture signal.

From plugin
ai-toolkit
180117 skills44 agents

Claude Code

$ npx -y skills add softspark/ai-toolkit --skill analyze --agent claude-code

SKILL.md

analyze.SKILL.md
name: analyze
description: "Analyzes code quality, complexity, patterns across codebase. Triggers: quality report, hotspot scan, code analysis, architecture signal."
user-invocable: true
effort: medium
argument-hint: "[path or pattern]"
allowed-tools: Read, Grep, Glob

Code Analysis

$ARGUMENTS

Analyze code quality, complexity, and patterns.

Usage

/analyze [path] [--type=<type>]

What This Command Does

1. **Scans** codebase or specific path 2. **Analyzes** code quality metrics 3. **Identifies** patterns and anti-patterns 4. **Reports** findings with recommendations

Analysis Types

| Type | Description | |------|-------------| | `quality` | Code quality metrics (default) | | `security` | Security vulnerability scan | | `complexity` | Cyclomatic complexity | | `dependencies` | Dependency analysis | | `coverage` | Test coverage gaps |

Output Format

## Code Analysis Report

### Summary
- **Files Analyzed**: [count]
- **Issues Found**: [count]
- **Quality Score**: [score]/100

### Metrics
| Metric | Value | Threshold |
|--------|-------|-----------|
| Complexity | [avg] | <10 |
| Duplication | [%] | <5% |
| Coverage | [%] | >70% |

### Issues by Severity
- Critical: [count]
- High: [count]
- Medium: [count]
- Low: [count]

### Top Issues
1. **[Issue]** - [file:line]
   - [Description]
   - Fix: [Recommendation]

### Patterns Detected
- [Pattern 1]: [locations]
- [Pattern 2]: [locations]

### Recommendations
1. [Recommendation with priority]

Automated Complexity Analysis

Run the bundled script for a quick complexity report:

python3 ${CLAUDE_SKILL_DIR}/scripts/complexity.py .

Reports file counts by type, largest files, TODO/FIXME counts, and total code lines.

Common Rationalizations

| Excuse | Why It's Wrong | |--------|----------------| | "The linter is green, the code is fine" | Linters catch syntax, not design flaws — analysis covers architecture and patterns | | "We know where the problems are" | Intuition misses systemic issues — data-driven analysis reveals hidden hotspots | | "Analysis takes too long" | A 5-minute scan prevents weeks of debugging — front-load the investment | | "It's legacy code, analysis won't help" | Legacy code benefits most — find the critical paths before they break |

Tools Used

| Language | Tools | |----------|-------| | Python | ruff, mypy, pylint | | JavaScript | eslint, tsc | | Go | golangci-lint | | Rust | clippy |

Rules

  • **MUST** report measured values — never assert "this is fine" without numbers
  • **NEVER** modify source files (read-only skill)
  • **CRITICAL**: if the requested analysis type is unsupported for the detected language, say so explicitly and stop — do not fake metrics

Gotchas

  • Linters that exit `0` still may have **skipped** files (gitignore rules, no-match patterns, parse errors). Always read the "N files checked" line before reporting "clean".
  • Coverage percentages silently exclude generated code, migrations, and `__init__.py` by default. Report coverage with the exclude list, not the headline number alone.
  • `ruff` and `pylint` disagree on several rules (line length, import order) — pick one as the source of truth for the project and note the choice in the report.
  • `mypy --strict` on a codebase that was not authored under strict mode will return hundreds of spurious findings. Start with `--ignore-missing-imports` and a file allowlist before claiming the codebase is untyped.

When NOT to Use

  • For a single-PR code review — use `/review` instead
  • For fixing a specific bug — use `/debug` or `/fix`
  • For architectural friction and module design — use `/architecture-audit`
  • For a vulnerability scan of dependencies — use `/cve-scan`

Related Skills

  • Found quality issues? → `/refactor` to fix them systematically
  • Security issues detected? → `/cve-scan` for dependency audit
  • Want deeper architecture review? → `/architecture-audit` for friction discovery
  • Performance hotspots found? → `/workflow performance-optimization`
Read more
@softspark
Ships withai-toolkit

AI coding toolkit with machine-enforced safety, 116 skills, 44 agents, lifecycle hooks, persona presets, opt-in plugin packs, and benchmark tooling.

180117 skills44 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
180
Star history of softspark/ai-toolkit on GitHub, a chart by star-history.com

Other skills on ai-toolkit.

ai-toolkit-rules

ai-toolkit-rules

Mandatory engineering, security, testing, git, performance, quality, and response rules. Claude MUST load this skill for every…

mem-search

mem-search

Searches past coding sessions for observations, decisions, context. Triggers: mem-search, recall session, past work, prior…

a11y-validate

a11y-validate

Accessibility validator: WCAG 2.1 AA, EN 301 549, EAA. Triggers: a11y, accessibility, WCAG, EAA, ARIA, contrast, keyboard, screen…

agent-creator

agent-creator

Creates new specialized agents with frontmatter, tools, delegation. Triggers: new agent, create agent, agent scaffold,…

api-patterns

api-patterns

API design: naming, versioning, pagination, idempotency, OpenAPI, error contracts and safe retries. Triggers: API design, REST,…

app-builder

app-builder

App scaffolding: Next.js, Vite, Nuxt, Astro, FastAPI, Django, Laravel, RN, Flutter. Triggers: scaffold, bootstrap, new project,…

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills3w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc3w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react12d252k
@facebook@facebookInstall Skill

Questions about analyze.

Which coding agents can use analyze?
analyze installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.