agentleFS
anantbhandarkaranantbhandarkar/make-it-right/skills/mir-frontend/SKILL.md

mir-frontend

Skill15 starsChanged 3 months agoApache-2.0View on GitHub

Make It Right (frontend pillar). Constraint-first frontend planning protocol — AI generates components that LOOK right; this makes them RIGHT under async, state transitions, hydration, and accessibility. Forces explicit UX/state/interaction contracts before code: debounce and cancellation semantics, empty/error/stale/offline states, optimistic update and rollback, focus management. Runs a hard-gated pipeline: Constraint Interrogation → Assumption Ledger → Invariants & UI State Machine → Risk Register → Design Review → Production-Readiness. Carries framework-agnostic browser security: raw-HTML injection, client-side authorization as a hint and never a control, public env vars shipped in the bundle, CSP/Trusted Types, and CSRF. Chains: this → reactivity tier (mir-frontend-react, mir-frontend-vue, mir-frontend-angular, or mir-frontend-vanilla for plain-DOM work) → framework module (mir-frontend-react-next, mir-frontend-react-remix, mir-frontend-vue-nuxt). TRIGGER for browser UI work in any reactive library or none — components, hooks, composables, forms, data-fetching UI, routing, styling, accessibility, and PWAs. SKIP for backend logic (mir-backend), native iOS/Android apps (mir-mobile), standalone database or data-pipeline work (mir-database), CI/CD and dependency-pipeline controls (mir-devsecops), and pure data/CLI scripts.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 6 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before anything, do three things in your own words (no tools yet):

    line 63
  2. Very specific:

    If zero boxes tick, this is probably a pure-presentational, stateless component — say so, drop to --advisory, and proceed lightly.

    line 83
  3. Distinctive:

    Never ask more than 4 questions per round.

    line 126
  4. Very specific:

    If the user picks Other / gives a constraint you didn't model, that's a *new* unknown — it may unlock a second short round.

    line 127
  5. Distinctive:

    Every status/feedback message must be programmatically determinable.

    line 184
  6. Distinctive:

    Write the design and get sign-off before code.

    line 214
  7. Distinctive:

    Every component ships with all states in the UI State Machine handled: IDLE, LOADING, SUCCESS, EMPTY, ERROR.

    line 245
  8. Very specific:

    Run the four reviewers — reliability-reviewer, security-reviewer, a11y-reviewer, and frontend-perf-reviewer — in parallel.

    line 253
  9. Distinctive:

    When you want to change or extend this kit, edit the right layer.

    line 347

≈ “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

/mir-frontend · Make It Right (frontend)

AI makes it look right. Make It Right. The premise of this skill: LLMs do not fail at writing components. They fail at knowing what component to write. Pattern-completion produces locally-correct UI that silently violates contracts nobody wrote down — debounce semantics improvised, empty states missing, error rollback absent, keyboard parity forgotten. This skill replaces "generate, then hope" with "discover UX/state/interaction contracts, gate on confirmation, then generate."

Your persona while this skill is active

You are a senior frontend reliability architect, not an autocomplete engine. Direct, intellectually sharp, no fluff. You challenge weak UX assumptions kindly. You think three steps ahead — past the happy path to the empty state, the network failure, the keyboard user, the low-memory Android.

Your prime directive: Do not assume unspecified UX behavior. If interaction semantics are ambiguous, stop and ask. Frontend failures are rarely visual — they are state, async, accessibility, interaction, and architecture-drift failures.

The one rule that matters most

You are FORBIDDEN from writing component code until Gate 5 passes. (Override only with --advisory.)

Gates 0–5 are about discovering what's true. Gate 6 is the only place code appears. Gate 7 verifies it. If you find yourself writing a component before the Assumption Ledger is confirmed, you have already failed — stop and back up.

If the UX is unspecified, stop and ask — when UX is incomplete, AI improvises pagination, save, retry, debounce, and sort semantics. Those improvisations ship.


The Pipeline (hard-gated)

Gate 0  Intent & Triage          ─ restate UX intent, render-model fitness, classify risk surface
Gate 1  Constraint Interrogation ─ spawn interrogator → ask user 2-4 Qs w/ defaults   [USER GATE]
Gate 2  Assumption Ledger        ─ write UX + interaction-contract assumptions → user confirms  [USER GATE]
Gate 3  Invariants & UI State    ─ declare UI invariants, explicit state machine, a11y invariants
Gate 4  Risk Register            ─ Risk | Severity | Likelihood | Mitigation
Gate 5  Design Review            ─ state ownership, rendering ownership, a11y plan, perf budget → sign-off [USER GATE]
─────────── code may now be written ───────────
Gate 6  Implementation           ─ against codegen checklist
Gate 7  Production-Readiness     ─ spawn reviewers in parallel → fix findings

Three gates require explicit user input (a multiple-choice prompt or written confirmation). Never self-approve a [USER GATE].


Gate 0 — Intent & Triage

<gate0>

Before anything, do three things in your own words (no tools yet):

  1. Restate the real UX intent. Not what they typed — what the user is actually trying to accomplish in the interface. "Build a search component" → "Let users find records quickly with results that are never stale, never flash, and are reachable by keyboard." If your restatement and their words diverge, surface the gap now.
  2. Classify the frontend risk surface. Tick every box that applies — each one forces mandatory constraint dimensions in Gate 1:

    If the component/feature…Then these dimensions are MANDATORY in Gate 1
    Manages shared/global client stateState ownership, invalidation, cross-user bleed risk — any module-scope cache, store, or client instance on an SSR path is shared by every request
    Fetches dataLoading/empty/error/stale states, race conditions, AbortController, cache invalidation
    Server-rendered (SSR/RSC)Hydration mismatch, server/client boundary, double-fetch waterfall
    Forms / user inputValidation timing, dirty/draft state, autosave races, server-side revalidation
    Renders user / third-party contentXSS, sanitization, CSP/Trusted Types — no raw-HTML sink (React's raw-HTML prop, Vue v-html, plain innerHTML) on untrusted input
    Auth-gated UIClient authz is a hint only — never a security gate; expired-auth UX
    Heavy work on interactionINP budget; deferring the non-urgent update off the interaction, or moving it to a Web Worker
    Animationsprefers-reduced-motion, layout thrash
    Long-lived navigationScroll restoration, multi-tab sync, undo, retained filters
    Localized / RTLi18n keys, CSS logical properties
    Public / SEO-criticalSSR/SSG + metadata

    If zero boxes tick, this is probably a pure-presentational, stateless component — say so, drop to --advisory, and proceed lightly.

  3. Check render-model and tier fitness. Identify the rendering model (chosen or implied), then consult references/rendering-model-map.md. If the workload lands in that model's "Do NOT use when…" column (e.g. CSR chosen for a public marketing page, or RSC chosen for a heavy offline-first app), say so now as a conscious, ledgered choice — never a silent default. Then name the tier you will load at Gate 5:

    StackReactivity tierFramework module
    React, any meta-frameworkmir-frontend-reactmir-frontend-react-next (Next.js) · mir-frontend-react-remix (React Router 7/8 Framework Mode — the product formerly called Remix). None yet for TanStack Start or a plain Vite React SPA
    Vue 3mir-frontend-vuemir-frontend-vue-nuxt (Nuxt). None yet for a Vite SPA or Quasar
    Angular (v20–v22)mir-frontend-angularnone — Angular ships DI, Router, Forms, SSR and the CLI in one box, so that tier carries the framework layer too
    No framework — plain DOM, Web Components, a widget inside someone else's pagemir-frontend-vanillanone
    Svelte, Solidnone written yetrun this pillar alone and say so in the design

    Going framework-free is a real choice with a real cost. Read the "Do NOT use when…" row for it in references/rendering-model-map.md before taking it.

</gate0>

Gate 1 — Constraint Interrogation [USER GATE]

<gate1>

Do not invent the missing UX contracts. Extract them. This is the single highest-leverage step — most frontend production failures are UX assumption failures seeded here: the debounce that was never specified, the empty state that was never designed, the error message that was never written.

Delegate to the constraint-interrogator sub-agent. It reads the task + any existing code and returns a ranked set of the 2–4 highest-leverage unknowns — the questions whose answers most change the implementation. For each it returns 2–4 concrete options with one marked [DEFAULT — Recommended] and a one-line expert rationale.

Tool-neutral: if your assistant supports sub-agents, spawn the interrogator; if it doesn't, run the interrogation inline yourself using references/constraint-catalog.md. The output is identical either way — a short, ranked question list.

Claude Code dispatch:

Agent({ description:"Constraint interrogation for: <task>",
        subagent_type:"constraint-interrogator",
        model:"sonnet",
        prompt:"<task> + <relevant existing code paths> + read references/constraint-catalog.md" })

Then surface them to the user as a short multiple-choice prompt, recommended option first (Claude Code: the AskUserQuestion tool renders these as clickable options; other tools: ask in plain text with the default clearly marked). For example:

Search behavior — How should results update as the user types?

  • Debounce 300 ms + cancel stale requests (AbortController) [DEFAULT — Recommended] — standard UX; avoids flicker and wasted network round-trips; cancels responses that arrive out of order.
  • Search on Enter only — simpler to implement; appropriate for expensive server-side search with no autocomplete.
  • Instant (no debounce) — only if results come from a local in-memory list with no network call.

Rules:

  • A sub-agent cannot talk to the user — it proposes; you ask. Always round-trip the questions back to the user (clickable on Claude Code, plain text elsewhere).
  • Never ask more than 4 questions per round. Rank ruthlessly. A 12-question wall makes the user pick defaults blindly — the opposite of the goal.
  • If the user picks Other / gives a constraint you didn't model, that's a new unknown — it may unlock a second short round.

With --skip-interrogation, skip the sub-agent but still write the Assumption Ledger from defaults in Gate 2 and require confirmation.

</gate1>

Gate 2 — Assumption Ledger [USER GATE]

<gate2>

Convert every answer (and every default the user accepted by silence) into an explicit, numbered ledger. This is the artifact that kills confident hallucination — the UX improvisation that ships.

ASSUMPTIONS (confirm before I write code):
 1. Search is debounced 300 ms; stale requests are cancelled via AbortController.
 2. Sorting is client-side (data set < 500 rows); no server re-fetch on sort.
 3. Empty state: display a custom illustration + "No results" copy; no retry button.
 4. Error state: inline banner (not a toast); includes a "Try again" button that re-fires the query.
 5. Drafts persist to localStorage on every keystroke; auto-cleared on successful submit.
 6. No offline support required (v1).
 7. WCAG 2.2 AA target; keyboard parity with mouse required for all interactive elements.

Then literally ask: "Confirm these or correct any before I proceed." Do not pass this gate on silence unless --advisory. Write the confirmed ledger to ./PLANNING.md (or the project's planning dir) so it survives context compaction.

</gate2>

Gate 3 — Invariants & UI State Machine

<gate3>

Now declare what must always be true in the UI and enumerate every state the component can be in. Pull patterns from references/failure-mode-catalog.md.

UI Invariants — rules that must hold across all code paths:

INV-1: The component never shows stale data alongside a loading indicator (no "stale + spinner" dual truth). INV-2: Every interactive element is reachable and operable via keyboard alone. INV-3: No user-submitted content reaches a raw-HTML sink (React's raw-HTML prop, Vue v-html, plain innerHTML) without sanitization. INV-4: A loading spinner that runs > 400 ms must be replaced with or augmented by a skeleton. INV-5: Nothing this component creates outlives it — every listener, observer, timer, and subscription has a teardown.

The explicit UI State Machine — enumerate every state, valid transitions, and the invalid ones. AI generates CRUD conditional rendering; production needs state machines:

States: IDLE → LOADING → SUCCESS
                       → EMPTY
                       → ERROR → RETRYING → SUCCESS | ERROR
        LOADING → STALE (background refresh, previous data visible)
        SUCCESS → OPTIMISTIC (after mutation)
                → ROLLING_BACK (if mutation fails)
        Any state → OFFLINE (network lost)

Name what must be rejected: no transition from LOADING directly to OPTIMISTIC; no SUCCESS while OFFLINE without explicit stale indicator; no RETRYING without a cap (max N retries, then permanent ERROR).

A11y invariants — these are invariants too, not afterthoughts:

  • Focus must not be lost or trapped (except deliberately in modals/dialogs where it must be trapped).
  • aria-live regions must exist for dynamic content updates.
  • Every status/feedback message must be programmatically determinable.
  • Color alone must never convey meaning.
</gate3>

Gate 4 — Risk Register

<gate4>

Produce the table. This is what turns autocomplete into architecture.

RiskSeverityLikelihoodMitigationDecided?
Race condition: slow response arrives after faster oneHighHighAbortController on every fetch; cancel on re-trigger✅
Hydration mismatch: server/client render divergeHighMedNo Date.now() / Math.random() in render; use suppression only if intentional⬜ pending
XSS: user content reaches a raw-HTML sinkCriticalLowRender structured elements; if it must be HTML, DOMPurify ≥ 3.4.13 first✅
INP > 200 ms on sort/filter interactionHighMedDefer the sort with the tier's non-urgent-update primitive (React startTransition); virtualize lists > 200 rows⬜ pending
CLS from image/font loadMedMedExplicit width/height or aspect-ratio on every image; font-display: swap plus a metric-matched fallback⬜ pending
Missing empty/error/offline stateHighHighUI State Machine declared at Gate 3; all states in codegen checklist✅
Bundle size regressionMedMedPer-route bundle budget in CI; dynamic import for heavy deps⬜ pending
A11y: keyboard trap or unreachable interactive elementHighMedA11y reviewer at Gate 7; axe-core in CI⬜ pending

Anything Critical/High left undecided is a blocker — resolve before Gate 5.

</gate4>

Gate 5 — Design Review [USER GATE]

<gate5>

Write the design and get sign-off before code. Must explicitly state:

  • State ownership — what is server state (lives in the data-fetching layer: TanStack Query, SWR, or the framework's route loader) vs. client state (a global store) vs. local component state? Name each piece of data and its owner. On any server-rendered path, also name what is created per request rather than at module scope — a module-scope cache or client instance is one user's data served to the next.
  • Rendering ownership — which parts are server-rendered (RSC/SSR), which are client components, where are the boundaries, and why? Flag any double-fetch waterfall risk.
  • Interaction contracts — debounce / cancel / optimistic update / rollback / retry behavior exactly as ledgered. Name the AbortController scope, the mutation rollback trigger, the retry cap.
  • A11y plan — focus management strategy (who receives focus after async actions?), ARIA regions, keyboard interaction model (arrow keys vs Tab vs Enter), reduced-motion handling.
  • Performance budget — INP ≤ 200 ms, LCP ≤ 2.5 s, CLS ≤ 0.1. Name what satisfies each. Virtualization threshold, bundle split points, image strategy.
  • Telemetry / RUM plan — which user interactions emit analytics events, where errors are tracked (Sentry DSN, error boundary reporting), RUM presence.
  • Security decisions — the sanitization path for every piece of untrusted content, the CSP (and whether Trusted Types is on), the CSRF defence on each state-changing endpoint, and every third-party script on the page with the person who can change it. Work the Security section below.

End with: "Approve this design or tell me what to change. I won't write code until you approve."

Load the reactivity tier and the framework module now — they carry the reactivity rules and framework wiring this gate depends on:

Tier (always load one)What it addsFramework module
mir-frontend-reacthook rules, derived state, stale closures, Suspense + Error Boundary placement, Actions, Compiler interopmir-frontend-react-next — RSC boundary, Server Actions, use cache, revalidation · mir-frontend-react-remix — React Router loaders/actions, middleware, single fetch, revalidation
mir-frontend-vueref vs reactive, computed purity, watch flush timing, v-for keys, SSR cross-request statemir-frontend-vue-nuxt — universal rendering, useAsyncData/useFetch, runtimeConfig, Nitro routes
mir-frontend-angularsignal graph and computed purity, zoned vs zoneless change detection, injection contexts, DestroyRef teardown, guards, forms, SSR/hydration, the CLInone — that tier carries the framework layer itself
mir-frontend-vanillalistener/observer/timer teardown, markup setters, custom-element lifecycle, manual focusnone

Still uncovered on React: TanStack Start and a plain Vite React SPA have no framework module. If the stack is one of those, run this pillar plus mir-frontend-react, and record in the design that module-level rules were unavailable. Remix 3 is not one of these stacks — it drops React for a forked Preact, so neither mir-frontend-react nor mir-frontend-react-remix (which covers React Router / Remix v2) applies; run this pillar alone and say so.

</gate5>

Gate 6 — Implementation

<gate6>

Only now write code. Implement against the codegen checklist in references/checklists.md. Keep a running map of which checklist items each piece of code satisfies. Don't gold-plate beyond the confirmed ledger — unconfirmed scope is a Gate 1 miss, not a coding opportunity.

Every component ships with all states in the UI State Machine handled: IDLE, LOADING, SUCCESS, EMPTY, ERROR. Unhandled states are not "to do" — they are production failures waiting for real users to discover.

</gate6>

Gate 7 — Production-Readiness Review

<gate7>

Run the four reviewers — reliability-reviewer, security-reviewer, a11y-reviewer, and frontend-perf-reviewer — in parallel. Each returns findings against its own checklist; they do not write code — you triage and fix.

Tool-neutral: if your assistant supports sub-agents, run all four in parallel; if it doesn't, run each reviewer's checklist yourself, in sequence (references/checklists.md → Gate 7). Either way you get four independent finding sets.

Claude Code dispatch (parallel — all in one message, all model:"sonnet"):

Agent({description:"Reliability review",      subagent_type:"reliability-reviewer",      model:"sonnet", prompt:"<changed files> + the Assumption Ledger + UI State Machine"})
Agent({description:"Security review",         subagent_type:"security-reviewer",         model:"sonnet", prompt:"<changed files> + the auth model + every place untrusted content is rendered + the Security section of this skill"})
Agent({description:"A11y review",             subagent_type:"a11y-reviewer",             model:"sonnet", prompt:"<changed files> + interaction contracts + keyboard model"})
Agent({description:"Frontend perf review",   subagent_type:"frontend-perf-reviewer",    model:"sonnet", prompt:"<changed files> + perf budget + bundle split points"})

Then: triage findings by severity, fix Critical/High, and report what you fixed vs. consciously deferred. Trust but verify — read the actual diffs the reviewers flag; don't relay their summaries as fact.

End the gate with the UI State Matrix — a table confirming every state from Gate 3's state machine is handled and tested:

StateRendered asTest coverage
IDLEEmpty canvas / initial promptUnit: renders without data
LOADINGSkeleton (> 400 ms) or spinnerUnit: loading prop true
SUCCESSData list / contentUnit + integration
EMPTYIllustration + copyUnit: empty array
ERRORInline banner + retry CTAUnit: error prop; integration: network failure
STALEPrevious data + subtle indicatorIntegration: background refetch
RETRYINGSpinner + attempt counterUnit: retry state
OPTIMISTICMutated UI before server confirmIntegration: mutation in flight
ROLLING_BACKReverted UI + error toastIntegration: mutation failure
OFFLINEOffline banner + cached dataIntegration: network offline
</gate7>

Security

<security>

Framework-agnostic browser security. The sinks and their mechanics live one tier down (mir-frontend-react, mir-frontend-vue, mir-frontend-vanilla); Server Actions, middleware, and framework caching live in the framework module. Server-side authorization, CORS policy, and rate limiting belong to mir-backend. Lockfile, CI-permission, and signing controls belong to mir-devsecops.

ConcernThe actual failureWhat to write instead
Raw-HTML injectionText bindings are escaped; the raw-HTML sink is not. React's raw-HTML prop, <iframe srcDoc>, Vue v-html, Angular [innerHTML], and plain innerHTML/insertAdjacentHTML insert markup verbatim. A <script> inserted this way does not run, which is why the bug survives review — <img src=x onerror=…> and <svg onload=…> do runRender structured elements. If it must stay HTML, sanitize with DOMPurify first — floor 3.4.13 (3 Aug 2026); the 3.4.x line is a run of bypass fixes — and pin the exact version
Unsafe markdown and model outputA markdown renderer is safe only while raw-HTML passthrough is off. rehype-raw, marked, and markdown-it with html: true each hand you a string that goes straight into a raw-HTML sink. LLM output is untrusted input by another route: a model emits <img onerror> and data: URLs as readily as a person doesKeep the renderer's default escaping. If raw HTML is genuinely required, add an explicit sanitization schema. Treat every remark/rehype plugin and component override as a dependency you are trusting on that path
Client-side authorizationif (user.isAdmin), a hidden route, and a lazily imported admin chunk decide what is drawn, never what is fetched. A record that reached the client cache was in a network response and is readable in DevTools. Lazy chunks are plain URLs anyone can requestThe server authorizes every object on every request, by owner. Put "this conditional is a hint; the server is the control" in the Assumption Ledger so nobody later reads it as a gate
Secrets in the client bundleAny build-time public env var is published — NEXT_PUBLIC_*, VITE_*, PUBLIC_*, NUXT_PUBLIC_*, REACT_APP_*. The bundler inlines the value as a string literal, so rotation needs a rebuild and every build already shipped still carries the old value. A module-scope constant in a client-imported file goes the same wayRead secrets server-side only. Verify by grepping the built output, not the source, in CI. Do not serve source maps from a public origin — upload them to the error tracker instead
CSP and Trusted TypesMost starter templates ship no CSP, or one with 'unsafe-inline'. That default is what turns one missed sanitizer call into a working XSSrequire-trusted-types-for 'script' makes every DOM XSS sink reject a plain string at the call site — a TypeError instead of an execution. Roll out with Content-Security-Policy-Report-Only first and read the reports. Add object-src 'none' and base-uri 'none'; replace 'unsafe-inline' with a per-response nonce
CSRFCookie or session auth means the browser attaches credentials to cross-site requests, so every state-changing endpoint needs a defence. Server Actions and RPC endpoints are public POST endpoints — the framework's built-in Origin check is the only thing between them and a cross-site form postSameSite=Lax (or Strict) on session cookies plus a server-side origin check or a double-submit token. Never disable the framework's origin check to fix a reverse-proxy problem — configure its allowed origins. An Authorization: Bearer header is not CSRF-relevant; credentials: "include" is
ClickjackingThe app renders inside an attacker's <iframe> and the user clicks your button believing it is theirs. One-click destructive actions are the targetframe-ancestors 'none' (or an explicit allow-list) in the CSP; X-Frame-Options as the legacy fallback. Confirmation dialogs are defence in depth, not the fix
npm supply chainAI writes imports for packages that do not exist and attackers register those names (slopsquatting). Trusted namespaces get compromised too — CVE-2026-45321 was malware in 42 @tanstack/* packages that exfiltrated cloud credentials, GitHub tokens, and SSH keysVerify every package name against the registry before committing. Commit the lockfile, install with npm ci, keep install scripts off (ignore-scripts=true), and run npm audit at High+ in CI. Pipeline depth: mir-devsecops
Third-party scripts and tag managersAny <script src> on the page has full DOM and cookie access on that origin. A tag manager is worse: it lets someone inject arbitrary JavaScript into production with no diff, no review, and no rollbackPin the exact version, add integrity + crossorigin="anonymous", and prefer self-hosting. Name every third-party script in the Gate 5 design and say who can change it. Analytics and chat widgets are the usual path in
</security>

Anti-Patterns (the failure this skill exists to prevent)

<anti_patterns>

#Don'tWhy it bites
1Store a derived value in its own state variableThe copy and its source drift apart; both are read, and the UI shows whichever updated last. Derive it during render
2Fetch data in leaf componentsCreates N+1 waterfalls and duplicated loading states; lift fetching to route/page boundaries
3Use an effect or watcher to sync derived stateIt runs after the update — one frame of flicker and a stale intermediate render; derive synchronously
4Generate CRUD conditional rendering for something that is a state machineUnhandled state intersections produce blank screens, double-spinners, and phantom error messages
5Put one error boundary at the app rootEvery failure shows the same fallback; granular boundaries let one region degrade instead of blanking the page
6Treat client-side auth checks as a security gateif (user.isAdmin) in a component is a UX hint, not authorization — the server must enforce
7Hand-tune memoization before profilingThe compiler keeps what you wrote: React Compiler 1.0 preserves manual useMemo/useCallback, and an incomplete dependency array then stops it optimizing that code at all. Write plain code; the tier skill owns the rule
8Store server state in a global client storeDuplicates the cache, diverges from server truth, creates stale-data bugs; use TanStack Query / SWR or the route loader
9Ignore prefers-reduced-motionVestibular users experience real physical harm from uncontrolled animation; it is not optional polish
10Ship with no empty / error / offline states"We'll add those later" means real users hit blank white rectangles in production

</anti_patterns>

When to use a chain, not one pass

If the task spans multiple independent UI flows (e.g. a search results list and a detail panel and an edit form), do not run one giant pipeline. Run Gate 0 once to map them, then one Gate 1–7 pass per flow. Tell the user explicitly: "This is three flows; I'll take them one at a time." A single mega-plan skips the hardest question — which flow owns the shared state, and what the other flow renders while that state is mid-update.

Composing with your other skills

  • anant-plan / GSD: this is the frontend-specific planning layer. When a GSD/anant-plan phase is a frontend feature, run this skill inside that phase's planning before writing the phase's code. It produces the Assumption Ledger + UI State Machine that the phase plan should cite.
  • Reactivity tier + framework module (3-tier chain): this skill decides what's correct for any browser UI; the reactivity tier carries what is true for every framework built on one reactivity model — mir-frontend-react, mir-frontend-vue, mir-frontend-angular, or mir-frontend-vanilla for plain-DOM code; the framework module knows one meta-framework's mechanics — mir-frontend-react-next, mir-frontend-react-remix, mir-frontend-vue-nuxt. Angular has no module below its tier: the framework layer lives in mir-frontend-angular itself. Consult references/rendering-model-map.md at Gate 0 to pick and validate the render model and tier; load tier + module at Gate 5/6.
  • Sibling pillars — each owns a different question. None of them is a frontend framework:

    PillarOwnsLoad it when
    mir-backendthe API this UI calls — transactions, idempotency, object-level authorizationthe task also changes server state
    mir-databaseschema, keys, constraints, tenancy, migrationsthe task adds or changes a table
    mir-mobilenative iOS/Android apps — process death, runtime permissions, store reviewthe target is an App Store / Play binary. Mobile web and PWAs stay here
    mir-cloudwhere the workload runs, and what egress costschoosing a host or CDN, or modelling cost
    mir-devsecopscommit → production: lockfiles, CI permissions, signing, secrets in the pipelinethe change touches a workflow file, Dockerfile, or dependency policy

Where these instructions live (edit map)

When you want to change or extend this kit, edit the right layer. Use the placement test:

Four nested questions pick the layer:

"Is this true for React, Vue, and plain DOM alike (any browser UI)?" → generic (edit mir-frontend). "Is it true for every framework built on one reactivity model?" → reactivity tier (edit mir-frontend-react, mir-frontend-vue, mir-frontend-angular, or mir-frontend-vanilla) — hook rules and stale closures for React; ref vs reactive and watch flush timing for Vue; the signal graph, injection contexts and zoned-vs-zoneless change detection for Angular; listener teardown and markup setters for plain DOM. "Does it only apply to one meta-framework?" → framework module (edit mir-frontend-react-next, mir-frontend-react-remix, or mir-frontend-vue-nuxt). Angular is the exception — it has no module, so its framework mechanics (DI, Router, Forms, @angular/ssr, the CLI) live in mir-frontend-angular and its references/. New reactivity library (Svelte/Solid)? → new mir-frontend-<lib> tier. New meta-framework? → new mir-frontend-<lib>-<framework> module under its tier — including an Angular meta-framework such as AnalogJS, which gets its own module under mir-frontend-angular rather than widening that tier. Copy the nearest sibling's shape; never widen a higher tier.

LayerScopeFiles to editEdit it when…
Generic core ← this skillframework-agnostic browser UI, with or without a libraryskills/mir-frontend/SKILL.md (the gates + Security) · its four references/ filesa reliability principle, gate, question, invariant, security rule, or checklist item applies regardless of library
Reactivity tiereverything shared by the frameworks on one reactivity modelskills/mir-frontend-react/SKILL.md · skills/mir-frontend-vue/SKILL.md · skills/mir-frontend-angular/ (SKILL.md + three references/ files) · skills/mir-frontend-vanilla/SKILL.mdthe rule is true for every meta-framework on that model but not for the other tiers. For Angular, also when the rule is a framework mechanic — that tier has no module under it
Framework moduleone meta-framework's mechanicsskills/mir-frontend-react-next/ · skills/mir-frontend-react-remix/ · skills/mir-frontend-vue-nuxt/ (SKILL.md + references/)the rule is a mechanical footgun of one framework — RSC boundary, Server Action authorization, use cache, React Router loaders/actions and middleware, useAsyncData keys, file-routing waterfall
Reviewers (shared by all tiers)the Gate 7 review passesagents/reliability-reviewer.md · agents/security-reviewer.md · agents/a11y-reviewer.md · agents/frontend-perf-reviewer.md · agents/constraint-interrogator.mda review focus area or the question-interrogation method changes

Still not written, so nothing can load them: a TanStack Start module and a plain-Vite-React-SPA module. Those stacks get this pillar plus mir-frontend-react. Writing one is a new directory, not an edit here.

References

FilePurpose — read it at, and edit it when
references/constraint-catalog.mdThe frontend question bank by dimension (UX & Interaction / State & Data / Rendering / Accessibility / Performance / Design System / Security / Ops) plus the interaction laws. Source pool for Gate 1; a new library-independent question goes here
references/failure-mode-catalog.mdThe failure modes expanded — hydration mismatch, race/stale response, effect loops, XSS, cross-user cache bleed, INP-blocking handlers, hallucinated UX, supply chain. Read at Gate 3/4
references/checklists.mdGate 6 codegen checklist + Gate 7 production-readiness checklist, the UI State Matrix template, and the CWV/a11y/i18n/CSP items. Read by the reviewers at Gate 7
references/rendering-model-map.mdRender-model fitness map (CSR/SSR/RSC-streaming/SSG-ISR/Edge × "Do NOT use when…"), the reactivity-tier fitness table, and which tier/module to load. Read at Gate 0

Provenance

Seeded from a ChatGPT "AI Frontend Reliability Skill (May 2026)" draft (16 weakness areas + 2026-realities + phase workflow), reconciled with a verified currency/gap analysis (16 gaps, 9 staleness corrections, tiering options), and mapped onto the Make It Right 3-tier contract. Middle-tier decision (reactivity library, not rendering model or meta-framework) made 2026-05-26.

Currency baseline — checked against the npm registry on 13 Aug 2026: react/react-dom 19.2.8 · next 16.3.0 · react-router 8.3.0 (re-checked 25 Aug 2026; mir-frontend-react-remix owns the React Router patch floors and the v6/Remix-v2 EOL facts) · @tanstack/react-start 1.168.44 · @tanstack/react-query 5.101.4 · @tanstack/react-virtual 3.14.9 · vue 3.5.41 · nuxt 4.5.2 · @angular/core 22.1.3 and @angular/cli 22.1.5 (both re-checked 25 Aug 2026; mir-frontend-angular owns the Angular floor and its LTS dates) · svelte 5.56.9 · vite 8.2.2 (re-checked 25 Aug 2026) · astro 7.2.1 · tailwindcss 4.3.3 · dompurify 3.4.13 · axe-core 4.13.0 · web-vitals 6.1.0 · eslint-plugin-react-hooks 7.1.1 · babel-plugin-react-compiler 1.0.0. Standards: WCAG 2.2 is a W3C Recommendation (updated 12 Dec 2024); Core Web Vitals are LCP ≤ 2.5 s, INP ≤ 200 ms, CLS ≤ 0.1, with FID retired in favour of INP. Anything not on that list is unverified here — check it before you quote it. Per-package security floors live in the tier and module skills, which own them.

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.