Arness Execute Task
Execute a single task from the task list by spawning a arn-code-task-executor agent. Optionally run a arn-code-task-reviewer to validate the implementation before marking the task complete.
Pipeline position (this is an alternative entry point, not in the main pipeline):
arn-code-taskify -> arn-code-execute-task (single task) -> [optional] arn-code-review-implementation
Use cases:
- Re-running a failed task after manual intervention
- Testing a single phase independently
- Implementing one task without the full pipeline
- Retrying a task that was escalated during arn-code-execute-plan
Prerequisites
If no ## Arness section exists in the project's CLAUDE.md, inform the user: "Arness is not configured for this project yet. Run /arn-implementing to get started — it will set everything up automatically." Do not proceed without it. Task list must exist (run /arn-code-taskify first).
Workflow
Step 1: Load Configuration
-
Read the project's CLAUDE.md and extract the
## Arnesssection to find:- Plans directory -- base path where project plans are saved
- Code patterns -- path to the directory containing stored pattern documentation
- Template path -- path to the report template set (JSON templates)
- Template version -- plugin version the templates were copied from (if present)
- Template updates -- user preference:
ask,auto, ormanual(if present) - Specs directory -- path to the directory containing specification files (if present)
Template version check: If
Template versionandTemplate updatesfields are present, run the template version check procedure documented in arn-code-save-plan Step 1 (Template Version Check) before proceeding. If## Arnessdoes not contain these fields, treat as legacy and skip.
Step 2: Identify the Task
- If user provided a task ID or number: verify it exists in TaskList
- If user provided a description: search TaskList for a matching task
- If no task specified: show all available tasks (pending, unblocked) and ask user to choose
- Show the selected task: ID, description, status, dependencies
- If task is blocked: warn user that dependencies haven't completed, ask if they want to proceed anyway
Step 3: Choose Review Option
Ask (using AskUserQuestion):
"Run with review gate after execution?"
Options:
- Yes, review after execution (Recommended) -- Spawn reviewer to validate
- No, execute only -- Skip review, mark complete after executor finishes
If review chosen, also ask:
Ask (using AskUserQuestion):
"How should Arness handle critical review findings?"
Options:
- Resume executor with feedback (Recommended) -- Resumes the original agent with its full implementation context
- Dispatch fresh executor with review report -- Spawns a new executor with the review report as context
Store the choice for the execution session.
Step 4: Execute the Task
-
Ask the user for
PROJECT_NAMEif not provided in the trigger message -
Verify the project directory exists:
<plans-dir>/<PROJECT_NAME>/ ├── INTRODUCTION.md ├── TASKS.md ├── PROGRESS_TRACKER.json ├── plans/PHASE_*.md └── reports/If
PROGRESS_TRACKER.jsonis missing, warn that progress tracking will not be available. Execution can still proceed. -
Mark task as
in_progressvia TaskUpdate -
Check if the project has
### Visual Testingconfigured in the## Arnesssection of CLAUDE.md. If found, extract: capture script path, compare script path, baseline directory, diff threshold.Note: Extract only the top-level fields (implicit Layer 1). Do NOT parse
#### Layer N:subsections — multi-layer visual validation runs during/arn-code-review-implementation, not per-task. -
Determine the executor model. First check the per-phase upgrade override:
- Read PROGRESS_TRACKER.json. Find the phase entry whose
implementation.taskIdmatches the current task ID. - If
phase.implementation.modelOverrideis non-null (e.g.,"opus"), use that value as themodelparameter for this dispatch. Skip the standard agent-models lookup. Emit a one-line status to the user:Phase <N> (<phaseTitle>) executor model: <override> (upgraded — complex phase per pipeline.complex-phase-upgrade). - If
phase.implementation.modelOverrideis null or the field is missing, fall through to the standard lookup: pass the model from.arness/agent-models/code.mdas themodelparameter (seeplugins/arn-code/skills/arn-code-ensure-config/references/ensure-config.md"Dispatch convention" for fallback).
Then spawn
arn-code-task-executorvia the Task tool with the determined model. Full context:- Task ID and full task description
- Project name:
<PROJECT_NAME> - Project folder path:
<plans-dir>/<PROJECT_NAME>/ - Phase plan file path (extracted from the task description)
- INTRODUCTION.md path:
<project-folder>/INTRODUCTION.md - Code patterns directory path:
<code-patterns-dir>/ - Specs directory path:
<specs-dir>/(if relevant to the task) - Report template path:
<template-path>/ - Visual testing config (if configured): capture script path, compare script path, baseline directory, diff threshold
- Read PROGRESS_TRACKER.json. Find the phase entry whose
-
Record the agent ID returned by the Task tool (needed for resume mode)
-
Wait for executor to complete
Step 5: Review (if requested)
- Read the executor's output to extract:
- Report file path(s)
- List of files created and modified
- Visual capture directory path (if reported)
- Spawn
arn-code-task-reviewervia the Task tool, passing the model from.arness/agent-models/code.mdas themodelparameter (seeplugins/arn-code/skills/arn-code-ensure-config/references/ensure-config.md"Dispatch convention" for fallback). Context:- Task ID and full task description
- Project name and folder path
- INTRODUCTION.md path
- Code patterns directory path
- Report template path (for TASK_REVIEW_REPORT_TEMPLATE.json)
- Implementation/testing report path(s) from executor
- List of files created/modified by executor
- Visual testing config (if configured in Step 4): compare script path, baseline directory, diff threshold
- Note: Only Layer 1 visual config is passed to the reviewer. Multi-layer visual validation runs during
/arn-code-review-implementation. - Visual capture directory (if reported by executor)
- Handle verdict:
- pass -- mark task as completed via TaskUpdate
- pass-with-warnings -- append warnings to implementation report (
reviewFindingssection), mark task as completed via TaskUpdate - needs-fixes -- apply chosen feedback mode:
- Resume mode: resume the original executor agent (using its agent ID from Step 4.6, via the
resumeparameter of the Task tool) with review feedback, then re-run reviewer - Fresh dispatch mode: spawn a new executor with the review report + original context, then re-run reviewer
- Maximum 2 review cycles, then escalate to user with full findings
- Resume mode: resume the original executor agent (using its agent ID from Step 4.6, via the
- After marking the task as completed (pass or pass-with-warnings), update
PROGRESS_TRACKER.json:- Read
<plans-dir>/<PROJECT_NAME>/PROGRESS_TRACKER.json - Find the phase entry whose
implementation.taskIdortesting.taskIdmatches this task - Set the matching status to
"completed"andcompletedAtto current ISO 8601 timestamp - Set
review.verdictto the reviewer's verdict andreview.reviewCyclesto the number of review cycles - If all phases now have
implementation.status = "completed"(andtesting.status = "completed"or"none"), setoverallStatusto"completed"; otherwise setoverallStatusto"in_progress"(if not already) - Update
lastUpdatedand write to disk - If no review was requested: same update but leave
review.verdictandreview.reviewCyclesat their initial values - If `PROGRESS_TRACK
- Read