/engsys-web:web-platform-conventionsfrom engsys-web
Web platform conventions for this repo — Content-Security-Policy discipline and (for Next.js 16+) the proxy.ts-not-middleware convention. Use when editing CSP headers, adding a third-party SDK / analytics / external API origin, touching request-edge code (middleware/proxy), or wiring auth/redirects/headers on a web frontend.
Ships in engsys-web. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Applies to: the web frontend(s) in this repo. Mostly framework-agnostic; the proxy.ts section is Next.js-specific.
Naturalize: confirm the framework/version and where the CSP is built in
CLAUDE.md. The defaults below assume a same-origin BFF/proxy architecture.
Treat the CSP as code that gates every network origin the page may reach. Any new XHR/fetch origin, script host, or asset host must be added explicitly. Never relax a directive to a wildcard to "make it work."
connect-src policy'self' only — no https: wildcard, no data: / blob: / javascript:. Browser-initiated API calls should go through a same-origin BFF/proxy (e.g. /api/proxy/*), so 'self' covers them.window.location navigations, which are governed by form-action / navigation directives, not connect-src.ws: / wss: for the dev server's hot-reload.connect-src (e.g. https://browser.sentry-cdn.com). Do NOT relax to https:.script-src.| Directive | Sources | Notes |
|---|---|---|
default-src | 'self' | Fallback for everything not listed. |
connect-src | 'self' (+ ws: wss: in dev) | All XHRs same-origin via BFF. |
script-src | 'self', per-request nonce, 'strict-dynamic' | Add explicit CDN hosts; avoid 'unsafe-inline' in prod. |
style-src | 'self', 'unsafe-inline' (if the CSS framework requires it) | Tailwind/Next often need inline styles. |
img-src | 'self', data:, your asset/storage host | |
frame-ancestors | 'none' | Plus X-Frame-Options: DENY belt-and-suspenders. |
object-src | 'none' | No Flash, no PDF embed. |
base-uri | 'self' | Blocks <base> injection. |
form-action | 'self' | All forms post same-origin. |
Prefer a per-request nonce + 'strict-dynamic' over host allowlists for scripts where the framework supports it.
proxy.ts, not middleware.tsNext.js 16 replaced middleware.ts with proxy.ts. Having both present is a build error ("use ./proxy.ts only").
Rule: on Next.js 16+, there is no middleware.ts anywhere in the service. Auth, redirects, headers, request rewriting, and the CSP header all go through proxy.ts.
Background: https://nextjs.org/docs/messages/middleware-to-proxy.
Use the project logger, not console.*, on web frontends — so logs are structured, domain-scoped, and routable. Check CLAUDE.md for the logger import and the domain/level conventions.
What SKILL.md sets; muted values are Claude Code's defaults
3 skills in this plugin
/frontend-testingFrontend test discipline — Vitest 4, Testing Library (RTL / React Testing Library), and Playwright E2E for React / Next.js apps. Use when writing or reviewing Vitest specs, vi.mock factories, fake-timer tests, RTL component tests, Radix portal tests, or Playwright E2E specs and their CI matrix wiring./react-conventionsReact + Next.js client conventions (React 19 / Next.js 16+, TanStack Query, Radix UI, shadcn-style cards/dialogs). Use when writing or reviewing React components, hooks, optimistic cache patches, data-fetching code, dialogs, Radix Select usage, JSX, interactive cards/rows, or Next.js 16 proxy.ts / runtime boundary code.Other plugins' skills for the same job
npx claudepluginhub eric-sabe/engsys --plugin engsys-web