| name | kb-status |
| description | 展示知识库整体状态仪表盘。当用户说"知识库状态"、"kb status"、"看看知识库"时触发。
|
| user-invocable | true |
知识库状态
展示知识库的整体健康度和统计信息。
执行步骤
Step 1: 定位知识库
- 查找
index/MASTER-INDEX.md 确定根目录
- 如果找不到,提示用户先运行
/kb-init
Step 2: 收集统计数据
使用 Bash 工具执行以下统计:
- raw/ 文件数:
find raw/ -type f ! -path '*/\.extracted/*' | wc -l
- wiki/ 文章数:
find wiki/ -name '*.md' | wc -l
- wiki/ 总词数:
find wiki/ -name '*.md' -exec cat {} + | wc -c(字符数,中文约等于词数)
- 编译率:读
index/RAW-REGISTRY.md,统计 done 和 pending 的比例
- output/ 待回填报告数:
find output/ -name '*.md' | wc -l
- 上次 lint 结果:如果
index/LINT-REPORT.md 存在,读取摘要
Step 3: 展示仪表盘
以文本仪表盘格式输出:
知识库状态
══════════════════════════════════
原始文件: 42 个
Wiki 文章: 28 篇 (共 ~85,000 字)
编译率: 85% (36/42)
待回填: 3 份报告
上次 Lint: 2026-04-02 — 2 断链, 1 矛盾
══════════════════════════════════
最近编译的文章:
- wiki/concepts/xxx.md (2026-04-02)
- wiki/concepts/yyy.md (2026-04-01)
待处理:
- 6 个文件待编译 → /kb-compile
- 3 份报告待回填 → /kb-file
Step 4: 建议下一步操作
- 根据状态给出建议(如有待编译文件建议跑 compile,很久没 lint 建议跑 lint)