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.
- License 许可
- Apache-2.0
- 所属仓库
- alibaba/skill-up
- 最近更新
- 2026-11-13
- Stars
- ★ 1.5k
- Forks
- 131
01 前言 Front Matter
- name
- code-stats
- version
- 1.0.0
- 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.
02 资源文件 13
- 参考文档evals/cases/agent-judge-file.yaml344 B
- 参考文档evals/cases/analyze-directory.yaml1.5 KB
- 参考文档evals/cases/current-directory-format.yaml841 B
- 参考文档evals/cases/exclude-dependencies.yaml1.0 KB
- 参考文档evals/cases/top-extensions.yaml687 B
- 参考文档evals/eval-agent-judge-file.yaml605 B
- 参考文档evals/eval.yaml821 B
- 参考文档evals/evals.json1.8 KB
- 脚本evals/fixtures/repos/sample-project/main.go143 B
- 参考文档evals/fixtures/repos/sample-project/README.md73 B
- 脚本evals/fixtures/repos/sample-project/util.go134 B
- 脚本evals/fixtures/scripts/check-stats.sh1.9 KB
- 参考文档README.md4.6 KB
03 SKILL.md 正文
Code Stats Skill
Analyzes code files and generates statistics about a codebase.
Usage
When invoked, this skill will:
- Scan the specified directory (defaults to current directory)
- Exclude
node_modules/,.git/,dist/, andbuild/unless the user explicitly asks to count them. These are dependencies, repository metadata, or generated output rather than project source.
- Exclude
- Count total lines, files by extension
- Report the largest files
- Output results in a structured format
- 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
- Use
Bashwithfindto locate project files, pruning the excluded directories - Use
Bashwithwc -lto count lines per file - Group files with no extension under
(no ext) - Sort both extension summaries by total line count in descending order
- Aggregate the results into the output format above
- 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?"
04 同仓库更多 Skills
todo-manager
帮助用户管理待办事项,支持添加、删除、标记完成、列出任务等操作。
code-review-helper
帮助用户进行代码审查,识别常见代码问题并给出修改建议。
skill-upper
Capture and review Agent Skill observations, and create, run, diagnose, or iteratively improve Skill evaluations (evals) with the skill-up CLI. Use when the user asks to record explicitly attributed Skill usage or feedback; review observations or user-supplied traces/transcripts; turn an approved observation into a regression case; evaluate, test, regress, verify, fix, improve, iterate, or evolve a Skill; add or strengthen eval cases; write eval.yaml/case.yaml; run skill-up run/validate/list-cases/report/import/init; or migrate from Anthropic evals.json. Plugin observation capture/review require either the Codex skill-up plugin or an observer-enabled DSH skill-up plugin. User-supplied external evidence can be reviewed without a plugin; evaluation remains multi-engine.
deployment-config-guide
Ask for missing deployment settings and summarize the requested configuration without deploying it.
dsh-marker-reader
Decode the marker fixture used by the DeepSeek Harness integration example.
mood-booster
Triggered when the user expresses boredom, low mood, frustration, irritation, or a need to relax. Responds with warm words of comfort and tells a joke to lighten the atmosphere. Trigger phrases include "I'm so bored", "feeling down", "so frustrated", "gloomy", "not happy", "I'm tired".