maintain-tasks
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTask Management for Session Continuity
用于会话连续性的任务管理
Tasks are your working memory that survives compaction. Use them to maintain intent, sequence, and coordination across the natural lifecycle of a session.
任务是可在上下文压缩后留存的工作记忆。可借助任务在会话的全生命周期中维持工作意图、执行顺序和协调关系。
Tasks vs Issue Trackers
任务 vs 问题追踪工具
| Tool | Purpose | Scope |
|---|---|---|
| Tasks | Session/project working memory | Current effort, active coordination |
| Linear/GitHub | Team-visible project management | Cross-session, multi-person tracking |
Tasks are NOT a replacement for filing issues. They are your local execution state — what you're doing now, what comes next, who (which agent) is responsible.
Sync pattern:
- Pull work from Linear/GitHub into Tasks for execution
- Work through Tasks within the session
- Update Linear/GitHub at completion boundaries
| 工具 | 用途 | 范围 |
|---|---|---|
| 任务 | 会话/项目级工作记忆 | 当前工作内容、实时协调 |
| Linear/GitHub | 团队可见的项目管理 | 跨会话、多人追踪 |
任务并非问题追踪工具的替代方案。它们是你的本地执行状态——即你当前正在做什么、下一步要做什么、由哪个(子)Agent负责。
同步模式:
- 从Linear/GitHub拉取工作内容到任务中执行
- 在会话内完成任务
- 在工作完成节点同步更新Linear/GitHub
Why Tasks Survive Compaction
为何任务可在上下文压缩后留存
When context compacts, conversation history gets summarized. But Tasks persist in full:
- Task subjects and descriptions remain intact
- Dependencies (,
blockedBy) preservedblocks - Status (,
pending,in_progress) preservedcompleted - Subagent assignments preserved (critical — see below)
This means after compaction, you can read TaskList and know exactly where you were, what's next, and who's responsible.
当上下文被压缩时,对话历史会被总结,但任务会完整留存:
- 任务主题和描述保持完整
- 依赖关系(、
blockedBy)得以保留blocks - 状态(、
pending、in_progress)得以保留completed - 子Agent分配信息留存(至关重要——详见下文)
这意味着在上下文压缩后,你只需查看任务列表,就能准确了解工作进度、下一步计划以及负责人。
Subagent Assignment (Critical)
子Agent分配(至关重要)
Always assign subagents explicitly in task subjects.
After compaction, nuanced instructions like "have the reviewer check this" can lose fidelity. Explicit assignment survives:
[engineer] Implement auth refresh endpoint
[reviewer] Review auth implementation for security
[tester] Validate auth flow end-to-endThe prefix is not decoration — it's recoverable intent. After compaction, you can scan TaskList and immediately know which agent handles each task.
[agent-name]务必在任务主题中明确分配子Agent。
上下文压缩后,像“让审核人员检查这个”这类模糊的指令会丢失细节,但明确的分配信息会留存下来:
[engineer] Implement auth refresh endpoint
[reviewer] Review auth implementation for security
[tester] Validate auth flow end-to-end[agent-name]Assignment Patterns
分配模式
undefinedundefinedExplicit agent assignment
明确Agent分配
[engineer] Build the feature
[analyst] Research the approach
[reviewer] Check for issues
[tester] Validate behavior
[engineer] Build the feature
[analyst] Research the approach
[reviewer] Check for issues
[tester] Validate behavior
Background agents (include task ID for retrieval)
后台Agent(包含任务ID用于检索)
[reviewer:background] Security audit (task-id: abc123)
[reviewer:background] Security audit (task-id: abc123)
Resumable agents (include agent ID)
可恢复Agent(包含Agent ID)
[analyst] Continue research (resume: a7227ac)
undefined[analyst] Continue research (resume: a7227ac)
undefinedTask Dependencies
任务依赖
Use and to encode sequence:
blockedByblocksTask 1: [analyst] Research auth patterns
Task 2: [engineer] Implement auth flow (blockedBy: 1)
Task 3: [reviewer] Review implementation (blockedBy: 2)
Task 4: [tester] Validate auth (blockedBy: 3)After compaction, dependencies tell you what's actionable (no blockers) vs what's waiting.
使用和定义执行顺序:
blockedByblocksTask 1: [analyst] Research auth patterns
Task 2: [engineer] Implement auth flow (blockedBy: 1)
Task 3: [reviewer] Review implementation (blockedBy: 2)
Task 4: [tester] Validate auth (blockedBy: 3)上下文压缩后,依赖关系能告诉你哪些任务可执行(无阻塞)、哪些任务在等待。
Required Discipline
必备规范
When Starting Work
开始工作时
- Check TaskList first — understand current state
- Create tasks for non-trivial work — 3+ steps means use Tasks
- Set status to before beginning
in_progress - Assign subagent explicitly in the subject
- 先查看任务列表——了解当前状态
- 为非琐碎工作创建任务——如果工作包含3个及以上步骤,就使用任务管理
- 开始前将状态设为
in_progress - 在任务主题中明确分配子Agent
When Completing Work
完成工作时
- Mark completed immediately — don't batch
- Add discovered follow-ups as new tasks
- Check for unblocked tasks — completing one may unblock others
- 立即标记为已完成——不要批量处理
- 将发现的后续工作添加为新任务
- 检查是否有任务解除阻塞——完成一个任务可能会解除其他任务的阻塞
Before Compaction
上下文压缩前
As context fills, ensure Tasks reflect:
- What's done (completed tasks)
- What's active (single task)
in_progress - What's discovered (new tasks from implementation)
- What's blocked and why
当上下文即将满额时,确保任务列表准确反映:
- 已完成的工作(已完成任务)
- 当前进行中的工作(单个任务)
in_progress - 执行过程中发现的新工作(新增任务)
- 被阻塞的任务及原因
Task Structure
任务结构
Subject: [agent] Imperative action description
Description:
- Context needed to execute
- Acceptance criteria
- Any constraints or considerations
ActiveForm: Present continuous for spinner ("Implementing auth flow")Subject format:
[agent-name] Verb the thing[engineer] Implement JWT refresh logic[reviewer] Audit auth module for vulnerabilities[analyst] Research rate limiting approaches
Description includes:
- Enough context for the assigned agent to proceed independently
- Clear done criteria
- Dependencies or blockers if not captured in
blockedBy
Subject: [agent] Imperative action description
Description:
- Context needed to execute
- Acceptance criteria
- Any constraints or considerations
ActiveForm: Present continuous for spinner ("Implementing auth flow")主题格式:
[agent-name] 动词+任务内容[engineer] Implement JWT refresh logic[reviewer] Audit auth module for vulnerabilities[analyst] Research rate limiting approaches
描述包含:
- 足够的上下文,让被分配的Agent能独立执行
- 明确的完成标准
- 若未通过记录,则需说明依赖关系或阻塞因素
blockedBy
Coordination Patterns
协调模式
Sequential Handoff
顺序交接
1. [analyst] Research → creates findings
2. [engineer] Implement → uses findings (blockedBy: 1)
3. [reviewer] Review → checks implementation (blockedBy: 2)
4. [tester] Validate → confirms behavior (blockedBy: 3)1. [analyst] Research → creates findings
2. [engineer] Implement → uses findings (blockedBy: 1)
3. [reviewer] Review → checks implementation (blockedBy: 2)
4. [tester] Validate → confirms behavior (blockedBy: 3)Parallel Execution
并行执行
1. [engineer] Implement feature A
2. [engineer] Implement feature B
3. [tester] Integration tests (blockedBy: 1, 2)Tasks 1 and 2 can run in parallel; Task 3 waits for both.
1. [engineer] Implement feature A
2. [engineer] Implement feature B
3. [tester] Integration tests (blockedBy: 1, 2)任务1和任务2可并行执行;任务3需等待两者完成。
Iterative Refinement
迭代优化
1. [engineer] Initial implementation
2. [reviewer] Review round 1 (blockedBy: 1)
3. [engineer] Address feedback (blockedBy: 2)
4. [reviewer] Review round 2 (blockedBy: 3)1. [engineer] Initial implementation
2. [reviewer] Review round 1 (blockedBy: 1)
3. [engineer] Address feedback (blockedBy: 2)
4. [reviewer] Review round 2 (blockedBy: 3)Anti-Patterns
反模式
| Anti-Pattern | Why It Fails | Better Approach |
|---|---|---|
| No agent assignment | Lost after compaction | Always prefix with |
| Vague subjects | Can't recover intent | Specific, actionable subjects |
| Batching completions | State becomes stale | Mark done immediately |
| Skipping for "quick" tasks | Consistency matters | If 3+ steps, use Tasks |
| No dependencies | Unclear sequence | Encode with |
| 反模式 | 失败原因 | 优化方案 |
|---|---|---|
| 未分配Agent | 上下文压缩后丢失信息 | 始终以 |
| 主题模糊 | 无法恢复工作意图 | 使用具体、可执行的主题 |
| 批量标记完成 | 状态过时 | 立即标记完成 |
| 因“简单”任务跳过使用 | 一致性缺失 | 若包含3个及以上步骤,就使用任务管理 |
| 未设置依赖关系 | 执行顺序不明确 | 使用 |
Rules
规则
ALWAYS:
- Assign subagent explicitly in task subject:
[agent] Task description - Use dependencies to encode sequence
- Mark before starting,
in_progresswhen donecompleted - Check TaskList after compaction to recover state
NEVER:
- Use Tasks as a replacement for Linear/GitHub issues
- Leave multiple tasks simultaneously
in_progress - Skip agent assignment ("the main agent will figure it out")
- Batch task completions at end of work
务必遵守:
- 在任务主题中明确分配子Agent:
[agent] 任务描述 - 使用依赖关系定义执行顺序
- 开始前设为,完成后设为
in_progresscompleted - 上下文压缩后查看任务列表恢复状态
切勿:
- 将任务作为Linear/GitHub问题的替代方案
- 同时将多个任务设为状态
in_progress - 跳过Agent分配(“主Agent会自行处理”)
- 在工作结束时批量标记任务完成