Task Decomposer & Skill Generator
This skill helps decompose complex user requests into executable subtasks, identify required capabilities for each task, search for existing skills from the open skills ecosystem, and automatically create new skills when no existing solution is available.
Core Workflow
CODEBLOCK0
Phase 1: Task Analysis & Decomposition
When receiving a user request, follow these steps:
Step 1: Understand User Intent
Analyze the request to identify:
- - Core objective: What is the end goal?
- Domains involved: What areas of expertise are needed?
- Trigger mechanism: One-time, scheduled, or event-driven?
Example analysis:
CODEBLOCK1
Step 2: Decompose into Atomic Tasks
Break down the complex task into minimal executable units:
CODEBLOCK2
Phase 2: Capability Identification
Map each subtask to a capability type from the universal capability taxonomy.
Universal Capability Types
| Capability | Description | Search Keywords |
|---|
| INLINECODE0 | Web navigation, interaction, scraping | browser, selenium, puppeteer, playwright, scrape |
| INLINECODE1 |
Internet search and information retrieval | search, google, bing, duckduckgo |
|
api_integration | Third-party API communication | api, rest, graphql, webhook, {service-name} |
|
data_extraction | Parse and extract structured data | parse, extract, scrape, ocr, pdf |
|
data_transformation | Convert, clean, transform data | transform, convert, format, clean, etl |
|
content_generation | Create text, images, or other content | generate, write, create, summarize, translate |
|
file_operations | Read, write, manipulate files | file, read, write, csv, excel, json, pdf |
|
message_delivery | Send notifications or messages | notify, send, email, slack, discord, telegram |
|
scheduling | Time-based task execution | schedule, cron, timer, daily, weekly |
|
authentication | Identity and access management | auth, oauth, login, token, credentials |
|
database_operations | Database CRUD operations | database, sql, mongodb, query, store |
|
code_execution | Run scripts or programs | execute, run, script, shell, python |
|
version_control | Git and code repository operations | git, github, gitlab, commit, pr, review |
|
testing | Automated testing and QA | test, jest, pytest, e2e, unit |
|
deployment | Application deployment and CI/CD | deploy, docker, kubernetes, ci-cd, release |
|
monitoring | System and application monitoring | monitor, alert, log, metrics, health |
Capability Identification Process
For each subtask:
- 1. Analyze the task description and requirements
- Match to one or more capability types
- Generate search keywords for skill discovery
Example:
CODEBLOCK3
Phase 3: Skill Search
Use the Skills CLI to search for existing skills at https://skills.sh/
Search Process
For each capability need, search using relevant keywords:
CODEBLOCK4
Evaluate Search Results
When results are returned:
CODEBLOCK5
Evaluate each result for:
- - Relevance: Does it match the required capability?
- Completeness: Does it cover all needed functionality?
- Quality: Is it well-documented and maintained?
Generate Capability Mapping
CODEBLOCK6
Phase 4: Gap Analysis
Identify tasks without matching skills:
Built-in Capabilities (No Skill Needed)
These capabilities are typically handled by the agent's native abilities:
- -
content_generation - LLM's native text generation - INLINECODE17 - Basic data manipulation via code
- INLINECODE18 - Direct script execution
- INLINECODE19 - System-level cron/scheduler configuration
Skills Required
For capabilities without built-in support, determine:
- 1. Skill exists: Install from skills.sh
- Skill not found: Create new skill
Phase 5: Skill Creation
When no existing skill matches a required capability, create a new skill.
Skill Creation Process
- 1. Define scope: Determine what the skill should do
- Design interface: Define inputs, outputs, and usage patterns
- Create SKILL.md: Write the skill definition file
- Add resources: Include scripts, references, or assets as needed
Skill Template
CODEBLOCK7 bash
{Basic command or code example}
CODEBLOCK8
Initialize New Skill
CODEBLOCK9
Phase 6: Generate Execution Plan
Compile all information into a structured execution plan:
CODEBLOCK10
Task Decomposition Principles
Principle 1: Atomicity
Each subtask should be the minimal executable unit with clear input and output.
Principle 2: Independence
Minimize dependencies between tasks to allow parallel execution where possible.
Principle 3: Verifiability
Each task should have a clear way to verify successful completion.
Principle 4: Reusability
Identify reusable patterns and prefer creating general-purpose skills.
Principle 5: Single Responsibility
Each task should do one thing well.
Output Format
Present the decomposition results in a structured format:
CODEBLOCK11
Examples
Example 1: Workflow Automation
User Request:
CODEBLOCK12
Decomposition:
CODEBLOCK13
Example 2: Data Pipeline
User Request:
CODEBLOCK14
Decomposition:
CODEBLOCK15
Best Practices
- 1. Start with skill search: Always check https://skills.sh/ before creating new skills
- Use specific search terms: Combine capability keywords with domain terms
- Leverage built-in capabilities: Don't create skills for things the agent can do natively
- Create reusable skills: Design new skills to be general-purpose when possible
- Document thoroughly: New skills should have clear usage instructions
- Verify before proceeding: Confirm skill installation before executing tasks
- Handle errors gracefully: Include fallback strategies in execution plans
Integration with find-skills
This skill works in conjunction with the find-skills skill for discovering existing solutions:
CODEBLOCK16
Notes
- - Always search for existing skills before creating new ones
- Built-in capabilities (LLM, basic code) don't require skills
- Skill creation requires user confirmation before proceeding
- Complex workflows may need multiple skills working together
任务分解与技能生成器
此技能帮助将复杂的用户请求分解为可执行的子任务,识别每个任务所需的能力,从开放技能生态系统中搜索现有技能,并在没有现有解决方案时自动创建新技能。
核心工作流
用户请求 → 任务分解 → 能力识别 → 技能搜索 → 差距分析 → 技能创建 → 执行计划
第一阶段:任务分析与分解
收到用户请求时,请遵循以下步骤:
步骤1:理解用户意图
分析请求以识别:
- - 核心目标:最终目标是什么?
- 涉及领域:需要哪些专业领域?
- 触发机制:一次性、定时还是事件驱动?
示例分析:
用户输入:帮我每天早上获取邮件摘要并发送到Slack
分析:
- - 核心目标:自动将邮件摘要投递到Slack
- 领域:邮件访问、内容摘要、消息传递
- 触发方式:定时(每天早晨)
步骤2:分解为原子任务
将复杂任务分解为最小的可执行单元:
yaml
任务分解:
- task_id: 1
name: 访问并获取邮件列表
type: 数据检索
input: 邮件凭证/会话
output: 带元数据的邮件列表
dependencies: []
- task_id: 2
name: 从邮件中提取关键信息
type: 数据提取
input: 邮件列表
output: 结构化邮件数据
dependencies: [1]
- task_id: 3
name: 生成邮件摘要
type: 内容生成
input: 结构化邮件数据
output: 格式化摘要文本
dependencies: [2]
- task_id: 4
name: 发送消息到Slack
type: 消息投递
input: 摘要文本、Slack webhook/令牌
output: 投递确认
dependencies: [3]
- task_id: 5
name: 配置定时执行
type: 调度
input: 工作流脚本、调度配置
output: 活跃的定时任务
dependencies: [4]
第二阶段:能力识别
将每个子任务映射到通用能力分类中的能力类型。
通用能力类型
| 能力 | 描述 | 搜索关键词 |
|---|
| browserautomation | 网页导航、交互、抓取 | browser, selenium, puppeteer, playwright, scrape |
| websearch |
互联网搜索和信息检索 | search, google, bing, duckduckgo |
| api_integration | 第三方API通信 | api, rest, graphql, webhook, {service-name} |
| data_extraction | 解析和提取结构化数据 | parse, extract, scrape, ocr, pdf |
| data_transformation | 转换、清洗、转换数据 | transform, convert, format, clean, etl |
| content_generation | 创建文本、图像或其他内容 | generate, write, create, summarize, translate |
| file_operations | 读取、写入、操作文件 | file, read, write, csv, excel, json, pdf |
| message_delivery | 发送通知或消息 | notify, send, email, slack, discord, telegram |
| scheduling | 基于时间的任务执行 | schedule, cron, timer, daily, weekly |
| authentication | 身份和访问管理 | auth, oauth, login, token, credentials |
| database_operations | 数据库CRUD操作 | database, sql, mongodb, query, store |
| code_execution | 运行脚本或程序 | execute, run, script, shell, python |
| version_control | Git和代码仓库操作 | git, github, gitlab, commit, pr, review |
| testing | 自动化测试和质量保证 | test, jest, pytest, e2e, unit |
| deployment | 应用部署和CI/CD | deploy, docker, kubernetes, ci-cd, release |
| monitoring | 系统和应用监控 | monitor, alert, log, metrics, health |
能力识别过程
对于每个子任务:
- 1. 分析任务描述和需求
- 匹配到一个或多个能力类型
- 生成用于技能发现的搜索关键词
示例:
yaml
任务:发送消息到Slack
能力:message_delivery
搜索关键词:[slack, notification, message, webhook]
第三阶段:技能搜索
使用Skills CLI在https://skills.sh/搜索现有技能
搜索过程
对于每个能力需求,使用相关关键词搜索:
bash
搜索匹配该能力的技能
npx skills find <关键词>
示例:
npx skills find slack notification
npx skills find browser automation
npx skills find pdf extract
npx skills find github api
评估搜索结果
当返回结果时:
使用 npx skills add 安装
owner/repo@skill-name
└ https://skills.sh/owner/repo/skill-name
评估每个结果:
- - 相关性:是否匹配所需能力?
- 完整性:是否覆盖所有所需功能?
- 质量:文档是否完善且维护良好?
生成能力映射
yaml
能力映射:
- task_id: 1
capability: browser_automation
search_query: browser email automation
found_skills:
- name: anthropic/claude-skills@browser-use
url: https://skills.sh/anthropic/claude-skills/browser-use
match_score: high
recommendation: 安装browser-use技能
- task_id: 4
capability: message_delivery
search_query: slack notification
found_skills: []
recommendation: 创建新技能:slack-notification
第四阶段:差距分析
识别没有匹配技能的任務:
内置能力(无需技能)
这些能力通常由代理的原生能力处理:
- - contentgeneration - LLM的原生文本生成
- datatransformation - 通过代码进行基本数据操作
- code_execution - 直接脚本执行
- scheduling - 系统级cron/调度器配置
所需技能
对于没有内置支持的能力,确定:
- 1. 技能存在:从skills.sh安装
- 未找到技能:创建新技能
第五阶段:技能创建
当没有现有技能匹配所需能力时,创建新技能。
技能创建过程
- 1. 定义范围:确定技能应做什么
- 设计接口:定义输入、输出和使用模式
- 创建SKILL.md:编写技能定义文件
- 添加资源:根据需要包含脚本、参考资料或资产
技能模板
markdown
name: {技能名称}
description: {清晰描述技能的功能及使用场景。以第三人称书写。}
{技能标题}
{简要介绍,说明技能的目的。}
使用时机
{描述应触发此技能的场景。}
前提条件
{列出所需的安装、配置或凭证。}
使用方法
{详细的使用说明及示例。}
基本用法
bash
{基本命令或代码示例}
高级用法
{更复杂的示例和选项。}
配置
{任何配置选项或环境变量。}
示例
示例1:{用例}
{带代码的逐步示例。}
故障排除
{常见问题及解决方案。}
初始化新技能
bash
使用skills CLI创建技能
npx skills init <技能名称>
或手动创建结构:
技能名称/
├── SKILL.md(必需)
├── scripts/(可选)
├── references/(可选)
└── assets/(可选)
第六阶段:生成执行计划
将所有信息编译成结构化的执行计划:
yaml
执行计划:
title: {任务描述}
prerequisites:
- {前提条件1}
- {前提条件2}
skillstoinstall:
- skill: owner/repo@skill-name
command: npx skills add owner/repo@skill-name -g -y
url: https://skills.sh/owner/repo/skill-name
skillstocreate:
- name: {新技能名称}
capability: {能力类型}
description: {功能描述}
execution_steps:
- step: 1
task: {任务名称}
skill: {技能名称 | built-in}
action: {要执行的具体操作}
- step: 2
task: {任务名称}
skill: {技能名称 | built-in}
action: {要执行的具体操作}
verification:
- {如何验证步骤1成功}
- {如何验证步骤2成功}
任务分解原则
###