task-plan-generator_cn
为复杂任务生成多方案任务计划,并在执行过程中持续优化。适用于:1) 用户提出需要多步骤完成的任务;2) 需要协调多个工具或skill的复杂工作流;3) 需要评估不同执行策略的场景。此skill会在每次任务完成后生成简报归档,分析任务复杂度并提供效率/成功率/资源消耗等多种方案供选择。
MIT-0 · Free to use, modify, and redistribute. No attribution required.
⭐ 0 · 23 · 0 current installs · 0 all-time installs
bybeyondSuffering@louisding9527
MIT-0
Security Scan
OpenClaw
Benign
medium confidencePurpose & Capability
The name/description (generate multi-option task plans, archive reports, and optimize) match the SKILL.md instructions: analyze tasks, read a local plan_source.md, produce 2–3 plans, ask for confirmations, and archive task_reports. No unrelated services, credentials, or installers are requested.
Instruction Scope
The runtime instructions explicitly tell the agent to read/write files in the workspace, parent directory, and ~/.claude/resources, and to aggregate historical report data (cat/grep/jq examples). This stays within the stated planning/archiving purpose, but the search path includes the user's home directory and parent directories which could expose unrelated files. The doc also uses shell tooling (grep/jq) without declaring required binaries.
Install Mechanism
This is instruction-only with no install spec or downloaded artifacts, so nothing is written to disk by an installer. That reduces supply-chain risk.
Credentials
The skill declares no required env vars or credentials (appropriate). However it reads config/resource files from ~/.claude/resources and workspace/parent directories (file paths not declared in requires.config), which is reasonable for its purpose but broad — review whether accessing the home directory is acceptable in your environment.
Persistence & Privilege
always:false (normal). The skill expects to write archived reports to {workspace}/task_reports and perform automatic cleanup (>90 days). Writing and deleting files inside the workspace is coherent with the purpose, but you should confirm the cleanup behavior and scope to avoid unintended deletion outside the intended folder.
Assessment
This skill is generally coherent for local task planning and report archiving. Before installing: (1) confirm you are comfortable allowing the agent to read plan_source.md from the workspace, parent directory, or your home (~/.claude/resources); (2) note the SKILL.md uses shell commands (cat/grep/jq) but the skill declares no required binaries — ensure 'jq' (and a shell) are available or adjust the instructions; (3) verify the archive path ({workspace}/task_reports/) is the intended location and that the auto-clean policy (delete >90 days) will not remove important files; (4) avoid placing sensitive credentials or unrelated private data in plan_source.md or the searched directories. If you want tighter control, restrict the allowed search paths to a specific project folder and confirm/preview any deletions before they run.Like a lobster shell, security has layers — review code before you run it.
Current versionv1.0.1
Download zipexperiencelatestplantask
License
MIT-0
Free to use, modify, and redistribute. No attribution required.
SKILL.md
Task Plan Generator
这个skill帮助agent为复杂任务生成结构化的任务计划,并在执行过程中持续优化。
核心工作流程
- 接收并分析任务 - 理解用户需求,评估任务复杂度
- 读取历史资源 - 从plan_source.md获取可用的SKILLS/MCP/工具
- 生成多方案 - 根据不同策略生成2-3个执行方案
- 用户确认 - 与用户对话确认不明确的地方
- 生成任务简报 - 归档执行结果,便于回溯
第一步:接收任务并分析复杂度
当用户提出任务时,首先进行初步分析:
任务复杂度判断标准
| 复杂度 | 判断条件 | 示例 |
|---|---|---|
| 短 | 1-2个步骤,单一工具即可完成 | 读取文件、简单转换 |
| 中 | 3-5个步骤,需要2-3个工具协调 | 数据处理+生成报告 |
| 长 | 5个以上步骤,多工具/多次交互 | 完整项目开发、多阶段数据处理 |
任务分析输出格式
任务复杂度评估:[短/中/长]
预估步骤数:X步
需要资源类型:[SKILLS/MCP/工具列表]
潜在风险点:[列出可能失败或需要确认的地方]
第二步:读取历史成功资源
读取 plan_source.md
在当前工作空间或指定路径查找 plan_source.md 文件:
查找路径优先级:
1. 当前工作空间根目录/plan_source.md
2. 上一级目录/plan_source.md
3. ~/.claude/resources/plan_source.md
plan_source.md 格式规范
# Plan Source Resources
## 可用SKILLS
- skill-name: 功能描述 | 上次成功调用时间
- document-skills:pdf: PDF处理 | 2024-01-15
## 可用MCP
- mcp-name: 功能描述 | 上次成功调用时间
- filesystem: 文件系统操作 | 2024-01-15
## 可用系统工具
- Read: 读取文件内容
- Write: 写入文件
- Edit: 编辑文件
- Bash: 执行shell命令
## 可用系统资源
- 当前工作目录路径
- 可访问的API端点
资源匹配策略
从plan_source.md中筛选与当前任务匹配的资源:
- 按功能类型过滤(SKILLS/MCP/工具)
- 按最近成功时间排序
- 标记可能不可用的资源(超过30天未调用)
第三步:生成多方案执行计划
根据不同策略生成2-3个方案:
方案生成模板
## 方案 X:[策略名称]
**策略描述**:XXX
**预估耗时**:X分钟
**成功率预估**:X%
**资源消耗**:低/中/高
### 执行步骤
1. [步骤描述] - 使用[资源]
2. [步骤描述] - 使用[资源]
...
### 风险评估
- [风险点1]:缓解措施
- [风险点2]:缓解措施
三种推荐策略
策略1:效率优先
- 最小化步骤数量
- 使用最熟悉的工具组合
- 并行化可独立的步骤
策略2:成功率优先
- 选择历史成功率高资源
- 增加验证步骤
- 预留回退方案
策略3:资源消耗最小
- 减少API调用次数
- 使用本地工具替代远程服务
- 合并可合并的步骤
第四步:识别需要确认的地方
触发用户确认的条件
出现以下情况时,必须与用户对话确认:
| 条件 | 示例 | 优先级 |
|---|---|---|
| 意图不明确 | "处理那个文件" - 哪个文件? | 高 |
| 资源不可用 | 需要用的skill历史调用失败 | 高 |
| 成功率低于70% | 方案预估成功率为50% | 中 |
| 多种可行方案 | 两种方法都能完成 | 中 |
| 风险较高 | 涉及删除/覆盖操作 | 高 |
对话确认模板
⚠️ 需要确认
[问题描述]
可能的选项:
1. [选项1]
2. [选项2]
3. [自定义]
请选择或补充说明。
确认后更新计划
用户确认后,将答案补充到task_plan中:
## 确认记录
- Q: [问题]
- A: [用户回答]
- 更新内容: [计划调整]
第五步:生成任务简报
简报生成时机
- 任务完成后(无论成功/失败)
- 用户主动要求中断时
- 阶段性里程碑完成时
简报格式(低Token + 数据化成功率)
简报分为两个部分:
- 数据块(供agent快速读取,结构化便于程序解析)
- 摘要(人类可读,50字以内)
# Task Report: [task_id]
## DATA
{"t":X,"s":"[success/failed/partial]","d":X,"tools":[
{"n":"[工具名]","s":X,"h":X}, // 本次成功=1/失败=0,历史成功率%
{"n":"Read","s":1,"h":98},
{"n":"Write","s":1,"h":95},
{"n":"xlsx","s":0,"h":72}
]}
## SUMMARY
[一句话总结,50字以内]
数据字段说明
| 字段 | 说明 | 示例 |
|---|---|---|
t | 总步骤数 | 5 |
s | 执行状态 | success/failed/partial |
d | 执行耗时(分钟) | 3 |
tools[] | 工具调用记录 | - |
n | 工具名称 | Read, Write, xlsx |
s | 本次成功标志 | 1=成功, 0=失败 |
h | 历史成功率(%) | 98 |
历史成功率聚合规则
- 首次调用:历史成功率设为 50%(无历史数据)
- 已有数据:读取同一工作空间内所有历史简报,聚合计算
- 聚合计算:
(成功次数 / 总调用次数) * 100
简报归档规则
- 归档路径:
{workspace}/task_reports/{YYYYMM}/{task_id}.md - 命名规范:
{YYYYMMDD}_{HHMMSS}_{task_name}.md - 历史记录:保留最近90天的简报,超期自动清理
快速读取历史成功率(Agent专用)
当需要获取历史成功率时,按顺序查找:
# 查找最近30天的所有简报,聚合tools数组
cat {workspace}/task_reports/*.md | grep -A100 "## DATA" | jq '.tools[].h'
简化读取示例(不解析全部内容):
读取最近5个简报的DATA行 → 聚合 → 输出: {Read:95%, Write:88%, xlsx:72%}
执行示例
示例1:短任务(无需多方案)
用户输入:"读取当前目录下的README.md文件"
分析结果:
任务复杂度:短
预估步骤:1步
需要资源:Read工具
执行计划:
## 方案1:直接执行
1. 使用Read工具读取README.md
简报:
# Task Report: read_readme_20240315_143022
## DATA
{"t":1,"s":"success","d":0,"tools":[
{"n":"Read","s":1,"h":98}
]}
## SUMMARY
成功读取README.md文件
历史成功率读取示例
下次执行类似任务时,agent可快速获取:
从最近10个简报聚合 → Read工具: 98% (98/100)
示例2:中任务(需要多方案)
用户输入:"分析销售数据并生成图表报告"
分析结果:
任务复杂度:中
预估步骤:4-5步
需要资源:Read/xlsx/Skills
多方案生成:
## 方案1:效率优先
- 使用xlsx skill直接生成图表
- 预估耗时:5分钟,成功率90%
## 方案2:成功率优先
- 先读取数据验证格式
- 分步生成图表+报告
- 预估耗时:8分钟,成功率95%
## 方案3:资源消耗最小
- 使用本地Python脚本处理
- 预估耗时:10分钟,成功率85%
用户确认:
⚠️ 需要确认
您希望使用哪种格式的报告?
1. PDF文档
2. HTML页面
3. Markdown文件
示例3:长任务(需要详细规划)
用户输入:"构建一个完整的Web应用"
分析结果:
任务复杂度:长
预估步骤:15+步
需要资源:多个SKILLS和工具
生成计划:
- 按阶段分解(需求→设计→开发→测试→部署)
- 每个阶段生成独立方案
- 识别关键依赖节点
确认环节:
- 技术栈选择
- 部署平台偏好
- 优先级排序
注意事项
- 不要过度规划:简单任务一步完成,不强制生成多方案
- 尊重用户时间:确认问题要简洁明了,避免重复询问
- 记录历史:每次执行结果都要归档,用于后续优化
- 适应变化:执行过程中发现新情况,及时调整计划
- 保持简洁:简报总token控制在300字以内,DATA区结构化,SUMMARY区人类可读
相关文件
plan_source.md- 历史成功资源记录(需维护更新)task_reports/- 任务简报归档目录
Files
1 totalSelect a file
Select a file to preview.
Comments
Loading comments…
