⏳ This skill is pending AI review.
Scores will appear once the review pipeline completes.
code-stats
Analyzes code files and reports statistics including line counts, file counts by extension, and total size. Use this skill whenever the user wants to understand the composition of a codebase - asking about "how many lines of code", "what file types exist", "code distribution", or needing a quick audit of project size and structure. Make sure to invoke this skill when users mention analyzing codebases, counting lines, checking file distributions, or auditing code.
Choose how to use this skill
You do not need every option. Choose the path your AI client supports. The stable page stays the same; versioned files are immutable.
1. Native installer
This listing has no registered native installer command. Use the complete package or source fallback below, depending on what your client supports.
Do not guess an installer command or replace an existing version without reviewing the diff.
2. Complete package recommended
Download the ZIP when available. It includes SKILL.md plus the references, security notes and version metadata.
No complete ProSkills package is published for this listing yet.3. Prompt-only
Copy the prompt above when the agent can read the stable page or when you want to adopt the workflow without installing a skill.
Need only the instruction file?
Download SKILL.md only if your client requires a single file. The complete ZIP is safer for a full installation because it preserves the references and release context.
No path installs or executes anything by itself. Your agent still needs access to the project files. Before updating, compare the installed version and review the diff.
// RATINGS
Not yet listed on ClawHub or SkillsMP
// README
Code Stats Skill
A real evaluable skill that analyzes code files and reports statistics. Works with both skill-creator and skill-up.
Structure
code-stats/
├── SKILL.md # Skill definition with instructions
└── evals/
├── eval.yaml # skill-up config (YAML format)
├── evals.json # skill-creator format
├── cases/
│ ├── analyze-directory.yaml # Test: analyze directory
│ ├── top-extensions.yaml # Test: find top extensions
│ ├── current-directory-format.yaml
│ └── exclude-dependencies.yaml
└── fixtures/
├── scripts/
│ └── check-stats.sh # Evaluation script
└── repos/
└── sample-project/ # Test repository
├── main.go
├── util.go
└── README.md
How to Evaluate
With skill-creator
# Run evaluation using skill-creator workflow
claude -p "$(cat <<'EOF'
Create a skill evaluation for ./examples/code-stats using skill-creator.
EOF
)"
With skill-up (Go framework)
The YAML suite uses OpenCode with dashscope/qwen3.8-max at
https://dashscope.aliyuncs.com/compatible-mode/v1. Install OpenCode and inject
DASHSCOPE_API_KEY through your environment or secret manager; keep it out of YAML.
The endpoint and model must be available to that key.
# From the repository root; DASHSCOPE_API_KEY must already be injected.
make build
./bin/skill-up validate ./examples/code-stats/evals/eval.yaml
./bin/skill-up run ./examples/code-stats/evals/eval.yaml \
--include-case-name analyze-directory --parallelism 1 \
--format json --format html --format junit
analyze-directory reuses check-stats.sh as the format script judge and adds
an independent relevance Agent judge. The other cases retain their singular
script judges. The evaluated agent runs once per configuration; semantic review
uses a separate Agent session over the same completed output. all_required
requires both judges to pass. Benchmark mode also runs a separate without_skill
configuration; that is a baseline evaluation, not a second execution for judging.
The relevance judge selects its own OpenCode model and endpoint through
judges[].engine, so runner engine/model CLI overrides do not change the reviewer.
Its credentials still resolve from the DashScope provider configuration. In the
none runtime, preinstall every selected runner and judge CLI. Multi-judge
Docker/OpenSandbox snapshot support is a separate runtime extension.
The prompt limits the project to main.go, util.go, and README.md, and gates
check 3 files and 20 lines. This excludes OpenCode's installed Skill and generated
configuration from project statistics. The reused script checks report formatting;
the semantic rubric checks that an actual, complete report answers the request.
Verified behavior
The selected case was exercised with real OpenCode 1.14.24 / Qwen3.8-Max calls on 2026-09-30: both judges passed with the Skill. A controlled failure in a scratch copy produced script FAIL, semantic PASS and aggregate FAIL; the semantic judge could not see a file written by the script judge. The baseline failed the exact output-format gates, so both judges were skipped.
See the verification report and reproduction steps for evidence boundaries and the negative-test procedure. This does not claim a live-model run of all four cases.
Dual Format Support
| Tool | Config File | Format |
|---|---|---|
| skill-creator | evals/evals.json | JSON with skill_name, evals[] array |
| skill-up | evals/eval.yaml + cases/*.yaml | YAML with schema v1alpha1 |
For skill-up, case file paths, repo_fixture, and script_path are relative to the Skill root (the directory containing SKILL.md). Use evals/cases/... and evals/fixtures/... as in this example.
Test Cases
- analyze-directory: Check the fixed project with script and semantic judges
- top-extensions: Find top file extensions by line count
- current-directory-format: Check the required report sections
- exclude-dependencies: Verify dependency-directory exclusions
Evaluation Script
check-stats.sh validates:
- Agent exit code is recorded as a warning if nonzero; script exit code determines its verdict
- Output contains "Files by Extension"
- Output contains "Total Files" and "Total Lines"
- Markdown table format with
|characters - No error indicators
// HOW IT'S BUILT
// FILES
2 files shipped with this skill. Inline text is the catalog copy. The upstream link is the source repository.
examples/code-stats/SKILL.md1.9 KBupstream ↗
--- name: code-stats description: Analyzes code files and reports statistics including line counts, file counts by extension, and total size. Use this skill whenever the user wants to understand the composition of a codebase - asking about "how many lines of code", "what file types exist", "code distribution", or needing a quick audit of project size and structure. Make sure to invoke this skill when users mention analyzing codebases, counting lines, checking file distributions, or auditing code. version: 1.0.0 --- # Code Stats Skill Analyzes code files and generates statistics about a codebase. ## Usage When invoked, this skill will: 1. Scan the specified directory (defaults to current directory) 2. Count total lines, files by extension 3. Report the largest files 4. Output results in a structured format 5. Sort extension summaries by total line count in descending order ## Output Format Always use this exact format for the output: ``` # Code Statistics ## Summary - Total Files: <count> - Total Lines: <count> - Total Size: <size_bytes> bytes ## Files by Extension | Extension | Files | Lines | |-----------|-------|-------| | .go | 12 | 1500 | | .md | 5 | 200 | ## Top 5 File Extensions by Line Count 1. .go — 1500 lines 2. .md — 200 lines ## Largest Files (top 5) 1. main.go (500 lines) 2. util.go (300 lines) ``` If a file has no extension, group it under `(no ext)` in both extension sections. ## Process 1. Use `Bash` with `find` to locate all code files 2. Use `Bash` with `wc -l` to count lines per file 3. Group files with no extension under `(no ext)` 4. Sort both extension summaries by total line count in descending order 5. Aggregate the results into the output format above 6. If no directory is specified, analyze the current working directory ## Examples - "Analyze the current directory" - "Run code-stats on ./src" - "Show me file type distribution" - "How many lines of Python do we have?"README.mdupstream ↗
Contents are not inlined in the catalog. Open the upstream file.
Plain-text copy, no login: /skill-bundles/alibaba-skill-up-examples-code-stats.md