Skip to content

Commit 48d19bd

Browse files
fix(ai-workflow): Mandate Task() sub-agents for all phase implementations
- Add Critical Requirements section to workflow-implement-phases command - Add CRITICAL: Mandatory Sub-Agent Requirement section to implement-phases skill - Update parallel/sequential execution patterns with explicit Task() call examples - Add correct/wrong pattern examples to prevent direct implementation - Bump ai-workflow to v1.0.3 and marketplace to v1.6.3
1 parent 9f0d4c9 commit 48d19bd

6 files changed

Lines changed: 110 additions & 18 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"metadata": {
88
"description": "A curated list of custom Claude Code plugins, agents, and skills for developers.",
9-
"version": "1.6.2",
9+
"version": "1.6.3",
1010
"pluginRoot": "./plugins"
1111
},
1212
"plugins": [
@@ -142,7 +142,7 @@
142142
"name": "ai-workflow",
143143
"source": "./plugins/ai-workflow",
144144
"description": "AI-powered development workflow automation - Phase-based planning, implementation orchestration, and preflight code quality checks for efficient sub-agent execution",
145-
"version": "1.0.2",
145+
"version": "1.0.3",
146146
"keywords": [
147147
"ai",
148148
"workflow",

CHANGELOG.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.6.3] - 2025-12-13
11+
12+
### Fixed
13+
14+
#### AI-Workflow Plugin (v1.0.3)
15+
16+
- **Fixed `/workflow-implement-phases` not using sub-agents for phase implementations**
17+
- Added explicit "Critical Requirements" section mandating Task() sub-agent usage for every phase
18+
- Added "CRITICAL: Mandatory Sub-Agent Requirement" section to implement-phases skill
19+
- Clarified orchestrator role: read plans, analyze dependencies, spawn sub-agents only
20+
- Added correct/wrong pattern examples showing Task() usage vs direct implementation
21+
- Updated parallel and sequential execution patterns with explicit Task() call examples
22+
- Prevents main agent from implementing phases directly, ensuring context isolation
23+
1024
## [1.6.2] - 2025-12-12
1125

1226
### Fixed
@@ -407,7 +421,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
407421

408422
- README.md, CLAUDE.md, individual plugin READMEs, and MIT license
409423

410-
[Unreleased]: https://github.com/charlesjones-dev/claude-code-plugins-dev/compare/v1.6.2...HEAD
424+
[Unreleased]: https://github.com/charlesjones-dev/claude-code-plugins-dev/compare/v1.6.3...HEAD
425+
[1.6.3]: https://github.com/charlesjones-dev/claude-code-plugins-dev/compare/v1.6.2...v1.6.3
411426
[1.6.2]: https://github.com/charlesjones-dev/claude-code-plugins-dev/compare/v1.6.1...v1.6.2
412427
[1.6.1]: https://github.com/charlesjones-dev/claude-code-plugins-dev/compare/v1.6.0...v1.6.1
413428
[1.6.0]: https://github.com/charlesjones-dev/claude-code-plugins-dev/compare/v1.5.4...v1.6.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Claude Code Plugins for Developers
22

3-
[![Version](https://img.shields.io/badge/version-1.6.2-blue.svg)](https://github.com/charlesjones-dev/claude-code-plugins-dev/releases)
3+
[![Version](https://img.shields.io/badge/version-1.6.3-blue.svg)](https://github.com/charlesjones-dev/claude-code-plugins-dev/releases)
44
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
55
[![GitHub Issues](https://img.shields.io/github/issues/charlesjones-dev/claude-code-plugins-dev.svg)](https://github.com/charlesjones-dev/claude-code-plugins-dev/issues)
66
[![GitHub Stars](https://img.shields.io/github/stars/charlesjones-dev/claude-code-plugins-dev.svg)](https://github.com/charlesjones-dev/claude-code-plugins-dev/stargazers)

plugins/ai-workflow/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ai-workflow",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "AI-powered development workflow automation - Phase-based planning, implementation orchestration, and preflight code quality checks for efficient sub-agent execution",
55
"author": {
66
"name": "Charles Jones",

plugins/ai-workflow/commands/workflow-implement-phases.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,21 @@ Read the plan file passed as an argument (e.g., `@docs/plans/my-plan.md`) and pr
3232
2. If plans are found, present them to the user and ask which one to implement
3333
3. If no plans are found, inform the user and suggest using `/workflow-plan-phases` to create one first
3434

35+
## Critical Requirements
36+
37+
**MANDATORY: Every phase MUST be implemented via a Task() sub-agent.**
38+
39+
- NEVER implement any phase directly in the main agent conversation
40+
- Each phase gets its own dedicated sub-agent spawned via the Task tool
41+
- This ensures context isolation and prevents context saturation
42+
- Even single phases must use a sub-agent
43+
3544
## Workflow
3645

3746
1. **Read the plan file** — Use the Read tool to load the plan document
3847
2. Parse plan document and extract phases
3948
3. Analyze dependencies (explicit and implicit)
4049
4. Determine optimal execution strategy (parallel/sequential/mixed)
4150
5. Present execution plan to user for confirmation
42-
6. Execute via Task() sub-agents with coordination directory
51+
6. **Execute via Task() sub-agents** — Spawn one Task() sub-agent per phase (NEVER implement directly)
4352
7. Aggregate results and report

plugins/ai-workflow/skills/implement-phases/SKILL.md

Lines changed: 80 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,49 @@ When implementing phases from a plan document, the orchestrator must:
1919

2020
---
2121

22+
## CRITICAL: Mandatory Sub-Agent Requirement
23+
24+
**YOU MUST USE THE TASK TOOL TO SPAWN A SUB-AGENT FOR EVERY PHASE IMPLEMENTATION.**
25+
26+
This is a non-negotiable requirement. The orchestrator (main agent) is ONLY responsible for:
27+
- Reading and parsing the plan document
28+
- Analyzing dependencies
29+
- Determining execution strategy
30+
- Presenting the plan to the user
31+
- Spawning Task() sub-agents for each phase
32+
- Aggregating results after sub-agents complete
33+
34+
**The orchestrator MUST NOT:**
35+
- Implement any phase directly in the main conversation
36+
- Write code, create files, or make changes for any phase
37+
- Skip sub-agent spawning for "simple" phases
38+
- Combine multiple phases into a single implementation
39+
40+
**Why this matters:**
41+
- Context isolation: Each sub-agent has fresh context, preventing saturation
42+
- Parallelization: Independent phases can run in parallel via multiple Task() calls
43+
- Failure isolation: A failed phase doesn't corrupt the main agent's state
44+
- Results tracking: Sub-agents write structured results to coordination directory
45+
46+
**Correct pattern:**
47+
```
48+
# For each phase (or group of parallel phases), spawn Task() sub-agents
49+
Task(
50+
subagent_type="general-purpose",
51+
prompt="[Phase implementation prompt with full spec and acceptance criteria]",
52+
description="Implement phase-1: [name]"
53+
)
54+
```
55+
56+
**WRONG pattern (never do this):**
57+
```
58+
# Never implement phases directly
59+
Edit(file_path="src/feature.ts", ...) # WRONG - orchestrator should not edit files
60+
Write(file_path="src/new-file.ts", ...) # WRONG - orchestrator should not create files
61+
```
62+
63+
---
64+
2265
## Step 1: Parse the Plan Document
2366

2467
Extract from the plan file:
@@ -243,6 +286,8 @@ Proceed? [Y/n/modify]
243286

244287
## Step 4: Execute Phases
245288

289+
**REMINDER: You MUST use Task() sub-agents for ALL phase implementations. Never implement directly.**
290+
246291
### Coordination Setup
247292

248293
```bash
@@ -251,7 +296,7 @@ mkdir -p .claude/phase-coordination/{artifacts,results}
251296

252297
### Sub-Agent Prompt Template
253298

254-
When spawning Task() for each phase:
299+
When spawning Task() for each phase (REQUIRED for every phase):
255300

256301
```markdown
257302
## Phase Implementation Task
@@ -310,20 +355,38 @@ Write your artifacts to: `.claude/phase-coordination/artifacts/{phase_id}/`
310355

311356
### Parallel Execution Pattern
312357

313-
```
314-
# Spawn all phases in current level simultaneously
315-
tasks = []
316-
for phase in current_level_phases:
317-
task = Task(prompt=build_phase_prompt(phase))
318-
tasks.append(task)
319-
320-
# All tasks run in parallel
358+
**Use multiple Task() calls in a SINGLE message to execute phases in parallel:**
359+
360+
```
361+
# Spawn all phases in current level simultaneously using multiple Task() calls in ONE message
362+
# This is the ONLY way to achieve true parallelization
363+
364+
# In your response, include ALL of these Task() calls together:
365+
Task(
366+
subagent_type="general-purpose",
367+
prompt=build_phase_prompt(phase_1),
368+
description="Implement phase-1: [name]"
369+
)
370+
Task(
371+
subagent_type="general-purpose",
372+
prompt=build_phase_prompt(phase_2),
373+
description="Implement phase-2: [name]"
374+
)
375+
Task(
376+
subagent_type="general-purpose",
377+
prompt=build_phase_prompt(phase_3),
378+
description="Implement phase-3: [name]"
379+
)
380+
381+
# All tasks run in parallel when called in the same message
321382
# Wait for all to complete
322383
# Collect results from .claude/phase-coordination/results/
323384
```
324385

325386
### Sequential Execution Pattern
326387

388+
**Each phase STILL requires its own Task() sub-agent, just called one at a time:**
389+
327390
```
328391
for phase in topologically_sorted_phases:
329392
# Build context from dependencies
@@ -332,10 +395,15 @@ for phase in topologically_sorted_phases:
332395
dep_results = read(f".claude/phase-coordination/results/{dep.id}.md")
333396
dependency_context += f"\n### Context from {dep.id}\n{dep_results}"
334397
335-
# Execute with dependency context
336-
Task(prompt=build_phase_prompt(phase, dependency_context))
398+
# Execute with dependency context - MUST use Task(), never implement directly
399+
Task(
400+
subagent_type="general-purpose",
401+
prompt=build_phase_prompt(phase, dependency_context),
402+
description="Implement {phase.id}: {phase.name}"
403+
)
337404
338-
# Verify before proceeding
405+
# Wait for sub-agent to complete
406+
# Verify results before proceeding to next phase
339407
verify_phase_results(phase)
340408
```
341409

0 commit comments

Comments
 (0)