← 返回 Skills 市场
charlie-morrison

codebase-stats

作者 charlie-morrison · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
99
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install codebase-stats
功能描述
Analyze project metrics: lines of code, language distribution, function complexity, code-to-comment ratio, test coverage indicators, dependency counts, large...
使用说明 (SKILL.md)

Codebase Stats

Project metrics, complexity analysis, and health indicators. Pure Python, zero deps, 40+ languages.

Quick Start

# Analyze current directory
python3 scripts/codebase_stats.py

# Analyze specific project
python3 scripts/codebase_stats.py /path/to/project

# Markdown report
python3 scripts/codebase_stats.py /path/to/project --format markdown

# JSON (for CI/CD dashboards)
python3 scripts/codebase_stats.py /path/to/project --format json

# Filter by language
python3 scripts/codebase_stats.py --language Python

# Save report
python3 scripts/codebase_stats.py --format markdown --output stats.md

What It Measures

Category Metrics
Size Total files, code/comment/blank lines, lines per file
Languages Distribution by code lines and file count (40+ languages)
Complexity Per-function cyclomatic complexity estimate, top complex functions
Quality Code-to-comment ratio, test file coverage indicator
Dependencies npm, pip, Go modules, Cargo crate counts
Tech Debt TODO/FIXME/HACK/XXX counts across codebase
Files Top 10 largest files by line count

Supported Languages

Python, JavaScript, TypeScript, Java, Go, Rust, Ruby, PHP, C, C++, C#, Swift, Kotlin, Scala, R, Lua, Perl, Shell, SQL, HTML, CSS, SCSS, Vue, Svelte, Dart, Elixir, Erlang, Zig, Nim, V, Solidity, Terraform, Protobuf, and more.

Exit Codes

  • 0 — Success
  • 1 — Error (directory not found, language not found)
安全使用建议
The tool appears coherent and limited to local repository analysis, but it reads many files in the target directory — do not run it directly on repositories containing secrets or private credentials. Because the provided source in the prompt was truncated, review the full script before use (search for any network/socket/file-write code or subprocess.exec calls). Run it in an isolated environment or on a copy of the repo first, and inspect reported outputs to ensure no sensitive content is included in generated reports.
功能分析
Type: OpenClaw Skill Name: codebase-stats Version: 1.0.0 The codebase-stats skill is a standard utility for performing static analysis on a project directory. The core script, scripts/codebase_stats.py, uses only Python standard libraries to calculate lines of code, estimate cyclomatic complexity, and identify tech debt markers (e.g., TODOs). There is no evidence of data exfiltration, network activity, or unauthorized file access, and the instructions in SKILL.md are strictly aligned with the tool's analytical purpose.
能力评估
Purpose & Capability
Name/description match the included Python scanner. The script implements LOC, language detection, simple complexity heuristics, dependency counts, and TODO/FIXME scanning — all expected for a 'codebase-stats' tool. No unrelated credentials, binaries, or cloud access are requested.
Instruction Scope
SKILL.md instructs running the included Python script on a target directory and offers output formats (markdown/json). The runtime instructions and the script operate on repository files and manifest files only; they do not instruct the agent to read unrelated system config or call external endpoints.
Install Mechanism
No install specification and the tool is pure Python with no external dependencies per SKILL.md and the script header. This reduces risk because nothing is downloaded or written to disk beyond running the provided script.
Credentials
The skill requires no environment variables, credentials, or special config paths. The script reads local project files (package.json, requirements.txt, go.mod, Cargo.toml, source files) which is appropriate for its purpose.
Persistence & Privilege
The skill is not always-on and uses normal model invocation. It does not appear to modify agent/system configuration or request persistent privileges.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install codebase-stats
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /codebase-stats 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release
元数据
Slug codebase-stats
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

codebase-stats 是什么?

Analyze project metrics: lines of code, language distribution, function complexity, code-to-comment ratio, test coverage indicators, dependency counts, large... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 99 次。

如何安装 codebase-stats?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install codebase-stats」即可一键安装,无需额外配置。

codebase-stats 是免费的吗?

是的,codebase-stats 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

codebase-stats 支持哪些平台?

codebase-stats 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 codebase-stats?

由 charlie-morrison(@charlie-morrison)开发并维护,当前版本 v1.0.0。

💬 留言讨论