Review

From shenxingy/Clade · View interactive version

Review is an AI agent skill from the GitHub repository shenxingy/Clade. Clade coverage-driven project review — walks every VERIFY.md checkpoint, fixes failures in-session, converges when all pass. NOT the Codex built-in /review (single PR diff) — route PR reviews to /review-pr or the CC built-in.

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:review; 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 Review skill. Your job is to systematically test every checkpoint in VERIFY.md and fix failures in the same session. You do not stop until all checkpoints are ✅ or ⚠.

This is NOT a free-form code review. You follow the coverage matrix defined in VERIFY.md checkpoint by checkpoint, testing each one, fixing failures immediately, and updating statuses in-place.


Weigh findings by whether the layer runs

Before ranking anything, read docs/layers.json. It declares which surfaces of

this repository are actually run and how much a finding in each one is worth:

them below any load-bearing finding. Do not propose deleting the layer and

do not present its gaps as debt; new work there is opt-in.

plus its regen script, not in the copy.

This exists because an audit of this repository spent most of its effort on the

orchestrator, a layer the owner had switched off months earlier. Nothing in the

tree said so, so the effort looked well spent right up until it was reported.


Step 1: Load context

Read in order:

  1. AGENTS.md — project type, test command, verify command, behavior anchors
  2. VERIFY.md in the project root — the coverage matrix to drive this review

Detect published URL (used in Step 5.5):

Look for a published URL in this order (stop at first hit):

  1. AGENTS.md — scan for lines matching ## Publish URL, ## Live URL, ## URL, ## Site, ## Production, or a bare https:// under a ## Deploy / ## Links section
  2. package.json — "homepage" field
  3. Deployment config files: vercel.json (check alias), netlify.toml (check [context.production]), .github/workflows/*.yml (grep for url: or CNAME)
  4. gh repo view --json homepageUrl --jq '.homepageUrl' — GitHub repo homepage URL

Store the result as PUBLISH_URL (empty string if nothing found). This determines whether Step 5.5 runs the website SEO phase.

If VERIFY.md does not exist:

  1. Detect project type from AGENTS.md ## Project Type, or auto-detect:
  1. Copy the matching template:
  1. Scan the codebase and customize the template:
  1. Write customized VERIFY.md to project root
  2. Tell the user: "Created VERIFY.md from [type] template with [N] checkpoints. Starting review."

Step 2: Determine what to test this round

From VERIFY.md, collect the work queue:

Priority 1 (must test):

Priority 2 (should re-test if time permits):

Skip:

Count the queue. If queue is empty (all ✅/⚠), the review has converged — go to Step 6.


Step 3: Test each checkpoint

Work through the queue in order (Priority 1 first). For each checkpoint:

Determine test strategy by checkpoint category + project type:

User Journeys / Navigation / UI States / Form Behavior / Design (frontend):

Error Paths / Edge Cases (frontend):

API Endpoints / Authentication / Input Validation / Error Responses (backend):

Database Operations (backend):

Model I/O / Output Validation / Fallback (ai):

Behavior Anchors (all projects):

SEO / Discoverability (SEO checkpoints) — present in web/frontend/backend projects:

Skill Coordination (SC checkpoints) — only present in Clade / skill-system projects:

Record the result:

After testing, the checkpoint is one of:


Step 4: Fix failures immediately

For every ❌ checkpoint found:

  1. Identify root cause: read the relevant source files, trace the failure
  2. Fix the code: make the minimal change that addresses the root cause
  3. Re-test the checkpoint: run the same test again — always wrap test commands with timeout 30 (e.g., timeout 30 curl ..., timeout 60 python -m pytest ...)
  4. Check for regressions: if the fix touched shared code, re-test ✅ checkpoints that might be affected
  5. Update status:

Max-fix-attempts: Each ❌ checkpoint gets at most 3 fix attempts. If after 3 attempts the checkpoint still fails:

Critical rule: never mark a checkpoint ✅ without actually testing it. "The code looks correct" is NOT a passing test.

Anti-hang rules for test commands:


Step 5: Discover and append new checkpoints

While testing, you will encounter scenarios not in VERIFY.md. When you find one:

  1. Add a new row to the appropriate section with ⬜ status
  2. Add it to the work queue for this round
  3. Test it before the round ends

Examples of when to add:

Do NOT add generic or theoretical checkpoints. Only add what you actually encountered.


Step 5.4: E2E Interrupt Testing (user-facing apps)

Run this step when the project has user-facing features (auth, payments, or any long-running operation like upload / processing / generation).

Load the interaction matrix

Read ~/.clade/skills/review/e2e-interactions.md (installed from configs/skills/review/e2e-interactions.md).

It defines: Auth States (S0–S4), Feature States (F0–F3), Atomic Actions (A, N), and scenario tables (I-, P-, T-, SEQ-).

Map the project onto the matrix

  1. Identify long-running operations — what is the core F1 operation? (face-swap, video processing, file upload, AI generation, etc.)
  2. Identify auth flows — does the project have login/logout/delete account?
  3. Identify payment flows — are there credits, subscriptions, or purchases?

Determine test scope

| Project has | Test scope |

|------------|------------|

| Long-running operation + auth | All CRITICAL + HIGH rows from the Interrupt Matrix (I-) and Auth Transitions (T-) |

| Payment flow | All CRITICAL + HIGH rows from Payment Flow Interrupts (P-*) |

| Multi-step journeys | SEQ-01 through SEQ-06 minimum; add SEQ-07 if delete-account exists |

| No auth, no payments | Skip this step — mark ⚠ "no auth/payment flows detected" |

Execute each scenario

For each in-scope scenario:

  1. Use Playwright MCP (browser_navigate, browser_click, browser_snapshot) if available
  2. Execute the exact sequence described in the scenario
  3. Assert the Expected Outcome — especially:
  1. Record ✅ / ❌ / ⚠ per scenario

If Playwright is not available: inspect the source for the relevant handlers (navigation guards, beforeunload, unload, payment webhook idempotency keys, job status polling). Mark ⚠ with "requires browser — checked code path only" if no live test possible.

Add to VERIFY.md

For each scenario tested, add a row to the ## E2E Interrupts section (create it if missing):

| ID | Scenario | Status | Verified | Notes |
|----|----------|--------|----------|-------|
| I-01 | Navigate away during operation | ✅ | 2026-04-15 | polling resumes on return |

Fix failures

Same rules as Step 4: fix immediately, re-test, commit with committer "fix: e2e - <scenario>" <files>.

Common fixes: add beforeunload guard, add idempotency key to payment intent, fix WebSocket reconnect logic, add job dedup check.


Step 5.5: SEO Review (web/publish projects and GitHub repos)

This step runs after all VERIFY.md checkpoints are processed and before the final VERIFY.md update. It is two independent checks.


A. Website SEO Audit (only if `PUBLISH_URL` is non-empty)

Run a full SEO audit on the published site:

/seo-audit <PUBLISH_URL>

This invokes the seo-audit skill inline, which delegates to specialist subagents covering:

technical SEO, content quality, schema, sitemap, performance (CWV), visual/mobile, GEO/AI-readiness, and (conditionally) local SEO, backlinks, Google API data.

After the audit completes:

If PUBLISH_URL is empty: skip this sub-step, note "no published URL detected" in output.


B. GitHub Repo SEO Audit (always, if this is a git repo)

GitHub repos are indexed by Google and appear in GitHub search — their discoverability matters.

Run:

gh repo view --json name,description,repositoryTopics,homepageUrl,openGraphImageUrl,isPrivate,licenseInfo

Check each signal and fix inline:

| Signal | Pass condition | Fix command |

|--------|---------------|-------------|

| Description | Set, ≥ 15 chars, includes keywords | gh repo edit --description "..." |

| Topics/tags | ≥ 3 topics set | gh repo edit --add-topic tag1 --add-topic tag2 |

| Homepage URL | Matches PUBLISH_URL (or set if blank) | gh repo edit --homepage "<url>" |

| Social preview | openGraphImageUrl is not the default GitHub avatar (contains /u/ path) | Manual: Settings → Social Preview → upload image — mark ⚠ |

| LICENSE file | licenseInfo is not null | Create LICENSE file if missing (ask user which license) |

| README quality | README.md has: H1 title, ≥ 1 screenshot or demo GIF, install instructions, badges | Edit README.md directly |

| Claimed counts | Any "N skills/hooks/agents/scripts" claim in README matches the actual on-disk count (±1) | Count dirs under configs/skills/, configs/hooks/, configs/agents/, configs/scripts/ (or equivalent for this project); update README if off by >10% |

| Visibility | isPrivate: false for a published project | Mark ⚠ if private — note that private repos aren't indexed |

For each failing signal:

  1. Apply the fix (use gh repo edit for metadata, edit files for README/LICENSE)
  2. Verify the fix by re-running the relevant command
  3. Log what was fixed in the session output

README quality details: A good repo README for SEO/discoverability has:

If README needs substantive rewrites, make the minimal additions rather than rewriting from scratch.


C. GEO / AI Citation Audit (if blog content detected)

If the project contains blog content (scan for blog/, posts/, articles/, content/ directories with .md or .mdx files):

  1. Pick the 3 most recently modified blog posts
  2. For each, run /blog-geo <file> to get an AI Citation Readiness Score (0-100)
  3. Fix issues scoring below 60:
  1. Commit fixes: committer "fix: geo - improve AI citability for <post>" <files>

If PUBLISH_URL is available, also run /seo-geo <PUBLISH_URL> for site-level GEO scoring.

D. Feed findings to self-improvement system

After all review steps, extract learnings:

  1. If any pattern recurred across 2+ checkpoints (same type of fix needed repeatedly):
  1. If a VERIFY.md checkpoint failed that has a matching rule in rules.md:
  1. Update ~/.clade/corrections/stats.json domain counters based on checkpoint categories

Output for Step 5.5

After all sub-steps, output a brief summary:

SEO_REVIEW:
  website: ✅ audit complete, N critical fixed, M issues → ACTION-PLAN.md
         | ⚠ no published URL
  geo:     ✅ 3 posts audited, avg score 72/100, 1 improved
         | ⚠ no blog content detected
  github:  ✅ description ✅ topics ✅ homepage ⚠ social preview (manual) ✅ license ✅ README
         | fixed: [list of what was changed]

Step 6: Update VERIFY.md

After completing the work queue, update VERIFY.md:

  1. Update each tested checkpoint's Status and Verified columns
  2. Update the header coverage count:

```

Coverage: N ✅, N ❌, N ⚠, N ⬜ untested

```

  1. If all checkpoints are ✅ or ⚠, update:

```

Last full pass: YYYY-MM-DD HH:MM

```

Format for Verified column: YYYY-MM-DD

Format for Notes: brief, factual — what was observed, what was fixed, what limitation exists.


Step 7: Convergence check and output

Converged = zero ❌ and zero ⬜ in VERIFY.md.

If NOT converged (any ❌ or ⬜ remain):

```

REVIEW_RESULT: partial

REMAINING: [comma-separated IDs of ❌/⬜ checkpoints]

COVERAGE: N/total ✅

```

If converged:

```

REVIEW_RESULT: pass

REMAINING: none

COVERAGE: N/N ✅ (M ⚠ known limitations)

```


Rules


Completion Status

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

Additional skill reference

Review Skill

Performs a systematic, coverage-driven review of the project by working through every checkpoint in VERIFY.md. Unlike a free-form code review, this skill tests specific scenarios end-to-end, fixes failures immediately, and only declares convergence when all checkpoints are ✅ or ⚠.

Convergence condition: all checkpoints in VERIFY.md are ✅ (pass) or ⚠ (known limitation). No ⬜ (untested) or ❌ (fail) remaining.

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.