claude-code/claude-zh/commands/instinct-export.md

92 lines
2.3 KiB
Markdown
Raw Normal View History

2026-02-27 13:45:37 +00:00
---
name: instinct-export
description: 匯出直覺 (Instincts),以便與隊友分享或用於其他專案
command: /instinct-export
---
# 直覺匯出指令 (Instinct Export Command)
將直覺匯出為可分享的格式。非常適合於:
- 與隊友分享
- 轉移到新機器
- 貢獻於專案慣例
## 使用方式
```
/instinct-export # 匯出所有個人直覺
/instinct-export --domain testing # 僅匯出測試相關直覺
/instinct-export --min-confidence 0.7 # 僅匯出高置信度的直覺
/instinct-export --output team-instincts.yaml
```
## 操作步驟
1.`~/.claude/homunculus/instincts/personal/` 讀取直覺
2. 根據旗標 (Flags) 進行篩選
3. 清除敏感資訊:
- 移除會話 ID (Session IDs)
- 移除檔案路徑 (僅保留模式 patterns)
- 移除早於「上週」的時間戳記
4. 生成匯出檔案
## 輸出格式
建立一個 YAML 檔案:
```yaml
# 直覺匯出 (Instincts Export)
# 生成日期2025-01-22
# 來源personal
# 數量12 則直覺
version: "2.0"
exported_by: "continuous-learning-v2"
export_date: "2025-01-22T10:30:00Z"
instincts:
- id: prefer-functional-style
trigger: "when writing new functions"
action: "Use functional patterns over classes"
confidence: 0.8
domain: code-style
observations: 8
- id: test-first-workflow
trigger: "when adding new functionality"
action: "Write test first, then implementation"
confidence: 0.9
domain: testing
observations: 12
- id: grep-before-edit
trigger: "when modifying code"
action: "Search with Grep, confirm with Read, then Edit"
confidence: 0.7
domain: workflow
observations: 6
```
## 隱私考量
匯出內容包含:
- ✅ 觸發模式 (Trigger patterns)
- ✅ 行動 (Actions)
- ✅ 置信度評分 (Confidence scores)
- ✅ 領域 (Domains)
- ✅ 觀察計數 (Observation counts)
匯出內容**不**包含:
- ❌ 實際程式碼片段
- ❌ 檔案路徑
- ❌ 會話逐字稿
- ❌ 個人識別資訊
## 旗標 (Flags)
- `--domain <name>`:僅匯出指定領域
- `--min-confidence <n>`:最低置信度門檻 (預設0.3)
- `--output <file>`:輸出檔案路徑 (預設instincts-export-YYYYMMDD.yaml)
- `--format <yaml|json|md>`:輸出格式 (預設yaml)
- `--include-evidence`:包含證據文本 (預設:不包含)