Codebase Inspection logo

Codebase Inspection

Community
seaworld008
codebase-inspection

Use when a user needs reproducible repository sizing, language composition, file counts, or code-versus-comment ratios with pygount; record exclusions and verify measurement scope before interpreting results.

Overview

Publisherseaworld008
RepositoryCommonly-used-high-value-skills
Skill namecodebase-inspection
Stars
70
Forks
11
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by seaworld008 on GitHub. Read the source before you install it.

Installation

Install the Codebase Inspection AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/seaworld008/Commonly-used-high-value-skills.git /tmp/Commonly-used-high-value-skills
mkdir -p .claude/skills
cp -r /tmp/Commonly-used-high-value-skills/openclaw-skills/codebase-inspection .claude/skills/codebase-inspection
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Codebase Inspection in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Codebase Inspection on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Codebase Inspection is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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

bash
python3 -m venv /path/to/approved-tools/pygount-venv
/path/to/approved-tools/pygount-venv/bin/python -m pip install pygount
/path/to/approved-tools/pygount-venv/bin/pygount --version

Choose a new, approved environment path; do not overwrite an existing environment or bypass externally managed Python protections. Use its pygount executable in the examples below, or activate that environment first.

1. Basic Summary (Most Common)

Get a full language breakdown with file counts, code lines, and comment lines:

bash
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:

bash
# 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

bash
# 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

bash
# 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 -20

5. Output Formats

bash
# 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/null

6. 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. Markup classification varies — do not assume all Markdown is counted as comments. Inspect the installed version's output and lexer behavior.
  3. Logical versus physical lines — pygount classification and wc -l measure different things. Label physical-line counts separately instead of treating them as a correction.
  4. Large monorepos — for very large repos, consider using --suffix to target specific languages rather than scanning everything.

Measurement Contract

Before scanning, agree on the repository root and the population being measured. A language summary over application code is not comparable to a summary that also includes generated exports, vendored libraries, test fixtures, and caches. Record whether tests and documentation belong in the requested population. Explicit folder patterns replace pygount defaults; include [...] when you want to extend its defaults, then add project-specific exclusions.

Common Patterns: Comparable Snapshots

text
revision: full commit SHA, or explicitly identified dirty checkout
tool: pygount version
scope: absolute root and included subdirectories
exclusions: exact folder and filename patterns
duplicate policy: default deduplication or explicit --duplicates
outputs: summary plus JSON, stored outside the measured tree
errors: unknown, binary, generated, duplicate and error file counts

Compare snapshots only when these settings agree. If the tree is dirty, report that fact without stashing, discarding, or committing the user's changes. Use JSON for downstream parsing: human-readable summary column widths vary. Inspect a few representative files, including a generated file and a duplicate, before using totals to justify a migration or capacity decision.

Acceptance and Boundaries

  • The command exits successfully and the output describes the intended root.
  • Excluded dependencies are absent from the detailed file listing.
  • Parse errors and unknown languages are reported, not silently folded into zero.
  • Code-to-comment ratios state their denominator and treatment of empty lines.
  • Two scans of an unchanged tree with identical settings yield identical counts.
  • A file count or LOC change is not evidence of quality, risk, or productivity.
  • Analysis is read-only; do not run repository code or upload private source.

Command semantics were checked against the primary pygount usage documentation. Recheck installed help before relying on new flags.

Frequently asked questions

What does the Codebase Inspection AI skill do?

Use when a user needs reproducible repository sizing, language composition, file counts, or code-versus-comment ratios with pygount; record exclusions and verify measurement scope before interpreting results.

Why use Codebase Inspection on TypingMind?

Because you install it once and use it with any model. Codebase Inspection is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Codebase Inspection in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/seaworld008/Commonly-used-high-value-skills/tree/main/openclaw-skills/codebase-inspection. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Codebase Inspection?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Codebase Inspection?

As many as you like. As long as a model supports skills, you can use Codebase Inspection with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Codebase Inspection AI skill free?

Yes. It is published on GitHub by seaworld008 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇