Method · Doc

Phase 4 — Execute

Phase 4 — Execute

The AI implements task by task, with the Ralph Loop until gates pass.

Attribute Value
Who drives AI implements
Human's role Monitor (steps in when stuck)
Input Approved DARE/BLUEPRINT.md + DARE/EXECUTION/task-NNN.md
Output Code + green tests
Typical time varies by task — between 2 and 30 min
Inner loop Ralph Loop

🎯 Goal

Implement what was planned. Task by task. With rigorous Validation Gates ensuring that "done" means it actually works.

📋 Prerequisites

Before calling Execute:

🧩 Anatomy of a task

Each task-NNN.md should contain:

# Task NNN — Descriptive title

## Context
Why this task exists (link back to the DESIGN/BLUEPRINT).

## Goal
One sentence: what this task delivers.

## Affected files
- `src/auth/jwt.service.ts` (create)
- `src/auth/auth.module.ts` (modify)
- `tests/auth/jwt.service.spec.ts` (create)

## Specification
Implementation details. Not pseudo-code — a clear description of the
expected behavior, edge cases, and integrations.

## Validation Gates
Commands that must pass for the task to be considered done:

```bash
npm run lint
npm run typecheck
npm test -- src/auth/jwt.service.spec.ts

Expected result: exit 0 on all of them.

Dependencies

Estimate

~15-30 min of AI execution


## 🤖 How the AI executes

### Step-by-step flow

1. **Reads the full task-NNN.md**
2. **Reads the existing affected files** for context
3. **Implements** the changes
4. **Runs the Validation Gates** (the task's commands)
5. **If any gate fails:** it enters the Ralph Loop
   - Reads the error
   - Identifies the problem
   - Fixes it
   - Runs the gates again
   - Repeats (up to 6 attempts)
6. **If all gates pass:** ✓ task done
7. **If the Ralph Loop maxes out:** it aborts and signals the human

### How the human monitors

- Follows the logs in the terminal / IDE sidebar
- If the Ralph Loop keeps spinning on the same error, steps in
- When a task finishes, visually validates the generated code before calling the next one

## 🚀 How to trigger (Cursor)

/execute-task task-001


The AI loads `DARE/EXECUTION/task-001.md`, implements, runs the gates, and lets you know when it's done.

For the next task:

/execute-task task-002


And so on. **Do not run several in parallel** — it breaks the human checkpoint between tasks.

## ✅ Criteria for "task done"

A task is **only** done if:

- [ ] All Validation Gates passed (exit 0)
- [ ] You reviewed the diff of the generated code
- [ ] There are no TODOs or FIXMEs left behind
- [ ] The tests that were created actually cover the case (not empty tests)

## 🚫 Common anti-patterns

### "Accepting a task as done without reviewing the diff"
Validation Gates passing = the code compiles and passes tests. It does not mean it's good. Always review the diff.

### "Giant tasks"
A task that takes >30min of AI execution is a candidate for splitting. Fine granularity = short Ralph Loop + easy human review.

### "Weak Validation Gates"
A task with just an "npm run lint" gate is theater. Also add typecheck + tests specific to what changed.

### "Skipping a dependency"
If task-005 depends on task-003 and task-004, **do not run task-005 first** even if it looks easier.

### "Infinite Ralph Loop"
If the AI is on iteration 5+ on the same error, **stop**. The problem is probably the specification, not the code. Go back to the task or the Blueprint.

## 📊 Optional telemetry

If you want to track cost / consumption:

- The AI logs each call in `DARE/TELEMETRY.md`
- Run `/telemetry-report` at the end to see totals
- Useful to estimate upcoming features and justify AI cost to the team/client

[Details in the GUIA-TELEMETRIA.md of each implementation]

## 🎯 Principle in short

> **Atomic tasks + rigorous Validation Gates + Ralph Loop = code that actually works.**

Without any one of the three, the method degrades.

## 🔗 Related topics

- Ralph Loop in depth
- Glossary (DESIGN, BLUEPRINT, TASKS, gate, attempt)
- FAQ