-
Notifications
You must be signed in to change notification settings - Fork 10
feat: integrate PACT with Claude Code Task system #118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add self-contained Task tracking section to all 8 PACT agents:
- pact-architect, pact-backend-coder, pact-frontend-coder
- pact-database-engineer, pact-preparer, pact-test-engineer
- pact-memory-agent, pact-n8n
Each agent now has {task_id} placeholder for orchestrator injection,
with on-start, on-blocker, on-algedonic, and on-completion protocols.
Part of Task system integration per docs/plans/2026-01-28-task-system-integration-design.md
Update orchestrate, comPACT, and imPACT commands with Task operations: - orchestrate: Full Task hierarchy (Feature → Phase → Agent tasks) - comPACT: Simpler hierarchy (Feature → Agent tasks) - imPACT: Operates on existing blocker Tasks via TaskGet/TaskUpdate Each adds Signal Monitoring section referencing CLAUDE.md. Part of Task system integration per docs/plans/2026-01-28-task-system-integration-design.md
Update plan-mode, rePACT, peer-review, and wrap-up with Task operations: - plan-mode: Planning + Consultation task hierarchy - rePACT: Nested sub-feature + phase structure - peer-review: Review → Reviewer → Remediation → Step → Approval tasks - wrap-up: TaskList audit logic with cleanup rules Part of Task system integration per docs/plans/2026-01-28-task-system-integration-design.md
Update algedonic.md: - Add Task creation flow for algedonic signals - Agent blocks self with addBlockedBy - Orchestrator amplifies scope (ALERT → phase, HALT → feature) Update pact-s2-coordination.md: - Add Task System Integration section - Reference TaskList for conflict detection and parallel agent visibility Part of Task system integration per docs/plans/2026-01-28-task-system-integration-design.md
Major rewrite of PACT hooks to use Task system: - compaction_refresh.py: Read TaskList directly (Tasks survive compaction) - phase_completion.py: Check Task statuses instead of transcript parsing - validate_handoff.py: Verify Task protocol compliance (status, metadata) - session_init.py: Read TaskList for resumption context - precompact_refresh.py: Add deprecation note (Tasks make this redundant) - stop_audit.py: New Python hook to audit orphaned in_progress Tasks All hooks use "TaskList first, fallback to transcript" for backward compatibility. Part of Task system integration per docs/plans/2026-01-28-task-system-integration-design.md
Extract get_task_list() and helper functions to hooks/shared/task_utils.py: - get_task_list() - find_feature_task() - find_current_phase() - find_active_agents() - find_blockers() Update 4 hooks to import from shared module instead of local definitions: - compaction_refresh.py (~130 lines saved) - phase_completion.py - session_init.py - stop_audit.py Addresses DRY violation identified in PR review.
Add 40 tests covering Task system functions: - get_task_list(): 7 tests (valid files, empty dir, malformed JSON, env vars) - find_feature_task(): 6 tests (top-level detection, phase filtering) - find_current_phase(): 5 tests (in-progress detection, all prefixes) - find_active_agents(): 6 tests (agent detection, case insensitivity) - find_blockers(): 7 tests (blocker/algedonic types, completed filter) - build_refresh_from_tasks(): 7 tests (message formatting) - Integration: 2 tests (Task-first main() path) Addresses test coverage gap identified in PR review.
plan-mode.md: - Add note explaining how orchestrate references Planning tasks - Clarifies the plan-orchestrate Task linkage flow wrap-up.md: - Add note about relationship to stop_audit.py hook - Keep cleanup rules table as intentional redundancy for self-contained commands Addresses documentation gaps identified in PR review.
Remove explicit `tools` field from all 8 agent definitions. Per Claude Code docs, omitting this field grants agents access to ALL tools from the parent conversation, including TaskCreate, TaskUpdate, TaskGet, TaskList. This enables agents to: - Mark themselves in_progress on start - Create blocker/algedonic Tasks directly - Mark themselves completed with metadata Fixes the "S1 agents own their status" design by giving agents actual Task tool access.
- Remove tools: field from all agents (grants all tool access by default) - Standardize permissionMode to acceptEdits for all agents - Standardize PACT operational sections to bold format (HANDOFF, AUTONOMY CHARTER, BEFORE COMPLETING, TASK TRACKING, HOW TO HANDLE BLOCKERS) This enables agents to manage their own Task state via TaskCreate/TaskUpdate tools.
- Create pact-task-tracking skill with task tracking protocol - Add skills: [pact-task-tracking] to all 8 agent frontmatter fields - Remove duplicated TASK TRACKING sections from agent bodies (~30 lines x 8 agents) The skill is auto-loaded when agents are invoked via Task tool, ensuring consistent task tracking behavior without relying on agents to remember to invoke it manually.
- Remove HOW TO HANDLE BLOCKERS from pact-task-tracking skill - Restore generic blocker section to 6 agents (backend, frontend, database, test, preparer, architect) - Domain-specific blocker sections remain in pact-n8n and pact-memory-agent Future DRY opportunity tracked in issue #119.
Address peer review minor items (M1-M7): - M1: Add Claude Code Task System docs link to skill - M2: Add task ID placeholder note explaining orchestrator injection - M3: Update skill description to mention auto-loading - M4: Verify section ordering (already correct) - M5: Add permissionMode documentation comment - M6: Create skills README with naming conventions - M7: Add 9 pytest tests for skill loading validation Address future item F4: - Create pact-task-hierarchy.md documenting Feature→Phase→Agent model - Add Task Hierarchy section to pact-protocols.md - Reference hierarchy from pact-task-tracking skill
Add Task System Integration subsection to S2 Coordination in pact-protocols.md, matching content already in the extract file. Update verify-protocol-extracts.sh line ranges to account for the 21 new lines added to the SSOT. All 10 protocol extracts now pass verification.
Clarify Feature task as parent container (not blocker) in hierarchy docs. Add explicit CODE-blocked-by-ARCHITECT step to match blocking diagram. Move skill_content fixture to module level to eliminate duplication between test classes.
Both agents were missing the standard blocker protocol section that all other 6 agents have. Added it immediately before each file's existing DOMAIN-SPECIFIC BLOCKERS section.
Replace the brief reference stub in pact-protocols.md with the full Task Hierarchy content (74 lines). Convert pact-task-hierarchy.md to a verbatim extract. Add verification entry to the extract script. All 11 extracts now pass verification.
michael-wojcik
added a commit
that referenced
this pull request
Jan 28, 2026
Add PR #118 key feature entry, update protocol extract count to 11, update test count to 757.
michael-wojcik
added a commit
that referenced
this pull request
Jan 28, 2026
This reverts commit 4954412.
18 tasks
michael-wojcik
added a commit
that referenced
this pull request
Jan 29, 2026
…tration (#118)" This reverts commit 21bca1c (PR #118), giving us a clean baseline for reimplementation with the orchestrator-only architecture. The original integration assumed sub-agents could call Task tools (TaskCreate, TaskUpdate, etc.), but empirical testing revealed this is a Claude Code platform limitation — only the parent orchestrator process has access to these tools. Reimplementation follows the revised plan at docs/plans/2026-01-28-task-system-revised-design.md
This was referenced Jan 29, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Integrates the PACT framework with Claude Code's native Task system (TaskCreate, TaskUpdate, TaskGet, TaskList) per the design at
docs/plans/2026-01-28-task-system-integration-design.md.Goals achieved:
/tasksChanges:
{task_id}placeholderKey architectural decisions:
blockedBydependenciesTest plan