Build Adw
Implement a plan using the ADW orchestrator with domain expert guidance. Tracks progress via Tasks.
---
name: build_adw
description: Implement a plan using the ADW orchestrator with domain expert guidance. Tracks progress via Tasks.
argument-hint: [plan-path]
---
# Build ADW
Implement a plan using the ADW orchestrator with domain expert guidance. Supports ATDD test-first development with Task-based progress tracking.
## Variables
PLAN_PATH: $ARGUMENTS
SESSION_ID: adw-build-{timestamp}
## Task Integration
Build ADW consumes Tasks created by `/plan_adw` or `/atdd_adw`:
┌─────────────────────────────────────────────────────────────────┐ │ BUILD TASK FLOW │ ├─────────────────────────────────────────────────────────────────┤ │ │ │ TaskList → Find pending tasks → Claim task → Execute → Complete│ │ ↓ ↓ ↓ ↓ ↓ │ │ [View all] [Filter by plan] [Set owner] [Do work] [Update] │ │ │ │ Dependency Resolution: │ │ - Tasks auto-unblock when blockers complete │ │ - Parallel execution for independent tasks │ │ - Sequential for dependent tasks │ │ │ └─────────────────────────────────────────────────────────────────┘
## Instructions
### 1. Load Plan and Tasks
Read the plan from PLAN_PATH (or search in `project/specs/plan/` if just a name):
- Extract implementation steps
- Identify the expert used during planning (from frontmatter `expert:`)
- **Check for `atdd: true` flag** in frontmatter
- **Check for `task_ids:` field** for existing tasks
- Get the original task description
If plan status is not `approved`, warn and ask for confirmation.
**Check for existing Tasks:**
TaskList # View all tasks
Filter for tasks related to this plan
Look for tasks with metadata.plan_path matching PLAN_PATH
**If tasks exist from planning phase:**
- Resume from pending tasks
- Skip completed tasks
- Report current progress
**If no tasks exist (legacy plan):**
- Create tasks from "Step by Step Tasks" section
- See Section 4.5 for task creation
### 2. Initialize ADW Session
Session: adw-build-{YYYYMMDD-HHMMSS} Link to planning session if exists (from plan's adw_session field)
Load the same expert used during planning for consistency.
### 3. Load Expert Context
Read expert YAML from `.claude/commands/experts/{expert}/expertise.yaml`:
- Load `guidelines` for implementation rules
- Load `validation_commands` for verification
- Load `context_files` for reference
Apply expert context to all implementation work.
### 4. Execute Implementation Steps
**Get pending tasks and execute:**
TaskList # Get current task state
Find next executable task (pending, not blocked)
Priority: tasks with no blockedBy, or all blockers completed
**If plan has `atdd: true` flag, use ATDD phases:**
#### ATDD Phase 1: RED (Scaffold & Fail)
**Claim and execute scaffold tasks:**
For each scaffold task
TaskGet: {task_id} # Get full details
TaskUpdate: taskId: {task_id} status: "in_progress" owner: "build_adw"
1. **Create Test Files**
- Write test cases from acceptance criteria
- Use Given/When/Then structure
- For Python: pytest fixtures and test functions
- For TypeScript: Jest describe/test blocks with DSL
2. **Run Tests (Expect RED)**
```bash
# Python
pytest tests/acceptance/ -v
# TypeScript
pnpm test:acceptance
- Tests SHOULD fail at this point
- Log:
RED phase complete - X tests failing as expected
- Complete scaffold tasks:
TaskUpdate: taskId: {task_id} status: "completed" # This auto-unblocks GREEN phase tasks
ATDD Phase 2: GREEN (Implement Until Pass)
Claim GREEN phase tasks (now unblocked):
TaskList # GREEN tasks should now be unblocked
TaskUpdate:
taskId: {green_task_id}
status: "in_progress"
owner: "build_adw"
Goal: Make tests PASS with minimal implementation
Implement Business Logic
- Focus on making tests pass, not perfection
- Follow expert guidelines
Run Tests After Each Change
- Track progress:
X of Y tests passing - Continue until ALL tests pass
- Track progress:
Final GREEN Check
- All tests passing
- No regressions in existing tests
Complete GREEN tasks:
TaskUpdate: taskId: {green_task_id} status: "completed" # This auto-unblocks REFACTOR phase tasks
ATDD Phase 3: REFACTOR (Improve Quality)
Claim REFACTOR tasks:
TaskUpdate:
taskId: {refactor_task_id}
status: "in_progress"
owner: "build_adw"
Goal: Clean up without breaking tests
Code Quality Improvements
- Extract common patterns
- Improve naming and documentation
- Apply expert guidelines
Final Validation
- Run full test suite
- Run linting/type checks
Complete REFACTOR tasks:
TaskUpdate: taskId: {refactor_task_id} status: "completed" # This unblocks Review task
For standard (non-ATDD) plans:
For each step in the plan's "Step by Step Tasks":
Claim Task
TaskUpdate: taskId: {step_task_id} status: "in_progress" owner: "build_adw"Execute
- Follow expert guidelines
- Create/modify files as specified
Complete Task
TaskUpdate: taskId: {step_task_id} status: "completed"
4.5. Create Tasks (Legacy Plans)
If plan has no task_ids, create tasks from steps:
# For each step in "Step by Step Tasks"
TaskCreate:
subject: "Step {n}: {step_description}"
description: "{full step details}"
activeForm: "{action in progress tense}"
metadata:
plan_path: "{PLAN_PATH}"
step_number: {n}
# Set up dependencies
TaskUpdate:
taskId: {
Maintain Build Adw?
Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.
[Build Adw on getagentictools](https://getagentictools.com/loops/amkeener-build-adw?ref=badge)