Skip to content

oliverv/caro / .agents/skills/oma-frontend

oma-frontend

Unverified

Implement or modify web UI in React, Next.js, or Angular. Use for components, pages, styles, forms, and frontend state or data flows.

FileKindSize
SKILL.mdskill md13.0 KB
resources/angular-rules.mdmarkdown4.9 KB
resources/checklist.mdmarkdown4.7 KB
resources/error-playbook.mdmarkdown5.2 KB
resources/execution-protocol.mdmarkdown2.5 KB
resources/snippets.mdmarkdown11.6 KB
resources/tailwind-rules.mdmarkdown2.7 KB
resources/tech-stack.mdmarkdown8.4 KB

resources/checklist.md

View on GitHub
# Frontend Agent - Self-Verification Checklist

Run through every item before submitting your work.

## Next.js 16 Conventions
- [ ] Request-proxy/auth-gate file is named `proxy.ts` (NOT `middleware.ts`) and exports `proxy` (NOT `middleware`)
<!-- oma-docs:ignore-start -->
- [ ] Do NOT flag `src/proxy.ts` as dead code or recommend renaming to `middleware.ts`; `proxy.ts` is the canonical Next.js 16+ convention
<!-- oma-docs:ignore-end -->
- [ ] Config flags use the `Proxy` form (e.g. `skipProxyUrlNormalize`), not the legacy `Middleware` form
- [ ] Every `<Link>` passes `prefetch={false}`; any prefetching link is a deliberate high-intent target with an inline reason

## TypeScript
- [ ] Strict mode, no `any` types
- [ ] Explicit interfaces for all component props
- [ ] No TypeScript errors (`npx tsc --noEmit`)

## Styling
- [ ] Tailwind CSS only (no inline styles, no CSS modules)
- [ ] Responsive at 320px, 768px, 1024px, 1440px
- [ ] Dark mode supported (if project uses it)
- [ ] No hardcoded colors (use Tailwind theme tokens)

## Accessibility (WCAG 2.2 AA)
- [ ] Semantic HTML elements (`<nav>`, `<main>`, `<button>`)
- [ ] All images have alt text
- [ ] Color contrast >= 4.5:1 (normal text), >= 3:1 (large text)
- [ ] Keyboard navigation works for all interactive elements
- [ ] ARIA labels on non-obvious interactive elements
- [ ] Focus indicators visible

## UX States
- [ ] Loading state (skeleton or spinner)
- [ ] Error state (user-friendly message + retry action)
- [ ] Empty state (helpful message + CTA)
- [ ] Optimistic updates where appropriate

## Deferred / Stub Markers (transparency)
- [ ] Every deferred external integration is wrapped in `// TODO(oma-deferred): <vendor or feature>`
- [ ] Every mock data block has `// MVP: replace with <real-source>` on top
- [ ] Every save/persist UI has a working storage adapter (localStorage, IndexedDB, or API). Empty `onClick={() => console.log("save")}` does NOT count; wire actual persistence, or mark explicitly: `// TODO(oma-deferred): persist <state> to <storage>`
- [ ] Reload-after-save round-trips state for any save action surfaced in the UI

## React 19 hook patterns (catch what eslint catches)
React 19 + recent `eslint-plugin-react-hooks` flag these as hard errors. They aren't style nits; they break runtime behavior. Avoid them at write-time, not "fix later".

- [ ] **Don't put `setState` synchronously inside `useEffect`** (`react-hooks/set-state-in-effect`). Cascading renders trash performance and, in graphics contexts, can exhaust GPU resources. Replace with: derive in render (`const count = items.length`), lazy `useState` initializer (`useState(() => computeOnce())`), move the update into the event handler that triggered it, or `useSyncExternalStore` for external subscriptions.
- [ ] **Don't read `ref.current` during render** (`react-hooks/refs`). Refs are null on first render and don't trigger re-renders when they attach, so any JSX gated on `ref.current` is wrong. Read refs only inside event handlers or effects. When a child component needs an instance, pass the ref object itself (or use a callback ref); let the child read `.current` from inside its own effect/handler.
- [ ] **`useEffect` deps complete and stable.** List every referenced reactive value. Wrap object/array literals in `useMemo` so the dep identity doesn't change every render.
- [ ] **No prop-mirroring via effect.** `useEffect(() => setX(derive(props)))` is always a bug; compute `x` in the render body or memoize.

## react-three-fiber specifics
- [ ] Heavy components (`Canvas`, drei helpers, anything that touches `window`/WebGL) load via `next/dynamic` with `ssr: false`.
- [ ] Effects, helpers, and post-process passes mount unconditionally on the relevant state; don't gate them on `ref.current` truthiness in JSX.
- [ ] Background and lighting work without remote assets when the project doesn't ship a CDN HDR. Solid `<color attach="background">` or local textures beat a `<Environment preset>` that depends on network.
- [ ] Shadow map sizes scale to the number of lights; default to 1024 unless the scene needs more. Multiple 2048-shadowed lights drain GPU memory on integrated graphics.

## Performance
- [ ] No unnecessary re-renders (check with React DevTools Profiler)
- [ ] Memoization matches the project's React Compiler setting: compiler ON (`reactCompiler` in `next.config.*`) → no hand-written `useMemo`/`useCallback`/`React.memo` in new code; compiler OFF → memoize manually (see `tech-stack.md` §React Compiler)
- [ ] Code splitting for route-level components
- [ ] Images optimized and lazy-loaded

## Testing
- [ ] Unit tests for components with logic
- [ ] User interactions tested (click, type, submit)
- [ ] Async behavior tested (loading -> data -> display)
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall