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

92 lines
2.4 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.
---
name: instinct-export
description: 导出直觉Instincts以便与团队成员或其他项目共享
command: /instinct-export
---
# 直觉导出Instinct Export命令
将直觉Instincts导出为可共享的格式。非常适用于
- 与团队成员共享
- 迁移到新机器
- 为项目规范Conventions贡献内容
## 用法
```
/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. 脱敏处理(剥离敏感信息):
- 移除会话 IDSession IDs
- 移除文件路径(仅保留模式匹配符 Pattern
- 移除早于“上周”的时间戳
4. 生成导出文件
## 输出格式
创建一个 YAML 文件:
```yaml
# Instincts Export
# Generated: 2025-01-22
# Source: personal
# Count: 12 instincts
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>`: 仅导出指定的域Domain
- `--min-confidence <n>`: 最低置信度阈值默认值0.3
- `--output <file>`: 输出文件路径默认值instincts-export-YYYYMMDD.yaml
- `--format <yaml|json|md>`: 输出格式默认值yaml
- `--include-evidence`: 包含证据文本(默认值:排除)