Initial commit: company-kb framework
- 完整的知识库框架(P0-P5 路线图) - 12篇治理文档 - 工具脚本(kb-init.sh, kb-lint-fm.py, feishu-sync.py, kb-bot) - 7个 Claude 命令 - 示例项目和测试项目(wanniu-l1) - 契约文件(meta/kb-contract.yaml) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
24
.claude/commands/kb-ingest.md
Executable file
24
.claude/commands/kb-ingest.md
Executable file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
description: 录入循环——把原始资料编译成 OKF 合规知识页
|
||||
argument-hint: <项目代号> <源:文件路径/URL/粘贴的聊天>
|
||||
---
|
||||
|
||||
录入循环。参数:`$ARGUMENTS`(第一个词是项目代号,其余是源)。人只负责丢资料 + 一句说明 + 对要点点头;其余你自动完成。
|
||||
|
||||
执行步骤:
|
||||
1. **读契约**:先读 `meta/kb-contract.yaml` 拿 type 集、字段必填矩阵、enum。所有 frontmatter 严格据此,禁止硬编码。
|
||||
2. **取内容**:源是文件→Read;是 URL→WebFetch;是粘贴文本→直接用。
|
||||
3. **去重**:与 `meta/ingest-manifest.json` 比对内容 hash,命中则跳过并告知。
|
||||
4. **落原文**:原始内容存到 `projects/<代号>/` 对应子目录(doc→docs/,聊天→conversations/)。
|
||||
5. **抽要点**:展示 3-5 个关键发现(决策/需求/风险/客户信息),请用户点头或修正。
|
||||
6. **编译成页**:按要点写成 OKF 合规页(参考 `projects/_example/` 的结构与 frontmatter):
|
||||
- 自动补齐可推导字段:`title`(←H1/文件名)、`created`(←源日期或今天)、`ingested`(=今天)、`source`/`source_link`(←采集来源)、`status: seed`。
|
||||
- 只有判断类字段(如 `author`、信息有效期 `timestamp`)需要时才问人。
|
||||
- 决策→`decisions/`(type: decision),聊天沉淀→`conversations/`(type: conversation)。
|
||||
- 加 `related: [[...]]` wikilink 连到项目 _index 和相关页。
|
||||
7. **矛盾挂起**:若新信息与已有页冲突,用 `> [!contradiction]` callout 标注,**不静默覆盖**,交人裁决。
|
||||
8. **更新 manifest**:把 hash + 时间 + 影响页写回 `meta/ingest-manifest.json`。
|
||||
9. **校验**:跑 `python3 tools/kb-lint-fm.py projects/<代号>`,必须 exit 0。
|
||||
10. 简报写了哪些页。
|
||||
|
||||
铁律:AI 永不擅自有损操作(删/覆盖)、永不编造、溯源字段必挂。
|
||||
Reference in New Issue
Block a user