skills/close-the-loop/SKILL.md
Automated verification loop that ensures work is done — tests pass, UI works, screenshots match designs. Use when you want to verify stories, check everything works, close the loop, run acceptance checks, or match a UI to a reference design component-by-component.
npx skillsauth add RonanCodes/ronan-skills close-the-loopInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Verification loop that checks your work is actually done — not just "compiles", but tested, functional, and visually correct. Three workflows:
.ralph/prd.json stories, run tests + browser check + visual-diff regression.This skill is the gatekeeper between in-progress and closed in the canonical label system (~/Dev/ronan-skills/canon/labels.md). Before allowing an orchestrator (ralph / planner-worker / matt-pocock) to drop the in-progress label and let the issue auto-close on PR merge, this skill asserts the verification matrix is complete (canon: factory #98 / #104):
If any row of the matrix is incomplete, block the close: comment on the issue with the specific missing rows, do NOT drop the in-progress label. The orchestrator surfaces this as a HITL escalation (label → needs-human) or returns the slice to ready-for-agent for another pass, per its own escalation policy.
/close-the-loop # Verify all incomplete stories
/close-the-loop --story US-003 # Verify a single story
/close-the-loop --url http://localhost:3000/settings # Verify a specific page
/close-the-loop --all # Verify everything, including already-passed stories
# Design-match: iterate until the live app matches a reference
/close-the-loop --design-match .visual-diff/design-match.json
/close-the-loop --design-match ./nyt-reference.png --url http://localhost:3000 # ad-hoc whole-page
.ralph/prd.json if it exists, otherwise ask the user what to verifydev/start/serveFor each story (or the provided --url):
npm run dev, etc.)/playwright-check to navigate to the relevant page.visual-diff/baselines//visual-diff to compare current screenshot against baselinePurpose: take a live app and iterate on it until it matches a reference design — per component, not just per page. This is the "does my NYT theme actually look like NYT Connections?" loop.
A design-match plan lives at .visual-diff/design-match.json (one per project). Example:
{
"name": "NYT Connections theme match",
"url": "http://localhost:3000",
"threshold": 85,
"max_iterations": 3,
"components": [
{
"id": "page",
"selector": null,
"reference": "./references/nyt-full-page.png",
"notes": "Overall page layout and typography"
},
{
"id": "word-card",
"selector": "[data-slot=\"card\"]",
"reference": "./references/nyt-tile.png",
"notes": "Tile bg #efefe6, 8px radius, bold uppercase"
},
{
"id": "primary-button",
"selector": "button[data-variant=\"default\"]",
"reference": "./references/nyt-button.png"
},
{
"id": "dialog",
"selector": "[role=\"dialog\"]",
"reference": { "page": "https://nytimes.com/games/connections", "selector": ".modal" }
}
]
}
Each component can reference:
{ page, selector } for playwright capture on both sidesFor each component in the plan:
/playwright-check navigates to url, screenshots the component (selector crop if defined)./visual-diff runs pixel + Claude vision. Threshold from plan (default 85%).The key property: component iteration is independent. Getting .word-card right doesn't re-run the .primary-button diff. This keeps context focused and avoids thrashing.
/close-the-loop --design-match ./ref.png --url http://localhost:3000 skips the JSON plan, does a single whole-page diff, and iterates up to 3 times.
## Verification Report
| Story | Tests | Browser | Visual | Status |
|-------|-------|---------|--------|--------|
| US-001 | Pass | Pass | Pass | Verified |
| US-002 | Pass | Pass | 92% (below 95%) | FAIL |
| US-003 | Fail (TypeError) | Skipped | Skipped | FAIL |
### Issues Found
- US-002: Button color differs from baseline (#3B82F6 vs #2563EB)
- US-003: TypeError in search handler — fixed on attempt 2, now passing
### Summary
Verified: 2/3 | Failed: 1/3
## Design-Match Report — NYT Connections theme
| Component | Selector | Match | Iterations | Status |
|-----------|----------|-------|------------|--------|
| page | — | 88% | 1 | Matched |
| word-card | [data-slot="card"] | 91% | 2 | Matched (fixed bg #efefe6, radius 8px) |
| primary-button | button[data-variant="default"] | 79% | 3 | Flagged — pill radius present but font-weight 600 vs 700 |
| dialog | [role="dialog"] | 86% | 1 | Matched |
### Fixes Applied
- word-card iter 1 → iter 2: set `--card: #efefe6`, `border-radius: 0.5rem`
- primary-button iter 1 → 2 → 3: added `border-radius: 9999px`, adjusted padding. Still failing on font-weight.
### Flagged for Human
- primary-button — Claude vision says font-weight mismatch, but the relevant CSS var is already set. Might be a font-loading issue (Franklin not loaded). Check network tab.
.ralph/prd.json, updates passes field on verification.visual-diff/tmp/ with descriptive names so the user can inspect the ones that failed.development
--- name: worktree description: Coordinate multiple agents on one repo via a worktree-lock pool, so two agents never clobber each other's working tree. Acquire the first free slot (main, then beta/gamma… worktrees, created on demand), work there on your own branch, release when you've pushed. Use before modifying any repo that might be in use by another agent (factory, dataforce, etc.), or whenever you're told a repo is being worked on. Backed by `ro worktree`. category: development argument-hin
testing
--- name: ship description: Ship a feature branch the local-CI-first way — run the full local gate, push, open a PR, squash-merge, then deploy, without waiting on GitHub Actions. Use when a branch is ready for main and you want it merged and deployed now. Reads CI policy from `ro ci` (default skips remote CI because GitHub Actions billing keeps hitting limits). Sibling to /ro:gh-ship (waits on GitHub checks) and /ro:cf-ship (the deploy half). Triggers on "ship it", "ship this", "merge and deploy
testing
--- name: setup-logging description: Set up (or audit) the observability stack in a TanStack Start + Cloudflare Workers app so it is "diagnosable by default" — structured logging (logtape) with a request context carrying trace_id + userId + tenant/orgId, a trace_id propagated FE→BE→logs→Sentry→PostHog, Cloudflare Workers observability enabled, and Sentry + PostHog wired. Two modes: `setup` (wire it into an app) and `audit` (check an existing app + report gaps). Use when scaffolding a new app, wh
development
Manage credentials INSIDE the active ~/.claude/.env file — read which token/account to use for a given app (Simplicity vs Dataforce vs Ronan-personal), add or update a secret WITHOUT it passing through the chat (an interactive Terminal window prompts for it), and track secrets that were exposed in a transcript so they get rotated. Sibling to /ro:context (which switches WHICH env file is active). Use when the user wants to add an API key/token/secret, asks "which credential do I use for X", needs the env organized/labelled, or a secret was pasted into the chat and should be rotated.