code-analysis

A structured way to study unfamiliar code, its architecture, and its important components. It uses code structure and reference counts to focus attention before refactoring or documenting a system.

In plain words
What is it for?
Use it to analyze modules, identify core components, document implementation details, understand design patterns, and prepare code for refactoring or integration.
Why use it?
Large or unfamiliar codebases are difficult to understand line by line. Focusing first on central modules and frequently referenced components gives a clearer picture of how the system is organized.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/dqz00116/skill-lib/code-analysis
Any agent
npx skills add Dqz00116/skill-lib --skill code-analysis
Clone the repo
git clone --depth 1 https://github.com/Dqz00116/skill-lib

Made for: Claude Code, Codex.

Per session 19 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,496 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00019 $0.02496
Opus 5 $0.00010 $0.01248
Sonnet 5 $0.00004 $0.00499
Haiku 4.5 $0.00002 $0.00250

Measured 2d ago against content hash 888fdc1fa5a9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

code-analysis scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (attention_focus.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

code-analysis/SKILL.md · 368 lines

How it starts

The opening of the file, as written. The whole thing — 368 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Code Analysis Skill

Overview

Standardized workflow for reading, analyzing, and documenting codebases with attention-driven focus.

When to Use

Use this skill when you need to:

  • Understand a new code module or system
  • Analyze architecture and design patterns
  • Document technical implementation details
  • Prepare for code refactoring or integration
  • Create technical documentation for teams
  • Focus on core components (high-attention code analysis)

Attention-Driven Code Analysis (NEW in v1.2)

Identify core components in code using heuristic rules, optimizing analysis focus.

Attention Scoring System

# Use the attention_focus.py module
from attention_focus import CodeAttentionScorer

scorer = CodeAttentionScorer()
components = scorer.analyze_code_structure(file_content, file_name)
focus = scorer.get_analysis_focus(components)

Scoring Criteria

Factor Weight Description
Core Keywords +3 Manager, Controller, Handler, System, Core
Important Keywords +2 Helper, Util, Factory, Provider
Lines of Code +2 (>100 lines) / +1 (50-100 lines) Scale metric
Reference Count +2 (>5 refs) / +1 (2-5 refs) Dependency metric
Complexity +1 Methods>10 or Conditional statements>5

Attention Levels

Level Score Analysis Depth
High 8-10 Detailed analysis + Full code + Design principles
Medium 5-7 Focused analysis + Key code snippets
Low 0-4 Brief mention + Function description

Workflow with Attention Focus

1. Read code file
       ↓
2. Run attention_focus.py analysis
       ↓
3. Get prioritized component list
       ↓
4. Analyze HIGH attention components in detail
5. Analyze MEDIUM attention components briefly
6. Reference LOW attention components as needed
       ↓
7. Generate focused documentation

Benefits

  • Reduce token consumption: Focus on 20% core code that provides 80% value
  • Faster analysis: Skip boilerplate and utility code
  • Better documentation: Highlight architectural decisions and critical paths
  • Estimated improvement: 20-30% token reduction, 30% faster analysis

Read the full file on GitHub · 368 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 368 lines · 19 tokens per session scan A 888fdc1fa5a9

Subscribe to this mod's changes

code-analysis is a skill published in the GitHub repository Dqz00116/skill-lib (22 stars, last pushed 3mo ago), licensed MIT. It adds 19 tokens to every session and 2,496 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

academic-paper-drafting

End-to-end academic paper drafting for CHI, HBR, journals, and conferences with venue-specific templates, drafting workflows, and revision strategies.

fabioc-aloha/Alex_Skill_Mall · 34 tokens

research-first-development

Build knowledge bases that build software — research before code, teach before execute.

fabioc-aloha/Alex_Skill_Mall · 18 tokens

agent-governance

Patterns for adding safety, trust, and policy enforcement to AI agent systems -- control which tools agents can call, what content they process, and maintain accountability through audit trails.

fabioc-aloha/Alex_Skill_Mall · 39 tokens

mall-self-curation

Operate the Plugin Mall's canonical vendor, contribution, scan, score, render, and validation workflows. Use when importing or refreshing curated plugins, reviewing contributor PRs, running first-party maintenance, debugging the weekly catalog refresh, or onboarding to Mall internals.

fabioc-aloha/Alex_Skill_Mall · 56 tokens

threejs-animation

Three.js animation - keyframe animation, skeletal animation, morph targets, animation mixing. Use when animating objects, playing GLTF animations, creating procedural motion, or blending animations.

fabioc-aloha/Alex_Skill_Mall · 40 tokens

loop-implement

The single implementation loop. It plans via wiki-plan (step 2, required) into an ordered, wiki-navigated task list, then executes those tasks in order, each loading only its named wiki pages, writing tests first, getting an independent test-quality audit, and judging against done; on failure it reflects and retries…

choiyounggi/dev-loop · 94 tokens