skill-evolution-driver
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese技能进化驱动师
Skill Evolution Driver
任务目标
Task Objectives
- 本 Skill 用于:驱动技能进行自我进化,随着项目过程推进持续优化
- 能力包含:
- 监控skill-manager存储的数据,识别技能优化机会
- 在空闲时提醒用户潜在的优化建议
- 维护技能优化任务清单
- 执行技能更新流程(备份、更新、测试、还原)
- 管理技能版本号
- 触发条件:以下任一情况触发
- 用户直接需求:"优化技能"、"改进技能"、"技能需要更新"、"技能升级"、"修复技能问题"
- 自动监控触发:监控到skill-manager存储的技能数据中有待优化的任务(如:status=pending的优化任务、日志中的错误和警告、缺失的必要字段)
- 版本相关:"技能版本号需要更新"、"需要记录技能变更"
- 质量相关:"技能格式不正确"、"需要检查技能质量"、"技能测试不通过"
- This Skill is used to: Drive self-evolution of skills, continuously optimize as the project progresses
- Capabilities include:
- Monitor data stored in skill-manager to identify skill optimization opportunities
- Notify users of potential optimization suggestions during idle time
- Maintain a list of skill optimization tasks
- Execute skill update processes (backup, update, testing, restoration)
- Manage skill version numbers
- Trigger conditions: Triggered by any of the following situations
- Direct user requests: "Optimize skill", "Improve skill", "Skill needs update", "Skill upgrade", "Fix skill issues"
- Automatic monitoring trigger: Detects pending optimization tasks in skill data stored in skill-manager (such as optimization tasks with status=pending, errors and warnings in logs, missing required fields)
- Version-related: "Skill version number needs update", "Need to record skill changes"
- Quality-related: "Skill format is incorrect", "Need to check skill quality", "Skill test failed"
优化识别
Optimization Identification
数据来源
Data Sources
从skill-manager存储的技能数据中分析优化机会:
- 缺失信息:技能配置中缺乏必要字段(如version)
- 格式问题:数据格式不符合规范
- 重复信息:存在冗余或重复的内容
- 使用模式:根据访问频率和方式识别改进点
- 错误日志:从日志中识别常见错误或警告
- 跨技能协作问题:从其他技能的日志中识别对当前技能的依赖问题或改进建议
Analyze optimization opportunities from skill data stored in skill-manager:
- Missing information: Lack of required fields in skill configuration (such as version)
- Format issues: Data format does not comply with specifications
- Duplicate information: Redundant or duplicate content exists
- Usage patterns: Identify improvement points based on access frequency and methods
- Error logs: Identify common errors or warnings from logs
- Cross-skill collaboration issues: Identify dependency issues or improvement suggestions for the current skill from logs of other skills
优化类型
Optimization Types
- format_improvement:格式改进
- content_optimization:内容优化
- version_update:版本号更新
- bug_fix:Bug修复
- feature_enhancement:功能增强
- format_improvement: Format improvement
- content_optimization: Content optimization
- version_update: Version number update
- bug_fix: Bug fix
- feature_enhancement: Feature enhancement
进化流程
Evolution Process
步骤1:提醒用户
Step 1: Notify User
自动监控触发
Automatic Monitoring Trigger
智能体定期检查 skill-manager 存储的数据,识别优化机会:
检查工具:调用
scripts/check_optimization_opportunities.pybash
undefinedThe agent periodically checks data stored in skill-manager to identify optimization opportunities:
Inspection Tools: Call
scripts/check_optimization_opportunities.pybash
undefined检查所有技能
Check all skills
python scripts/check_optimization_opportunities.py
python scripts/check_optimization_opportunities.py
检查特定技能
Check specific skill
python scripts/check_optimization_opportunities.py --skill-name dev-observability
**检查内容**:
1. **待处理任务**:检查 skill-evolution-driver 自身存储的优化任务(status=pending)
2. **缺失字段**:检查技能配置是否缺少必要字段(如 version、deploy_mode、manual_path)
3. **错误日志**:检查技能日志中的 ERROR/WARNING/CRITICAL 日志
4. **目录问题**:检查技能目录结构是否符合规范
**提醒格式**:检测到潜在优化机会:
- 技能:skill-name
- 优化类型:format_improvement
- 描述:SKILL.md缺少version字段
- 是否开始优化?(y/n)
undefinedpython scripts/check_optimization_opportunities.py --skill-name dev-observability
**Inspection Content**:
1. **Pending tasks**: Check optimization tasks stored in skill-evolution-driver itself (status=pending)
2. **Missing fields**: Check if skill configuration lacks required fields (such as version, deploy_mode, manual_path)
3. **Error logs**: Check ERROR/WARNING/CRITICAL logs in skill logs
4. **Directory issues**: Check if skill directory structure complies with specifications
**Notification Format**:Potential optimization opportunities detected:
- Skill: skill-name
- Optimization type: format_improvement
- Description: SKILL.md is missing version field
- Start optimization? (y/n)
undefined用户主动触发
User-Initiated Trigger
当用户表达以下需求时,直接提醒用户:
- "优化技能"、"改进技能"
- "技能需要更新"、"技能升级"
- "修复技能问题"
- "技能版本号需要更新"
- "技能格式不正确"、"需要检查技能质量"
Directly notify the user when the user expresses the following needs:
- "Optimize skill", "Improve skill"
- "Skill needs update", "Skill upgrade"
- "Fix skill issues"
- "Skill version number needs update"
- "Skill format is incorrect", "Need to check skill quality"
步骤2:维护任务清单
Step 2: Maintain Task List
若用户同意,调用skill-manager存储优化任务:
json
{
"task_id": "OPT-001",
"skill_name": "skill-name",
"optimization_type": "format_improvement",
"description": "SKILL.md缺少version字段",
"status": "pending",
"feasibility": "pending",
"backup_path": "",
"old_version": "",
"new_version": "",
"test_result": "",
"notes": "",
"created_at": "2024-01-22 12:00:00",
"updated_at": "2024-01-22 12:00:00"
}存储方式:更新 skill-evolution-driver 在 skill-manager 中的配置
python
import sys
sys.path.insert(0, '/workspace/projects/skill-manager/scripts')
from skill_manager import SkillStorage
storage = SkillStorage(data_path="/workspace/projects/skill-data.json")
existing_config = storage.get_config("skill-evolution-driver") or {}
existing_config["optimization_tasks"] = [task_dict] # 任务列表
storage.save_config("skill-evolution-driver", existing_config)If the user agrees, call skill-manager to store the optimization task:
json
{
"task_id": "OPT-001",
"skill_name": "skill-name",
"optimization_type": "format_improvement",
"description": "SKILL.md is missing version field",
"status": "pending",
"feasibility": "pending",
"backup_path": "",
"old_version": "",
"new_version": "",
"test_result": "",
"notes": "",
"created_at": "2024-01-22 12:00:00",
"updated_at": "2024-01-22 12:00:00"
}Storage method: Update the configuration of skill-evolution-driver in skill-manager
python
import sys
sys.path.insert(0, '/workspace/projects/skill-manager/scripts')
from skill_manager import SkillStorage
storage = SkillStorage(data_path="/workspace/projects/skill-data.json")
existing_config = storage.get_config("skill-evolution-driver") or {}
existing_config["optimization_tasks"] = [task_dict] # Task list
storage.save_config("skill-evolution-driver", existing_config)步骤3:分析可行性
Step 3: Analyze Feasibility
分析该技能的优化可行性:
可行性评估标准:
- 技能目录结构完整
- SKILL.md格式正确
- 脚本语法正确
- 依赖关系清晰
- 优化内容明确
不可行情况:
- 技能目录不存在或损坏
- SKILL.md格式错误,无法解析
- 优化内容不明确或过于复杂
- 优化可能破坏现有功能
更新任务状态:
- 可行:
feasibility: "feasible" - 不可行:,并在
feasibility: "not_feasible"中说明原因notes
Analyze the feasibility of optimizing the skill:
Feasibility Evaluation Criteria:
- Complete skill directory structure
- Correct SKILL.md format
- Valid script syntax
- Clear dependency relationships
- Clear optimization content
Infeasible Scenarios:
- Skill directory does not exist or is damaged
- SKILL.md format is incorrect and cannot be parsed
- Optimization content is unclear or overly complex
- Optimization may damage existing functions
Update task status:
- Feasible:
feasibility: "feasible" - Infeasible: , and explain the reason in
feasibility: "not_feasible"notes
步骤4:备份技能
Step 4: Backup Skill
调用 备份技能:
scripts/backup_skill.pybash
python scripts/backup_skill.py --skill-dir /workspace/projects/skill-name备份文件格式:
skill-name.backup.<timestamp>.skill更新任务:
backup_path: "/workspace/projects/skill-name.backup.<timestamp>.skill"
Call to backup the skill:
scripts/backup_skill.pybash
python scripts/backup_skill.py --skill-dir /workspace/projects/skill-nameBackup file format:
skill-name.backup.<timestamp>.skillUpdate task:
backup_path: "/workspace/projects/skill-name.backup.<timestamp>.skill"
步骤5:更新技能
Step 5: Update Skill
执行具体的优化操作,并更新版本号:
- 执行优化:根据优化类型修改技能内容
- 更新版本号:调用
scripts/update_version.py
bash
python scripts/update_version.py --skill-dir /workspace/projects/skill-name --type patch版本号类型:
- :修订版本(v1.0.0 -> v1.0.1)
patch - :次版本(v1.0.0 -> v1.1.0)
minor - :主版本(v1.0.0 -> v2.0.0)
major
更新任务:
old_version: "v1.0.0"new_version: "v1.0.1"
Execute specific optimization operations and update the version number:
- Execute optimization: Modify skill content according to optimization type
- Update version number: Call
scripts/update_version.py
bash
python scripts/update_version.py --skill-dir /workspace/projects/skill-name --type patchVersion number types:
- : Patch version (v1.0.0 -> v1.0.1)
patch - : Minor version (v1.0.0 -> v1.1.0)
minor - : Major version (v1.0.0 -> v2.0.0)
major
Update task:
old_version: "v1.0.0"new_version: "v1.0.1"
步骤6:进行测试
Step 6: Conduct Testing
对更新后的技能进行测试验证:
测试内容:
- SKILL.md格式验证(YAML前言区)
- 脚本语法检查(Python语法)
- 目录结构验证(符合固定结构)
- 依赖完整性检查(dependency字段)
测试脚本:
bash
python scripts/backup_skill.py --validate-only --skill-dir /workspace/projects/skill-nameTest and verify the updated skill:
Testing Content:
- SKILL.md format verification (YAML preamble area)
- Script syntax check (Python syntax)
- Directory structure verification (complies with fixed structure)
- Dependency integrity check (dependency field)
Test script:
bash
python scripts/backup_skill.py --validate-only --skill-dir /workspace/projects/skill-name步骤7:处理测试结果
Step 7: Handle Test Results
测试不通过:
- 调用 还原技能
scripts/restore_skill.py - 使用 更新任务状态
manage_optimization_tasks.py
bash
undefinedTest Failed:
- Call to restore the skill
scripts/restore_skill.py - Use to update task status
manage_optimization_tasks.py
bash
undefined还原技能
Restore skill
python scripts/restore_skill.py --backup-file <备份路径> --skill-dir /workspace/projects/skill-name
python scripts/restore_skill.py --backup-file <backup path> --skill-dir /workspace/projects/skill-name
更新任务状态
Update task status
python scripts/manage_optimization_tasks.py update
--task-id OPT-001
--status failed
--test-result failed
--notes "测试失败:SKILL.md格式错误"
--task-id OPT-001
--status failed
--test-result failed
--notes "测试失败:SKILL.md格式错误"
**测试通过**:
1. 使用 `manage_optimization_tasks.py` 更新任务状态
2. 打包新的.skill文件
3. 告知用户更新内容
4. 提醒用户重新加载技能
```bashpython scripts/manage_optimization_tasks.py update
--task-id OPT-001
--status failed
--test-result failed
--notes "Test failed: SKILL.md format error"
--task-id OPT-001
--status failed
--test-result failed
--notes "Test failed: SKILL.md format error"
**Test Passed**:
1. Use `manage_optimization_tasks.py` to update task status
2. Package the new .skill file
3. Inform the user of update content
4. Remind the user to reload the skill
```bash更新任务状态
Update task status
python scripts/manage_optimization_tasks.py update
--task-id OPT-001
--status completed
--test-result passed
--notes "优化成功:已添加version字段"
--new-version v1.0.1
--backup-path /workspace/projects/skill-name.backup.20260122120000.skill
--task-id OPT-001
--status completed
--test-result passed
--notes "优化成功:已添加version字段"
--new-version v1.0.1
--backup-path /workspace/projects/skill-name.backup.20260122120000.skill
**重要**:必须更新任务状态为 `completed`,避免下次检查时重复提醒相同的优化机会。python scripts/manage_optimization_tasks.py update
--task-id OPT-001
--status completed
--test-result passed
--notes "Optimization successful: version field added"
--new-version v1.0.1
--backup-path /workspace/projects/skill-name.backup.20260122120000.skill
--task-id OPT-001
--status completed
--test-result passed
--notes "Optimization successful: version field added"
--new-version v1.0.1
--backup-path /workspace/projects/skill-name.backup.20260122120000.skill
**Important**: Must update the task status to `completed` to avoid repeated reminders of the same optimization opportunity during next inspection.步骤8:通知用户
Step 8: Notify User
根据测试结果通知用户:
测试通过:
✓ 技能优化成功
- 技能:skill-name
- 版本:v1.0.0 -> v1.0.1
- 更新内容:添加version字段
- 备份:skill-name.backup.<timestamp>.skill
请重新加载AI交互界面以使用更新后的技能。测试不通过:
✗ 技能优化失败
- 技能:skill-name
- 原因:测试失败
- 详情:SKILL.md格式错误
- 技能已还原Notify the user based on test results:
Test Passed:
✓ Skill optimization successful
- Skill: skill-name
- Version: v1.0.0 -> v1.0.1
- Update content: Added version field
- Backup: skill-name.backup.<timestamp>.skill
Please reload the AI interaction interface to use the updated skill.Test Failed:
✗ Skill optimization failed
- Skill: skill-name
- Reason: Test failed
- Details: SKILL.md format error
- Skill has been restored核心功能说明
Core Function Description
智能体可处理的功能
Functions Handled by the Agent
- 监控skill-manager数据,识别优化机会
- 在空闲时提醒用户优化建议
- 维护技能优化任务清单
- 分析优化可行性
- 执行优化操作
- 进行测试验证
- 处理测试结果
- 通知用户
- Monitor skill-manager data to identify optimization opportunities
- Notify users of optimization suggestions during idle time
- Maintain skill optimization task list
- Analyze optimization feasibility
- Execute optimization operations
- Conduct test verification
- Handle test results
- Notify users
脚本实现的功能
Functions Implemented by Scripts
- 检查优化机会:扫描skill-manager数据,自动识别优化机会(过滤已完成的任务)
scripts/check_optimization_opportunities.py - 管理优化任务:提供优化任务的增删改查功能(add/update/list)
scripts/manage_optimization_tasks.py - 备份技能:备份整个skill目录
scripts/backup_skill.py - 还原技能:从备份还原技能
scripts/restore_skill.py - 更新版本号:增加SKILL.md中的version字段
scripts/update_version.py - 测试验证:验证技能格式
scripts/backup_skill.py --validate-only
- Check optimization opportunities: scans skill-manager data to automatically identify optimization opportunities (filter completed tasks)
scripts/check_optimization_opportunities.py - Manage optimization tasks: provides add/delete/update/query functions for optimization tasks
scripts/manage_optimization_tasks.py - Backup skill: backs up the entire skill directory
scripts/backup_skill.py - Restore skill: restores skill from backup
scripts/restore_skill.py - Update version number: updates the version field in SKILL.md
scripts/update_version.py - Test verification: verifies skill format
scripts/backup_skill.py --validate-only
资源索引
Resource Index
- 优化机会检查工具:见 scripts/check_optimization_opportunities.py(自动扫描skill-manager数据,识别优化机会,过滤已完成的任务)
- 优化任务管理工具:见 scripts/manage_optimization_tasks.py(优化任务的增删改查)
- 备份工具:见 scripts/backup_skill.py(备份技能目录)
- 还原工具:见 scripts/restore_skill.py(从备份还原技能)
- 版本管理:见 scripts/update_version.py(更新版本号)
- 优化指南:见 references/optimization_guide.md(优化类型、测试标准、最佳实践)
- Optimization opportunity inspection tool: See scripts/check_optimization_opportunities.py (automatically scans skill-manager data to identify optimization opportunities and filter completed tasks)
- Optimization task management tool: See scripts/manage_optimization_tasks.py (add/delete/update/query of optimization tasks)
- Backup tool: See scripts/backup_skill.py (backs up skill directory)
- Restore tool: See scripts/restore_skill.py (restores skill from backup)
- Version management: See scripts/update_version.py (updates version number)
- Optimization guide: See references/optimization_guide.md (optimization types, test standards, best practices)
注意事项
Notes
- 优化前必须备份技能
- 优化过程中保持task状态同步更新
- 测试不通过必须还原技能
- 版本号遵循语义化版本规范
- 重大变更需用户明确确认
- 优化完成后必须更新任务状态为 ,避免重复提醒
completed - 优化后需提醒用户重新加载技能
- Must backup the skill before optimization
- Keep task status synchronized during optimization process
- Must restore the skill if test fails
- Version numbers follow semantic versioning specifications
- Major changes require explicit user confirmation
- Must update task status to after optimization to avoid repeated reminders
completed - Remind user to reload the skill after optimization
最佳实践
Best Practices
- 定期监控skill-manager数据,识别优化机会
- 优先处理高价值、低风险的优化
- 优化前充分分析可行性
- 保持详细的优化日志
- 定期清理过期的备份文件
- 向用户提供清晰的优化说明
- Regularly monitor skill-manager data to identify optimization opportunities
- Prioritize high-value, low-risk optimizations
- Fully analyze feasibility before optimization
- Maintain detailed optimization logs
- Regularly clean up expired backup files
- Provide clear optimization instructions to users
使用示例
Usage Examples
示例1:添加version字段
Example 1: Add version field
检测到skill-name的SKILL.md缺少version字段。
- 提醒用户
- 用户同意后,创建优化任务
- 分析可行性:可行
- 备份技能:skill-name.backup.20240122120000.skill
- 更新SKILL.md,添加version: v1.0.0
- 测试验证:通过
- 更新任务状态:completed
- 通知用户:优化成功
Detected that SKILL.md of skill-name is missing version field.
- Notify user
- Create optimization task after user agrees
- Analyze feasibility: feasible
- Backup skill: skill-name.backup.20240122120000.skill
- Update SKILL.md, add version: v1.0.0
- Test verification: passed
- Update task status: completed
- Notify user: optimization successful
示例2:格式改进
Example 2: Format improvement
检测到skill-name的SKILL.md格式不符合规范。
- 提醒用户
- 用户同意后,创建优化任务
- 分析可行性:可行
- 备份技能
- 修正SKILL.md格式
- 测试验证:通过
- 更新任务状态:completed
- 通知用户:优化成功
Detected that SKILL.md of skill-name does not comply with format specifications.
- Notify user
- Create optimization task after user agrees
- Analyze feasibility: feasible
- Backup skill
- Correct SKILL.md format
- Test verification: passed
- Update task status: completed
- Notify user: optimization successful
示例3:不可行的优化
Example 3: Infeasible optimization
检测到skill-name的优化内容过于复杂。
- 提醒用户
- 用户同意后,创建优化任务
- 分析可行性:不可行
- 更新任务状态:failed
- 更新备注:优化内容过于复杂,需要人工介入
- 通知用户:优化不可行,需人工处理
Detected that optimization content of skill-name is overly complex.
- Notify user
- Create optimization task after user agrees
- Analyze feasibility: infeasible
- Update task status: failed
- Update notes: optimization content is overly complex, requires manual intervention
- Notify user: optimization is infeasible, manual processing required