codebase-inspection

Inspect codebases with pygount to report LOC, language breakdown, and comment ratios.

Updated Jul 3, 2026
One-click install
npx skills add https://github.com/CHENHUI-X/toolbox --skill codebase-inspection-chenhui-x
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: codebase-inspection
Source: https://github.com/CHENHUI-X/toolbox/tree/main/official-skills/software-development/codebase-inspection
Command: npx skills add https://github.com/CHENHUI-X/toolbox --skill codebase-inspection-chenhui-x

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pygount.

What problem does it solve? Answering questions about repository size, language composition, and code-to-comment ratios requires running line-counting tools correctly, and misconfigured scans can hang on dependency directories like node_modules or .git. ## Core Features & Use Cases - Language Breakdown: Produces a summary table of files, code lines, and comment lines per programming language using pygount. - Targeted Counting: Filters analysis by file suffix (e.g., Python only) and supports JSON output for programmatic use. - Safe Scanning Defaults: Provides curated --folders-to-skip exclusion lists for Python, JavaScript, and general projects to avoid crawling dependency trees. - Use Case: A user asks "how big is this repo and what languages does it use?" and gets a per-language LOC summary with code-vs-comment percentages in seconds. ## Quick Start Use the codebase-inspection skill to count the lines of code and show the language breakdown of the repository at /path/to/repo.

Frequently Asked Questions about codebase-inspection

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I count lines of code in a repository?

Run pygount with --format=summary in the repository root to get a per-language table of files, code lines, and comment lines. Always pass --folders-to-skip to exclude .git, node_modules, and virtual environments.

How to count LOC for only one programming language?

Use the --suffix flag to filter by file extension, for example pygount --suffix=py --format=summary . counts only Python files. Multiple suffixes can be comma-separated, such as py,yaml,yml.

Why does pygount hang or take a long time on my repo?

pygount crawls every directory by default, including .git, node_modules, and virtual environments, which can contain millions of files. Fix this by passing --folders-to-skip with an exclusion list matching your project type.

Why does Markdown show zero code lines in pygount output?

pygount classifies all Markdown content as comments rather than code, so Markdown files always report zero code lines. This is expected behavior, not a bug.

Can pygount output results as JSON for scripts?

Yes, pygount supports --format=json for programmatic consumption alongside the default summary table and per-file detailed output. JSON results can be piped into other tools for further processing.