agentleFS
comkocscomkocs/md-workflow/.agents/skills/repo-scale-reporting/SKILL.md

repo-scale-reporting

Skill3 starsChanged 8 days agoApache-2.0View on GitHub

当要报一个或多个仓的代码规模、把行数分代码、测试、配置、文档几列,或要量一段时间的提交数与改动量、给数字配统计截止时间与各仓 HEAD 时使用。凡遇到这些情况,先读本 skill 再动手:先定口径再跑数。

The file

Files
SKILL.md

这个 skill 是干什么的(人话)

这个 skill 帮你按 git 跟踪文件量一个或多个仓的真实规模:行数分代码、测试、配置、文档,报告写明统计截止时间与各仓 HEAD。不用它,常见的坑是数里混进未跟踪文件、扩展名口径没写清,过两周数字对不上是哪棵树、什么算的。

分类

分类:装 core/ 即可用

用前填这几个名字

  • {{统计命令}}:统计脚本入口,在仓根跑;例:python -X utf8 core/tools/repo_scale.py
  • {{规则文件}}:UTF-8 JSON 分类规则件,五个键全部可省;例:rules.json

有 python 用 python;没有时将统计命令的 python -X utf8 换成 py -X utf8,其余参数不变。

什么时候用

  • 要在报告或对外介绍里写一个仓的代码行数与测试、配置、文档体量。
  • 要量一段时间内的提交数与改动量,或对比两个时点的规模。
  • 别人报的行数对不上,要换一条路复量。
  • 要给数字配上统计截止时间与各仓提交号,让结论可复核。

步骤

  1. 装法:只拷产品 core/ 一个目录即可用;纯 Python 标准库加 git,无需装包;要 Python 3.9+ 与支持 --attr-source 的 git。
  2. 单仓起手:{{统计命令}} --repo <仓路径> --ref HEAD --start <起时> --end <止时> --config {{规则文件}};起止用带时区的 ISO 8601 时间,窗口左闭右开、按提交者时间;--ref 一次解析成完整提交号,各仓 HEAD 就写它;只量 git 跟踪文件,不碰未跟踪文件与磁盘散件。
  3. 分类:{{规则文件}} 五键——exclude_path_globs、exclude_extensions、text_extensions、test_path_globs、include_merges;测试行靠 test_path_globs 单列一行;代码、配置、文档分列靠按扩展名多跑几趟(每趟一套 text_extensions)或用排除项,口径写进报告;行数含空行与注释,这点也要写明。
  4. 落盘:输出是打到标准输出的 UTF-8 Markdown,重定向存件;空仓或坏引用退出码 2;浅仓会被拒;缺对象不会触发补拉。
  5. 报告必写:统计截止时间(取跑的时刻,带时区)、各仓 HEAD 提交号、口径(跟踪文件、含空行注释、扩展名与排除规则、是否含合并);数变了要能对回是哪棵树、什么口径算的。
  6. 参数与规则键的细节以 core/tools/repo_scale.py --help 为准。

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.