maintain-tasks

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Task 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 问题追踪工具

ToolPurposeScope
TasksSession/project working memoryCurrent effort, active coordination
Linear/GitHubTeam-visible project managementCross-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:
  1. Pull work from Linear/GitHub into Tasks for execution
  2. Work through Tasks within the session
  3. Update Linear/GitHub at completion boundaries
工具用途范围
任务会话/项目级工作记忆当前工作内容、实时协调
Linear/GitHub团队可见的项目管理跨会话、多人追踪
任务并非问题追踪工具的替代方案。它们是你的本地执行状态——即你当前正在做什么、下一步要做什么、由哪个(子)Agent负责。
同步模式:
  1. 从Linear/GitHub拉取工作内容到任务中执行
  2. 在会话内完成任务
  3. 在工作完成节点同步更新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
    ,
    blocks
    ) preserved
  • Status (
    pending
    ,
    in_progress
    ,
    completed
    ) preserved
  • 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-end
The
[agent-name]
prefix is not decoration — it's recoverable intent. After compaction, you can scan TaskList and immediately know which agent handles each task.
务必在任务主题中明确分配子Agent。
上下文压缩后,像“让审核人员检查这个”这类模糊的指令会丢失细节,但明确的分配信息会留存下来:
[engineer] Implement auth refresh endpoint
[reviewer] Review auth implementation for security
[tester] Validate auth flow end-to-end
[agent-name]
前缀并非装饰——它是可恢复的工作意图。上下文压缩后,你只需扫描任务列表,就能立刻知道每个任务由哪个Agent负责。

Assignment Patterns

分配模式

undefined
undefined

Explicit 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)
undefined

Task Dependencies

任务依赖

Use
blockedBy
and
blocks
to encode sequence:
Task 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.
使用
blockedBy
blocks
定义执行顺序:
Task 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

开始工作时

  1. Check TaskList first — understand current state
  2. Create tasks for non-trivial work — 3+ steps means use Tasks
  3. Set status to
    in_progress
    before beginning
  4. Assign subagent explicitly in the subject
  1. 先查看任务列表——了解当前状态
  2. 为非琐碎工作创建任务——如果工作包含3个及以上步骤,就使用任务管理
  3. 开始前将状态设为
    in_progress
  4. 在任务主题中明确分配子Agent

When Completing Work

完成工作时

  1. Mark completed immediately — don't batch
  2. Add discovered follow-ups as new tasks
  3. Check for unblocked tasks — completing one may unblock others
  1. 立即标记为已完成——不要批量处理
  2. 将发现的后续工作添加为新任务
  3. 检查是否有任务解除阻塞——完成一个任务可能会解除其他任务的阻塞

Before Compaction

上下文压缩前

As context fills, ensure Tasks reflect:
  • What's done (completed tasks)
  • What's active (single
    in_progress
    task)
  • 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-PatternWhy It FailsBetter Approach
No agent assignmentLost after compactionAlways prefix with
[agent]
Vague subjectsCan't recover intentSpecific, actionable subjects
Batching completionsState becomes staleMark done immediately
Skipping for "quick" tasksConsistency mattersIf 3+ steps, use Tasks
No dependenciesUnclear sequenceEncode with
blockedBy
反模式失败原因优化方案
未分配Agent上下文压缩后丢失信息始终以
[agent]
作为前缀
主题模糊无法恢复工作意图使用具体、可执行的主题
批量标记完成状态过时立即标记完成
因“简单”任务跳过使用一致性缺失若包含3个及以上步骤,就使用任务管理
未设置依赖关系执行顺序不明确使用
blockedBy
定义顺序

Rules

规则

ALWAYS:
  • Assign subagent explicitly in task subject:
    [agent] Task description
  • Use dependencies to encode sequence
  • Mark
    in_progress
    before starting,
    completed
    when done
  • Check TaskList after compaction to recover state
NEVER:
  • Use Tasks as a replacement for Linear/GitHub issues
  • Leave multiple tasks
    in_progress
    simultaneously
  • Skip agent assignment ("the main agent will figure it out")
  • Batch task completions at end of work
务必遵守:
  • 在任务主题中明确分配子Agent:
    [agent] 任务描述
  • 使用依赖关系定义执行顺序
  • 开始前设为
    in_progress
    ,完成后设为
    completed
  • 上下文压缩后查看任务列表恢复状态
切勿:
  • 将任务作为Linear/GitHub问题的替代方案
  • 同时将多个任务设为
    in_progress
    状态
  • 跳过Agent分配(“主Agent会自行处理”)
  • 在工作结束时批量标记任务完成