agentleFS
yusixianyusixian/agent-skills/skills/frontend-acceptance/SKILL.md

frontend-acceptance

Skill2 starsChanged 3 months agoMITView on GitHub

Evidence-first implementation and runtime acceptance for user-visible frontend changes, responsive work, interactions, animations, and user flows. Requires browser evidence and a local report. Do not use it to turn a read-only code review into implementation or harness installation without separate authorization.

The file

Show its rules and text

We split this skill into the rules it gives an agent

44 rules. About 0 are common, 31 are distinctive, and 13 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈31

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 13

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill whenever work changes something a user can see or interact with.

    line 9
  2. Distinctive:

    Never declare a user-visible frontend change complete from code inspection alone.

    line 19
  3. Distinctive:

    run the real application;

    line 23
  4. Distinctive:

    verify deterministic behavior with Playwright assertions.

    line 25
  5. Distinctive:

    Do not replace missing evidence with confident prose.

    line 33
  6. Very specific:

    If the harness is not installed, do not assume the Skill-only installation was enough.

    line 59
  7. Distinctive:

    If the harness is missing, say that the acceptance harness is not installed and either install/copy it when authorized or perform an …

    line 61
  8. Very specific:

    follow assets/acceptance/README.md (install @playwright/test + chromium, add the four package scripts, gitignore .acceptance/).

    line 68
  9. Very specific:

    add app-specific helpers (auth login, seed data) to fixtures.ts or spec files as needed.

    line 70
  10. Very specific:

    When a project already has an acceptance/ harness from an older or divergent generation, do not force-copy over it.

    line 74
  11. Very specific:

    create or update .acceptance/plan.md.

    line 93
  12. Distinctive:

    Do not perform a giant unstructured rewrite.

    line 103
  13. Very specific:

    Create/update cases under acceptance/specs/.

    line 124
  14. Distinctive:

    Use the project fixture:

    line 126
  15. Distinctive:

    Every meaningful case should call:

    line 132
  16. Distinctive:

    Use stable IDs so reports and visual review can refer to the same case.

    line 144
  17. Distinctive:

    Prefer batches that a user can understand:

    line 148
  18. Distinctive:

    Do not split purely by source file if that obscures the user-visible result.

    line 157
  19. Distinctive:

    Do not change an acceptance expectation or screenshot baseline merely because the implementation fails.

    line 161
  20. Distinctive:

    Run the relevant acceptance subset during iteration:

    line 165
  21. Distinctive:

    Use the real browser flow.

    line 171
  22. Very specific:

    Use acceptance.checkpoint() for states a human should be able to inspect later.

    line 181
  23. Distinctive:

    before/after a destructive or stateful action.

    line 185
  24. Distinctive:

    Run the relevant case with pass-video retention:

    line 201
  25. Distinctive:

    Use Trace as additional evidence.

    line 207
  26. Distinctive:

    Treat unexpected runtime errors as implementation failures.

    line 231
  27. Distinctive:

    Do not suppress them with allowlists unless they are genuinely understood, unrelated, and documented.

    line 233
  28. Distinctive:

    If the app intentionally uses horizontal-scrolling subcontainers, that must not create horizontal overflow on the document root.

    line 237
  29. Distinctive:

    When a case fails:

    line 241
  30. Distinctive:

    After targeted repair passes, run the full acceptance suite before final completion.

    line 250
  31. Distinctive:

    Do not "repair" a failure by weakening the test unless the test was objectively wrong.

    line 252
  32. Very specific:

    If progress is blocked by authentication, unavailable backend data, permissions, external services, unsupported environment, or missing …

    line 254
  33. Distinctive:

    After an automation run, find the latest run:

    line 258
  34. Very specific:

    write .acceptance/runs/<run>/visual-review.json conforming to acceptance/visual-review.schema.json.

    line 275
  35. Distinctive:

    Do not write visual review based only on filenames or DOM assertions.

    line 277
  36. Very specific:

    Use uncertain when the evidence exists but visual correctness is subjective or not sufficiently demonstrated.

    line 286
  37. Very specific:

    Use blocked when required evidence could not be produced or a dependency prevents verification.

    line 288
  38. Distinctive:

    If visual review finds a real defect, return to the repair loop and produce a fresh run.

    line 296
  39. Very specific:

    no case at any severity is FAIL.

    line 328
  40. Distinctive:

    all required visual evidence has been inspected.

    line 329
  41. Very specific:

    If there are unresolved UNCERTAIN or BLOCKED items, the implementation may be ready, but verification remains incomplete.

    line 335
  42. Distinctive:

    Keep the chat handoff short.

    line 339
  43. Distinctive:

    only the manual-review blockers that still require human attention.

    line 346
  44. Distinctive:

    Do not restate every browser step in chat when it is already preserved in the report.

    line 348

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Frontend Acceptance

Use this skill whenever work changes something a user can see or interact with.

For a read-only review, preserve that boundary: inspect existing browser evidence and report missing acceptance coverage, but do not install a harness, run a repair loop, or edit product code unless the user separately requests implementation or runtime acceptance.

The objective is not merely to make tests green. The objective is to leave human-readable evidence that the implementation and important UI/UX flows were actually exercised.

A frontend task is not complete until the acceptance gate below is satisfied.

Core rule

Never declare a user-visible frontend change complete from code inspection alone.

For each affected flow, you must:

  1. run the real application;
  2. operate it through a real browser;
  3. verify deterministic behavior with Playwright assertions;
  4. capture screenshots of important states;
  5. inspect runtime/browser diagnostics;
  6. visually inspect the captured evidence;
  7. fix discovered issues and rerun affected flows;
  8. generate a local acceptance report;
  9. mark anything you cannot reliably verify as UNCERTAIN or BLOCKED.

Do not replace missing evidence with confident prose.

Locate the harness

Expected project files:

acceptance/
  playwright.config.ts
  fixtures.ts
  specs/
  visual-review.schema.json
  scripts/

Expected commands:

pnpm acceptance
pnpm acceptance:report
pnpm acceptance:open
pnpm acceptance:clean

The repository may use npm/yarn/bun instead. Read package.json and lockfiles first and use the project's package manager.

If the harness is not installed, do not assume the Skill-only installation was enough. A Skill gives workflow guidance; the project still needs acceptance/ and its Playwright dependency for executable evidence.

If the harness is missing, say that the acceptance harness is not installed and either install/copy it when authorized or perform an equivalent evidence-first Playwright workflow. Do not silently downgrade to code-only verification.

Bundled template

This skill ships a ready-to-copy harness under assets/acceptance/ (next to this SKILL.md). When the project has no harness and you are authorized to install one:

  1. copy assets/acceptance/ into the project root as acceptance/;
  2. follow assets/acceptance/README.md (install @playwright/test + chromium, add the four package scripts, gitignore .acceptance/);
  3. point it at the app with ACCEPTANCE_BASE_URL or ACCEPTANCE_WEB_SERVER_CMD;
  4. add app-specific helpers (auth login, seed data) to fixtures.ts or spec files as needed.

Upgrading an existing harness

When a project already has an acceptance/ harness from an older or divergent generation, do not force-copy over it. Reconcile it to the current template by hand, preserving the project's own parts:

  • Keep: specs/, app-specific config in playwright.config.ts (webServer, projects, baseURL), auth/seed helpers in fixtures.ts, and historical .acceptance/runs/.
  • Replace: the framework plumbing with the template's complete scripts/ directory and visual-review.schema.json.
  • Converge the contract: per-case evidence JSON shape, run-dir layout, and the four package scripts must match the template, because run/report tooling depends on them. Read the project's existing fixtures and merge logic, then adapt rather than blindly overwrite.
  • The report tolerates mixed-generation history: runs whose evidence it cannot read are simply omitted from the run-history sidebar instead of breaking the report.

The generated report.html is a self-contained dark report: collapsible case panels, status filter chips, an image lightbox (keyboard ←/→/Esc), a run-history sidebar (every run under .acceptance/runs/ summarized and cross-linked), and before/after comparison sliders. Checkpoint naming convention: a before:<label> checkpoint and an after:<label> checkpoint with the same label are paired automatically into an <img-compare> slider (a dependency-free Web Component in scripts/report-assets/report.js, reusable on its own). Use it for regression/fix evidence.

Phase 0 — Understand before changing

For a narrow change, inspect the affected component, route, state management, existing tests, and surrounding UI.

For a broad request such as "improve the frontend", "polish the UI", or "fix UX overall":

  1. start the application;
  2. inspect the important routes in desktop and mobile viewports;
  3. identify the primary user journeys;
  4. capture a small baseline set where useful;
  5. create or update .acceptance/plan.md.

The plan should prioritize user-visible problems, not file-by-file refactors.

Suggested buckets:

  • P0: broken flow, inaccessible core action, data loss, severe responsive breakage
  • P1: confusing hierarchy, inconsistent component behavior, broken states, obvious visual defects
  • P2: polish, spacing, typography, motion, minor consistency improvements

Do not perform a giant unstructured rewrite. Work in reviewable batches.

Phase 1 — Define acceptance criteria before implementation

Each user-visible batch must have acceptance criteria that can be observed.

Bad:

  • "looks better"
  • "make responsive"
  • "animation should be smooth"

Better:

  • "At 390×844, the primary action remains visible without horizontal page scrolling."
  • "Closing the lightbox returns focus and visual state to the originating thumbnail."
  • "During close animation, only one flying image layer is visible."
  • "Loading, empty, error, and success states retain the same page shell width and typography hierarchy."

Acceptance criteria should describe user-visible outcomes rather than implementation details.

Create/update cases under acceptance/specs/.

Use the project fixture:

import { test, expect } from '../fixtures';

Every meaningful case should call:

acceptance.meta({
  id: 'stable-case-id',
  feature: 'Feature name',
  severity: 'P1',
  steps: ['...', '...'],
  expected: ['...', '...'],
});

Use stable IDs so reports and visual review can refer to the same case.

Phase 2 — Implement in small batches

Prefer batches that a user can understand:

  • shell/navigation
  • design tokens and shared components
  • one route or one workflow
  • responsive behavior
  • states and validation
  • motion/polish

Do not split purely by source file if that obscures the user-visible result.

Preserve existing behavior unless the task explicitly changes it.

Do not change an acceptance expectation or screenshot baseline merely because the implementation fails. Only change expectations when the requested product behavior truly changed.

Phase 3 — Browser verification

Run the relevant acceptance subset during iteration:

pnpm acceptance -- --grep "case or feature"

Use the real browser flow. Do not simulate completion by calling internal state setters unless the product itself exposes that as normal behavior.

At minimum verify:

  • the intended happy path;
  • the states directly changed by this work;
  • desktop and mobile projects;
  • loading/empty/error states when relevant;
  • keyboard/focus behavior when interaction or modal/dialog behavior changed.

Use acceptance.checkpoint() for states a human should be able to inspect later.

Examples:

  • before/after a destructive or stateful action;
  • modal/lightbox open;
  • animation settled state;
  • mobile navigation expanded;
  • form validation error;
  • empty/error/success states;
  • any layout that was specifically fixed.

Name fix/regression pairs before:<label> and after:<label> — the report renders each pair as a single draggable comparison slider instead of two separate thumbnails.

A final screenshot is captured automatically, but that is not a substitute for meaningful intermediate checkpoints.

Motion and animation

For animations, transitions, drag, gesture, lightbox, carousel, or other temporal behavior, screenshots alone may not prove correctness.

Run the relevant case with pass-video retention:

ACCEPTANCE_VIDEO=on pnpm acceptance -- --grep "case"

Use Trace as additional evidence. If final acceptance requires the complete suite, run the full suite afterward.

Record every video or trace actually inspected in the case's evidenceRefs. Paths must be relative to the run directory and point to existing artifacts, for example:

{
  "evidenceRefs": [
    "playwright-artifacts/lightbox-close/video.webm",
    "playwright-artifacts/lightbox-close/trace.zip"
  ]
}

Phase 4 — Automatic diagnostics

The harness records:

  • console.error
  • page exceptions
  • failed requests
  • HTTP 4xx/5xx
  • horizontal viewport overflow
  • screenshots and Playwright artifacts

Treat unexpected runtime errors as implementation failures.

Do not suppress them with allowlists unless they are genuinely understood, unrelated, and documented.

A network warning is not automatically a product bug, but it must be inspected if it affects the tested flow.

If the app intentionally uses horizontal-scrolling subcontainers, that must not create horizontal overflow on the document root.

Phase 5 — Repair loop

When a case fails:

  1. inspect the failure;
  2. inspect screenshot/trace/diagnostics;
  3. identify the product defect;
  4. fix product code;
  5. rerun the smallest affected acceptance subset;
  6. repeat until stable.

After targeted repair passes, run the full acceptance suite before final completion.

Do not "repair" a failure by weakening the test unless the test was objectively wrong.

If progress is blocked by authentication, unavailable backend data, permissions, external services, unsupported environment, or missing product requirements, stop fabricating certainty and mark the case BLOCKED.

Phase 6 — Visual review

After an automation run, find the latest run:

.acceptance/latest

Read:

.acceptance/runs/<run>/evidence-index.json

For every case whose visualRequired is not false:

  1. inspect all relevant desktop/mobile screenshots listed in the evidence index;
  2. inspect video/trace when temporal behavior matters;
  3. judge against the case's expected criteria and the visual rubric in references/visual-review.md;
  4. write .acceptance/runs/<run>/visual-review.json conforming to acceptance/visual-review.schema.json.

Do not write visual review based only on filenames or DOM assertions. Actually inspect the images.

Allowed visual statuses:

  • pass
  • fail
  • uncertain
  • blocked

Use uncertain when the evidence exists but visual correctness is subjective or not sufficiently demonstrated.

Use blocked when required evidence could not be produced or a dependency prevents verification.

Confidence:

  • high: direct clear evidence
  • medium: evidence supports the conclusion but has some ambiguity
  • low: weak evidence; normally pair with uncertain

If visual review finds a real defect, return to the repair loop and produce a fresh run. Do not keep a known-bad run as the final report.

Phase 7 — Final report

After writing visual-review.json:

pnpm acceptance:report

The required final deliverables are:

.acceptance/runs/<run>/report.html
.acceptance/runs/<run>/summary.md
.acceptance/runs/<run>/evidence-index.json

The HTML report should be the primary human handoff.

Final status semantics:

  • PASS: automation passed and required visual review passed.
  • FAIL: automation or visual review found a defect.
  • UNCERTAIN: evidence is incomplete/ambiguous, automation was flaky, or visual review is missing/uncertain.
  • BLOCKED: the flow could not be exercised for an external or environmental reason.

Completion gate

You may declare the frontend task complete only when:

  1. the final full acceptance run exists;
  2. no case at any severity is FAIL;
  3. all required visual evidence has been inspected;
  4. remaining UNCERTAIN/BLOCKED cases are explicitly surfaced for human review;
  5. report.html and summary.md were generated.

pnpm acceptance:report always writes the available report, but exits non-zero unless the overall status is PASS. Invalid visual-review data also fails closed instead of being treated as a passing verdict.

If there are unresolved UNCERTAIN or BLOCKED items, the implementation may be ready, but verification remains incomplete. Say exactly that rather than calling the task complete or fully verified.

Final response style

Keep the chat handoff short. The report contains the detail.

Report:

  • what was changed;
  • final counts: PASS / FAIL / UNCERTAIN / BLOCKED;
  • the local report path;
  • only the manual-review blockers that still require human attention.

Do not restate every browser step in chat when it is already preserved in the report.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.