agent-configs 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,190 @@
1
+ # /evolve - 进化 Instincts 为 Skills/Commands/Agents
2
+
3
+ 分析已学习的 instincts,将相关的聚合为更高级的结构。
4
+
5
+ ## 触发
6
+
7
+ 运行 `/evolve` 分析并进化 instinct 集群。
8
+
9
+ ## 进化规则
10
+
11
+ ### → Command(用户主动调用)
12
+
13
+ 当 instincts 描述用户会显式请求的动作:
14
+
15
+ - 多个 instincts 包含 "when user asks to..."
16
+ - Instincts 的触发条件像 "when creating a new X"
17
+ - Instincts 遵循可重复的序列
18
+
19
+ **示例**:
20
+ ```
21
+ instincts:
22
+ - new-table-step1: "when adding a database table, create migration"
23
+ - new-table-step2: "when adding a database table, update schema"
24
+ - new-table-step3: "when adding a database table, regenerate types"
25
+
26
+ → 生成: /new-table command
27
+ ```
28
+
29
+ ### → Skill(自动触发)
30
+
31
+ 当 instincts 描述应该自动发生的行为:
32
+
33
+ - 模式匹配触发
34
+ - 错误处理响应
35
+ - 代码风格强制
36
+
37
+ **示例**:
38
+ ```
39
+ instincts:
40
+ - prefer-functional: "when writing functions, prefer functional style"
41
+ - use-immutable: "when modifying state, use immutable patterns"
42
+ - avoid-classes: "when designing modules, avoid class-based design"
43
+
44
+ → 生成: functional-patterns skill
45
+ ```
46
+
47
+ ### → Agent(需要深度/隔离)
48
+
49
+ 当 instincts 描述复杂的多步骤过程,受益于隔离执行:
50
+
51
+ - 调试工作流
52
+ - 重构序列
53
+ - 研究任务
54
+
55
+ **示例**:
56
+ ```
57
+ instincts:
58
+ - debug-step1: "when debugging, first check logs"
59
+ - debug-step2: "when debugging, isolate the failing component"
60
+ - debug-step3: "when debugging, create minimal reproduction"
61
+ - debug-step4: "when debugging, verify fix with test"
62
+
63
+ → 生成: debugger agent
64
+ ```
65
+
66
+ ## 使用方式
67
+
68
+ ```bash
69
+ /evolve # 分析所有 instincts 并建议进化
70
+ /evolve --domain testing # 只进化 testing domain 的 instincts
71
+ /evolve --dry-run # 预览将创建的内容,不实际创建
72
+ /evolve --threshold 5 # 要求 5+ 相关 instincts 才形成集群
73
+ /evolve --execute # 实际创建进化后的结构
74
+ ```
75
+
76
+ ## 输出格式
77
+
78
+ ```
79
+ 🧬 Evolve Analysis
80
+ ==================
81
+
82
+ Found 3 clusters ready for evolution:
83
+
84
+ ## Cluster 1: Database Migration Workflow
85
+ Instincts: new-table-migration, update-schema, regenerate-types
86
+ Type: Command
87
+ Confidence: 85% (based on 12 observations)
88
+
89
+ Would create: /new-table command
90
+ Files:
91
+ - ~/.cursor/homunculus/evolved/commands/new-table.md
92
+
93
+ ## Cluster 2: Functional Code Style
94
+ Instincts: prefer-functional, use-immutable, avoid-classes, pure-functions
95
+ Type: Skill
96
+ Confidence: 78% (based on 8 observations)
97
+
98
+ Would create: functional-patterns skill
99
+ Files:
100
+ - ~/.cursor/homunculus/evolved/skills/functional-patterns.md
101
+
102
+ ## Cluster 3: Debugging Process
103
+ Instincts: debug-check-logs, debug-isolate, debug-reproduce, debug-verify
104
+ Type: Agent
105
+ Confidence: 72% (based on 6 observations)
106
+
107
+ Would create: debugger agent
108
+ Files:
109
+ - ~/.cursor/homunculus/evolved/agents/debugger.md
110
+
111
+ ---
112
+ Run `/evolve --execute` to create these files.
113
+ ```
114
+
115
+ ## 处理流程
116
+
117
+ 1. 读取所有 instincts(`~/.cursor/homunculus/instincts/`)
118
+ 2. 按以下维度分组:
119
+ - Domain 相似性
120
+ - Trigger pattern 重叠
121
+ - Action 序列关系
122
+ 3. 对于每个 3+ 相关 instincts 的集群:
123
+ - 确定进化类型 (command/skill/agent)
124
+ - 生成对应文件
125
+ - 保存到 `~/.cursor/homunculus/evolved/{commands,skills,agents}/`
126
+ 4. 将进化后的结构链接回源 instincts
127
+
128
+ ## 生成文件格式
129
+
130
+ ### Command 格式
131
+ ```markdown
132
+ ---
133
+ name: new-table
134
+ description: Create a new database table with migration, schema update, and type generation
135
+ command: /new-table
136
+ evolved_from:
137
+ - new-table-migration
138
+ - update-schema
139
+ - regenerate-types
140
+ ---
141
+
142
+ # New Table Command
143
+
144
+ [基于聚合的 instincts 生成的内容]
145
+
146
+ ## Steps
147
+ 1. ...
148
+ 2. ...
149
+ ```
150
+
151
+ ### Skill 格式
152
+ ```markdown
153
+ ---
154
+ name: functional-patterns
155
+ description: Enforce functional programming patterns
156
+ evolved_from:
157
+ - prefer-functional
158
+ - use-immutable
159
+ - avoid-classes
160
+ ---
161
+
162
+ # Functional Patterns Skill
163
+
164
+ [基于聚合的 instincts 生成的内容]
165
+ ```
166
+
167
+ ### Agent 格式
168
+ ```markdown
169
+ ---
170
+ name: debugger
171
+ description: Systematic debugging agent
172
+ model: sonnet
173
+ evolved_from:
174
+ - debug-check-logs
175
+ - debug-isolate
176
+ - debug-reproduce
177
+ ---
178
+
179
+ # Debugger Agent
180
+
181
+ [基于聚合的 instincts 生成的内容]
182
+ ```
183
+
184
+ ## 相关命令
185
+
186
+ | 命令 | 说明 |
187
+ |------|------|
188
+ | `/instinct-status` | 查看所有 instincts |
189
+ | `/learn` | 手动提取 patterns |
190
+ | `/instinct-export` | 导出 instincts |
@@ -0,0 +1,64 @@
1
+ # /instinct-status - 查看已学习的 Instincts
2
+
3
+ 显示所有已学习的 instincts 及其置信度。
4
+
5
+ ## 触发
6
+
7
+ 运行 `/instinct-status` 查看当前学习状态。
8
+
9
+ ## 功能
10
+
11
+ 1. 列出所有 personal instincts(自动学习的)
12
+ 2. 列出所有 inherited instincts(从他人导入的)
13
+ 3. 显示每个 instinct 的置信度和 domain
14
+ 4. 标识可能可以进化的 instinct 集群
15
+
16
+ ## 输出格式
17
+
18
+ ```
19
+ 🧠 Instinct Status
20
+ ==================
21
+
22
+ Personal Instincts (12):
23
+ | ID | Domain | Confidence | Trigger |
24
+ |----|--------|------------|---------|
25
+ | prefer-functional | code-style | 0.75 | when writing new functions |
26
+ | use-zod-validation | validation | 0.68 | when validating input |
27
+ | ...
28
+
29
+ Inherited Instincts (3):
30
+ | ID | Source | Confidence |
31
+ |----|--------|------------|
32
+ | test-first | team-defaults | 0.90 |
33
+ | ...
34
+
35
+ Evolution Candidates:
36
+ - code-style (4 instincts, avg 0.72) → could become skill
37
+ - debugging (5 instincts, avg 0.65) → could become agent
38
+
39
+ Use /evolve to turn instinct clusters into skills/commands/agents.
40
+ ```
41
+
42
+ ## 文件位置
43
+
44
+ - Personal: `~/.cursor/homunculus/instincts/personal/`
45
+ - Inherited: `~/.cursor/homunculus/instincts/inherited/`
46
+ - Evolved: `~/.cursor/homunculus/evolved/{skills,commands,agents}/`
47
+
48
+ ## 实现
49
+
50
+ 读取并解析所有 instinct 文件,汇总状态信息。
51
+
52
+ ```bash
53
+ # 底层实现(如果需要脚本执行)
54
+ find ~/.cursor/homunculus/instincts -name "*.md" -exec cat {} \;
55
+ ```
56
+
57
+ ## 相关命令
58
+
59
+ | 命令 | 说明 |
60
+ |------|------|
61
+ | `/learn` | 手动提取 patterns 为 skill |
62
+ | `/evolve` | 将 instinct 集群进化为更高级结构 |
63
+ | `/instinct-export` | 导出 instincts 分享给他人 |
64
+ | `/instinct-import <file>` | 导入他人的 instincts |
@@ -0,0 +1,83 @@
1
+ # /learn - 提取可复用的 Patterns
2
+
3
+ 分析当前会话,提取值得保存为 skills 的 patterns。
4
+
5
+ ## 触发
6
+
7
+ 在会话中任意时刻运行 `/learn`,当你解决了一个非平凡的问题时。
8
+
9
+ ## 要提取的内容
10
+
11
+ 寻找以下类型的 patterns:
12
+
13
+ ### 1. 错误解决模式
14
+ - 遇到了什么错误?
15
+ - 根本原因是什么?
16
+ - 如何修复的?
17
+ - 这个方案是否可复用于类似错误?
18
+
19
+ ### 2. 调试技巧
20
+ - 非显而易见的调试步骤
21
+ - 有效的工具组合
22
+ - 诊断模式
23
+
24
+ ### 3. 变通方案
25
+ - 库的特殊行为
26
+ - API 限制
27
+ - 版本特定的修复
28
+
29
+ ### 4. 项目特定模式
30
+ - 发现的代码库约定
31
+ - 做出的架构决策
32
+ - 集成模式
33
+
34
+ ## 输出格式
35
+
36
+ 创建 skill 文件到 `~/.cursor/skills/learned/[pattern-name].md`:
37
+
38
+ ```markdown
39
+ # [描述性的 Pattern 名称]
40
+
41
+ **Extracted:** [日期]
42
+ **Context:** [适用场景简述]
43
+
44
+ ## Problem
45
+ [这个 pattern 解决什么问题 - 要具体]
46
+
47
+ ## Solution
48
+ [pattern/技巧/变通方案]
49
+
50
+ ## Example
51
+ [如果适用,代码示例]
52
+
53
+ ## When to Use
54
+ [触发条件 - 什么情况应该激活这个 skill]
55
+ ```
56
+
57
+ ## 处理流程
58
+
59
+ 1. 回顾会话,寻找可提取的 patterns
60
+ 2. 识别最有价值/可复用的洞见
61
+ 3. 起草 skill 文件
62
+ 4. 询问用户确认后保存
63
+ 5. 保存到 `~/.cursor/skills/learned/`
64
+
65
+ ## 注意事项
66
+
67
+ - **不要**提取简单问题(拼写错误、简单语法错误)
68
+ - **不要**提取一次性问题(特定 API 故障等)
69
+ - **聚焦**于能在未来会话中节省时间的 patterns
70
+ - **保持聚焦** - 每个 skill 只包含一个 pattern
71
+
72
+ ## 与 Instincts 的区别
73
+
74
+ | 特性 | Skill (v1) | Instinct (v2) |
75
+ |------|------------|---------------|
76
+ | 粒度 | 完整 pattern | 原子行为 |
77
+ | 置信度 | 无 | 0.3-0.9 |
78
+ | 进化 | 直接使用 | 可聚合为 skill/command/agent |
79
+ | 创建方式 | 手动 `/learn` | 自动观察 |
80
+
81
+ 如果你想使用更高级的 instinct-based 学习系统,可以:
82
+ - 使用 `/instinct-status` 查看已学习的 instincts
83
+ - 使用 `/evolve` 将相关 instincts 进化为更高级结构
@@ -35,8 +35,8 @@ function expandPath(p) {
35
35
 
36
36
  // 默认配置
37
37
  const MIN_SESSION_LENGTH = 10;
38
- const LEARNED_SKILLS_PATH = expandPath('~/.claude/skills/learned/');
39
- const HOMUNCULUS_PATH = expandPath('~/.claude/homunculus/');
38
+ const LEARNED_SKILLS_PATH = expandPath('~/.cursor/skills/learned/');
39
+ const HOMUNCULUS_PATH = expandPath('~/.cursor/homunculus/');
40
40
 
41
41
  async function main() {
42
42
  try {
@@ -0,0 +1,12 @@
1
+ {
2
+ "version": 1,
3
+ "hooks": {
4
+ "stop": [
5
+ {
6
+ "command": "node .cursor/hooks/learning-end.js",
7
+ "loop_limit": 1,
8
+ "description": "Evaluate session for learnable patterns on session end"
9
+ }
10
+ ]
11
+ }
12
+ }