codebase-inspection – Other skill for AI agents
Inspect codebases w/ pygount: LOC, languages, ratios.
Install the codebase-inspection skill with one command
Pick the tool you use, copy the command and paste it in your terminal. The skill lands in that tool's skills folder and is ready in your next session.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/codebase-inspection-e388f.tgz | tar xz -C ~/.claude/skills
Call it in Claude Code: /codebase-inspection – then describe the task you want done.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/codebase-inspection-e388f.tgz | tar xz -C ~/.codex/skills
Call it in Codex: $codebase-inspection – then describe the task you want done.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/codebase-inspection-e388f.tgz | tar xz -C ~/.hermes/skills
Call it in Hermes Agent: /codebase-inspection – then describe the task you want done.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/codebase-inspection-e388f.tgz | tar xz -C ~/.deepcode/skills
Call it in DeepSeek: /codebase-inspection – then describe the task you want done.
SKILL.md content
Codebase Inspection with pygount
Analyze repositories for lines of code, language breakdown, file counts, and code-vs-comment ratios using pygount.
When to Use
- User asks for LOC (lines of code) count
- User wants a language breakdown of a repo
- User asks about codebase size or composition
- User wants code-vs-comment ratios
- General "how big is this repo" questions
Prerequisites
pip install --break-system-packages pygount 2>/dev/null || pip install pygount1. Basic Summary (Most Common)
Get a full language breakdown with file counts, code lines, and comment lines:
cd /path/to/repo
pygount --format=summary \
--folders-to-skip=".git,node_modules,venv,.venv,__pycache__,.cache,dist,build,.next,.tox,.eggs,*.egg-info" \
.IMPORTANT: Always use --folders-to-skip to exclude dependency/build directories, otherwise pygount will crawl them and take a very long time or hang.
2. Common Folder Exclusions
Adjust based on the project type:
# Python projects
--folders-to-skip=".git,venv,.venv,__pycache__,.cache,dist,build,.tox,.eggs,.mypy_cache"
# JavaScript/TypeScript projects
--folders-to-skip=".git,node_modules,dist,build,.next,.cache,.turbo,coverage"
# General catch-all
--folders-to-skip=".git,node_modules,venv,.venv,__pycache__,.cache,dist,build,.next,.tox,vendor,third_party"3. Filter by Specific Language
# Only count Python files
pygount --suffix=py --format=summary .
# Only count Python and YAML
pygount --suffix=py,yaml,yml --format=summary .4. Detailed File-by-File Output
# Default format shows per-file breakdown
pygount --folders-to-skip=".git,node_modules,venv" .
# Sort by code lines (pipe through sort)
pygount --folders-to-skip=".git,node_modules,venv" . | sort -t$'\t' -k1 -nr | head -205. Output Formats
# Summary table (default recommendation)
pygount --format=summary .
# JSON output for programmatic use
pygount --format=json .
# Pipe-friendly: Language, file count, code, docs, empty, string
pygount --format=summary . 2>/dev/null6. Interpreting Results
The summary table columns:
- Language — detected programming language
- Files — number of files of that language
- Code — lines of actual code (executable/declarative)
- Comment — lines that are comments or documentation
- % — percentage of total
Special pseudo-languages:
__empty__— empty files__binary__— binary files (images, compiled, etc.)__generated__— auto-generated files (detected heuristically)__duplicate__— files with identical content__unknown__— unrecognized file types
Pitfalls
1. Always exclude .git, node_modules, venv — without --folders-to-skip, pygount will crawl everything and may take minutes or hang on large dependency trees.
2. Markdown shows 0 code lines — pygount classifies all Markdown content as comments, not code. This is expected behavior.
3. JSON files show low code counts — pygount may count JSON lines conservatively. For accurate JSON line counts, use wc -l directly.
4. Large monorepos — for very large repos, consider using --suffix to target specific languages rather than scanning everything.
Related skills
- planning-and-task-breakdown – Breaks work into ordered tasks. Use when you have a spec or clear requirements and need…
- etetoolkit – Analyzes, manipulates, compares, annotates, and visualizes phylogenetic or other…
- comfyui – Generate images, video, and audio via diffusion workflows.
- capacity-planner – Use when an ops leader (Director of CX, Head of Support, VP Ops, Head of BizOps, Head of…
- capture – Captures and organizes chaotic brain dumps into a structured, actionable system with…
- embedding-strategies – Select and optimize embedding models for semantic search and RAG applications. Use when…
- employment-contract-templates – Create employment contracts, offer letters, and HR policy documents following legal best…
- ceo-advisor – Executive leadership guidance for strategic decision-making, organizational development…