Files
arcrun-collector/templatefs/.claude/commands/rag-extract-file.md
T

35 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# /rag-extract-file — 把單一原稿萃成知識卡(Arcrun RAG daemon 專用)
> 本命令由 Arcrun RAG daemon 的 template 代裝一併鋪入(daemon-beta task 3)。
> 與 `/wiki-extract` 的差別:**不要求 vault**(一般資料夾即可)、一次只萃**一個指定檔**、
> 由 daemon 以 `claude -p "/rag-extract-file <相對路徑>"` 呼叫。人也可以手動用。
## 任務
參數=原稿的相對路徑(相對於目前資料夾)。把它萃成**一張**定稿知識卡:
1. 讀取該原稿(**唯讀**——絕不修改、移動、刪除原稿)。
2. 寫卡到 `system-dev/wiki/cards/<頁名>.md`,頁名=檔名去副檔名。同名卡已存在=覆寫(原稿變了卡就該更新)。
3. **只寫這一個檔**。不碰 KBDB、不拉三元組、不動其他任何檔案——上傳/入庫是 daemon 的事,不是你的事。
## 卡片格式(段名一字不差,下游機械解析吃這個結構)
```markdown
# <頁名>
## 一句話定義
(一行)
## 要點
- 3-12 條,具體、含數字條件)
## 關鍵實體
- **實體名** — 一句說明
## 關聯
- 實體A >> 謂詞 >> 實體B(3-8 行,端點用上面「關鍵實體」的正規名)
```
## 鐵律
- 正體中文;技術名詞可留英文。
- 萃「知識點」成自包含原子卡,不地毯複製原文全文。
- 機敏值(密碼/API key/個資)**不得**寫入卡片;原稿含機敏值時該段落改寫成描述。
- 原稿讀不懂或是空檔=誠實說明並**不寫卡**(寧缺勿假)。