Skip to content

fix: ensure Task ID is passed to agents in all dispatch instructions#120

Open
michael-wojcik wants to merge 11 commits intomainfrom
fix/task-id-handoff-gap
Open

fix: ensure Task ID is passed to agents in all dispatch instructions#120
michael-wojcik wants to merge 11 commits intomainfrom
fix/task-id-handoff-gap

Conversation

@michael-wojcik
Copy link
Collaborator

Summary

  • Fixes a gap where agents were never receiving their Task ID, causing tasks to stay in "pending" status indefinitely
  • The pact-task-tracking skill already tells agents to call TaskUpdate with {task_id}, but the orchestrator instructions never included the task ID in dispatch prompts
  • Adds Task ID to the agent prompting structure template in CLAUDE.md and to every command file that dispatches agents (orchestrate, comPACT, peer-review, plan-mode, rePACT, imPACT)

Test plan

  • Verify each command file includes Task ID in its dispatch/invoke instructions
  • Verify CLAUDE.md prompting template includes TASK ID field
  • End-to-end: run a workflow and confirm agents update their task status

The pact-task-tracking skill tells agents to call TaskUpdate on start
and completion, but agents can only do this if they know their Task ID.
Previously, the Task Hierarchy pseudocode mentioned dispatching "with
task IDs" but the actual invocation templates and per-phase instructions
did not include the Task ID field. This caused tasks to stay in
"pending" status indefinitely.

Changes:
- CLAUDE.md: Add TASK ID as first field in agent prompting structure
- orchestrate.md: Add Task ID reminder to all 4 phase invoke lists
- comPACT.md: Add Task ID line to both prompt templates
- peer-review.md: Add Task ID to reviewer dispatch step
- plan-mode.md: Add Task ID to dispatch step and prompt template
- rePACT.md: Add Task ID to nested cycle execution step
- imPACT.md: Add Task ID to resolution agent delegation step
- Normalize placeholder to {task_id} everywhere (was [agent's task ID
  from TaskCreate] in comPACT.md)
- Add guard clause to pact-task-tracking skill: if no task ID was
  provided, skip TaskUpdate calls gracefully
- Add reviewer prompt template to peer-review.md with Task ID field
- Add specialist prompt template to rePACT.md with Task ID field
Strengthen the Task ID handoff callout to make TaskCreate the mandatory
first step before dispatching any agent, rather than conditional on
whether a Task already exists.
Adds a dispatch checkpoint alongside the existing delegation checkpoints,
reinforcing that TaskCreate must precede every agent dispatch.
Replace "Task ID" with {task_id} in all parenthetical dispatch
reminders across command files, matching the placeholder notation
used in prompt templates and the pact-task-tracking skill.
Standardize all prose instances of "task ID" to "Task ID" across
command files, protocols, skill, and CLAUDE.md for consistency.
Normalize "task" → "Task" (capital T) throughout the plugin when
referring to a Claude Code Task system object (created by TaskCreate,
tracked by TaskUpdate). Generic uses of "task" meaning "work item"
remain lowercase.

Affected: command files, protocols, and pact-task-tracking skill.
Capitalize "parent task" → "Parent Task" in the S1 Autonomy source
file to match the extract in pact-protocols.md.
The pact-task-tracking skill used {task_id} as a template placeholder,
but skill files are loaded as static markdown with no substitution.
The guard clause would see the literal {task_id} and tell agents to
skip all TaskUpdate calls, defeating Task tracking entirely.

Replace the static placeholder with explicit instructions for agents
to extract the Task ID from the orchestrator's prompt line
"Your assigned Task ID is: <number>". Use YOUR_TASK_ID as a clear
variable name in all TaskUpdate examples to avoid template confusion.
…ming

Agents were loading the pact-task-tracking skill and seeing the
instructions but skipping the "On Start" TaskUpdate call entirely,
jumping straight to their primary task. The instruction was present
but not compelling enough to override the agent's focus on its mission.

Changes:
- SKILL.md: Reframe "On Start" as a prerequisite gate with explicit
  "Do not read files, do not invoke skills, do not begin any work"
  language; strengthen "On Completion" with (REQUIRED) heading
- CLAUDE.md: Add FIRST ACTION (MANDATORY) block to the prompt
  template so the TaskUpdate instruction appears in the agent's
  immediate prompt context, not just in a skill loaded later

Dual reinforcement: both the prompt and the skill now explicitly
state that TaskUpdate must be the agent's very first tool call.
Update test_task_id_placeholder_present → test_text_based_reporting_keywords
to check for Blocker/Completion keywords instead of removed {task_id}.
Fix validate_handoff.py docstring to reflect orchestrator-owned TaskUpdate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant