← 返回 Skills 市场
Code Stats
作者
douduandou
· GitHub ↗
· v1.0.0
866
总下载
0
收藏
7
当前安装
1
版本数
在 OpenClaw 中安装
/install openclaw-code-stats
功能描述
分析代码仓库的统计信息(行数、文件数,语言分布)。用于了解项目规模和复杂度。当需要了解项目有多大、有多少代码时使用。
安全使用建议
This skill is small and appears to do what it claims, but inspect and/or modify it before use: 1) The script is hard-coded to /home/duan/.openclaw/workspace (including a specific username). If you expect it to analyze a different folder, change WORKSPACE or add a command-line/path option. 2) It will recursively read all non-hidden files under that path — treat it as having broad read access to anything in your workspace; don't run it against a workspace containing secrets. 3) The walker does not guard against symlink cycles — a malicious or accidental cyclic symlink could cause excessive recursion. 4) If the repo is empty totalLines can be 0 and the percentage calculation will produce NaN — harmless but noisy. Recommended actions: run in a sandbox or on a copy of the workspace first, or edit the script to accept a path argument and to add cycle detection/limits. If you do not trust the code author, do not run it on sensitive data.
功能分析
Type: OpenClaw Skill
Name: openclaw-code-stats
Version: 1.0.0
The skill 'openclaw-code-stats' is designed to analyze code repository statistics (file count, line count, language distribution). The `index.js` script implements this functionality using standard Node.js `fs` and `path` modules to read files and directories within the specified OpenClaw workspace. It does not perform any network requests, execute external commands, access sensitive data, or contain any prompt injection attempts in `SKILL.md`. The `package.json` also shows no external dependencies, indicating a low supply chain risk. All observed behaviors are directly aligned with the stated purpose.
能力评估
Purpose & Capability
The code's functionality (recursively counting files and lines by extension) matches the skill description. However the implementation uses a fixed WORKSPACE path ('/home/duan/.openclaw/workspace') rather than acting on the current working directory or an explicitly provided path. The hard-coded home path with a specific username is unexpected and may not match the installing user's environment.
Instruction Scope
SKILL.md states it analyzes the 'current workspace' and instructs running node skills/code-stats/index.js, but the script always scans the fixed WORKSPACE path. The script will read every non-hidden file under that directory (subject to IGNORE_DIRS), which means it can access any file present in that workspace — this is consistent with the stated purpose but narrower/less flexible than the documentation implies and has privacy implications.
Install Mechanism
No install spec; the package is instruction + a small JS script with no external dependencies. Nothing is downloaded or written during install, which is low risk.
Credentials
The skill requests no environment variables or credentials, which is appropriate. Nonetheless it reads files from the user's workspace (a form of broad read access). That file-system access is inherent to its purpose but should be acknowledged as sensitive — there's no configuration to limit the scanned path.
Persistence & Privilege
The skill does not request persistent privileges. always is false and it does not modify system or other skills' configuration.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install openclaw-code-stats - 安装完成后,直接呼叫该 Skill 的名称或使用
/openclaw-code-stats触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of code-stats skill:
- Analyze code repositories for total file count, line count, and language distribution
- Calculate language proportions within a project
- Supports JavaScript/TypeScript, Python, JSON/YAML, Markdown, Shell/Bash, HTML/CSS
- Designed for understanding project size and code complexity
- Easy usage via CLI or integration with OpenClaw
元数据
常见问题
Code Stats 是什么?
分析代码仓库的统计信息(行数、文件数,语言分布)。用于了解项目规模和复杂度。当需要了解项目有多大、有多少代码时使用。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 866 次。
如何安装 Code Stats?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install openclaw-code-stats」即可一键安装,无需额外配置。
Code Stats 是免费的吗?
是的,Code Stats 完全免费(开源免费),可自由下载、安装和使用。
Code Stats 支持哪些平台?
Code Stats 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Code Stats?
由 douduandou(@douduandou)开发并维护,当前版本 v1.0.0。
推荐 Skills