AgentSkillsCN

maintain-tasks

为会话连续性提供任务管理支持。当您需要协调多步骤工作、管理子智能体分配,或在压缩过程中保持意图一致时,可运用此技能。触发条件包括“追踪任务”“管理工作”“协调智能体”,或在复杂任务需要按顺序推进时。

SKILL.md
--- frontmatter
name: maintain-tasks
description: Task management for session continuity. Use when coordinating multi-step work, managing subagent assignments, or preserving intent across compaction. Triggers on "track tasks", "manage work", "coordinate agents", or when complex work requires sequencing.
user-invocable: false

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

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

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.

Subagent Assignment (Critical)

Always assign subagents explicitly in task subjects.

After compaction, nuanced instructions like "have the reviewer check this" can lose fidelity. Explicit assignment survives:

code
[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.

Assignment Patterns

code
# Explicit agent assignment
[engineer] Build the feature
[analyst] Research the approach
[reviewer] Check for issues
[tester] Validate behavior

# Background agents (include task ID for retrieval)
[reviewer:background] Security audit (task-id: abc123)

# Resumable agents (include agent ID)
[analyst] Continue research (resume: a7227ac)

Task Dependencies

Use blockedBy and blocks to encode sequence:

code
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.

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

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

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

Task Structure

code
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

Coordination Patterns

Sequential Handoff

code
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

code
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.

Iterative Refinement

code
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

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