Local files before sync with remote

This commit is contained in:
yangqianqian
2026-07-17 10:29:27 +08:00
commit 1dc354ef71
60 changed files with 4411 additions and 0 deletions

18
.claude/commands/kb-check.md Executable file
View File

@@ -0,0 +1,18 @@
---
description: frontmatter 校验 + lint 体检
argument-hint: [可选:路径,默认全库]
---
跑知识库健康体检。
1. 执行:`python3 tools/kb-lint-fm.py $ARGUMENTS`(无参数则扫全库)。
2. 解读退出码:
- `0`:全绿,简报"检查 N 页0 错误"。
- `1`:有 frontmatter 错误(缺硬必填 / 未激活 type / enum 非法 / 派生必填缺失)。
- `2`:环境问题(缺 PyYAML → 提示 `pip install pyyaml`;缺契约文件)。
3. 对每条错误:
- **安全项**(补 title、补可推导字段、加 wikilink→ 你直接自动修,修完重跑确认。
- **有损项**(删页、合并、改 type、解决矛盾→ 列出来交用户拍板,**不擅自改**。
4. 简报修了什么、还剩什么需人处理。
校验规则一律以 `meta/kb-contract.yaml` 为准。