SuperAPI AI 工具集

tidy

通用与其它

查看项目

更新于 10-16 01:09

技能介绍

用途:在草稿目录(wiki/sources/draft/.md)和渲染目录(llmwiki/html/.html)膨胀时进行清理与校验。核心动作是 PROMOTE(把草稿中的决策、经验、模式提升为 wiki 的 ADR/concept)、ARCHIVE(已完成的草稿移入 archive,保留历史不删除)、KEEP(规范文件保留)以及 RE-INDEX。

触发方式:会话开始时若检测到草稿根层 .md 文件超过阈值(默认 10),hook 会询问用户,同意后运行;用户也可主动调用 /tidy;或在 /lint 的 docs-sprawl 检查、medic 探测报 warn 时触发。

主要能力:读取草稿与 html 及 frontmatter;用 git mv 移动文件(保留历史,git 视为 rename 而非 delete);写入 wiki(ADR/concept/index/log);运行 wiki-health 与 index_sync 校验。工具负责确定性的计数、分类、移动与重建索引,agent 负责阅读并决定提升内容。

使用方式:先运行 python3 harness/scripts/tidy.py check(下游无 harness/ 时用 python3 ~/.claude/harness/harness/scripts/tidy.py check --root .),退出码 3 表示超过阈值;再运行 tidy.py plan 查看 KEEP/ARCHIVE/PROMOTE? 计划;agent 先完成 PROMOTE 写入 wiki,再运行 tidy.py apply 执行归档与重建索引;最后用 git status、wiki-health --fail-on broken、index_sync 校验并提交。阈值可用 --threshold N 或环境变量 OVERSTACK_DRAFT_THRESHOLD 调整,html 报告保留日期数用 --keep-dates N(默认 2)。

限制与边界:不删除草稿,只移动;不因文件旧就归档仍处于 proposed/open/implementing 的草稿;规范文件(overstack.html、index.html、wiki-graph.html、cheatsheet、health-dashboard、problem-tree、line-status 等)永不归档;archive/ 内文件被校验器忽略,不修改;目标目录被 .gitignore 时工具拒绝移动并提示需移除的 gitignore 行;wiki-health 或 index_sync 报错需先修复再提交。其余细节暂未提供。