跳转至

Evolve 命令

实现

使用插件根路径运行 instinct CLI:

python3 "${CLAUDE_PLUGIN_ROOT}/skills/continuous-learning-v2/scripts/instinct-cli.py" evolve [--generate]

或者在 CLAUDE_PLUGIN_ROOT 未设置时(手动安装):

python3 ~/.claude/skills/continuous-learning-v2/scripts/instinct-cli.py evolve [--generate]

分析 instincts,并将相关的 instincts 聚类到更高级别的结构: - 命令:当 instincts 描述用户调用的操作时 - 技能:当 instincts 描述自动触发的行为时 - 代理:当 instincts 描述复杂的多步骤流程时

使用方法

/evolve                    # すべてのinstinctsを分析して進化を提案
/evolve --domain testing   # testingドメインのinstinctsのみを進化
/evolve --dry-run          # 作成せずに作成される内容を表示
/evolve --threshold 5      # クラスター化に5以上の関連instinctsが必要

进化规则

→ 命令(用户调用)

当 instincts 描述用户明确要求执行的操作时: - 多个与“用户要求……时”相关的 instincts - 具有类似“创建新的 X 时”触发器的 instincts - 遵循可重复序列的 instincts

示例: - new-table-step1:“添加数据库表时,创建迁移” - new-table-step2:“添加数据库表时,更新模式” - new-table-step3:“添加数据库表时,重新生成类型”

→ 创建:/new-table 命令

→ 技能(自动触发)

当 instincts 描述应自动发生的行为时: - 模式匹配触发器 - 错误处理响应 - 代码风格强制

示例: - prefer-functional:“编写函数时,优先使用函数式风格” - use-immutable:“修改状态时,使用不可变模式” - avoid-classes:“设计模块时,避免基于类的设计”

→ 创建:functional-patterns 技能

→ 代理(需要深度/分离)

当 instincts 描述受益于分离的复杂多步骤流程时: - 调试工作流 - 重构序列 - 研究任务

示例: - debug-step1:“调试时,首先查看日志” - debug-step2:“调试时,隔离失败的组件” - debug-step3:“调试时,创建最小复现” - debug-step4:“调试时,通过测试验证修复”

→ 创建:debugger 代理

执行内容

  1. 从 ~/.claude/homunculus/instincts/ 读取所有 instincts
  2. 按以下方面对 instincts 进行分组:
  3. 领域相似性
  4. 触发器模式重叠
  5. 操作序列关系
  6. 对于每个包含 3 个或更多相关 instincts 的聚类:
  7. 确定进化类型(command/skill/agent)
  8. 生成相应文件
  9. 保存到 ~/.claude/homunculus/evolved/{commands,skills,agents}/
  10. 将进化后的结构链接到源 instincts

输出格式

 進化分析
==================

進化の準備ができた3つのクラスターを発見:

## クラスター1: データベースマイグレーションワークフロー
Instincts: new-table-migration, update-schema, regenerate-types
タイプ: Command
信頼度: 85%(12件の観測に基づく)

作成: /new-tableコマンド
ファイル:
  - ~/.claude/homunculus/evolved/commands/new-table.md

## クラスター2: 関数型コードスタイル
Instincts: prefer-functional, use-immutable, avoid-classes, pure-functions
タイプ: Skill
信頼度: 78%(8件の観測に基づく)

作成: functional-patternsスキル
ファイル:
  - ~/.claude/homunculus/evolved/skills/functional-patterns.md

## クラスター3: デバッグプロセス
Instincts: debug-check-logs, debug-isolate, debug-reproduce, debug-verify
タイプ: Agent
信頼度: 72%(6件の観測に基づく)

作成: debuggerエージェント
ファイル:
  - ~/.claude/homunculus/evolved/agents/debugger.md

---
これらのファイルを作成するには`/evolve --execute`を実行してください。

标志

  • --execute:实际创建进化后的结构(默认为预览)
  • --dry-run:仅预览而不创建
  • --domain <name>:仅进化指定领域的 instincts
  • --threshold <n>:形成聚类所需的最小 instincts 数量(默认:3)
  • --type <command|skill|agent>:仅创建指定类型

生成的文件格式

命令

---
name: new-table
description: マイグレーション、スキーマ更新、型生成で新しいデータベーステーブルを作成
command: /new-table
evolved_from:
  - new-table-migration
  - update-schema
  - regenerate-types
---

# New Tableコマンド

[クラスター化されたinstinctsに基づいて生成されたコンテンツ]

## ステップ
1. ...
2. ...

技能

---
name: functional-patterns
description: 関数型プログラミングパターンを強制
evolved_from:
  - prefer-functional
  - use-immutable
  - avoid-classes
---

# Functional Patternsスキル

[クラスター化されたinstinctsに基づいて生成されたコンテンツ]

代理

---
name: debugger
description: 体系的なデバッグエージェント
model: sonnet
evolved_from:
  - debug-check-logs
  - debug-isolate
  - debug-reproduce
---

# Debuggerエージェント

[クラスター化されたinstinctsに基づいて生成されたコンテンツ]

本页原文 Markdown:在 AtomGit 查看·内容源自开源项目 ev/ECC