Skip to content
Testing
Skill

/agentic-tdd

Test-driven development for behaviour a unit test cannot reach, by writing the expectation against the running app before writing the code. Declare the consequence first, watch it fail, implement, watch it pass. Use when building a user-facing feature, when the user asks for TDD

From plugin
reticle
1.3k20 skills

Claude Code

$ npx -y skills add reticlehq/reticle --skill agentic-tdd --agent claude-code

SKILL.md

agentic-tdd.SKILL.md
name: agentic-tdd
description: Test-driven development for behaviour a unit test cannot reach, by writing the expectation against the running app before writing the code. Declare the consequence first, watch it fail, implement, watch it pass. Use when building a user-facing feature, when the user asks for TDD on UI or full-stack work, when a unit test cannot express the outcome that matters, or when you want a red-green loop that runs against the real app instead of mocks.
license: Apache-2.0
metadata:
  version: 3.10.10
  homepage: https://www.reticle.sh
  repository: https://github.com/reticlehq/reticle

Red, green, refactor: against the running app

Unit tests drive the units. They cannot say "clicking Deploy posts to `/api/deploy`, moves the store to `deploying`, and shows the banner": that outcome only exists when the whole app runs. So the loop stalls exactly where the interesting bugs are, and the agent falls back to writing code and hoping.

This runs the same discipline one level up, using **Reticle** to drive the real app. Not set up? Follow the [`reticle`](https://github.com/reticlehq/reticle/blob/main/skills/reticle/SKILL.md) skill: it installs Reticle, asks the user before `init` changes the app's files, and proves one flow.

Why this is TDD and not just testing afterwards

The whole value of test-first is that the oracle is written while you still do not know the answer. An expectation written **after** seeing the result can always be adjusted into agreeing with whatever happened, and an agent is especially good at that adjustment. It will find a reading of the output under which the code it just wrote is correct.

`reticle_act_and_wait({ ref, action, until })` enforces the order structurally: `until` is an argument to the action, so the consequence is named before the action runs. That is the red-green loop, made unfakeable.

1. RED: write the expectation, watch it fail

Before you write the feature, state what the app must do:

reticle_act_and_wait({ sessionId, ref, action: "click", until: { kind: "allOf", predicates: [
  { kind: "net",     method: "POST", urlContains: "/api/deploy", status: 200 },
  { kind: "signal",  name: "deploy:started" },
  { kind: "element", query: { testid: "deploy-banner" } },
  { kind: "console", level: "error", absent: true },
]}})

You want `verified: "no"` here. **A red you did not see is a test you cannot trust.** If this comes back `yes` before you have written anything, the expectation is not specific enough to the change. Tighten it until it fails for the right reason.

`verified: "unknown"` is not a red. It means Reticle could not tell, so the loop has no signal at all. Fix that before writing code, usually by naming a consequence the app can actually produce.

2. GREEN: implement until the same call passes

Write the smallest change that makes it hold, then re-run **the same call, unchanged**. That last word is the discipline: editing the predicate to match what you built converts TDD into narration. If the assertion has to change, say out loud why the original expectation was wrong.

Prefer re-asserting over re-driving when the verdict was `unknown` / `unsettled`: `reticle_assert({ predicate, since, timeout_ms: 8000 })`. Re-driving repeats a side effect that already happened.

3. REFACTOR: the expectation is the safety net

Now change the implementation freely and re-run. Predicates are bound to behaviour (a request, a signal, a state path), not to markup, so a refactor that preserves behaviour stays green while a DOM-shaped test would go red for no reason.

4. Keep the loop for the next change

A journey worth writing test-first is a journey worth re-running forever. Save it once:

reticle_run({ tool: "reticle_record", sessionId, args: { action: "start", name: "deploy" } })
// drive the journey with reticle_act_and_wait, as in step 1
reticle_run({ tool: "reticle_record", sessionId, args: { action: "stop", name: "deploy" } })
reticle_run({ tool: "reticle_flow_save", sessionId, args: { flowName: "deploy" } })
reticle_run({ tool: "reticle_verify", sessionId, args: { action: "flows" } })   // every saved flow, no model per flow

That turns the red-green loop into a regression suite you never hand-wrote.

What to assert on, in order of strength

1. **A signal the app fires itself** (`{ kind: "signal" }`): the app declaring success in its own vocabulary. Strongest available. 2. **State** (`reticle_look { action: "state" }`): what the app believes. Catches a UI that moved while the store did not. 3. **Network**: the request, method and status. Catches a mock standing in for the real thing. 4. **An element appearing**: necessary, never sufficient. Anything can render. 5. **Absence of console errors**: always include it, never rely on it alone. Absence-only predicates pass on a control wired to nothing.

Honesty

**Never weaken a check to turn a verdict green.** In this loop that is not a small sin: it is the loop running backwards, and it produces a green suite over a feature that does not work.

---

Predicate reference: `curl https://docs.reticle.sh/predicates.md`. Everything else: `curl https://docs.reticle.sh/llms.txt`.

Read more
@reticlehq
Ships withreticle

AI agents can generate code, but still struggle to understand what they build. Reticle brings Jev-style machine-native runtime perception to web & desktop applications.

Stars on GitHub

Momentum

stars in total
1.3k
Star history of reticlehq/reticle on GitHub, a chart by star-history.com

Other skills on reticle.

audit-my-app

audit-my-app

Sweep a whole running web app for what is broken, without writing a script or knowing the codebase. Clicks every reachable…

@reticlehq@reticlehqInstall Skill
debug-broken-ui

debug-broken-ui

Find out why something in a running web app does not work, when the console is empty and the code looks correct. Reads the click,…

@reticlehq@reticlehqInstall Skill
drive-desktop-app

drive-desktop-app

Drive and verify an Electron or Tauri desktop app from the inside, including the main-process and Rust IPC calls a browser tool…

@reticlehq@reticlehqInstall Skill
false-green-tests

false-green-tests

Find out why the tests pass but the app is broken. Catches false greens: a green suite over a feature that does not work, a…

@reticlehq@reticlehqInstall Skill
fix-what-i-pointed-at

fix-what-i-pointed-at

Pick up the bugs a human flagged by pointing at them in the running app, each arriving with the element, the note they typed, and…

@reticlehq@reticlehqInstall Skill

More skills from other plugins.

api-review

api-review

Produce the "Playwright 1.xx API Review" artifact for a range of commits - the public API additions and the breaking or behavior…

playwright11d100k
@microsoft@microsoftInstall Skill
add-e2e-selectors

add-e2e-selectors

Add reliable @grafana/e2e-selectors to interactive elements and key containers in the Grafana frontend. Use when adding e2e…

grafana11d78k
@grafana@grafanaInstall Skill
promptfoo-evals

promptfoo-evals

Write, refine, run, and QA promptfoo evaluation suites: promptfooconfig.yaml, prompts, providers, vars, tests, assertions,…

@promptfoo@promptfooInstall Skill
deepeval

deepeval

DeepEval evaluation workflow for AI agents and LLM applications. TRIGGER when the user wants to evaluate or improve an AI agent,…

deepeval13d19k
@confident-ai@confident-aiInstall Skill

Questions about agentic-tdd.

Which coding agents can use agentic-tdd?
agentic-tdd installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.