Skip to content

Commit ac19db2

Browse files
authored
Merge pull request #17 from ducdmdev/feat/dag-aligned-improvements
feat: DAG-aligned improvements (v2.6.0)
2 parents ce9e7f7 + 28ccdff commit ac19db2

26 files changed

+3283
-29
lines changed

.claude-plugin/marketplace.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
{
22
"name": "agent-team-plugin",
3-
"description": "Claude Code plugin for orchestrating parallel work via Agent Teams",
43
"owner": {
54
"name": "ducdmdev"
65
},
76
"plugins": [
87
{
98
"name": "agent-team",
109
"description": "Orchestrates parallel work via Agent Teams with automated coordination, workspace tracking, and hook enforcement",
11-
"version": "2.5.1",
10+
"version": "2.6.0",
1211
"source": {
1312
"source": "url",
1413
"url": "https://github.com/ducdmdev/agent-team-plugin.git"

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "agent-team",
33
"description": "Orchestrates parallel work via Agent Teams with automated coordination, workspace tracking, and hook enforcement",
4-
"version": "2.5.1",
4+
"version": "2.6.0",
55
"author": {
66
"name": "Duc Do"
77
}

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,28 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.6.0] - 2026-03-20
9+
10+
### Added
11+
- **`task-graph.json` workspace file** — centralized DAG with task dependencies, critical path, and convergence points. Created in Phase 3, maintained by lead, read by 3 new hook scripts
12+
- **`compute-critical-path.sh` hook** (TaskCompleted) — recomputes and displays remaining critical path after each task completion, warns about blocked critical tasks
13+
- **`detect-resume.sh` hook** (SessionStart) — detects resumable workspaces with smart staleness validation via git timestamps (valid/stale/missing output files)
14+
- **`check-integration-point.sh` hook** (TaskCompleted) — detects when convergence points (diamond dependencies) become fully unblocked, nudges lead to verify interface compatibility
15+
- **Critical Path Awareness** in Phase 4 — lead prioritizes critical-path blockers over non-critical work
16+
- **Resume from Existing Workspace** coordination pattern — valid/stale/remaining protocol with archive option
17+
- **Integration Checkpoint Response** coordination pattern — lead response protocol for convergence nudges
18+
- **CP column** in `tasks.md` — ★ marks critical path tasks, convergence notes in the Notes column
19+
20+
### Changed
21+
- Phase 1b gains convergence point marking (step 6 after integration points)
22+
- Phase 2 gains critical path display and integration checkpoint preview
23+
- Phase 3 gains resume detection (step 1a) and `task-graph.json` creation (step 4a)
24+
- Phase 4 gains critical-path-weighted prioritization and integration checkpoint processing
25+
- Deadline Escalation gains critical-path acceleration (skip Nudge, go to Warn)
26+
- Report gains critical path metrics (initial → final length, shift count) and integration checkpoint counts
27+
- All 5 archetype SKILL.md files reference step 4a
28+
- `agent-implement` completion gate check #4 gains convergence-point awareness
29+
830
## [2.5.1] - 2026-03-17
931

1032
### Changed

CLAUDE.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ docs/ Shared phases + reference docs consumed by skills at runt
3232
|------|---------|----------------|
3333
| `.claude-plugin/plugin.json` | Plugin identity | Bump version here on release |
3434
| `.claude-plugin/marketplace.json` | Marketplace registry | Bump version here too, keep in sync with plugin.json |
35-
| `hooks/hooks.json` | Hook registration (6 hooks) | Update timeout values, add new hooks, or update hook command paths |
36-
| `scripts/*.sh` | Hook enforcement logic (7 scripts) | Written in bash (`#!/bin/bash`), degrade gracefully without `jq` |
35+
| `hooks/hooks.json` | Hook registration (9 hook entries) | Update timeout values, add new hooks, or update hook command paths |
36+
| `scripts/*.sh` | Hook enforcement logic (12 scripts) | Written in bash (`#!/bin/bash`), degrade gracefully without `jq` |
3737
| `skills/agent-team/SKILL.md` | Hybrid/catch-all skill | Archetype detection + hybrid-specific overrides |
3838
| `skills/agent-implement/SKILL.md` | Implementation skill | Implementation-specific Phase 3/5 |
3939
| `skills/agent-research/SKILL.md` | Research skill | Research-specific Phase 3/5 |
@@ -45,7 +45,7 @@ docs/ Shared phases + reference docs consumed by skills at runt
4545
| `docs/communication-protocol.md` | Structured message formats | Update when changing protocol prefixes or role-specific formats |
4646
| `docs/coordination-patterns.md` | Core conflict resolution, handoffs | Update when adding new core coordination patterns |
4747
| `docs/coordination-advanced.md` | Advanced coordination patterns | Update when adding new advanced patterns |
48-
| `docs/workspace-templates.md` | Workspace file templates | Update when adding new workspace files |
48+
| `docs/workspace-templates.md` | Workspace file templates + `task-graph.json` schema | Update when adding new workspace files or changing DAG schema |
4949
| `docs/report-format.md` | Final report template | Update when changing report structure |
5050
| `docs/custom-roles.md` | Project-specific role template | Reference for users creating custom roles |
5151
| `docs/team-archetypes.md` | Team type definitions + phase profiles | Update when adding new archetypes or modifying phase overrides |
@@ -96,7 +96,7 @@ chore: maintenance (CI, dependencies)
9696
bash tests/run-tests.sh
9797
```
9898

99-
Runs 9 test files (78 assertions) covering all hooks and plugin structure.
99+
Runs 12 test files (145 assertions) covering all hooks and plugin structure.
100100

101101
### Validate Plugin
102102

@@ -114,14 +114,17 @@ Then trigger with: "use agent team to [task]"
114114

115115
### Verify Hooks
116116

117-
Six hooks registered in `hooks/hooks.json`:
117+
Nine hook entries registered in `hooks/hooks.json`:
118118

119119
1. **TaskCompleted** — try marking a task complete without file changes (should block)
120120
2. **TeammateIdle** — let a teammate go idle with in-progress tasks (should nudge)
121121
3. **SessionStart(compact)** — compact context in a team session (should recover workspace)
122122
4. **PreToolUse(Write|Edit)** — have a teammate edit another's file (should warn, then block)
123123
5. **SubagentStart** — spawn a teammate (should log to events.log)
124124
6. **SubagentStop** — teammate shuts down (should log to events.log)
125+
7. **ComputeCriticalPath** — complete a task and check stderr for critical path update
126+
8. **DetectResume** — start a new session with an incomplete workspace and check stdout for resume context
127+
9. **CheckIntegrationPoint** — complete both upstream tasks of a convergence point and check stderr for integration nudge
125128

126129
## Common Tasks
127130

@@ -130,7 +133,7 @@ Six hooks registered in `hooks/hooks.json`:
130133
1. Add the script to `scripts/`
131134
2. Make it executable
132135
3. Register it in `hooks/hooks.json` using `${CLAUDE_PLUGIN_ROOT}/scripts/your-script.sh`
133-
4. Document in SKILL.md Hooks section and README
136+
4. Document in shared-phases.md Hooks section and README
134137
5. Test: run `claude plugin validate .` then test manually in a team session
135138

136139
### Adding a New Teammate Role

README.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ CHECKPOINT #N: intermediate results, artifacts, ready_for=[task IDs]
227227

228228
## Hooks
229229

230-
Five hooks enforce team discipline automatically:
230+
Nine hooks enforce team discipline and provide DAG-aware coordination:
231231

232232
### TaskCompleted
233233

@@ -261,6 +261,27 @@ Tracks teammate lifecycle in `events.log`:
261261
- Logs spawn and stop events with timestamps and teammate metadata
262262
- Provides post-mortem analysis data
263263

264+
### ComputeCriticalPath (TaskCompleted)
265+
266+
Recomputes and displays the critical path after each task completion:
267+
- Reads `task-graph.json` for the dependency graph
268+
- Outputs remaining critical path and identifies blocked critical tasks
269+
- Informational only — always allows task completion
270+
271+
### DetectResume (SessionStart)
272+
273+
Detects resumable workspaces at session start:
274+
- Scans for incomplete `task-graph.json` files in `.agent-team/`
275+
- Validates completed task output files via git timestamps (valid/stale/missing)
276+
- Outputs resume context with options to resume or start fresh
277+
278+
### CheckIntegrationPoint (TaskCompleted)
279+
280+
Detects when convergence points become fully unblocked:
281+
- Checks if all upstream tasks of a convergence point are completed
282+
- Nudges the lead to verify interface compatibility before downstream task starts
283+
- Informational only — silent when no convergence point is ready
284+
264285
All hooks degrade gracefully — exit 0 if `jq` is missing.
265286

266287
## Workspace
@@ -270,9 +291,10 @@ Each team creates a persistent workspace at `.agent-team/{team-name}/` in your p
270291
```
271292
.agent-team/0304-refactor-auth/
272293
├── progress.md # Team status, members, decisions, handoffs
273-
├── tasks.md # Task ledger with status and dependencies
294+
├── tasks.md # Task ledger with status tracking
274295
├── issues.md # Issue tracker with severity and resolution
275296
├── file-locks.json # File ownership map (teammate -> files/directories)
297+
├── task-graph.json # DAG: task dependencies, critical path, convergence points
276298
├── events.log # Structured JSON event log for post-mortem analysis
277299
└── report.md # Final report (generated at completion)
278300
```
@@ -297,7 +319,12 @@ agent-team-plugin/
297319
│ ├── check-file-ownership.sh # PreToolUse(Write|Edit) hook
298320
│ ├── track-teammate-lifecycle.sh # SubagentStart/Stop hook
299321
│ ├── setup-worktree.sh # Worktree creation for isolation mode
300-
│ └── merge-worktrees.sh # Worktree merge in Phase 5
322+
│ ├── merge-worktrees.sh # Worktree merge in Phase 5
323+
│ ├── compute-critical-path.sh # ComputeCriticalPath hook
324+
│ ├── detect-resume.sh # DetectResume hook
325+
│ ├── check-integration-point.sh # CheckIntegrationPoint hook
326+
│ ├── record-demo.sh # Demo recording utility
327+
│ └── generate-demo-cast.sh # Demo asciicast generator
301328
├── skills/
302329
│ ├── agent-team/
303330
│ │ └── SKILL.md # Hybrid/catch-all orchestrator

docs/coordination-advanced.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,11 @@ Proactive time-based escalation to prevent tasks from exceeding the user's time
187187
What's your progress? Use PROGRESS or COMPLETED format.
188188
If blocked, use BLOCKED so I can log and route it.
189189
```
190+
191+
When checking stalled tasks, prioritize **critical-path tasks** (marked with `critical_path: true` in `task-graph.json`). A stalled critical-path task directly delays total completion. A stalled non-critical task has slack before it affects the timeline. Adjust escalation urgency accordingly:
192+
- Critical-path task stalled → skip Nudge, go directly to **Warn**
193+
- Non-critical task stalled → follow normal Nudge → Warn → Escalate ladder
194+
190195
3. **Escalation ladder**:
191196
- **Nudge** (first check): request status update
192197
- **Warn** (second check, ~5 min later): "Task #N is at risk. Need status or BLOCKED report."

docs/coordination-patterns.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ Patterns for the lead to handle common coordination scenarios during Phase 4.
1919
- [Synthesis Pattern](#synthesis-pattern) — collecting final results
2020
- [Error Recovery](#error-recovery) — handling teammate errors
2121
- [Issue Triage After Context Recovery](#issue-triage-after-context-recovery) — post-compaction review
22+
- [Resume from Existing Workspace](#resume-from-existing-workspace) — recovering from a previous team session
2223
- [Direct Handoff](#direct-handoff) — authorized peer-to-peer messaging with audit trail
24+
- [Integration Checkpoint Response](#integration-checkpoint-response) — handling convergence point nudges
2325
- [Advanced Patterns](coordination-advanced.md) — re-plan, adversarial review, checkpoint/rollback, deadline escalation, and more
2426

2527
## Communication Protocol
@@ -35,10 +37,13 @@ When receiving structured messages:
3537
| Prefix | Lead Action |
3638
|--------|--------------|
3739
| STARTING | Update `tasks.md` status to `in_progress`, add note |
38-
| COMPLETED | Update `tasks.md` status to `completed`, add file list and notes. Check: does this unblock other tasks? If yes, message the dependent teammate |
40+
| COMPLETED | Update `tasks.md` status to `completed`, add file list and notes. Update `task-graph.json`: set node status to `completed`, record `completed_at` and `output_files`. **Self-check**: read `task-graph.json` back to verify valid JSON. Check: does this unblock other tasks? If yes, message the dependent teammate. The `compute-critical-path.sh` hook will output the updated critical path. |
3941
| BLOCKED | Add row to `issues.md` immediately. Acknowledge the teammate. Route to resolution |
4042
| HANDOFF | Extract key details, forward to dependent teammate with actionable context. Log in `progress.md` Handoffs |
4143
| QUESTION | Check if answer is in workspace files. If yes, answer with file reference. If no, investigate |
44+
| PROGRESS | Note milestone in `tasks.md` Notes column. If percent indicates near-completion, no action needed. If stalled, trigger Deadline Escalation |
45+
| CHECKPOINT | If `ready_for` lists task IDs, forward checkpoint details to dependent teammate. Log in `progress.md` Handoffs |
46+
| (hook: integration checkpoint) | Read the nudge from `check-integration-point.sh`. Before unblocking the convergence task, verify interface compatibility between upstream outputs. If compatible, message the convergence task owner to proceed. If unclear, log in `issues.md` as medium severity. Log checkpoint in `progress.md` Decision Log. |
4247

4348
### Shared Workspace as Bulletin Board
4449

@@ -161,6 +166,29 @@ Recovery actions for common Phase 3 failures.
161166
| Teammate fails to spawn | Check the error. Common causes: tool not available, permission denied. Retry once. If still failing, log to `issues.md`, continue with remaining teammates, reassign orphaned tasks |
162167
| Context compaction during Phase 3 | On recovery, read workspace files. If they exist but tasks/teammates are incomplete, resume from where you left off. If workspace doesn't exist yet, restart Phase 3 |
163168

169+
## Resume from Existing Workspace
170+
171+
When starting a new team session and the `detect-resume.sh` hook reports a resumable workspace:
172+
173+
### Valid Completed Tasks
174+
Tasks whose output files are unchanged since `completed_at`. Skip these entirely — do not re-create or re-assign. Their results carry forward.
175+
176+
### Stale Completed Tasks
177+
Tasks whose output files were modified after `completed_at` (someone edited the files outside the team). These must be re-run:
178+
- Reset status to `pending` in `task-graph.json`
179+
- Create new TaskCreate entries for them
180+
- Assign to appropriate teammates
181+
- Log in `progress.md` Decision Log: "Resumed — task #N marked stale (output modified after completion)"
182+
183+
### Remaining Tasks
184+
Tasks that were never completed. Create and assign normally.
185+
186+
### Archive Protocol
187+
If the user chooses "start fresh" instead of resuming:
188+
- Rename `.agent-team/{team-name}/` to `.agent-team/{team-name}-archived/`
189+
- Proceed with normal Phase 3
190+
- The archived workspace is preserved for reference
191+
164192
## File Conflict Resolution
165193

166194
When two teammates report working on the same file:
@@ -311,6 +339,16 @@ For pre-approved information transfers between specific teammates, bypassing the
311339

312340
The audit trail MUST be maintained. Direct handoffs save time but must still be logged via the lead's workspace updates.
313341

342+
## Integration Checkpoint Response
343+
344+
When `check-integration-point.sh` fires an integration nudge after two converging streams complete:
345+
346+
1. **Read the nudge** — identify which convergence point was unblocked and which upstream tasks produced the converging outputs
347+
2. **Quick compatibility check** — read the `output_files` from both upstream tasks in `task-graph.json`. Do they define compatible interfaces? (e.g., if task #1 exports `TokenResult` and task #2 imports `TokenResult`, do the types match?)
348+
3. **If compatible** — message the convergence task owner: "Upstream tasks #X and #Y both completed. Interfaces verified compatible. Proceed with task #Z."
349+
4. **If unclear or incompatible** — message both upstream owners and the convergence owner: "Integration issue at #Z: outputs from #X and #Y may conflict at [interface]. Verify before proceeding." Log in `issues.md` as **medium** severity.
350+
5. **Log** — record the checkpoint in `progress.md` Decision Log: "Integration checkpoint: #Z unblocked by #X + #Y, compatibility [verified|flagged]"
351+
314352
## See Also
315353

316354
- [coordination-advanced.md](coordination-advanced.md) — Re-plan on Block, Adversarial Review, Quality Gate, Checkpoint/Rollback, Deadline Escalation, Circular Dependency Detection, Graceful Degradation, Auto-Block, Anti-Patterns

0 commit comments

Comments
 (0)