CommunityCoding & Developmentgithub.com

hasaneks/web-craft-arch

Architecture and integration rules for React web apps (Next.js App Router or React with Vite): server and client component boundaries, one API layer with a typed error model, state ownership, react-hook-form + Zod with server errors mapped to fields, state boundaries (loading.tsx, error.tsx, Suspense), i18n architecture (locale registry, resolution order, URL policy, request-scoped locale, catalogues, kit and date locale), RTL with logical properties, auth, XSS, CSRF, secrets and cache isolation

What is web-craft-arch?

web-craft-arch is a Claude Code agent skill that architecture and integration rules for React web apps (Next.js App Router or React with Vite): server and client component boundaries, one API layer with a typed error model, state ownership, react-hook-form + Zod with server errors mapped to fields, state boundaries (loading.tsx, error.tsx, Suspense), i18n architecture (locale registry, resolution order, URL policy, request-scoped locale, catalogues, kit and date locale), RTL with logical properties, auth, XSS, CSRF, secrets and cache isolation.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/hasaneks/web-craft/tree/HEAD/skills/web-craft-arch

Installed? Explore more Coding & Development skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Web app architecture

Read web-craft first. Load only the references the task needs; kit and framework adapters only for the chosen kit and framework.

Map

TopicReference
Server vs client components, BFF, env and secrets boundaryreferences/server-client.md
API layer, error model, state ownership, forms, optimistic UI, URL statereferences/data-forms.md
Loading, error and not-found boundaries, retry, offline, skeleton timingreferences/states.md
i18n: registry, resolution, URL, catalogues, formatting, backend headerreferences/i18n.md
RTL, logical properties, directional icons, portalsreferences/rtl.md
Auth, authorization, XSS, CSRF, cookies, cache isolation, personal datareferences/auth-security.md
Theme: user preference vs applied theme, system changes, no flashreferences/theming.md
SEO for public pagesreferences/seo.md
GEO: visibility in AI search and assistantsreferences/geo.md
Next.js App Router adapterreferences/fw-next.md
React + Vite adapterreferences/fw-vite.md
shadcn/ui adapterreferences/kit-shadcn.md
Ant Design adapterreferences/kit-antd.md
Material UI adapterreferences/kit-mui.md
Working with a node-craft (or any OpenAPI) backendreferences/node-craft-contract.md
Official sources and review datesreferences/sources.md

Rules that hold everywhere

  1. Boundaries by need. A component is a client component because it needs interactivity, browser APIs or client state, not by default. Keep interactive islands small. Never import server-only code, ORM clients or secrets into client code; a public env variable is not a secret.
  2. One API layer. One fetch client, one typed error model keyed by stable codes and status, one auth behaviour. Features do not build their own fetch and retry. Server data lives in the query/cache layer, global client state in a small store or context, form state in the form tool, local UI state in the component. A mock source is switched on by configuration for development and tests, never by editing features; untrusted responses are parsed at runtime.
  3. Forms. react-hook-form + Zod unless the project has another tool. mode: 'onTouched', reValidateMode: 'onChange', focus and scroll to the first error, server field errors through setError, values kept after errors, double submit blocked. The server stays the authority on validation.
  4. States have boundaries. Route-level loading and error boundaries plus local Suspense where data streams; one failing widget does not blank the page.
  5. i18n is architecture. A real engine, a locale registry (BCP 47 tag, direction, catalogue, display name), English fallback unless chosen otherwise, request-scoped locale on the server, the same initial locale on server and client, catalogues loaded per locale and namespace, kit and date locales mapped from the app locale.
  6. Security is server-side. Authorization in the backend. Sanitize any HTML you render. Cookie sessions need CSRF protection. Personal responses never go into a shared cache; locale- and user-dependent responses vary their cache keys.
  7. Public pages are findable. Locale-correct metadata rendered on the server, canonical per language, hreflang alternates only for real counterparts, sitemap, structured data that matches the visible content. GEO starts with that: indexable, citable content and an explicit AI crawler policy. No ranking or citation guarantees.
  8. Kits are adapted, not wrapped. Theme and tokens come from the product's design decisions. Wrap a kit component only for repeated product behaviour or to pin an API. Do not stack a second animation system on a kit's own transitions.

Done

Apply web-craft → done, plus: no client bundle contains a secret or server-only module; two concurrent requests in different locales or for different users cannot mix data; the first render is in the right language and theme; every claimed kit/framework combination was actually checked.

Individual skills in this repo

This repo contains 2 individual skills — each has its own dedicated page.

Related Skills