HE Implement
Execute plan tasks with DAG-batch parallelism.
Inputs
- •
docs/plans/active/<slug>.md(plan_mode: lightweight|execution)
Generated Context
Before starting execution, refresh generated context if stale:
- •
docs/generated/db-schema.md(if present) - •
docs/generated/api-schema.md(if present) - •
docs/generated/component-tree.md(if present) - •
docs/generated/dependency-graph.md(if present) - •Other generated reference docs in
docs/generated/(if present)
Each generated file should include a last_updated timestamp.
Execution Model
- •Parse task DAG/checklist from active plan and load concrete execution details from
Task Details.- •For
executionmode: loadfiles_to_change,tests_to_run,verify_commands. - •For
lightweightmode: loadfiles,steps,test_type,verify,done_when.
- •For
- •Build next ready batch (all dependencies satisfied).
- •Launch one subagent per task in the batch. Each subagent receives the task details, target files, and relevant generated context. Run all subagents in the batch concurrently.
- •Collect subagent results and integrate batch outputs.
- •Repeat until no remaining tasks.
Use subagents aggressively — every independent task in a batch should be its own subagent. Keep the main context clean by offloading implementation work to subagents and only handling integration and plan updates in the main thread.
Subagent Return Contract
Each subagent returns:
- •changed files
- •planned target files (
files_to_changeorfiles) and whether each was touched (or explicit no-change reason) - •tests run and results (must match task's
test_type— unit or e2e, no mocks) - •unresolved risks with
priority - •integration notes
Integration Rules
- •Integrate one batch at a time.
- •If conflicts occur, split tasks or sequence conflicting tasks.
- •Re-run targeted tests for integrated batch.
- •If a task is missing concrete file paths or verify commands in
Task Details, send it back to planning before execution.
Branch and PR Convention
- •Work on the initiative's branch (one branch per slug).
- •Use worktree-per-task for parallel execution when blast radius is non-trivial.
- •Create PR at the implement-to-review boundary.
Plan Progress Updates
Update docs/plans/active/<slug>.md after each batch:
- •Update
Task DAGstatuses (todo|in_progress|blocked|done) — this is the single source of truth - •Check/uncheck step checkboxes (
implementation_stepsin execution mode,stepsin lightweight mode) to reflect executed work - •Append
Progress Logentry with evidence - •Append
Decision Logentry when scope/approach changes
Exit Gate
- •All planned tasks completed or explicitly deferred
- •Plan progress is current
- •Docs commit gate passes
Transition Options
Present 2-3 explicit next-step options with a recommended default. Use request_user_input (Codex) or AskUserQuestion (Claude Code) in Plan mode; otherwise ask in chat. Wait for user selection before proceeding.
At least one option must be Next step: he-review.