agentic-tdd
Test-driven development for behaviour a unit test cannot reach, by writing the expectation against the running app before writing…
Prove a UI that updates before the server answers puts things back and says so when the request fails, and keeps the change when it succeeds. Use when a like, toggle, rename, reorder, delete or add-to-cart updates instantly, when an optimistic update was added or changed, or
Claude Code
$ npx -y skills add reticlehq/reticle --skill verify-optimistic-update --agent claude-code
Codex
$ npx skills add reticlehq/reticle --skill verify-optimistic-update -a codex -y
Cursor
$ npx skills add reticlehq/reticle --skill verify-optimistic-update -a cursor -y
Gemini CLI
$ npx skills add reticlehq/reticle --skill verify-optimistic-update -a gemini-cli -y
GitHub Copilot
$ npx skills add reticlehq/reticle --skill verify-optimistic-update -a github-copilot -y
OpenCode
$ npx skills add reticlehq/reticle --skill verify-optimistic-update -a opencode -y
Windsurf
$ npx skills add reticlehq/reticle --skill verify-optimistic-update -a windsurf -y
name: verify-optimistic-update description: 'Prove a UI that updates before the server answers puts things back and says so when the request fails, and keeps the change when it succeeds. Use when a like, toggle, rename, reorder, delete or add-to-cart updates instantly, when an optimistic update was added or changed, or when a user reports a change that "saved" but was gone after a reload.' license: Apache-2.0 metadata: version: 3.10.11 homepage: https://www.reticle.sh repository: https://github.com/reticlehq/reticle
Updating the UI before the server answers makes an app feel fast. It also means the UI claims something the server has not agreed to yet. The failure path, where the request fails and the UI has to take the claim back, is the one nobody clicks through, because on a working backend it never happens.
**Reticle** can make it happen in the running 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.
`reticle_network_mock` works in a leased tab (`reticle_run({ tool: "reticle_lease", args: { action: "acquire", url } })`) or a driven one, and not through the always-on SDK, which answers `{ ok: false, reason: "no-cdp-provider" }`. Without one, do step 4 (the success path) and report the rollback as **unknown**. Driving the happy path and reporting that rollback works is the one thing you may not do.
Confirm the session can observe first: `reticle_session({ action: "list" })`. A hidden or throttled tab can accept a click and render nothing.
reticle_run({ tool: "reticle_network_mock", sessionId, args: {
mocks: [{ urlContains: "/api/todos", method: "PATCH", status: 500, delayMs: 1500 }],
}})The delay is what makes the optimistic state observable. Without it the failure can land before anything is on screen, and you cannot tell "rolled back" from "never updated".
Get the control's ref with `reticle_look({ action: "page", sessionId, mode: "interactive" })`, then name the optimistic state before you click:
reticle_act_and_wait({ sessionId, ref: "<rename or toggle>", action: "click", until:
{ kind: "text", contains: "Buy oat milk" }
})This proves the UI updated before the server answered. It is the claim the next step checks is taken back.
Once the request has failed, the new value must be gone, the old one back, and the user told. Name the app's real failure message, scoped to its alert, because any other alert already on the page would satisfy a bare role check:
reticle_assert({ sessionId, timeout_ms: 5000, predicate: { kind: "allOf", predicates: [
{ kind: "net", urlContains: "/api/todos", method: "PATCH", status: 500 },
{ kind: "text", contains: "Buy oat milk", absent: true },
{ kind: "text", contains: "Buy milk" },
{ kind: "text", contains: "Could not save", scope: "[role=alert]" },
{ kind: "console", level: "error", absent: true },
]}})If the app keeps its state in a registered store, check the store too, because a UI can roll back on screen while the store keeps the optimistic value:
reticle_assert({ sessionId, predicate: { kind: "state", path: "todos.0.title", equals: "Buy milk" } })Clear the mock, then make the **same** change again from the state the rollback left. The ref from step 2 may be stale after a re-render, and a rename needs its new value entered again, so read the page first:
reticle_run({ tool: "reticle_network_mock", sessionId, args: { clear: true } })
reticle_look({ action: "page", sessionId, mode: "interactive" })Redo whatever set up the edit (for a rename, `reticle_act` the field with the new value), then save and name the outcome:
reticle_act_and_wait({ sessionId, ref: "<save or toggle>", action: "click", until: { kind: "allOf", predicates: [
{ kind: "net", urlContains: "/api/todos", method: "PATCH", ok: true },
{ kind: "text", contains: "Buy oat milk" },
]}})Then reload and prove the server kept it, which is what "saved" means. Use a real reload and wait for the new page, not a navigate to the URL you are already on:
reticle_navigate({ sessionId, reload: true })It must answer `confirmed: true` with a `sessionId`. Assert on that session, which is the reloaded page:
reticle_assert({ sessionId: "<sessionId from the reload>", predicate: { kind: "text", contains: "Buy oat milk" } })If the reload is not confirmed, report persistence as **unknown**.
Only `verified: "yes"` is a pass. A verdict taken under a mock is about the mocked condition, so say which endpoint you failed and with what status. Clear every mock before handing back, or the next session sees a backend that fails every save.
---
Capability reference: `curl https://docs.reticle.sh/capabilities.md`. Everything else: `curl https://docs.reticle.sh/llms.txt`.
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.
Test-driven development for behaviour a unit test cannot reach, by writing the expectation against the running app before writing…
Sweep a whole running web app for what is broken, without writing a script or knowing the codebase. Clicks every reachable…
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,…
Check that the UI you actually rendered uses the design system, by reading computed styles in the running app against the…
Drive and verify an Electron or Tauri desktop app from the inside, including the main-process and Rust IPC calls a browser tool…
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…
Produce the "Playwright 1.xx API Review" artifact for a range of commits - the public API additions and the breaking or behavior…
Write, refine, run, and QA promptfoo evaluation suites: promptfooconfig.yaml, prompts, providers, vars, tests, assertions,…
DeepEval evaluation workflow for AI agents and LLM applications. TRIGGER when the user wants to evaluate or improve an AI agent,…