Skip to content

Implement PACT Task System Integration #112

Description

@michael-wojcik

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:

  • commands/orchestrate.md — 4 phase tasks + specialist subtasks + skip handling
  • commands/comPACT.md — Workflow task + specialist subtasks
  • commands/peer-review.md — Workflow task + reviewer subtasks
  • commands/plan-mode.md — 4 phase tasks + planner subtasks
  • commands/rePACT.md — Nested phase tasks with parent linking
  • commands/imPACT.md — Task modification logic

Protocols:

  • protocols/pact-protocols.md — Add task integration section (SSOT)
  • protocols/pact-workflows.md — Add task structure for each workflow
  • protocols/algedonic.md — Add task annotation section
  • Run ./scripts/verify-protocol-extracts.sh to verify sync

Agents:

  • agents/pact-backend-coder.md — Standardize handoff format
  • agents/pact-frontend-coder.md — Standardize handoff format
  • agents/pact-database-engineer.md — Standardize handoff format
  • agents/pact-test-engineer.md — Standardize handoff format
  • agents/pact-architect.md — Standardize handoff format
  • agents/pact-preparer.md — Standardize handoff format

Files to Create

  • reference/task-metadata-schema.md — Document all schemas
  • reference/task-integration-guide.md — How Task system integrates with PACT

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions