agentleFS
TiagoGranelliTiagoGranelli/slopproof/.agents/skills/add-page/SKILL.md

add-page

Skill2 starsChanged 22 days agoMITView on GitHub

Add or change a page (route) in this repo's UI, with its accessibility, keyboard and Lighthouse obligations. Use when creating a file in src/routes, adding a form or a new UI state to a page, or when the routes gate of pnpm check fails.

5 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Static page: add its path to nitro({ prerender: { routes } }) in vite.config.ts (ADR 0004).

    line 21
  2. Very specific:

    Every control has a visible label.

    line 25

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “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

Add a page

Steps

  1. Route file in src/routes/ (kebab-case; TanStack prefixes such as _authed/ for signed-in pages). It holds the route definition (loader, beforeLoad, head, headers, validateSearch) and a small page component that composes features. Forms, buttons with behavior and lists live in src/features/<name>/components/, data access in src/features/<name>/api/.
  2. Head: a <title> through head(). Head scripts and styles also go through head() so the router adds the CSP nonce. Style with Tailwind classes only: no policy allows 'unsafe-inline', so style attributes and inline event handlers fail the prerender build and are blocked on SSR pages (ADR 0010).
  3. Errors: a route with a loader sets errorComponent to RouteError with its own title and action (as /dashboard, /account). A section that can fail on its own is wrapped in SectionErrorBoundary, and reads its suspense query inside the boundary (MyPostList).
  4. Static page: add its path to nitro({ prerender: { routes } }) in vite.config.ts (ADR 0004).
  5. Forms: useAppForm validating with the input's Effect Schema, loaded on first interaction through lazyFormSchema (see "Forms" in src/features/AGENTS.md). Every control has a visible label. A button whose action is pending sets aria-disabled and ignores presses, so it keeps focus (a disabled button loses it).
  6. Accessibility tests (tests/unit/route-coverage.test.ts in pnpm check fails without all three):
    • an entry in STATES in tests/e2e/a11y.spec.ts for the page and each new UI state (axe, WCAG 2.2 AA);
    • a landmark snapshot in the landmarks block of tests/e2e/landmarks.spec.ts;
    • a row in the tab-order table of tests/e2e/keyboard.spec.ts if the page has controls.
  7. Component tests for pending, disabled, error and limit states: renderInApp(ui, { route }) mounts the real route file (read tests/component/AGENTS.md and tests/e2e/AGENTS.md).
  8. Lighthouse: a page users land on goes in PAGES in scripts/lighthouse-policy.ts (SEO off for noindex pages). Accessibility, best practices and SEO must score 100, performance a median of 99; the policy is in docs/agents/gates.md.

Done when

pnpm check passes, pnpm build && pnpm verify:app passes, and for a page in PAGES, pnpm build && pnpm lighthouse --page=<name> passes.

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.