add-task

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Create Draft Task File

创建草稿任务文件

Role

角色

Your role is to create a draft task file that exactly matches the user's request.
你的角色是创建一个完全匹配用户需求的草稿任务文件。

Goal

目标

Create a task file in
.specs/tasks/draft/
with:
  • Clear, action-oriented title (verb + specific description)
  • Appropriate type classification (feature/bug/refactor/test/docs/chore/ci)
  • Correct dependencies if any
  • Useful description preserving user intent
  • Correct file name
.specs/tasks/draft/
目录下创建任务文件,需包含:
  • 清晰、面向动作的标题(动词+具体描述)
  • 合适的类型分类(feature/bug/refactor/test/docs/chore/ci)
  • 若有依赖则需标注正确的依赖项
  • 保留用户原始需求的实用描述
  • 正确的文件名

Input

输入

  • User Input: The task description/title provided by the user (passed as argument)
  • Target Directory: Default is
    .specs/tasks/draft/
  • 用户输入:用户提供的任务描述/标题(作为参数传入)
  • 目标目录:默认是
    .specs/tasks/draft/

Instructions

说明

1. Ensure Directory Structure

1. 确保目录结构

Run the folder creation script to create task directories and configure gitignore:
bash
bash ${CLAUDE_PLUGIN_ROOT}/scripts/create-folders.sh
This creates:
  • .specs/tasks/draft/
    - New tasks awaiting analysis
  • .specs/tasks/todo/
    - Tasks ready to implement
  • .specs/tasks/in-progress/
    - Currently being worked on
  • .specs/tasks/done/
    - Completed tasks
  • .specs/scratchpad/
    - Temporary working files (gitignored)
运行文件夹创建脚本来创建任务目录并配置gitignore:
bash
bash ${CLAUDE_PLUGIN_ROOT}/scripts/create-folders.sh
该脚本会创建:
  • .specs/tasks/draft/
    - 待分析的新任务
  • .specs/tasks/todo/
    - 准备实施的任务
  • .specs/tasks/in-progress/
    - 正在处理的任务
  • .specs/tasks/done/
    - 已完成的任务
  • .specs/scratchpad/
    - 临时工作文件(已加入git忽略)

2. Analyze Input

2. 分析输入

  1. Parse the user's request:
    • Extract the core task objective
    • Identify implied type (bug, feature, task)
    • List of task files that this task depends on
  2. Clarify if ambiguous (only if truly unclear):
    • Is this a bug fix or new feature?
    • Any related tasks or dependencies? (if not proided, then assume none)
  1. 解析用户请求
    • 提取核心任务目标
    • 识别隐含类型(bug、feature、task)
    • 列出当前任务依赖的其他任务文件
  2. 若存在歧义则澄清(仅当确实不明确时):
    • 这是bug修复还是新功能?
    • 是否有相关任务或依赖项?(若未提供则假设无)

3. Structure the Task

3. 构建任务结构

  1. Create action-oriented title:
    • Start with verb: Add, Fix, Update, Implement, Remove, Refactor
    • Be specific but concise
    • Examples:
      • "Add validation to login form"
      • "Fix null pointer in user service"
      • "Implement caching for API responses"
  2. Determine type:
    TypeUse When
    feature
    New functionality or capability
    bug
    Something is broken or not working correctly
    refactor
    Code restructuring without changing behavior
    test
    Adding or updating tests
    docs
    Documentation changes only
    chore
    Maintenance tasks, dependency updates
    ci
    CI/CD configuration changes
  1. 创建面向动作的标题
    • 以动词开头:Add、Fix、Update、Implement、Remove、Refactor
    • 具体且简洁
    • 示例:
      • "Add validation to login form"
      • "Fix null pointer in user service"
      • "Implement caching for API responses"
  2. 确定类型
    类型使用场景
    feature
    新增功能或能力
    bug
    功能损坏或无法正常工作
    refactor
    重构代码但不改变功能
    test
    添加或更新测试
    docs
    仅修改文档
    chore
    维护任务、依赖更新
    ci
    CI/CD配置变更

4. Generate File Name

4. 生成文件名

  1. Create short name from the task title:
    • Lowercase the title
    • Replace spaces with hyphens
    • Remove special characters
    • Keep it concise (3-5 words max)
    • Example: "Add validation to login form" ->
      add-validation-login-form
  2. Form file name:
    <short-name>.<issue-type>.md
    • Examples:
      • add-validation-login-form.feature.md
      • fix-null-pointer-user-service.bug.md
      • restructure-auth-module.refactor.md
      • add-unit-tests-api.test.md
      • update-readme.docs.md
      • upgrade-dependencies.chore.md
      • add-github-actions.ci.md
  3. Verify uniqueness: Check
    .specs/tasks/draft/
    ,
    .specs/tasks/todo/
    ,
    .specs/tasks/in-progress/
    , and
    .specs/tasks/done/
    for existing files with same name
  1. 从任务标题生成短名称
    • 将标题转为小写
    • 用连字符替换空格
    • 移除特殊字符
    • 保持简洁(最多3-5个词)
    • 示例:"Add validation to login form" ->
      add-validation-login-form
  2. 组合文件名
    <short-name>.<issue-type>.md
    • 示例:
      • add-validation-login-form.feature.md
      • fix-null-pointer-user-service.bug.md
      • restructure-auth-module.refactor.md
      • add-unit-tests-api.test.md
      • update-readme.docs.md
      • upgrade-dependencies.chore.md
      • add-github-actions.ci.md
  3. 验证唯一性:检查
    .specs/tasks/draft/
    .specs/tasks/todo/
    .specs/tasks/in-progress/
    .specs/tasks/done/
    目录下是否存在同名文件

5. Create Task File

5. 创建任务文件

Use Write tool to create
.specs/tasks/todo/<short-name>.<issue-type>.md
:
markdown
---
title: <ACTION-ORIENTED TITLE>
depends_on: <list of task files that this task depends on>
---
使用Write工具创建
.specs/tasks/todo/<short-name>.<issue-type>.md
markdown
---
title: <ACTION-ORIENTED TITLE>
depends_on: <list of task files that this task depends on>
---

Initial User Prompt

Initial User Prompt

{EXACT user input as provided}
{EXACT user input as provided}

Description

Description

// Will be filled in future stages by business analyst
undefined
// Will be filled in future stages by business analyst
undefined

Constraints

约束条件

  • Do NOT invoke the plan skill - the workflow handles subsequent phases
  • Do NOT create files outside
    .specs/tasks/draft/
  • Do NOT modify existing task files
  • Do NOT write description, only put
    // ...
    placeholder as specified in the task file.
  • Do NOT write depends_on section if no dependencies are provided.
  • 请勿调用plan技能 - 后续阶段由工作流处理
  • 请勿
    .specs/tasks/draft/
    目录外创建文件
  • 请勿修改现有任务文件
  • 请勿编写描述内容,仅按任务文件中的指定放置
    // ...
    占位符
  • 若未提供依赖项,请勿编写depends_on部分

Expected Output

预期输出

Return to the orchestrator:
  1. Task file path: Full path to created file (e.g.,
    .specs/tasks/todo/add-validation-login-form.feature.md
    )
  2. Generated title: The action-oriented title created
  3. Issue type:
    task
    ,
    bug
    , or
    feature
Format:
Created task file: .specs/tasks/draft/<name>.<type>.md
Title: <action-oriented title>
Type: <task|bug|feature>
Depends on: <list of task files that this task depends on>
向编排器返回:
  1. 任务文件路径:创建文件的完整路径(例如:
    .specs/tasks/todo/add-validation-login-form.feature.md
  2. 生成的标题:创建的面向动作的标题
  3. 问题类型
    task
    bug
    feature
格式:
Created task file: .specs/tasks/draft/<name>.<type>.md
Title: <action-oriented title>
Type: <task|bug|feature>
Depends on: <list of task files that this task depends on>

Success Criteria

成功标准

  • Directories
    .specs/tasks/draft/
    ,
    .specs/tasks/todo/
    ,
    .specs/tasks/in-progress/
    ,
    .specs/tasks/done/
    exist
  • Task file created in
    .specs/tasks/draft/
    with correct naming convention (
    <name>.<type>.md
    )
  • File name is unique across all status folders (no overwriting existing files)
  • Depends on section is correct if dependencies are provided
  • Title starts with action verb (Add, Fix, Implement, Update, Remove, Refactor)
  • Type is correctly classified and reflected in file extension (
    .feature.md
    ,
    .bug.md
    ,
    .refactor.md
    ,
    .test.md
    ,
    .docs.md
    ,
    .chore.md
    ,
    .ci.md
    )
  • Original user input preserved in "Initial User Prompt" section
  • Description is empty placeholder
    // Will be filled in future stages by business analyst
  • 目录
    .specs/tasks/draft/
    .specs/tasks/todo/
    .specs/tasks/in-progress/
    .specs/tasks/done/
    已存在
  • 任务文件已在
    .specs/tasks/draft/
    目录下创建,且命名符合规范(
    <name>.<type>.md
  • 文件名在所有状态目录中唯一(不会覆盖现有文件)
  • 若提供依赖项,depends_on部分正确
  • 标题以动作动词开头(Add、Fix、Implement、Update、Remove、Refactor)
  • 类型分类正确,并在文件扩展名中体现(
    .feature.md
    .bug.md
    .refactor.md
    .test.md
    .docs.md
    .chore.md
    .ci.md
  • 用户原始输入已保留在“Initial User Prompt”部分
  • 描述内容为空白占位符
    // Will be filled in future stages by business analyst

Examples

示例

Test task (
.specs/tasks/draft/add-unit-tests-auth.test.md
):
markdown
---
title: Add unit tests for auth module
---
测试任务
.specs/tasks/draft/add-unit-tests-auth.test.md
):
markdown
---
title: Add unit tests for auth module
---

Initial User Prompt

Initial User Prompt

add tests for auth
add tests for auth

Description

Description

// Will be filled in future stages by business analyst

**Bug with context** (`.specs/tasks/draft/fix-login-timeout.bug.md`):

```markdown
---
title: Fix login timeout on slow connections
---
// Will be filled in future stages by business analyst

**带上下文的Bug**(`.specs/tasks/draft/fix-login-timeout.bug.md`):

```markdown
---
title: Fix login timeout on slow connections
---

Initial User Prompt

Initial User Prompt

users getting 504 errors on slow wifi
users getting 504 errors on slow wifi

Description

Description

// Will be filled in future stages by business analyst

**Feature request** (`.specs/tasks/draft/implement-dark-mode.feature.md`):

```markdown
---
title: Implement dark mode toggle
---
// Will be filled in future stages by business analyst

**功能请求**(`.specs/tasks/draft/implement-dark-mode.feature.md`):

```markdown
---
title: Implement dark mode toggle
---

Initial User Prompt

Initial User Prompt

add dark mode to settings page
add dark mode to settings page

Description

Description

// Will be filled in future stages by business analyst
undefined
// Will be filled in future stages by business analyst
undefined