Overview
Implement integration between PACT framework and Claude Code's native Task system (v2.1.16+), aligning PACT's work tracking with Anthropic's development direction.
Supersedes: #110 (initial research and exploration)
Research docs: docs/research/pact-task-integration-brainstorm-session.md
Design Decisions
Alignment Framing
PACT adopts Task primitives as its work tracking layer, while maintaining its own methodology layer (VSM, phases, coordination protocols).
| Layer |
Approach |
| Conceptual |
Mirror Anthropic's orchestrator-worker pattern (PACT already aligned) |
| Architectural |
Complement, don't replace — PACT = methodology; Tasks = primitives |
| Implementation |
Adopt Task vocabulary where PACT concepts map naturally |
Hybrid Task Model
Phase tasks (owned by orchestrator) + Specialist subtasks (owned by specialists)
Phase Tasks (upfront, sequential):
PREPARE → ARCHITECT → CODE → TEST
When orchestrator starts CODE phase:
- Creates specialist subtasks: "Backend: Implement X", "Frontend: Add Y"
- Phase task blocked by its subtasks
- When subtasks complete → phase auto-unblocks → orchestrator completes phase
Naming Conventions
| Task Type |
Naming |
Example |
| Phase task |
Just phase name |
PREPARE, ARCHITECT, CODE, TEST |
| Specialist subtask |
Domain: Descriptive work |
Backend: Implement user auth |
| Workflow task |
Title case |
comPACT, Peer Review, Plan Mode |
Metadata Schemas
Phase Task:
{
taskType: "phase",
pactWorkflow: "orchestrate" | "plan-mode",
phase: "prepare" | "architect" | "code" | "test",
variety: { novelty, scope, uncertainty, risk, total },
featureBranch: "feature/...",
planRef: "docs/plans/...",
subtaskIds: ["4", "5"],
handoff: { summary, produced, keyDecisions, unresolvedItems, nextPhaseContext }
}
Specialist Subtask:
{
taskType: "specialist",
phaseTaskId: "3",
domain: "backend" | "frontend" | "database",
specialist: "pact-backend-coder" | ...,
agentId: "agent-abc123",
handoff: { produced, decisions, uncertainties, openQuestions }
}
Workflow Task (comPACT, Peer Review):
{
taskType: "workflow",
pactWorkflow: "comPACT" | "peer-review",
domain: "backend",
subtaskIds: [...]
}
Command Integration
| Command |
Task Structure |
orchestrate |
4 phase tasks + specialist subtasks |
comPACT |
1 workflow task + specialist subtasks |
peer-review |
1 workflow task + reviewer subtasks |
plan-mode |
4 phase tasks (analyze→consult→synthesize→present) + planner subtasks |
rePACT |
Nested phase tasks with rePACT: prefix |
imPACT |
Modifies existing tasks (no new workflow task) |
pin-memory |
No tasks (utility command) |
wrap-up |
No tasks (utility command) |
Status Transitions
- Orchestrator owns both transitions (in_progress and completed)
- Specialist subtasks block their parent phase task
- Phase auto-unblocks when all subtasks complete
- Orchestrator decides when to mark phase completed
Skipped Phases
Create task, immediately mark completed with skip indicator:
{ status: "completed", metadata: { skipped: true, skipReason: "..." }}
Algedonic Integration
Annotate existing tasks (don't create new ones):
metadata: {
algedonicHalt: { category, issue, awaitingAcknowledgment },
algedonicHistory: [{ type, category, triggeredAt, resolvedAt, resolution }]
}
Implementation Checklist
Files to Modify
Commands:
Protocols:
Agents:
Files to Create
Validation Criteria
| Command |
Success Criteria |
orchestrate |
4 phase tasks created, dependencies work, subtasks block phases |
comPACT |
1 workflow task, parallel subtasks, handoffs captured |
peer-review |
1 workflow task, parallel reviewers, findings synthesized |
plan-mode |
4 phase tasks, planner subtasks during consult phase |
rePACT |
Nested tasks with prefix, parent phase blocked |
imPACT |
Existing tasks modified based on triage outcome |
Key Insights from Research
- Token usage explains 80% of multi-agent performance variance (Anthropic)
- Task
owner is singular → orchestrator owns phase tasks, specialists own subtasks
- Task system designed for: Pipeline, Fan-out, Fan-in, Swarm patterns
- PACT execution is Pipeline + Fan-out + Fan-in combined
Overview
Implement integration between PACT framework and Claude Code's native Task system (v2.1.16+), aligning PACT's work tracking with Anthropic's development direction.
Supersedes: #110 (initial research and exploration)
Research docs:
docs/research/pact-task-integration-brainstorm-session.mdDesign Decisions
Alignment Framing
PACT adopts Task primitives as its work tracking layer, while maintaining its own methodology layer (VSM, phases, coordination protocols).
Hybrid Task Model
Phase tasks (owned by orchestrator) + Specialist subtasks (owned by specialists)
Naming Conventions
PREPARE,ARCHITECT,CODE,TESTDomain: Descriptive workBackend: Implement user authcomPACT,Peer Review,Plan ModeMetadata Schemas
Phase Task:
Specialist Subtask:
Workflow Task (comPACT, Peer Review):
Command Integration
orchestratecomPACTpeer-reviewplan-moderePACTrePACT:prefiximPACTpin-memorywrap-upStatus Transitions
Skipped Phases
Create task, immediately mark completed with skip indicator:
Algedonic Integration
Annotate existing tasks (don't create new ones):
Implementation Checklist
Files to Modify
Commands:
commands/orchestrate.md— 4 phase tasks + specialist subtasks + skip handlingcommands/comPACT.md— Workflow task + specialist subtaskscommands/peer-review.md— Workflow task + reviewer subtaskscommands/plan-mode.md— 4 phase tasks + planner subtaskscommands/rePACT.md— Nested phase tasks with parent linkingcommands/imPACT.md— Task modification logicProtocols:
protocols/pact-protocols.md— Add task integration section (SSOT)protocols/pact-workflows.md— Add task structure for each workflowprotocols/algedonic.md— Add task annotation section./scripts/verify-protocol-extracts.shto verify syncAgents:
agents/pact-backend-coder.md— Standardize handoff formatagents/pact-frontend-coder.md— Standardize handoff formatagents/pact-database-engineer.md— Standardize handoff formatagents/pact-test-engineer.md— Standardize handoff formatagents/pact-architect.md— Standardize handoff formatagents/pact-preparer.md— Standardize handoff formatFiles to Create
reference/task-metadata-schema.md— Document all schemasreference/task-integration-guide.md— How Task system integrates with PACTValidation Criteria
orchestratecomPACTpeer-reviewplan-moderePACTimPACTKey Insights from Research
owneris singular → orchestrator owns phase tasks, specialists own subtasks