task-decomposer
任务解密器 & 技能生成器是一项面向实际任务的技能,主要用于此技能有助于将复杂的用户请求解析为可执行子任务, 确定每项任务所需的能力, 搜索当前技能。它将相关步骤、工具调用和结果整理方式集中到统一流程中,帮助使用者更快完成目标并减少重复操作。
实际使用前应先确认任务范围、数据来源、运行环境、必要权限和关键参数,再依据技能说明逐步执行;若输入条件不完整,应先补齐信息或采用保守配置,避免因错误假设导致结果偏离需求。
执行过程中需要关注工具调用是否成功、接口或依赖是否可用、输出格式是否符合预期,并对异常提示、缺失字段和边界情况进行处理;涉及批量任务时,还应保存进度,避免中断后重复操作。
该技能可将复杂的用户请求分解为可执行的子任务,识别各子任务所需的能力类型,在开放技能生态中搜索已有技能,并在无现成方案时自动创建新技能。
User Request → Task Decomposition → Capability Identification → Skill Search → Gap Analysis → Skill Creation → Execution Plan
接收到用户请求后,请按以下步骤执行:
分析请求以识别:
示例分析:
User Input: "Help me get email summaries every morning and send them to Slack" Analysis: - Core objective: Automated email digest delivery to Slack - Domains: Email access, content summarization, messaging - Trigger: Scheduled (daily morning)
将复杂任务拆解为最小可执行单元:
Task Decomposition:
- task_id: 1
name: "Access and retrieve email list"
type: "data_retrieval"
input: "Email credentials/session"
output: "List of emails with metadata"
dependencies: []
- task_id: 2
name: "Extract key information from emails"
type: "data_extraction"
input: "Email list"
output: "Structured email data"
dependencies: [1]
- task_id: 3
name: "Generate email summary"
type: "content_generation"
input: "Structured email data"
output: "Formatted summary text"
dependencies: [2]
- task_id: 4
name: "Send message to Slack"
type: "message_delivery"
input: "Summary text, Slack webhook/token"
output: "Delivery confirmation"
dependencies: [3]
- task_id: 5
name: "Configure scheduled execution"
type: "scheduling"
input: "Workflow script, schedule config"
output: "Active scheduled job"
dependencies: [4]
将每个子任务映射至通用能力分类体系中的能力类型。
| 能力 | 描述 | 搜索关键词 |
|---|---|---|
browser_automation |
网页导航、交互、爬取 | browser, selenium, puppeteer, playwright, scrape |
web_search |
互联网搜索与信息检索 | 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 |
对每个子任务:
示例:
Task: "Send message to Slack" Capability: message_delivery Search Keywords: ["slack", "notification", "message", "webhook"]
使用 Skills CLI 在 https://skills.sh/ 上搜索已有技能。
针对每种能力需求,使用相关关键词进行搜索:
# 搜索匹配该能力的技能 npx skills find# 示例: npx skills find slack notification npx skills find browser automation npx skills find pdf extract npx skills find github api
当返回结果时:
Install with npx skills addowner/repo@skill-name └ https://skills.sh/owner/repo/skill-name
逐项评估结果是否满足:
Capability Mapping:
- 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: "Install browser-use skill"
- task_id: 4
capability: message_delivery
search_query: "slack notification"
found_skills: []
recommendation: "Create new skill: slack-notification"
识别尚未匹配到技能的子任务:
以下能力通常由智能体原生支持:
content_generation — LLM 原生文本生成能力data_transformation — 通过代码实现的基础数据处理code_execution — 直接执行脚本scheduling — 系统级 cron / 调度器配置对于不被原生支持的能力,请判断:
当无现有技能匹配某项必需能力时,创建新技能。
---
name: {skill-name}
description: {对该技能功能及其适用场景的清晰说明。使用第三人称撰写。}
---
# {Skill Title}
{简要介绍该技能的设计目的。}
## When to Use
{描述应触发此技能的典型场景。}
## Prerequisites
{列出所需的安装、配置或凭据等前提条件。}
## Usage
{含示例的详细使用说明。}
### Basic Usage
```bash
{基础命令或代码示例}
{更复杂的使用示例与可选参数。}
{任何配置选项或环境变量。}
{含代码的分步示例。}
{常见问题与解决方案。}
### 初始化新技能 ```bash # 使用 skills CLI 创建技能 npx skills init# 或手动构建目录结构: # skill-name/ # ├── SKILL.md (必需) # ├── scripts/ (可选) # ├── references/ (可选) # └── assets/ (可选)
整合所有信息,生成结构化的执行计划:
Execution Plan:
title: "{Task Description}"
prerequisites:
- "{Prerequisite 1}"
- "{Prerequisite 2}"
skills_to_install:
- skill: "owner/repo@skill-name"
command: "npx skills add owner/repo@skill-name -g -y"
url: "https://skills.sh/owner/repo/skill-name"
skills_to_create:
- name: "{new-skill-name}"
capability: "{capability_type}"
description: "{What it does}"
execution_steps:
- step: 1
task: "{Task name}"
skill: "{skill-name | built-in}"
action: "{Specific action to take}"
- step: 2
task: "{Task name}"
skill: "{skill-name | built-in}"
action: "{Specific action to take}"
verification:
- "{How to verify step 1 succeeded}"
- "{How to verify step 2 succeeded}"
每个子任务应为最小可执行单元,具备清晰的输入与输出边界。
尽可能减少任务间依赖,以便支持并行执行。
每个任务均应有明确的方式验证其是否成功完成。
识别可复用模式,优先创建通用型技能。
每个任务应只专注做好一件事。
以结构化格式呈现任务分解结果:
════════════════════════════════════════════════════════════════
📋 TASK DECOMPOSITION REPORT
════════════════════════════════════════════════════════════════
🎯 Original Request:
{User's original request}
────────────────────────────────────────────────────────────────
📊 SUBTASKS
────────────────────────────────────────────────────────────────
┌─────┬────────────────────────┬───────────────────┬───────────┐
│ ID │ Task │ Capability │ Status │
├─────┼────────────────────────┼───────────────────┼───────────┤
│ 1 │ {task name} │ {capability} │ Found │
│ 2 │ {task name} │ {capability} │ Built-in │
│ 3 │ {task name} │ {capability} │ Create │
└─────┴────────────────────────┴───────────────────┴───────────┘
────────────────────────────────────────────────────────────────
🔍 SKILL SEARCH RESULTS
────────────────────────────────────────────────────────────────
Task 1: {task name}
Search: npx skills find {keywords}
Found: owner/repo@skill-name
URL: https://skills.sh/owner/repo/skill-name
Task 3: {task name}
Search: npx skills find {keywords}
Found: No matching skills
Action: Create new skill
────────────────────────────────────────────────────────────────
🛠️ SKILLS TO CREATE
────────────────────────────────────────────────────────────────
1. {skill-name}
Capability: {capability_type}
Description: {what it does}
────────────────────────────────────────────────────────────────
📝 EXECUTION PLAN
────────────────────────────────────────────────────────────────
Prerequisites:
• {prerequisite 1}
• {prerequisite 2}
Steps:
1. {action} using {skill}
2. {action} using {skill}
3. {action} using {skill}
════════════════════════════════════════════════════════════════
用户请求:
Create a workflow that monitors GitHub issues, summarizes new issues, and posts notifications to Discord
分解结果:
Subtasks:
1. Monitor GitHub repository for new issues
Capability: api_integration
Search: "npx skills find github issues"
2. Extract issue content and metadata
Capability: data_extraction
Status: Built-in (code)
3. Generate issue summary
Capability: content_generation
Status: Built-in (LLM)
4. Send notification to Discord
Capability: message_delivery
Search: "npx skills find discord notification"
5. Configure webhook or polling trigger
Capability: scheduling
Status: Built-in (system)
用户请求:
Search for AI research papers, download PDFs, extract key findings, and save to Notion
分解结果:
Subtasks:
1. Search for AI research papers
Capability: web_search
Search: "npx skills find academic search"
2. Download PDF files
Capability: browser_automation
Search: "npx skills find browser download"
3. Extract text from PDFs
Capability: data_extraction
Search: "npx skills find pdf extract"
4. Generate summaries of key findings
Capability: content_generation
Status: Built-in (LLM)
5. Save to Notion database
Capability: api_integration
Search: "npx skills find notion"
本技能与 find-skills 技能协同工作,共同发现已有解决方案:
# 搜索技能生态 npx skills find# 安装已发现的技能 npx skills add -g -y # 浏览全部可用技能 # 访问:https://skills.sh/