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 你的模式。*