Verify

From shenxingy/Clade · View interactive version

Verify is an AI agent skill from the GitHub repository shenxingy/Clade. Verify project behavior anchors — compilation, tests, and interaction checks after autonomous runs. NOT the Codex built-in /verify (which runs the app to observe a single change working) — this one walks the AGENTS.md \"Features (Behavior Anchors)\" list.

How to use this skill

Skill file

Clade for Codex

This workflow runs directly in Codex. Do not launch the claude CLI or

delegate the workflow to Clade's MCP bridge.

Codex compatibility rules:

$clade:verify; a bare $name does not select the installed Clade plugin.

has only CLAUDE.md, treat it as legacy project guidance and read it too.

state). Existing legacy Claude state may be read for migration, but do not

create new vendor-specific state.

$clade:skill-name plugin skill, or the same workflow invoked naturally when

explicit skill invocation is not available.

workflow names a vendor-specific tool. If a capability is unavailable, use

the documented fallback instead of spawning another agent CLI.

containing this SKILL.md; resolve that root before invoking a helper.

Canonical Clade workflow

You are the Verify skill. You check that a project's key behaviors still work after code changes.


Step 1: Detect project type

Read AGENTS.md and look for ## Project Type section. Extract:

If ## Project Type is missing, auto-detect by scanning the repo:

Step 2: Read behavior anchors

Read AGENTS.md and look for ## Features (Behavior Anchors) section. Each line is a feature to verify:

- [feature-name]: [what should happen when user does X]

If no anchors found, note this gap and proceed with what's available.

Step 3: Run verification strategy

Execute checks based on project type. Run all applicable strategies:

Strategy: Test suite (all project types)

If a test command is specified in ## Project Type:

timeout 120 {test_command}

Record: pass/fail + count of passing/failing tests.

Context hygiene: if ~/.clade/scripts/quiet-run.sh is installed, wrap the command:

timeout 130 bash ~/.clade/scripts/quiet-run.sh {test_command}

Full output lands in .clade/logs/quiet-*.log, each line timestamped [HH:MM:SS];

only the verdict line + failure tail enters the transcript. The exit code is

mirrored, so pass/fail detection is unchanged. **Remember the printed full log:

path** — if the UI Interaction strategy runs later in this same /verify pass, its

browser console output gets appended to this SAME file (see below), so a test

failure and a JS console error land in one chronologically-ordered artifact.

If no test command but common test patterns exist:

Try the likely command. If it works, report results. If not, skip.

If timeout fires: mark as ⚠ (test suite timed out — may have hanging test), do NOT retry.

Strategy: Compile/type check

Strategy: Verify command (smoke test)

If a verify command is specified in ## Project Type, run it.

Strategy: Behavior anchor check

For each anchor in ## Features:

  1. Determine if the anchor is testable with available tools
  2. If testable: run a quick check (e.g., CLI anchor → run the command with --help or sample input; API anchor → check the route exists; script → check it's executable and runs without error)
  3. If NOT testable (requires browser, external service, credentials): mark as "unverifiable"

Anchor test examples:

Strategy: UI Interaction (frontend only)

Conditions — ALL must be true:

  1. Project type is web-fullstack (from AGENTS.md ## Project Type)
  2. Playwright MCP tools are available — check your tool list for mcp__playwright__browser_navigate (Playwright MCP tools carry the mcp__playwright__ prefix). If absent, the browser MCP is not wired in — skip.

If conditions are not met, set INTERACTION_RESULT: skipped and move on.

Enable browser verification once per project with configs/scripts/setup-browser-verify.sh <project_dir> — it adds the Playwright MCP to .clade/mcp.json (which both worker spawns and /verify already load) and installs the Chromium binary. Below, browser_navigate/browser_snapshot/etc. are shorthand for the mcp__playwright__-prefixed tools.

Flow:

  1. Run configs/scripts/ensure-dev-server.sh (no args needed — it reads AGENTS.md's Frontend: ... port NNNN line itself, defaulting to 3000). It is idempotent and flock-guarded (Thorsten Ball: shared discovery state, .clade/dev-server.json) — safe to call even when a concurrent worktree worker is also verifying, since only one of you will actually start it; the rest reuse the same server. Read its one-line output: PORT=<port> STATUS=reused|started|unreachable [PID=<pid>].
  1. If STATUS=unreachable (exit code 1) → set INTERACTION_RESULT: partial, write "App unreachable at localhost:{port}" to .clade/playwright-issues.md, and move on. Do NOT block the verify. Do NOT retry startup yourself — the script already tried for 30s.
  1. Otherwise (reused or started), connect to http://localhost:{port} via browser_navigate — the server is confirmed reachable at this point.
  1. Take a browser_snapshot of the home page to get the accessibility tree.
  1. Walk up to 5 pages (home + up to 4 linked pages):
  1. Call browser_console_messages once (after the page walk, not per-page — this

is a summary read, not a live stream). If it returns any error/warning

entries AND you remembered a quiet-run log path from the Test-suite strategy

above, append them to that SAME file (Thorsten Ball: merged, time-correlatable

log) — one line per message, timestamped and tagged so it sorts naturally

alongside the test-run output.

Never substitute message text directly into a shell command — a console

message can originate from the page under test (including a malicious PR's own

code), so it may contain $(...), backticks, or other shell metacharacters

that would execute if pasted into a quoted command string. Instead, for each

message: write it verbatim to a scratch file with the file-editing tools (not

shell-interpreted, so no escaping is needed), then append using only paths/

fixed text in the shell command, never the message content itself:

```bash

printf '[%s] [browser] ' "$(date +%H:%M:%S)" >> <remembered log path>

cat <scratch file path> >> <remembered log path>

printf '\n' >> <remembered log path>

```

If no quiet-run log path exists (no test command / quiet-run not used), skip the

append — the console findings still feed into .clade/playwright-issues.md below.

  1. Evaluate:
  1. Write findings to .clade/playwright-issues.md (overwrite, do not append):
  1. Set result:

Bounds: Max 2 minutes of interaction time. Max 5 pages. If time runs out, report what you found so far.

Strategy: Lint/format (optional, lightweight)

Only if project has linting configured (.eslintrc, ruff.toml, etc.):

{lint_command}

Report warnings but don't count as failures.

Step 4: Check VERIFY.md coverage (if present)

If VERIFY.md exists in the project root, read it and report coverage status.

This is a read-only step — do NOT fix anything here. /verify reports; /review fixes.

  1. Count checkpoints by status: ✅ / ❌ / ⚠ / ⬜
  2. Identify any ❌ checkpoints — these are confirmed regressions
  3. Identify ⬜ checkpoints — these are coverage gaps (untested)

Impact on VERIFY_RESULT:

If VERIFY.md does not exist: skip this step silently. Output VERIFY_COVERAGE: none in footer.


Step 5: Produce report

Write a human-readable summary, then the machine-parseable footer.

Summary format:

## Verify Report — {project_name}

### Test Suite
{pass/fail/skip details}

### Compile Check
{pass/fail details}

### Behavior Anchors
- [anchor-name]: PASS / FAIL (reason) / UNVERIFIABLE (reason)
- ...

### UI Interaction (frontend only)
{pass/partial/fail/skipped + details if applicable}

### VERIFY.md Coverage
{N ✅  N ❌  N ⚠  N ⬜ — or "not present"}
{list any ❌ checkpoint IDs and descriptions}

### Notes
{any observations, warnings, suggestions}

Structured issue checklist (`.clade/verify-issues.md`)

After producing the summary above, if ANY issues were found (failed anchors, test failures, compile errors, UI bugs, lint warnings), ALSO write a structured checklist to .clade/verify-issues.md.

Rules:

Format:

## Failed Anchors
- [ ] anchor-name: brief description of failure

## Test Failures
- [ ] test_module::test_name: assertion error / brief reason

## Compile Errors
- [ ] file:line: error description

## UI Issues
- [ ] [BUG] page/element: what's broken
- [ ] [UX] page/element: usability concern

## Lint Warnings
- [ ] file:line: warning code + message

Copying from playwright-issues.md: If .clade/playwright-issues.md exists and has [BUG] or [UX] items, copy them into the UI Issues section above.

Annotation convention (for human reviewers):

Users can annotate each checkbox to control what happens next:

Example: - [ ] [fix] slt: cycles to wrong mode after "off"

Unannotated items remain in the file for next review.

Footer (MUST be the last 5 lines — start.sh greps these):

VERIFY_RESULT: pass|partial|fail
FAILED_ANCHORS: anchor-name-1, anchor-name-2
UNVERIFIABLE: N
INTERACTION_RESULT: pass|partial|fail|skipped
VERIFY_COVERAGE: N_pass/N_total|none

Decision rules for VERIFY_RESULT:

FAILED_ANCHORS: comma-separated list of anchor names that FAIL (not unverifiable — only actual regressions). Use none if no failures. NEVER leave blank — blank line breaks grep in start.sh.

UNVERIFIABLE: count of anchors that could not be tested (integer). 0 if all anchors were testable.

VERIFY_COVERAGE: N_pass/N_total where N_pass = ✅ count, N_total = all checkpoints in VERIFY.md. Use none if VERIFY.md does not exist.

INTERACTION_RESULT: UI interaction test outcome.

Rules


Completion Status

3-strike rule: If the same approach fails 3 times, switch to BLOCKED — do not retry indefinitely.

Additional skill reference

Verify Skill

Post-iteration verification used by start.sh to check that behavior anchors still pass after autonomous work. Not user-invocable — called internally by the autonomous loop.

Delivery completion

If this workflow changes files or external state:

repository task.

$clade:delivery and create a repository-compliant checkpoint or preserve

the work when committing is unavailable.

deployment, or live verification part of the task, do not silently downgrade

the result to local-only work.

or reachable external state, report BLOCKED or NEEDS_CONTEXT rather than

appending a "not committed/pushed/deployed" caveat after DONE.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.