---
description: Implement all tasks for a feature autonomously
argument-hint: <feature-slug>
allowed-tools: Bash, Read, Write, Edit, Glob, Grep, Task
---

Implement all tasks for feature: $ARGUMENTS

## Instructions

### 1. Load Feature Context

```bash
sdlc feature show $ARGUMENTS --json
```

Parse the output to understand current phase, existing artifacts, and task status.

### 2. Verify Prerequisites

Check that these artifacts exist and are approved:
- `.sdlc/features/$ARGUMENTS/spec.md`
- `.sdlc/features/$ARGUMENTS/design.md`
- `.sdlc/features/$ARGUMENTS/tasks.md`

If any are missing or not approved, stop and report what needs to be completed first.

### 3. Transition to Implementation (if needed)

If in `ready` phase:

```bash
sdlc feature transition $ARGUMENTS implementation
```

### 4. Get Task List

```bash
sdlc task list $ARGUMENTS --json
```

Identify all pending tasks and their dependency order. Tasks with no `blocked_by` can be worked first.

### 5. Implement Tasks in Order

For each pending task (respecting dependencies):

1. **Start the task:**
   ```bash
   sdlc task start $ARGUMENTS <task-id>
   ```

2. **Read task scope** from tasks.md -- find the specific task section

3. **Study existing patterns** in files to be modified

4. **Implement changes:**
   - Production code first
   - Tests alongside or immediately after
   - Follow existing conventions

5. **Run tests:**
   ```bash
   go test ./... -v 2>&1 | tee /tmp/task-test-output.txt
   # or the appropriate test command for the project stack
   ```

6. **Complete (only if tests pass):**
   ```bash
   sdlc task complete $ARGUMENTS <task-id>
   ```

7. **Continue** to next pending task

### 6. Final Verification

After all tasks complete:

```bash
go test ./... -v
go vet ./...
```

### 7. Report Summary

- Tasks completed (count)
- Files changed
- Tests added/modified
- Final test status

## Critical Rules

- ALWAYS verify prerequisites before implementing
- ALWAYS implement tasks in dependency order
- NEVER mark a task complete if tests fail
- NEVER continue to next task if current task fails
- ALWAYS run final verification after all tasks
- ALWAYS follow existing codebase patterns
- NEVER implement beyond task stated scope
- ALWAYS read spec and design for context before coding
