docs: 完成所有文档的中文翻译并应用到项目

This commit is contained in:
xuxiang
2026-01-28 00:12:54 +08:00
parent 0ced59a26b
commit e133f58e1c
76 changed files with 6808 additions and 6170 deletions

View File

@@ -1,27 +1,27 @@
---
name: continuous-learning-v2
description: Instinct-based learning system that observes sessions via hooks, creates atomic instincts with confidence scoring, and evolves them into skills/commands/agents.
description: 基于直觉的学习系统通过钩子hooks观察会话创建带有置信度评分的原子直觉atomic instincts并将其演化为技能/命令/智能体。
version: 2.0.0
---
# Continuous Learning v2 - Instinct-Based Architecture
# 持续学习 v2 - 基于直觉的架构 (Instinct-Based Architecture)
An advanced learning system that turns your Claude Code sessions into reusable knowledge through atomic "instincts" - small learned behaviors with confidence scoring.
一个高级学习系统通过原子“直觉instincts”——带有置信度评分的小型习得行为将你的 Claude Code 会话转化为可复用的知识。
## What's New in v2
## v2 版本新特性
| Feature | v1 | v2 |
| 特性 | v1 | v2 |
|---------|----|----|
| Observation | Stop hook (session end) | PreToolUse/PostToolUse (100% reliable) |
| Analysis | Main context | Background agent (Haiku) |
| Granularity | Full skills | Atomic "instincts" |
| Confidence | None | 0.3-0.9 weighted |
| Evolution | Direct to skill | Instincts → cluster → skill/command/agent |
| Sharing | None | Export/import instincts |
| 观察 (Observation) | Stop 钩子(会话结束) | PreToolUse/PostToolUse (100% 可靠) |
| 分析 (Analysis) | 主上下文 (Main context) | 后台智能体 (Haiku) |
| 粒度 (Granularity) | 完整技能 (Full skills) | 原子“直觉(instincts)” |
| 置信度 (Confidence) | | 0.3-0.9 加权 |
| 演化 (Evolution) | 直接转换为技能 | 直觉 → 聚类 → 技能/命令/智能体 |
| 共享 (Sharing) | 无 | 导出/导入直觉 |
## The Instinct Model
## 直觉模型 (The Instinct Model)
An instinct is a small learned behavior:
“直觉(instinct)”是一个小型的习得行为:
```yaml
---
@@ -32,44 +32,44 @@ domain: "code-style"
source: "session-observation"
---
# Prefer Functional Style
# 偏好函数式风格 (Prefer Functional Style)
## Action
Use functional patterns over classes when appropriate.
## 操作 (Action)
在合适的时候优先使用函数式模式而非类class
## Evidence
- Observed 5 instances of functional pattern preference
- User corrected class-based approach to functional on 2025-01-15
## 证据 (Evidence)
- 观察到 5 次偏好函数式模式的实例
- 用户在 2025-01-15 将基于类的方法修正为函数式
```
**Properties:**
- **Atomic** — one trigger, one action
- **Confidence-weighted** — 0.3 = tentative, 0.9 = near certain
- **Domain-tagged** — code-style, testing, git, debugging, workflow, etc.
- **Evidence-backed** — tracks what observations created it
**属性:**
- **原子性 (Atomic)** — 一个触发器,一个动作
- **置信度加权 (Confidence-weighted)** — 0.3 = 尝试性的0.9 = 近乎确定
- **领域标签 (Domain-tagged)** — code-styletestinggitdebuggingworkflow
- **证据支持 (Evidence-backed)** — 追踪是哪些观察结果创建了它
## How It Works
## 工作原理
```
Session Activity
会话活动 (Session Activity)
Hooks capture prompts + tool use (100% reliable)
钩子捕获提示词 + 工具使用 (100% 可靠)
┌─────────────────────────────────────────┐
│ observations.jsonl │
│ (prompts, tool calls, outcomes)
│ (提示词, 工具调用, 结果)
└─────────────────────────────────────────┘
Observer agent reads (background, Haiku)
观察者智能体读取 (后台运行, Haiku)
┌─────────────────────────────────────────┐
│ PATTERN DETECTION
│ • User corrections → instinct
│ • Error resolutions → instinct
│ • Repeated workflows → instinct
模式检测 (PATTERN DETECTION)
│ • 用户修正 → 直觉
│ • 错误修复 → 直觉
│ • 重复工作流 → 直觉
└─────────────────────────────────────────┘
Creates/updates
创建/更新
┌─────────────────────────────────────────┐
│ instincts/personal/ │
@@ -78,7 +78,7 @@ Session Activity
│ • use-zod-validation.md (0.6) │
└─────────────────────────────────────────┘
│ /evolve clusters
│ /evolve 聚类
┌─────────────────────────────────────────┐
│ evolved/ │
@@ -88,11 +88,11 @@ Session Activity
└─────────────────────────────────────────┘
```
## Quick Start
## 快速开始
### 1. Enable Observation Hooks
### 1. 启用观察钩子 (Observation Hooks)
Add to your `~/.claude/settings.json`:
添加到你的 `~/.claude/settings.json`
```json
{
@@ -115,34 +115,34 @@ Add to your `~/.claude/settings.json`:
}
```
### 2. Initialize Directory Structure
### 2. 初始化目录结构
```bash
mkdir -p ~/.claude/homunculus/{instincts/{personal,inherited},evolved/{agents,skills,commands}}
touch ~/.claude/homunculus/observations.jsonl
```
### 3. Run the Observer Agent (Optional)
### 3. 运行观察者智能体 (可选)
The observer can run in the background analyzing observations:
观察者可以在后台运行,分析观察结果:
```bash
# Start background observer
# 启动后台观察者
~/.claude/skills/continuous-learning-v2/agents/start-observer.sh
```
## Commands
## 命令
| Command | Description |
| 命令 | 描述 |
|---------|-------------|
| `/instinct-status` | Show all learned instincts with confidence |
| `/evolve` | Cluster related instincts into skills/commands |
| `/instinct-export` | Export instincts for sharing |
| `/instinct-import <file>` | Import instincts from others |
| `/instinct-status` | 显示所有习得的直觉及其置信度 |
| `/evolve` | 将相关的直觉聚类为技能/命令 |
| `/instinct-export` | 导出直觉以便共享 |
| `/instinct-import <file>` | 从他人处导入直觉 |
## Configuration
## 配置
Edit `config.json`:
编辑 `config.json`
```json
{
@@ -178,80 +178,80 @@ Edit `config.json`:
}
```
## File Structure
## 文件结构
```
~/.claude/homunculus/
├── identity.json # Your profile, technical level
├── observations.jsonl # Current session observations
├── observations.archive/ # Processed observations
├── identity.json # 你的个人资料、技术水平
├── observations.jsonl # 当前会话观察结果
├── observations.archive/ # 已处理的观察结果
├── instincts/
│ ├── personal/ # Auto-learned instincts
│ └── inherited/ # Imported from others
│ ├── personal/ # 自动习得的直觉
│ └── inherited/ # 从他人处导入的直觉
└── evolved/
├── agents/ # Generated specialist agents
├── skills/ # Generated skills
└── commands/ # Generated commands
├── agents/ # 生成的专家智能体
├── skills/ # 生成的技能
└── commands/ # 生成的命令
```
## Integration with Skill Creator
## 与技能创建器 (Skill Creator) 集成
When you use the [Skill Creator GitHub App](https://skill-creator.app), it now generates **both**:
- Traditional SKILL.md files (for backward compatibility)
- Instinct collections (for v2 learning system)
当你使用 [Skill Creator GitHub App](https://skill-creator.app) 时,它现在会**同时**生成:
- 传统的 SKILL.md 文件(为了向后兼容)
- 直觉集合 (Instinct collections)(为了 v2 学习系统)
Instincts from repo analysis have `source: "repo-analysis"` and include the source repository URL.
来自仓库分析的直觉带有 `source: "repo-analysis"` 标签,并包含源仓库的 URL
## Confidence Scoring
## 置信度评分 (Confidence Scoring)
Confidence evolves over time:
置信度会随时间演化:
| Score | Meaning | Behavior |
| 分数 | 含义 | 行为 |
|-------|---------|----------|
| 0.3 | Tentative | Suggested but not enforced |
| 0.5 | Moderate | Applied when relevant |
| 0.7 | Strong | Auto-approved for application |
| 0.9 | Near-certain | Core behavior |
| 0.3 | 尝试性 (Tentative) | 建议但不强制执行 |
| 0.5 | 中等 (Moderate) | 在相关时应用 |
| 0.7 | 强 (Strong) | 自动批准应用 |
| 0.9 | 近乎确定 (Near-certain) | 核心行为 |
**Confidence increases** when:
- Pattern is repeatedly observed
- User doesn't correct the suggested behavior
- Similar instincts from other sources agree
**置信度增加** 的情况:
- 模式被重复观察到
- 用户没有修正建议的行为
- 来自其他来源的类似直觉达成一致
**Confidence decreases** when:
- User explicitly corrects the behavior
- Pattern isn't observed for extended periods
- Contradicting evidence appears
**置信度降低** 的情况:
- 用户明确修正了该行为
- 模式在很长一段时间内没有被观察到
- 出现矛盾的证据
## Why Hooks vs Skills for Observation?
## 为什么使用钩子 (Hooks) 而非技能 (Skills) 进行观察?
> "v1 relied on skills to observe. Skills are probabilistic—they fire ~50-80% of the time based on Claude's judgment."
> v1 依赖技能进行观察。技能是概率性的——根据 Claude 的判断,它们的触发率约为 50-80%。”
Hooks fire **100% of the time**, deterministically. This means:
- Every tool call is observed
- No patterns are missed
- Learning is comprehensive
钩子(Hooks)的触发是 **100% 确定性**的。这意味着:
- 每一个工具调用都会被观察到
- 不会遗漏任何模式
- 学习是全面的
## Backward Compatibility
## 向后兼容性
v2 is fully compatible with v1:
- Existing `~/.claude/skills/learned/` skills still work
- Stop hook still runs (but now also feeds into v2)
- Gradual migration path: run both in parallel
v2 完全兼容 v1
- 现有的 `~/.claude/skills/learned/` 技能仍然有效
- Stop 钩子仍然运行(但现在也会输入到 v2 系统中)
- 渐进式迁移路径:并行运行两者
## Privacy
## 隐私
- Observations stay **local** on your machine
- Only **instincts** (patterns) can be exported
- No actual code or conversation content is shared
- You control what gets exported
- 观察结果保存在你的本地机器上
- 只有 **直觉(instincts**(即模式)可以被导出
- 不会共享实际的代码或对话内容
- 你可以控制哪些内容被导出
## Related
## 相关链接
- [Skill Creator](https://skill-creator.app) - Generate instincts from repo history
- [Homunculus](https://github.com/humanplane/homunculus) - Inspiration for v2 architecture
- [The Longform Guide](https://x.com/affaanmustafa/status/2014040193557471352) - Continuous learning section
- [Skill Creator](https://skill-creator.app) - 从仓库历史生成直觉
- [Homunculus](https://github.com/humanplane/homunculus) - v2 架构的灵感来源
- [The Longform Guide](https://x.com/affaanmustafa/status/2014040193557471352) - 持续学习章节
---
*Instinct-based learning: teaching Claude your patterns, one observation at a time.*
*基于直觉的学习:通过一次又一次的观察,教会 Claude 你的模式。*

View File

@@ -1,24 +1,24 @@
---
name: observer
description: Background agent that analyzes session observations to detect patterns and create instincts. Uses Haiku for cost-efficiency.
description: 分析会话观测observations以检测模式patterns并创建直觉instincts的后台智能体Agent。使用 Haiku 模型以保证成本效益。
model: haiku
run_mode: background
---
# Observer Agent
# 观测者智能体 (Observer Agent)
A background agent that analyzes observations from Claude Code sessions to detect patterns and create instincts.
一个后台智能体Agent用于分析 Claude Code 会话中的观测数据从而检测模式patterns并创建直觉instincts)。
## When to Run
## 运行时机
- After significant session activity (20+ tool calls)
- When user runs `/analyze-patterns`
- On a scheduled interval (configurable, default 5 minutes)
- When triggered by observation hook (SIGUSR1)
- 当会话活动显著时(超过 20 次工具调用)
- 当用户运行 `/analyze-patterns` 命令时
- 按预定时间间隔(可配置,默认为 5 分钟)
- 当被观测钩子(observation hook)触发时(SIGUSR1
## Input
## 输入
Reads observations from `~/.claude/homunculus/observations.jsonl`:
`~/.claude/homunculus/observations.jsonl` 读取观测数据:
```jsonl
{"timestamp":"2025-01-22T10:30:00Z","event":"tool_start","session":"abc123","tool":"Edit","input":"..."}
@@ -27,45 +27,45 @@ Reads observations from `~/.claude/homunculus/observations.jsonl`:
{"timestamp":"2025-01-22T10:30:10Z","event":"tool_complete","session":"abc123","tool":"Bash","output":"All tests pass"}
```
## Pattern Detection
## 模式检测
Look for these patterns in observations:
在观测数据中寻找以下模式:
### 1. User Corrections
When a user's follow-up message corrects Claude's previous action:
- "No, use X instead of Y"
- "Actually, I meant..."
- Immediate undo/redo patterns
### 1. 用户修正
当用户的后续消息修正了 Claude 之前的操作时:
- "不,用 X 代替 Y"
- "实际上,我的意思是……"
- 立即撤销/重做模式
Create instinct: "When doing X, prefer Y"
创建直觉(instinct"执行 X 时,优先使用 Y"
### 2. Error Resolutions
When an error is followed by a fix:
- Tool output contains error
- Next few tool calls fix it
- Same error type resolved similarly multiple times
### 2. 错误修复
当错误发生后紧接着修复操作时:
- 工具输出包含错误
- 接下来的几次工具调用修复了该错误
- 同类错误多次以类似方式解决
Create instinct: "When encountering error X, try Y"
创建直觉(instinct"遇到错误 X 时,尝试 Y"
### 3. Repeated Workflows
When the same sequence of tools is used multiple times:
- Same tool sequence with similar inputs
- File patterns that change together
- Time-clustered operations
### 3. 重复工作流
当多次使用相同的工具序列时:
- 输入相似的相同工具序列
- 同步变更的文件模式
- 时间上聚集的操作
Create workflow instinct: "When doing X, follow steps Y, Z, W"
创建工作流直觉(workflow instinct"执行 X 时,遵循步骤 Y、Z、W"
### 4. Tool Preferences
When certain tools are consistently preferred:
- Always uses Grep before Edit
- Prefers Read over Bash cat
- Uses specific Bash commands for certain tasks
### 4. 工具偏好
当某些工具被持续偏好使用时:
- 总是在 Edit 之前使用 Grep
- 相比 Bash cat 更倾向于使用 Read
- 针对特定任务使用特定的 Bash 命令
Create instinct: "When needing X, use tool Y"
创建直觉(instinct"当需要 X 时,使用工具 Y"
## Output
## 输出
Creates/updates instincts in `~/.claude/homunculus/instincts/personal/`:
`~/.claude/homunculus/instincts/personal/` 中创建/更新直觉instincts
```yaml
---
@@ -76,41 +76,41 @@ domain: "workflow"
source: "session-observation"
---
# Prefer Grep Before Edit
# 优先在 Edit 前使用 Grep
## Action
Always use Grep to find the exact location before using Edit.
## 动作
在使用 Edit 之前,始终使用 Grep 查找确切位置。
## Evidence
- Observed 8 times in session abc123
- Pattern: Grep → Read → Edit sequence
- Last observed: 2025-01-22
## 证据
- 在会话 abc123 中观测到 8 次
- 模式:Grep → Read → Edit 序列
- 最近观测时间:2025-01-22
```
## Confidence Calculation
## 置信度计算
Initial confidence based on observation frequency:
- 1-2 observations: 0.3 (tentative)
- 3-5 observations: 0.5 (moderate)
- 6-10 observations: 0.7 (strong)
- 11+ observations: 0.85 (very strong)
基于观测频率的初始置信度:
- 1-2 次观测0.3(初步)
- 3-5 次观测0.5(中等)
- 6-10 次观测0.7(强)
- 11+ 次观测0.85(极强)
Confidence adjusts over time:
- +0.05 for each confirming observation
- -0.1 for each contradicting observation
- -0.02 per week without observation (decay)
置信度随时间调整:
- 每次证实性观测 +0.05
- 每次矛盾性观测 -0.1
- 无观测每周 -0.02(衰减)
## Important Guidelines
## 重要指南
1. **Be Conservative**: Only create instincts for clear patterns (3+ observations)
2. **Be Specific**: Narrow triggers are better than broad ones
3. **Track Evidence**: Always include what observations led to the instinct
4. **Respect Privacy**: Never include actual code snippets, only patterns
5. **Merge Similar**: If a new instinct is similar to existing, update rather than duplicate
1. **保持保守**仅针对清晰的模式3 次以上观测)创建直觉
2. **保持具体**:具体的触发条件优于宽泛的条件
3. **追踪证据**:始终包含导致该直觉的观测结果
4. **尊重隐私**:切勿包含实际代码片段,仅包含模式
5. **合并相似项**:如果新直觉与现有直觉相似,应进行更新而非重复创建
## Example Analysis Session
## 示例分析会话
Given observations:
给定观测数据:
```jsonl
{"event":"tool_start","tool":"Grep","input":"pattern: useState"}
{"event":"tool_complete","tool":"Grep","output":"Found in 3 files"}
@@ -119,19 +119,19 @@ Given observations:
{"event":"tool_start","tool":"Edit","input":"src/hooks/useAuth.ts..."}
```
Analysis:
- Detected workflow: Grep → Read → Edit
- Frequency: Seen 5 times this session
- Create instinct:
分析:
- 检测到的工作流:Grep → Read → Edit
- 频率:本会话出现 5 次
- 创建直觉:
- trigger: "when modifying code"
- action: "Search with Grep, confirm with Read, then Edit"
- action: "先用 Grep 搜索,再用 Read 确认,最后 Edit"
- confidence: 0.6
- domain: "workflow"
## Integration with Skill Creator
## 与技能生成器 (Skill Creator) 集成
When instincts are imported from Skill Creator (repo analysis), they have:
当从技能生成器(仓库分析)导入直觉时,它们具有:
- `source: "repo-analysis"`
- `source_repo: "https://github.com/..."`
These should be treated as team/project conventions with higher initial confidence (0.7+).
这些应被视为团队/项目规范,具有较高的初始置信度(0.7+)。

View File

@@ -1,141 +1,141 @@
---
name: evolve
description: Cluster related instincts into skills, commands, or agents
description: 将相关本能Instincts聚类为技能、命令或智能体
command: /evolve
implementation: python3 ~/.claude/skills/continuous-learning-v2/scripts/instinct-cli.py evolve
---
# Evolve Command
# 演进(Evolve)命令
## Implementation
## 实现
```bash
python3 ~/.claude/skills/continuous-learning-v2/scripts/instinct-cli.py evolve [--generate]
```
Analyzes instincts and clusters related ones into higher-level structures:
- **Commands**: When instincts describe user-invoked actions
- **Skills**: When instincts describe auto-triggered behaviors
- **Agents**: When instincts describe complex, multi-step processes
分析本能Instincts并将相关的本能聚类为更高级别的结构
- **命令(Commands**:当本能描述的是用户调用的操作时
- **技能(Skills**:当本能描述的是自动触发的行为时
- **智能体(Agents**:当本能描述的是复杂的、多步骤的过程时
## Usage
## 用法
```
/evolve # Analyze all instincts and suggest evolutions
/evolve --domain testing # Only evolve instincts in testing domain
/evolve --dry-run # Show what would be created without creating
/evolve --threshold 5 # Require 5+ related instincts to cluster
/evolve # 分析所有本能并建议演进方案
/evolve --domain testing # 仅演进测试领域(testing domain)中的本能
/evolve --dry-run # 显示将要创建的内容而不实际执行
/evolve --threshold 5 # 要求 5 个或更多相关本能才进行聚类
```
## Evolution Rules
## 演进规则
### → Command (User-Invoked)
When instincts describe actions a user would explicitly request:
- Multiple instincts about "when user asks to..."
- Instincts with triggers like "when creating a new X"
- Instincts that follow a repeatable sequence
### → 命令(Command,用户调用)
当本能描述用户会显式请求的操作时:
- 多个关于“当用户要求...”的本能
- 带有“在创建新的 X 时”等触发器的本能
- 遵循可重复序列的本能
Example:
- `new-table-step1`: "when adding a database table, create migration"
- `new-table-step2`: "when adding a database table, update schema"
- `new-table-step3`: "when adding a database table, regenerate types"
示例:
- `new-table-step1`:“在添加数据库表时,创建迁移文件”
- `new-table-step2`:“在添加数据库表时,更新 schema
- `new-table-step3`:“在添加数据库表时,重新生成类型”
Creates: `/new-table` command
创建:`/new-table` 命令
### → Skill (Auto-Triggered)
When instincts describe behaviors that should happen automatically:
- Pattern-matching triggers
- Error handling responses
- Code style enforcement
### → 技能(Skill,自动触发)
当本能描述应该自动发生的行为时:
- 模式匹配触发器
- 错误处理响应
- 代码风格强制执行
Example:
- `prefer-functional`: "when writing functions, prefer functional style"
- `use-immutable`: "when modifying state, use immutable patterns"
- `avoid-classes`: "when designing modules, avoid class-based design"
示例:
- `prefer-functional`:“在编写函数时,优先使用函数式风格”
- `use-immutable`:“在修改状态时,使用不可变模式”
- `avoid-classes`:“在设计模块时,避免基于类的设计”
Creates: `functional-patterns` skill
创建:`functional-patterns` 技能
### → Agent (Needs Depth/Isolation)
When instincts describe complex, multi-step processes that benefit from isolation:
- Debugging workflows
- Refactoring sequences
- Research tasks
### → 智能体(Agent,需要深度/隔离)
当本能描述受益于隔离的复杂、多步骤过程时:
- 调试工作流Workflow
- 重构序列
- 研究任务
Example:
- `debug-step1`: "when debugging, first check logs"
- `debug-step2`: "when debugging, isolate the failing component"
- `debug-step3`: "when debugging, create minimal reproduction"
- `debug-step4`: "when debugging, verify fix with test"
示例:
- `debug-step1`:“调试时,先检查日志”
- `debug-step2`:“调试时,隔离故障组件”
- `debug-step3`:“调试时,创建最小复现”
- `debug-step4`:“调试时,通过测试验证修复”
Creates: `debugger` agent
创建:`debugger` 智能体
## What to Do
## 执行步骤
1. Read all instincts from `~/.claude/homunculus/instincts/`
2. Group instincts by:
- Domain similarity
- Trigger pattern overlap
- Action sequence relationship
3. For each cluster of 3+ related instincts:
- Determine evolution type (command/skill/agent)
- Generate the appropriate file
- Save to `~/.claude/homunculus/evolved/{commands,skills,agents}/`
4. Link evolved structure back to source instincts
1. `~/.claude/homunculus/instincts/` 读取所有本能
2. 按以下维度对本能进行分组:
- 领域相似性
- 触发模式重叠
- 动作序列关系
3. 对于每个包含 3 个或更多相关本能的聚类:
- 确定演进类型(命令/技能/智能体)
- 生成相应的文件
- 保存到 `~/.claude/homunculus/evolved/{commands,skills,agents}/`
4. 将演进后的结构链接回源本能
## Output Format
## 输出格式
```
🧬 Evolve Analysis
🧬 演进分析(Evolve Analysis
==================
Found 3 clusters ready for evolution:
发现 3 个已准备好演进的聚类:
## Cluster 1: Database Migration Workflow
Instincts: new-table-migration, update-schema, regenerate-types
Type: Command
Confidence: 85% (based on 12 observations)
## 聚类 1: 数据库迁移工作流
本能: new-table-migration, update-schema, regenerate-types
类型: 命令 (Command)
置信度: 85% (基于 12 次观察)
Would create: /new-table command
Files:
将创建: /new-table 命令
文件:
- ~/.claude/homunculus/evolved/commands/new-table.md
## Cluster 2: Functional Code Style
Instincts: prefer-functional, use-immutable, avoid-classes, pure-functions
Type: Skill
Confidence: 78% (based on 8 observations)
## 聚类 2: 函数式代码风格
本能: prefer-functional, use-immutable, avoid-classes, pure-functions
类型: 技能 (Skill)
置信度: 78% (基于 8 次观察)
Would create: functional-patterns skill
Files:
将创建: functional-patterns 技能
文件:
- ~/.claude/homunculus/evolved/skills/functional-patterns.md
## Cluster 3: Debugging Process
Instincts: debug-check-logs, debug-isolate, debug-reproduce, debug-verify
Type: Agent
Confidence: 72% (based on 6 observations)
## 聚类 3: 调试过程
本能: debug-check-logs, debug-isolate, debug-reproduce, debug-verify
类型: 智能体 (Agent)
置信度: 72% (基于 6 次观察)
Would create: debugger agent
Files:
将创建: debugger 智能体
文件:
- ~/.claude/homunculus/evolved/agents/debugger.md
---
Run `/evolve --execute` to create these files.
运行 `/evolve --execute` 来创建这些文件。
```
## Flags
## 标志(Flags
- `--execute`: Actually create the evolved structures (default is preview)
- `--dry-run`: Preview without creating
- `--domain <name>`: Only evolve instincts in specified domain
- `--threshold <n>`: Minimum instincts required to form cluster (default: 3)
- `--type <command|skill|agent>`: Only create specified type
- `--execute`:实际创建演进后的结构(默认为预览)
- `--dry-run`:预览而不创建
- `--domain <name>`:仅演进指定领域中的本能
- `--threshold <n>`形成聚类所需的最小本能数量默认3
- `--type <command|skill|agent>`:仅创建指定类型
## Generated File Format
## 生成文件格式
### Command
### 命令 (Command)
```markdown
---
name: new-table
description: Create a new database table with migration, schema update, and type generation
description: 创建带有迁移、schema 更新和类型生成的数据库新表
command: /new-table
evolved_from:
- new-table-migration
@@ -143,36 +143,36 @@ evolved_from:
- regenerate-types
---
# New Table Command
# New Table 命令
[Generated content based on clustered instincts]
[基于聚类本能生成的具体内容]
## Steps
## 步骤
1. ...
2. ...
```
### Skill
### 技能 (Skill)
```markdown
---
name: functional-patterns
description: Enforce functional programming patterns
description: 强制执行函数式编程模式
evolved_from:
- prefer-functional
- use-immutable
- avoid-classes
---
# Functional Patterns Skill
# Functional Patterns 技能
[Generated content based on clustered instincts]
[基于聚类本能生成的具体内容]
```
### Agent
### 智能体 (Agent)
```markdown
---
name: debugger
description: Systematic debugging agent
description: 系统化调试智能体
model: sonnet
evolved_from:
- debug-check-logs
@@ -180,7 +180,7 @@ evolved_from:
- debug-reproduce
---
# Debugger Agent
# Debugger 智能体
[Generated content based on clustered instincts]
[基于聚类本能生成的具体内容]
```

View File

@@ -1,38 +1,38 @@
---
name: instinct-export
description: Export instincts for sharing with teammates or other projects
description: 导出直觉Instincts以便与团队成员或其他项目共享
command: /instinct-export
---
# Instinct Export Command
# 直觉导出命令(Instinct Export Command
Exports instincts to a shareable format. Perfect for:
- Sharing with teammates
- Transferring to a new machine
- Contributing to project conventions
将直觉Instincts导出为可共享的格式。非常适用于
- 与团队成员共享
- 迁移到新机器
- 贡献到项目规范Conventions)中
## Usage
## 使用方法
```
/instinct-export # Export all personal instincts
/instinct-export --domain testing # Export only testing instincts
/instinct-export --min-confidence 0.7 # Only export high-confidence instincts
/instinct-export # 导出所有个人直觉
/instinct-export --domain testing # 仅导出测试Testing领域的直觉
/instinct-export --min-confidence 0.7 # 仅导出高置信度的直觉
/instinct-export --output team-instincts.yaml
```
## What to Do
## 执行逻辑
1. Read instincts from `~/.claude/homunculus/instincts/personal/`
2. Filter based on flags
3. Strip sensitive information:
- Remove session IDs
- Remove file paths (keep only patterns)
- Remove timestamps older than "last week"
4. Generate export file
1. `~/.claude/homunculus/instincts/personal/` 读取直觉数据
2. 根据参数Flags进行过滤
3. 脱敏敏感信息:
- 移除会话 IDSession IDs
- 移除文件路径(仅保留模式串/Patterns
- 移除早于“上周”的时间戳
4. 生成导出文件
## Output Format
## 输出格式
Creates a YAML file:
创建一个 YAML 文件:
```yaml
# Instincts Export
@@ -67,25 +67,25 @@ instincts:
observations: 6
```
## Privacy Considerations
## 隐私说明
Exports include:
- ✅ Trigger patterns
- ✅ Actions
- ✅ Confidence scores
- ✅ Domains
- ✅ Observation counts
导出内容**包含**
-触发模式(Trigger patterns
-动作(Actions
-置信度评分(Confidence scores
-领域(Domains
-观测计数(Observation counts
Exports do NOT include:
-Actual code snippets
-File paths
- ❌ Session transcripts
-Personal identifiers
导出内容**不包含**
-实际代码片段
-文件路径
-会话转录(Session transcripts
-个人身份标识符
## Flags
## 参数(Flags
- `--domain <name>`: Export only specified domain
- `--min-confidence <n>`: Minimum confidence threshold (default: 0.3)
- `--output <file>`: Output file path (default: instincts-export-YYYYMMDD.yaml)
- `--format <yaml|json|md>`: Output format (default: yaml)
- `--include-evidence`: Include evidence text (default: excluded)
- `--domain <name>`: 仅导出指定领域Domain
- `--min-confidence <n>`: 最低置信度阈值(默认值:0.3
- `--output <file>`: 输出文件路径(默认值:instincts-export-YYYYMMDD.yaml
- `--format <yaml|json|md>`: 输出格式(默认值:yaml
- `--include-evidence`: 包含证据Evidence文本默认排除

View File

@@ -1,25 +1,25 @@
---
name: instinct-import
description: Import instincts from teammates, Skill Creator, or other sources
description: 从队友、技能生成器Skill Creator或其他来源导入直觉Instincts
command: /instinct-import
implementation: python3 ~/.claude/skills/continuous-learning-v2/scripts/instinct-cli.py import <file>
---
# Instinct Import Command
# 直觉导入命令(Instinct Import Command
## Implementation
## 实现
```bash
python3 ~/.claude/skills/continuous-learning-v2/scripts/instinct-cli.py import <file-or-url> [--dry-run] [--force] [--min-confidence 0.7]
```
Import instincts from:
- Teammates' exports
- Skill Creator (repo analysis)
- Community collections
- Previous machine backups
从以下来源导入直觉Instincts
- 队友导出的文件
- 技能生成器(Skill Creator)(仓库分析)
- 社区集合
- 之前的机器备份
## Usage
## 用法
```
/instinct-import team-instincts.yaml
@@ -27,109 +27,109 @@ Import instincts from:
/instinct-import --from-skill-creator acme/webapp
```
## What to Do
## 执行流程
1. Fetch the instinct file (local path or URL)
2. Parse and validate the format
3. Check for duplicates with existing instincts
4. Merge or add new instincts
5. Save to `~/.claude/homunculus/instincts/inherited/`
1. 获取直觉文件(本地路径或 URL
2. 解析并验证格式
3. 检查是否与现有直觉重复
4. 合并或添加新直觉
5. 保存至 `~/.claude/homunculus/instincts/inherited/`
## Import Process
## 导入过程示例
```
📥 Importing instincts from: team-instincts.yaml
📥 正在从 team-instincts.yaml 导入直觉:
================================================
Found 12 instincts to import.
发现 12 条待导入的直觉。
Analyzing conflicts...
正在分析冲突...
## New Instincts (8)
These will be added:
✓ use-zod-validation (confidence: 0.7)
✓ prefer-named-exports (confidence: 0.65)
✓ test-async-functions (confidence: 0.8)
## 新直觉 (8)
这些将被添加:
✓ use-zod-validation (置信度: 0.7)
✓ prefer-named-exports (置信度: 0.65)
✓ test-async-functions (置信度: 0.8)
...
## Duplicate Instincts (3)
Already have similar instincts:
## 重复直觉 (3)
已存在类似的直觉:
⚠️ prefer-functional-style
Local: 0.8 confidence, 12 observations
Import: 0.7 confidence
Keep local (higher confidence)
本地0.8 置信度12 个观测项
导入0.7 置信度
保留本地(置信度更高)
⚠️ test-first-workflow
Local: 0.75 confidence
Import: 0.9 confidence
Update to import (higher confidence)
本地0.75 置信度
导入0.9 置信度
更新为导入的内容(置信度更高)
## Conflicting Instincts (1)
These contradict local instincts:
## 冲突直觉 (1)
这些与本地直觉相矛盾:
❌ use-classes-for-services
Conflicts with: avoid-classes
Skip (requires manual resolution)
avoid-classes 冲突
跳过(需要手动解决)
---
Import 8 new, update 1, skip 3?
导入 8 个新项,更新 1 个,跳过 3 个?
```
## Merge Strategies
## 合并策略(Merge Strategies
### For Duplicates
When importing an instinct that matches an existing one:
- **Higher confidence wins**: Keep the one with higher confidence
- **Merge evidence**: Combine observation counts
- **Update timestamp**: Mark as recently validated
### 处理重复项
当导入的直觉与现有直觉匹配时:
- **高置信度胜出**保留置信度Confidence)较高的一方
- **合并证据**累计观测项Observation)计数
- **更新时间戳**:标记为最近已验证
### For Conflicts
When importing an instinct that contradicts an existing one:
- **Skip by default**: Don't import conflicting instincts
- **Flag for review**: Mark both as needing attention
- **Manual resolution**: User decides which to keep
### 处理冲突
当导入的直觉与现有直觉冲突时:
- **默认跳过**:不导入产生冲突的直觉
- **标记待审查**:将两者都标记为需要关注
- **手动解决**:由用户决定保留哪一个
## Source Tracking
## 来源追踪
Imported instincts are marked with:
导入的直觉会被标记以下字段:
```yaml
source: "inherited"
imported_from: "team-instincts.yaml"
imported_at: "2025-01-22T10:30:00Z"
original_source: "session-observation" # or "repo-analysis"
original_source: "session-observation" # "repo-analysis"
```
## Skill Creator Integration
## 技能生成器(Skill Creator)集成
When importing from Skill Creator:
从技能生成器(Skill Creator)导入时:
```
/instinct-import --from-skill-creator acme/webapp
```
This fetches instincts generated from repo analysis:
- Source: `repo-analysis`
- Higher initial confidence (0.7+)
- Linked to source repository
这将获取通过仓库分析生成的直觉:
- 来源:`repo-analysis`
- 较高的初始置信度(0.7+
- 已链接到源仓库
## Flags
## 参数标志(Flags
- `--dry-run`: Preview without importing
- `--force`: Import even if conflicts exist
- `--merge-strategy <higher|local|import>`: How to handle duplicates
- `--from-skill-creator <owner/repo>`: Import from Skill Creator analysis
- `--min-confidence <n>`: Only import instincts above threshold
- `--dry-run`:预览而不执行导入
- `--force`:即使存在冲突也强制导入
- `--merge-strategy <higher|local|import>`:如何处理重复项
- `--from-skill-creator <owner/repo>`:从技能生成器(Skill Creator)分析结果导入
- `--min-confidence <n>`:仅导入置信度高于阈值的直觉
## Output
## 输出
After import:
导入完成后:
```
Import complete!
导入完成!
Added: 8 instincts
Updated: 1 instinct
Skipped: 3 instincts (2 duplicates, 1 conflict)
已添加8 条直觉
已更新1 条直觉
已跳过3 条直觉2 个重复1 个冲突)
New instincts saved to: ~/.claude/homunculus/instincts/inherited/
新直觉已保存至:~/.claude/homunculus/instincts/inherited/
Run /instinct-status to see all instincts.
运行 /instinct-status 查看所有直觉。
```

View File

@@ -1,21 +1,21 @@
---
name: instinct-status
description: Show all learned instincts with their confidence levels
description: 显示所有已学习的直觉Instincts及其置信度水平
command: /instinct-status
implementation: python3 ~/.claude/skills/continuous-learning-v2/scripts/instinct-cli.py status
---
# Instinct Status Command
# Instinct Status 命令
Shows all learned instincts with their confidence scores, grouped by domain.
按领域Domain分组显示所有已学习的直觉Instincts及其置信度得分。
## Implementation
## 实现
```bash
python3 ~/.claude/skills/continuous-learning-v2/scripts/instinct-cli.py status
```
## Usage
## 用法
```
/instinct-status
@@ -23,57 +23,57 @@ python3 ~/.claude/skills/continuous-learning-v2/scripts/instinct-cli.py status
/instinct-status --low-confidence
```
## What to Do
## 执行逻辑
1. Read all instinct files from `~/.claude/homunculus/instincts/personal/`
2. Read inherited instincts from `~/.claude/homunculus/instincts/inherited/`
3. Display them grouped by domain with confidence bars
1. `~/.claude/homunculus/instincts/personal/` 读取所有个人直觉文件
2. `~/.claude/homunculus/instincts/inherited/` 读取继承的直觉
3. 按领域分组显示,并附带置信度进度条
## Output Format
## 输出格式
```
📊 Instinct Status
📊 直觉状态 (Instinct Status)
==================
## Code Style (4 instincts)
## 代码风格 (4 个直觉)
### prefer-functional-style
Trigger: when writing new functions
Action: Use functional patterns over classes
Confidence: ████████░░ 80%
Source: session-observation | Last updated: 2025-01-22
触发条件 (Trigger):编写新函数时
动作 (Action):优先使用函数式模式而非类
置信度 (Confidence)████████░░ 80%
来源 (Source)session-observation | 最后更新:2025-01-22
### use-path-aliases
Trigger: when importing modules
Action: Use @/ path aliases instead of relative imports
Confidence: ██████░░░░ 60%
Source: repo-analysis (github.com/acme/webapp)
触发条件 (Trigger):导入模块时
动作 (Action):使用 @/ 路径别名而非相对导入
置信度 (Confidence)██████░░░░ 60%
来源 (Source)repo-analysis (github.com/acme/webapp)
## Testing (2 instincts)
## 测试 (2 个直觉)
### test-first-workflow
Trigger: when adding new functionality
Action: Write test first, then implementation
Confidence: █████████░ 90%
Source: session-observation
触发条件 (Trigger):添加新功能时
动作 (Action):先写测试,再写实现
置信度 (Confidence)█████████░ 90%
来源 (Source)session-observation
## Workflow (3 instincts)
## 工作流 (3 个直觉)
### grep-before-edit
Trigger: when modifying code
Action: Search with Grep, confirm with Read, then Edit
Confidence: ███████░░░ 70%
Source: session-observation
触发条件 (Trigger):修改代码时
动作 (Action):先用 Grep 搜索,用 Read 确认,再进行编辑 (Edit)
置信度 (Confidence)███████░░░ 70%
来源 (Source)session-observation
---
Total: 9 instincts (4 personal, 5 inherited)
Observer: Running (last analysis: 5 min ago)
总计9 个直觉4 个个人5 个继承)
观察器 (Observer)运行中上次分析5 分钟前)
```
## Flags
## 参数 (Flags)
- `--domain <name>`: Filter by domain (code-style, testing, git, etc.)
- `--low-confidence`: Show only instincts with confidence < 0.5
- `--high-confidence`: Show only instincts with confidence >= 0.7
- `--source <type>`: Filter by source (session-observation, repo-analysis, inherited)
- `--json`: Output as JSON for programmatic use
- `--domain <name>`:按领域过滤(code-styletestinggit 等)
- `--low-confidence`:仅显示置信度 < 0.5 的直觉
- `--high-confidence`:仅显示置信度 >= 0.7 的直觉
- `--source <type>`:按来源过滤(session-observationrepo-analysisinherited
- `--json`:以 JSON 格式输出,供程序化使用