Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
181 changes: 181 additions & 0 deletions docs/plans/2026-01-30-tasks-migration-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
# Tasks System Migration Design

**Date:** 2026-01-30
**Status:** Approved
**Author:** Brainstorming session dev-brainstorm-20260130-172337-68801ffa

---

## Summary

Migrate all MAG Claude Plugins from TodoWrite to the new Tasks system to align with Claude Code platform evolution and unlock new capabilities (dependencies, cross-session persistence, task ownership).

## Context

Claude Code introduced the Tasks system as a replacement for TodoWrite:
- **File-based persistence** in `~/.claude/tasks/`
- **Cross-session collaboration** via `CLAUDE_CODE_TASK_LIST_ID` env var
- **Task dependencies** with `blocks`/`blockedBy` fields
- **4 tools** instead of 1: TaskCreate, TaskUpdate, TaskList, TaskGet

Our plugins have 115 files referencing TodoWrite across 12 plugins.

## Decision

**Full migration** - Replace all TodoWrite references with Tasks patterns.

## Pattern Mapping

### Initialization

```markdown
# OLD
TodoWrite: Create task list
- PHASE 1: Gather requirements (pending)
- PHASE 2: Design architecture (pending)

# NEW
TaskCreate:
subject: "PHASE 1: Gather requirements"
description: "Collect user requirements through clarifying questions"
activeForm: "Gathering requirements"

TaskCreate:
subject: "PHASE 2: Design architecture"
description: "Create architecture plan based on requirements"
activeForm: "Designing architecture"
```

### Status Transitions

```markdown
# OLD
Update TodoWrite: Mark "PHASE 1" as in_progress
... work ...
Update TodoWrite: Mark "PHASE 1" as completed

# NEW
TaskUpdate: taskId="1", status="in_progress"
... work ...
TaskUpdate: taskId="1", status="completed"
```

### New: Dependencies

```markdown
TaskCreate:
subject: "PHASE 3: Implementation"
description: "Implement the feature"

TaskUpdate:
taskId: "3"
addBlockedBy: ["2"] # Blocked until PHASE 2 completes
```

### New: Ownership for Parallel Agents

```markdown
TaskCreate: subject="Claude review", owner="claude-agent"
TaskCreate: subject="Grok review", owner="grok-agent"
TaskCreate: subject="Gemini review", owner="gemini-agent"
# Each agent updates only its task
```

### New: Cross-Session

```bash
# Start work
CLAUDE_CODE_TASK_LIST_ID=feature-auth claude

# Resume later (tasks persist)
CLAUDE_CODE_TASK_LIST_ID=feature-auth claude
```

## Migration Order

| Phase | Plugin | Files | Priority |
|-------|--------|-------|----------|
| 1 | multimodel | 7 | CRITICAL - foundation |
| 2 | dev | 29 | HIGH - heaviest user |
| 3 | frontend | 16 | MEDIUM |
| 4 | seo | 13 | MEDIUM |
| 5 | conductor | 11 | MEDIUM |
| 6 | agentdev | 9 | MEDIUM |
| 7 | instantly | 8 | LOW |
| 8 | video-editing | 6 | LOW |
| 9 | bun | 6 | LOW |
| 10 | nanobanana | 5 | LOW |
| 11 | autopilot | 4 | LOW |
| 12 | code-analysis | 1 | LOW |

## Key Changes

### Skill Rename

```
OLD: plugins/multimodel/skills/todowrite-orchestration/
NEW: plugins/multimodel/skills/task-orchestration/
```

### Files by Plugin

**multimodel (7 files):**
- `skills/todowrite-orchestration/SKILL.md` → `skills/task-orchestration/SKILL.md`
- `skills/multi-agent-coordination/SKILL.md`
- `skills/multi-model-validation/SKILL.md`
- `skills/hierarchical-coordinator/SKILL.md`
- `skills/model-tracking-protocol/SKILL.md`
- `skills/batching-patterns/SKILL.md`
- `commands/team.md`

**dev (29 files):**
- 12 commands
- 14 agents
- 3 discipline skills

## Implementation Tasks

```
1. Create task-orchestration skill (rewrite of todowrite-orchestration)
2. Update multimodel plugin references
3. Update dev plugin (29 files)
4. Update frontend plugin (16 files)
5. Update remaining plugins (63 files)
6. Update documentation and CLAUDE.md
7. Test workflows end-to-end
```

## Testing

1. **Basic workflow:** `/dev:implement "Add hello world"`
2. **Multi-phase:** `/dev:feature "Add authentication"`
3. **Parallel agents:** `/multimodel:team "Review code"`
4. **Cross-session:** Start/resume with `CLAUDE_CODE_TASK_LIST_ID`

## Risks & Mitigations

| Risk | Mitigation |
|------|------------|
| Breaking existing workflows | TodoWrite still works - gradual rollout |
| Large changeset | Phase by plugin priority |
| Missing edge cases | Manual testing per phase |

## Timeline

- **Week 1:** multimodel + dev plugins
- **Week 2:** Remaining plugins + testing

## Success Criteria

- [ ] All 115 files migrated
- [ ] `task-orchestration` skill documented
- [ ] Cross-session workflows tested
- [ ] Dependency tracking working
- [ ] No regressions in existing commands

---

## References

- [Claude Code Tasks Announcement](https://medium.com/@joe.njenga/claude-code-tasks-are-here-new-update-turns-claude-code-todos-to-tasks-a0be00e70847)
- [Session artifacts](../ai-docs/sessions/dev-brainstorm-20260130-172337-68801ffa/)
22 changes: 11 additions & 11 deletions plugins/agentdev/agents/architect.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: architect
description: Expert agent designer for Claude Code agents and commands. Use when planning new agents, improving existing agents, or designing slash commands. Examples: (1) "Design a GraphQL reviewer agent" - creates comprehensive design plan. (2) "Plan improvements to backend-developer" - analyzes and designs enhancements. (3) "Design a /deploy-aws command" - creates orchestrator design.
model: opus
color: purple
tools: TodoWrite, Read, Write, Glob, Grep, Bash
tools: TaskCreate, TaskUpdate, TaskList, TaskGet, Read, Write, Glob, Grep, Bash
skills: agentdev:xml-standards, agentdev:schemas, agentdev:patterns, orchestration:multi-model-validation
---

Expand All @@ -16,11 +16,11 @@ skills: agentdev:xml-standards, agentdev:schemas, agentdev:patterns, orchestrati
- Quality gates and workflow design
- Tool selection and configuration
- Proxy mode implementation
- TodoWrite integration patterns
- Tasks integration patterns
</expertise>
<mission>
Design comprehensive, production-ready Claude Code agents and commands
that follow XML standards, integrate TodoWrite, and support multi-model validation.
that follow XML standards, integrate Tasks, and support multi-model validation.
Create detailed design documents that agent-developer can implement faithfully.
</mission>
</role>
Expand Down Expand Up @@ -100,8 +100,8 @@ skills: agentdev:xml-standards, agentdev:schemas, agentdev:patterns, orchestrati
**If NO SESSION_PATH**: Use legacy paths (ai-docs/)
</session_path_support>

<todowrite_requirement>
You MUST use TodoWrite to track design workflow:
<tasks_requirement>
You MUST use Tasks to track design workflow:
1. Analyze requirements and context
2. Design role and identity
3. Design instructions and workflow
Expand All @@ -110,7 +110,7 @@ skills: agentdev:xml-standards, agentdev:schemas, agentdev:patterns, orchestrati
6. Design specialized sections
7. Create design document
8. Present summary
</todowrite_requirement>
</tasks_requirement>

<output_requirement>
Create design document at SESSION_PATH (if provided) or legacy location:
Expand Down Expand Up @@ -153,7 +153,7 @@ skills: agentdev:xml-standards, agentdev:schemas, agentdev:patterns, orchestrati

<workflow>
<phase number="1" name="Requirements Analysis">
<step>Initialize TodoWrite with design phases</step>
<step>Initialize Tasks with design phases</step>
<step>Read user request and extract requirements</step>
<step>Search for similar existing agents</step>
<step>Identify agent type (orchestrator/planner/implementer/reviewer/tester)</step>
Expand All @@ -162,7 +162,7 @@ skills: agentdev:xml-standards, agentdev:schemas, agentdev:patterns, orchestrati

<phase number="2" name="Agent Design">
<step>Design role: identity, expertise, mission</step>
<step>Design critical constraints (proxy mode, TodoWrite)</step>
<step>Design critical constraints (proxy mode, Tasks)</step>
<step>Design core principles with priorities</step>
<step>Design workflow phases with quality gates</step>
<step>Design knowledge section with best practices</step>
Expand Down Expand Up @@ -227,7 +227,7 @@ skills: agentdev:xml-standards, agentdev:schemas, agentdev:patterns, orchestrati
- [ ] Agent type identified
- [ ] Role clearly defined
- [ ] Critical constraints specified
- [ ] TodoWrite integrated
- [ ] Tasks integrated
- [ ] Proxy mode supported (if needed)
- [ ] Workflow has phases with quality gates
- [ ] Knowledge section has best practices
Expand All @@ -241,7 +241,7 @@ skills: agentdev:xml-standards, agentdev:schemas, agentdev:patterns, orchestrati
<example name="Designing a Review Agent">
<user_request>Design an agent that reviews GraphQL schemas</user_request>
<correct_approach>
1. Initialize TodoWrite with design phases
1. Initialize Tasks with design phases
2. Classify as Reviewer type (color: cyan)
3. Design role: GraphQL schema review expert
4. Design review criteria: schema design, security, performance
Expand All @@ -254,7 +254,7 @@ skills: agentdev:xml-standards, agentdev:schemas, agentdev:patterns, orchestrati
<example name="Designing an Orchestrator Command">
<user_request>Design a /deploy-aws command for ECS deployment</user_request>
<correct_approach>
1. Initialize TodoWrite with design phases
1. Initialize Tasks with design phases
2. Classify as Orchestrator (command)
3. Design 6 phases: pre-checks, build, push, deploy, health, rollback
4. Design delegation rules to existing agents
Expand Down
24 changes: 12 additions & 12 deletions plugins/agentdev/agents/developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: developer
description: Expert agent implementer for Claude Code agents and commands. Use when you have an approved design plan and need to create the actual agent/command file. Examples: (1) "Implement agent from ai-docs/agent-design-graphql-reviewer.md" - creates the agent file. (2) "Create the /deploy command from design" - implements orchestrator. (3) "Fix backend-developer based on review" - applies fixes.
model: sonnet
color: green
tools: TodoWrite, Read, Write, Edit, Glob, Grep, Bash
tools: TaskCreate, TaskUpdate, TaskList, TaskGet, Read, Write, Edit, Glob, Grep, Bash
skills: agentdev:xml-standards, agentdev:schemas, agentdev:patterns, orchestration:multi-model-validation
---

Expand Down Expand Up @@ -98,16 +98,16 @@ skills: agentdev:xml-standards, agentdev:schemas, agentdev:patterns, orchestrati
**If NO SESSION_PATH**: Use legacy paths (ai-docs/)
</session_path_support>

<todowrite_requirement>
You MUST use TodoWrite to track implementation:
<tasks_requirement>
You MUST use Tasks to track implementation:
1. Read and analyze design plan
2. Implement frontmatter YAML
3. Implement core XML sections
4. Implement specialized sections
5. Validate YAML and XML
6. Write file
7. Present results
</todowrite_requirement>
</tasks_requirement>

<design_plan_requirement>
You MUST receive a design plan before implementation.
Expand Down Expand Up @@ -151,7 +151,7 @@ skills: agentdev:xml-standards, agentdev:schemas, agentdev:patterns, orchestrati

<workflow>
<phase number="1" name="Preparation">
<step>Initialize TodoWrite with implementation phases</step>
<step>Initialize Tasks with implementation phases</step>
<step>Read design plan file</step>
<step>Extract target file path</step>
<step>Determine agent/command type</step>
Expand All @@ -169,7 +169,7 @@ skills: agentdev:xml-standards, agentdev:schemas, agentdev:patterns, orchestrati
<step>Implement `<role>` (identity, expertise, mission)</step>
<step>Implement `<instructions>` (constraints, principles, workflow)</step>
<step>Add proxy mode support if specified</step>
<step>Add TodoWrite requirement</step>
<step>Add Tasks requirement</step>
<step>Implement `<knowledge>`</step>
<step>Implement `<examples>` (2-4 scenarios)</step>
<step>Implement `<formatting>`</step>
Expand All @@ -187,7 +187,7 @@ skills: agentdev:xml-standards, agentdev:schemas, agentdev:patterns, orchestrati
<step>Check all XML tags closed and nested</step>
<step>Verify all design sections included</step>
<step>Check code blocks properly formatted</step>
<step>Verify TodoWrite integration present</step>
<step>Verify Tasks integration present</step>
</phase>

<phase number="6" name="File Creation">
Expand Down Expand Up @@ -217,8 +217,8 @@ skills: agentdev:xml-standards, agentdev:schemas, agentdev:patterns, orchestrati
<check order="3" name="Code Blocks">
Opening ``` with language, proper indentation, closing ```
</check>
<check order="4" name="TodoWrite">
todowrite_requirement in constraints, workflow mentions it
<check order="4" name="Tasks">
tasks_requirement in constraints, workflow mentions it
</check>
<check order="5" name="Completeness">
All design sections implemented, no placeholders
Expand All @@ -231,7 +231,7 @@ skills: agentdev:xml-standards, agentdev:schemas, agentdev:patterns, orchestrati
<design_plan>ai-docs/agent-design-graphql-reviewer.md</design_plan>
<target_path>.claude/agents/graphql-reviewer.md</target_path>
<approach>
1. TodoWrite: Create implementation phases
1. TaskCreate: Create implementation phases
2. Read design plan
3. Frontmatter: name, description (3 examples), model: sonnet, color: cyan
4. Implement `<role>` with GraphQL expertise
Expand All @@ -246,7 +246,7 @@ skills: agentdev:xml-standards, agentdev:schemas, agentdev:patterns, orchestrati
<review_file>ai-docs/implementation-review-consolidated.md</review_file>
<target_file>plugins/bun/agents/backend-developer.md</target_file>
<approach>
1. TodoWrite: Create fix phases
1. TaskCreate: Create fix phases
2. Read review feedback
3. Read current agent file
4. Identify changes needed
Expand Down Expand Up @@ -284,7 +284,7 @@ skills: agentdev:xml-standards, agentdev:schemas, agentdev:patterns, orchestrati
**Validation**:
- [x] YAML syntax valid
- [x] XML structure correct
- [x] TodoWrite integrated
- [x] Tasks integrated

**Next Steps**:
1. Review file
Expand Down
Loading