task-management

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Task Management Skill

任务管理Skill

Purpose: Track, manage, and validate feature implementations with atomic task breakdowns, dependency resolution, and progress monitoring.

用途:通过原子化任务拆分、依赖解析和进度监控,跟踪、管理并验证功能实现。

What I Do

功能介绍

I provide a command-line interface for managing task breakdowns created by the TaskManager subagent. I help you:
  • Track progress - See status of all features and their subtasks
  • Find next tasks - Show eligible tasks (dependencies satisfied)
  • Identify blocked tasks - See what's blocked and why
  • Manage completion - Mark subtasks as complete with summaries
  • Validate integrity - Check JSON files and dependency trees

我提供命令行界面,用于管理由TaskManager子代理创建的任务拆分。我可以帮助你:
  • 跟踪进度 - 查看所有功能及其实例任务的状态
  • 查找待执行任务 - 显示符合条件的任务(依赖已满足)
  • 识别阻塞任务 - 查看哪些任务被阻塞及原因
  • 管理任务完成 - 标记子任务为已完成并添加摘要
  • 验证完整性 - 检查JSON文件和依赖树

How to Use Me

使用方法

Quick Start

快速开始

bash
undefined
bash
undefined

Show all task statuses

显示所有任务状态

bash .opencode/skills/task-management/router.sh status
bash .opencode/skills/task-management/router.sh status

Show next eligible tasks

显示待执行任务

bash .opencode/skills/task-management/router.sh next
bash .opencode/skills/task-management/router.sh next

Show blocked tasks

显示阻塞任务

bash .opencode/skills/task-management/router.sh blocked
bash .opencode/skills/task-management/router.sh blocked

Mark a task complete

标记任务完成

bash .opencode/skills/task-management/router.sh complete <feature> <seq> "summary"
bash .opencode/skills/task-management/router.sh complete <feature> <seq> "summary"

Validate all tasks

验证所有任务

bash .opencode/skills/task-management/router.sh validate
undefined
bash .opencode/skills/task-management/router.sh validate
undefined

Command Reference

命令参考

CommandDescription
status [feature]
Show task status summary for all features or specific one
next [feature]
Show next eligible tasks (dependencies satisfied)
parallel [feature]
Show parallelizable tasks ready to run
deps <feature> <seq>
Show dependency tree for a specific subtask
blocked [feature]
Show blocked tasks and why
complete <feature> <seq> "summary"
Mark subtask complete with summary
validate [feature]
Validate JSON files and dependencies
help
Show help message

命令描述
status [feature]
显示所有功能或特定功能的任务状态汇总
next [feature]
显示待执行任务(依赖已满足)
parallel [feature]
显示可并行执行的就绪任务
deps <feature> <seq>
显示特定子任务的依赖树
blocked [feature]
显示阻塞任务及原因
complete <feature> <seq> "summary"
标记子任务为已完成并添加摘要
validate [feature]
验证JSON文件和依赖关系
help
显示帮助信息

Examples

使用示例

Check Overall Progress

查看整体进度

bash
$ bash .opencode/skills/task-management/router.sh status

[my-feature] My Feature Implementation
  Status: active | Progress: 45% (5/11)
  Pending: 3 | In Progress: 2 | Completed: 5 | Blocked: 1
bash
$ bash .opencode/skills/task-management/router.sh status

[my-feature] My Feature Implementation
  Status: active | Progress: 45% (5/11)
  Pending: 3 | In Progress: 2 | Completed: 5 | Blocked: 1

Find What's Next

查找待执行任务

bash
$ bash .opencode/skills/task-management/router.sh next

=== Ready Tasks (deps satisfied) ===

[my-feature]
  06 - Implement API endpoint [sequential]
  08 - Write unit tests [parallel]
bash
$ bash .opencode/skills/task-management/router.sh next

=== Ready Tasks (deps satisfied) ===

[my-feature]
  06 - Implement API endpoint [sequential]
  08 - Write unit tests [parallel]

Mark Complete

标记任务完成

bash
$ bash .opencode/skills/task-management/router.sh complete my-feature 05 "Implemented authentication module"

✓ Marked my-feature/05 as completed
  Summary: Implemented authentication module
  Progress: 6/11
bash
$ bash .opencode/skills/task-management/router.sh complete my-feature 05 "Implemented authentication module"

✓ Marked my-feature/05 as completed
  Summary: Implemented authentication module
  Progress: 6/11

Check Dependencies

查看依赖关系

bash
$ bash .opencode/skills/task-management/router.sh deps my-feature 07

=== Dependency Tree: my-feature/07 ===

07 - Write integration tests [pending]
  ├── ✓ 05 - Implement authentication module [completed]
  └── ○ 06 - Implement API endpoint [in_progress]
bash
$ bash .opencode/skills/task-management/router.sh deps my-feature 07

=== Dependency Tree: my-feature/07 ===

07 - Write integration tests [pending]
  ├── ✓ 05 - Implement authentication module [completed]
  └── ○ 06 - Implement API endpoint [in_progress]

Validate Everything

验证所有任务

bash
$ bash .opencode/skills/task-management/router.sh validate

=== Validation Results ===

[my-feature]
  ✓ All checks passed

bash
$ bash .opencode/skills/task-management/router.sh validate

=== Validation Results ===

[my-feature]
  ✓ All checks passed

Architecture

架构

.opencode/skills/task-management/
├── SKILL.md                          # This file
├── router.sh                         # CLI router (entry point)
└── scripts/
    └── task-cli.ts                   # Task management CLI implementation

.opencode/skills/task-management/
├── SKILL.md                          # 本文档
├── router.sh                         # CLI路由(入口文件)
└── scripts/
    └── task-cli.ts                   # 任务管理CLI实现

Task File Structure

任务文件结构

Tasks are stored in
.tmp/tasks/
at the project root:
.tmp/tasks/
├── {feature-slug}/
│   ├── task.json                     # Feature-level metadata
│   ├── subtask_01.json               # Subtask definitions
│   ├── subtask_02.json
│   └── ...
└── completed/
    └── {feature-slug}/               # Completed tasks
任务存储在项目根目录的
.tmp/tasks/
下:
.tmp/tasks/
├── {feature-slug}/
│   ├── task.json                     # 功能级元数据
│   ├── subtask_01.json               # 子任务定义
│   ├── subtask_02.json
│   └── ...
└── completed/
    └── {feature-slug}/               # 已完成任务

task.json Schema

task.json schema

json
{
  "id": "my-feature",
  "name": "My Feature",
  "status": "active",
  "objective": "Implement X",
  "context_files": ["docs/spec.md"],
  "reference_files": ["src/existing.ts"],
  "exit_criteria": ["Tests pass", "Code reviewed"],
  "subtask_count": 5,
  "completed_count": 2,
  "created_at": "2026-01-11T10:00:00Z",
  "completed_at": null
}
json
{
  "id": "my-feature",
  "name": "My Feature",
  "status": "active",
  "objective": "Implement X",
  "context_files": ["docs/spec.md"],
  "reference_files": ["src/existing.ts"],
  "exit_criteria": ["Tests pass", "Code reviewed"],
  "subtask_count": 5,
  "completed_count": 2,
  "created_at": "2026-01-11T10:00:00Z",
  "completed_at": null
}

subtask_##.json Schema

subtask_##.json Schema

json
{
  "id": "my-feature-05",
  "seq": "05",
  "title": "Implement authentication",
  "status": "pending",
  "depends_on": ["03", "04"],
  "parallel": false,
  "suggested_agent": "coder-agent",
  "context_files": ["docs/auth.md"],
  "reference_files": ["src/auth-old.ts"],
  "acceptance_criteria": ["Login works", "JWT tokens valid"],
  "deliverables": ["auth.ts", "auth.test.ts"],
  "started_at": null,
  "completed_at": null,
  "completion_summary": null
}

json
{
  "id": "my-feature-05",
  "seq": "05",
  "title": "Implement authentication",
  "status": "pending",
  "depends_on": ["03", "04"],
  "parallel": false,
  "suggested_agent": "coder-agent",
  "context_files": ["docs/auth.md"],
  "reference_files": ["src/auth-old.ts"],
  "acceptance_criteria": ["Login works", "JWT tokens valid"],
  "deliverables": ["auth.ts", "auth.test.ts"],
  "started_at": null,
  "completed_at": null,
  "completion_summary": null
}

Integration with TaskManager

与TaskManager集成

The TaskManager subagent creates task files using this format. When you delegate to TaskManager:
javascript
task(
  subagent_type="TaskManager",
  description="Implement feature X",
  prompt="Break down this feature into atomic subtasks..."
)
TaskManager creates:
  1. .tmp/tasks/{feature}/task.json
    - Feature metadata
  2. .tmp/tasks/{feature}/subtask_XX.json
    - Individual subtasks
You can then use this skill to track and manage progress.

TaskManager子代理使用此格式创建任务文件。当你委托给TaskManager时:
javascript
task(
  subagent_type="TaskManager",
  description="Implement feature X",
  prompt="Break down this feature into atomic subtasks..."
)
TaskManager会创建:
  1. .tmp/tasks/{feature}/task.json
    - 功能元数据
  2. .tmp/tasks/{feature}/subtask_XX.json
    - 单个子任务
之后你可以使用本Skill跟踪和管理进度。

Key Concepts

核心概念

1. Dependency Resolution

1. 依赖解析

Subtasks can depend on other subtasks. A task is "ready" only when all its dependencies are complete.
子任务可以依赖其他子任务。只有当所有依赖都完成时,任务才处于“就绪”状态。

2. Parallel Execution

2. 并行执行

Set
parallel: true
to indicate a subtask can run alongside other parallel tasks with satisfied dependencies.
设置
parallel: true
表示该子任务可与其他满足依赖的并行任务同时执行。

3. Status Tracking

3. 状态跟踪

  • pending - Not started, waiting for dependencies
  • in_progress - Currently being worked on
  • completed - Finished with summary
  • blocked - Explicitly blocked (not waiting for deps)
  • pending - 未启动,等待依赖
  • in_progress - 正在执行中
  • completed - 已完成并添加摘要
  • blocked - 明确被阻塞(非等待依赖)

4. Exit Criteria

4. 完成标准

Each feature has exit_criteria that must be met before marking the feature complete.
每个功能都有完成标准,必须满足这些标准才能标记功能为已完成。

5. Validation Rules

5. 验证规则

The
validate
command performs comprehensive checks on task files:
Task-Level Validation:
  • ✅ task.json file exists for the feature
  • ✅ Task ID matches feature slug
  • ✅ Subtask count in task.json matches actual subtask files
  • ✅ All required fields are present
Subtask-Level Validation:
  • ✅ All subtask IDs start with feature name (e.g., "my-feature-01")
  • ✅ Sequence numbers are unique and properly formatted (01, 02, etc.)
  • ✅ All dependencies reference existing subtasks
  • ✅ No circular dependencies exist
  • ✅ Each subtask has acceptance criteria defined
  • ✅ Each subtask has deliverables specified
  • ✅ Status values are valid (pending, in_progress, completed, blocked)
Dependency Validation:
  • ✅ All depends_on references point to existing subtasks
  • ✅ No task depends on itself
  • ✅ No circular dependency chains
  • ✅ Dependency graph is acyclic
Run
validate
regularly to catch issues early:
bash
bash .opencode/skills/task-management/router.sh validate my-feature
validate
命令会对任务文件执行全面检查:
任务级验证:
  • ✅ 功能对应的task.json文件存在
  • ✅ 任务ID与功能slug匹配
  • ✅ task.json中的子任务数量与实际子任务文件数量一致
  • ✅ 所有必填字段均存在
子任务级验证:
  • ✅ 所有子任务ID均以功能名称开头(例如:"my-feature-01")
  • ✅ 序号唯一且格式正确(01、02等)
  • ✅ 所有依赖均指向存在的子任务
  • ✅ 不存在循环依赖
  • ✅ 每个子任务都定义了验收标准
  • ✅ 每个子任务都指定了交付物
  • ✅ 状态值有效(pending、in_progress、completed、blocked)
依赖验证:
  • ✅ 所有depends_on引用均指向存在的子任务
  • ✅ 没有任务依赖自身
  • ✅ 不存在循环依赖链
  • ✅ 依赖图为无环图
定期运行
validate
以尽早发现问题:
bash
bash .opencode/skills/task-management/router.sh validate my-feature

6. Context and Reference Files

6. 上下文与参考文件

  • context_files - Standards, conventions, and guidelines to follow
  • reference_files - Existing project files to look at or build upon

  • context_files - 需要遵循的标准、规范和指南
  • reference_files - 可参考或基于其构建的现有项目文件

Workflow Integration

工作流集成

With TaskManager Subagent

与TaskManager子代理集成

  1. TaskManager creates tasks → Generates
    .tmp/tasks/{feature}/
    structure
  2. You use this skill to track → Monitor progress with
    status
    ,
    next
    ,
    blocked
  3. You mark tasks complete → Use
    complete
    command with summaries
  4. Skill validates integrity → Use
    validate
    to check consistency
  1. TaskManager创建任务 → 生成
    .tmp/tasks/{feature}/
    目录结构
  2. 使用本Skill跟踪 → 通过
    status
    next
    blocked
    命令监控进度
  3. 标记任务完成 → 使用
    complete
    命令并添加摘要
  4. Skill验证完整性 → 使用
    validate
    命令检查一致性

With Other Subagents

与其他子代理集成

Working agents (CoderAgent, TestEngineer, etc.) execute subtasks and report completion. Use this skill to:
  • Find next available tasks with
    next
  • Check what's blocking progress with
    blocked
  • Validate task definitions with
    validate

执行代理(CoderAgent、TestEngineer等)执行子任务并报告完成情况。使用本Skill可以:
  • 通过
    next
    命令查找下一个可用任务
  • 通过
    blocked
    命令检查进度阻塞原因
  • 通过
    validate
    命令验证任务定义

Common Workflows

常见工作流

Starting a New Feature

启动新功能

bash
undefined
bash
undefined

1. TaskManager creates the task structure

1. TaskManager创建任务结构

task(subagent_type="TaskManager", description="Implement feature X", ...)
task(subagent_type="TaskManager", description="Implement feature X", ...)

2. Check what's ready

2. 查看就绪任务

bash .opencode/skills/task-management/router.sh next
bash .opencode/skills/task-management/router.sh next

3. Delegate first task to working agent

3. 将第一个任务委托给执行代理

task(subagent_type="CoderAgent", description="Implement subtask 01", ...)
undefined
task(subagent_type="CoderAgent", description="Implement subtask 01", ...)
undefined

Tracking Progress

跟踪进度

bash
undefined
bash
undefined

Check overall status

查看整体状态

bash .opencode/skills/task-management/router.sh status my-feature
bash .opencode/skills/task-management/router.sh status my-feature

See what's next

查看待执行任务

bash .opencode/skills/task-management/router.sh next my-feature
bash .opencode/skills/task-management/router.sh next my-feature

Check what's blocked

查看阻塞任务

bash .opencode/skills/task-management/router.sh blocked my-feature
undefined
bash .opencode/skills/task-management/router.sh blocked my-feature
undefined

Completing Tasks

标记任务完成

bash
undefined
bash
undefined

After working agent finishes

执行代理完成任务后

bash .opencode/skills/task-management/router.sh complete my-feature 05 "Implemented auth module with JWT support"
bash .opencode/skills/task-management/router.sh complete my-feature 05 "Implemented auth module with JWT support"

Check progress

检查进度

bash .opencode/skills/task-management/router.sh status my-feature
bash .opencode/skills/task-management/router.sh status my-feature

Find next task

查找下一个任务

bash .opencode/skills/task-management/router.sh next my-feature
undefined
bash .opencode/skills/task-management/router.sh next my-feature
undefined

Validating Everything

验证所有任务

bash
undefined
bash
undefined

Validate all tasks

验证所有任务

bash .opencode/skills/task-management/router.sh validate
bash .opencode/skills/task-management/router.sh validate

Validate specific feature

验证特定功能

bash .opencode/skills/task-management/router.sh validate my-feature

---
bash .opencode/skills/task-management/router.sh validate my-feature

---

Tips & Best Practices

提示与最佳实践

1. Use Meaningful Summaries

1. 使用有意义的摘要

When marking tasks complete, provide clear summaries:
bash
undefined
标记任务完成时,提供清晰的摘要:
bash
undefined

Good

推荐写法

complete my-feature 05 "Implemented JWT authentication with refresh tokens and error handling"
complete my-feature 05 "Implemented JWT authentication with refresh tokens and error handling"

Avoid

避免写法

complete my-feature 05 "Done"
undefined
complete my-feature 05 "Done"
undefined

2. Check Dependencies Before Starting

2. 启动前检查依赖

bash
undefined
bash
undefined

See what a task depends on

查看任务依赖

bash .opencode/skills/task-management/router.sh deps my-feature 07
undefined
bash .opencode/skills/task-management/router.sh deps my-feature 07
undefined

3. Identify Parallelizable Work

3. 识别可并行工作的任务

bash
undefined
bash
undefined

Find tasks that can run in parallel

查找可并行执行的任务

bash .opencode/skills/task-management/router.sh parallel my-feature
undefined
bash .opencode/skills/task-management/router.sh parallel my-feature
undefined

4. Regular Validation

4. 定期验证

bash
undefined
bash
undefined

Validate regularly to catch issues early

定期验证以尽早发现问题

bash .opencode/skills/task-management/router.sh validate

---
bash .opencode/skills/task-management/router.sh validate

---

Troubleshooting

故障排除

"task-cli.ts not found"

"task-cli.ts not found"

Make sure you're running from the project root or the router.sh can find it.
确保你从项目根目录运行命令,或者router.sh可以找到该文件。

"No tasks found"

"No tasks found"

Run
status
to see if any tasks have been created yet. Use TaskManager to create tasks first.
运行
status
命令查看是否已创建任务。请先使用TaskManager创建任务。

"Dependency not satisfied"

"Dependency not satisfied"

Check the dependency tree with
deps
to see what's blocking the task.
使用
deps
命令查看依赖树,确认哪些任务阻塞了当前任务。

"Validation failed"

"Validation failed"

Run
validate
to see specific issues, then check the JSON files in
.tmp/tasks/
.

运行
validate
命令查看具体问题,然后检查
.tmp/tasks/
中的JSON文件。

File Locations

文件位置

  • Skill:
    .opencode/skills/task-management/
  • Router:
    .opencode/skills/task-management/router.sh
  • CLI:
    .opencode/skills/task-management/scripts/task-cli.ts
  • Tasks:
    .tmp/tasks/
    (created by TaskManager)
  • Documentation:
    .opencode/skills/task-management/SKILL.md
    (this file)

Task Management Skill - Track, manage, and validate your feature implementations!
  • Skill:
    .opencode/skills/task-management/
  • 路由文件:
    .opencode/skills/task-management/router.sh
  • CLI:
    .opencode/skills/task-management/scripts/task-cli.ts
  • 任务:
    .tmp/tasks/
    (由TaskManager创建)
  • 文档:
    .opencode/skills/task-management/SKILL.md
    (本文档)

任务管理Skill - 跟踪、管理并验证你的功能实现!