关于 task-generator
task-generator 是一项 Agent 技能,可将规格说明、计划或需求转为分步任务清单。它先规划高层任务,再拆分为可执行子任务,并写入任务文件。
主要功能
- 01两阶段任务生成
- 02规划高层父任务
- 03拆分可执行子任务
- 04识别相关源码与测试文件
- 05输出 Markdown 任务文件
适用场景
- 01根据功能规格制定实施计划
- 02将父任务拆分为聚焦的开发工作
- 03准备包含测试文件的任务清单
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ julianromli/ ai-skills --skill task-generator安装后在 Claude Code 中输入/task-generator确认已加载。
详细介绍
任务生成器
根据规格说明、计划或需求,生成详细的分步任务列表。
工作流(两阶段流程)
阶段 1:生成父任务
- 分析规格说明/计划内容,了解功能需求和实现范围
- 在
/tasks/tasks-[feature-name].md创建任务文件 - 生成 5-7 个高层级父任务:
- 始终以任务 0.0:「Create feature branch」(创建功能分支)开头,除非用户明确选择跳过
- 其他任务的数量由你判断
- 按输出格式向用户展示父任务(不含子任务)
- 告知用户:「我已生成高层级任务。准备好生成子任务了吗?回复 Go 以继续。」
阶段 2:生成子任务
- 等待用户回复「Go」
- 将每个父任务拆分为更小且可执行的子任务
- 确定需要创建/修改的相关文件(包括测试文件)
- 使用完整结构更新任务文件
输出格式
保存到 /tasks/tasks-[feature-name].md:
## Relevant Files
- `path/to/file.ts` - Brief description of why this file is relevant
- `path/to/file.test.ts` - Unit tests for file.ts
- `path/to/component.tsx` - Component description
- `path/to/component.test.tsx` - Unit tests for component.tsx
### Notes
- Unit tests should be placed alongside the code files they test
- Use `npx jest [optional/path/to/test/file]` to run tests
## Instructions for Completing Tasks
**IMPORTANT:** As you complete each task, check it off by changing `- [ ]` to `- [x]`. Update after completing each sub-task.
## Tasks
- [ ] 0.0 Create feature branch
- [ ] 0.1 Create and checkout new branch (`git checkout -b feature/[feature-name]`)
- [ ] 1.0 [Parent Task Title]
- [ ] 1.1 [Sub-task description]
- [ ] 1.2 [Sub-task description]
- [ ] 2.0 [Parent Task Title]
- [ ] 2.1 [Sub-task description]
指南
- 目标读者:将要实现此功能的初级开发者
- 任务风格:使用祈使动词(Create、Add、Implement、Update)
- 功能名称:根据规格说明的标题/主题,以 kebab-case 格式命名
- 文件识别:同时列出源文件和测试文件
- 子任务粒度:每个子任务应能在一次专注的工作时段内完成
评论
支持 Markdown