projx / nextjs
CLAUDE.md71 starsChanged 4 months agoMITView on GitHub
Stack-scoped notes. The root ../CLAUDE.md carries cross-cutting standards — read both, they compose. This directory is a projx template: a working SPA-style app whose own suite must stay green on the projx repo (root §"Per-template gates") and the source the CLI copies into scaffolded projects. It mirrors vitejs/ feature-for-feature but idiomatic to the App Router; vitejs remains the default frontend. pnpm format:check (prettier) → pnpm lint (eslint flat config) → pnpm typecheck (tsc --noEmit) → pnpm build (next build) →…
- Reads credentials
In this repository15 other files it gives its agents.
- admin-panel/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- cli/CLAUDE.mdCLAUDE.md
- e2e/CLAUDE.mdCLAUDE.md
- express/CLAUDE.mdCLAUDE.md
- fastapi/CLAUDE.mdCLAUDE.md
- fastify/CLAUDE.mdCLAUDE.md
- go/CLAUDE.mdCLAUDE.md
- infra/CLAUDE.mdCLAUDE.md
- laravel/CLAUDE.mdCLAUDE.md
- mobile/CLAUDE.mdCLAUDE.md
- rust/CLAUDE.mdCLAUDE.md
- scripts/CLAUDE.mdCLAUDE.md
- vitejs/CLAUDE.mdCLAUDE.md
- projxSkill
The file
Files
nextjs — React / Next.js frontend (projx template)
Stack-scoped notes. The root
../CLAUDE.mdcarries cross-cutting standards — read both, they compose.This directory is a projx template: a working SPA-style app whose own suite must stay green on the projx repo (root §"Per-template gates") and the source the CLI copies into scaffolded projects. It mirrors
vitejs/feature-for-feature but idiomatic to the App Router;vitejsremains the default frontend.
Stack
- Framework — React 19 + Next.js (App Router), TypeScript strict
- Build —
next buildwithoutput: 'standalone'(containerizednode server.js) - Auth — OIDC token flow (
src/lib/auth.ts); request-path-only refresh with one shared in-flight lock (no timer) - Config — DB-backed runtime config via server-injected
window.__RUNTIME_CONFIG__(src/lib/runtime-config*.ts); env bootstrap-only, noNODE_ENVbranching - Errors —
ErrorScaffoldwired into route-levelerror.tsx/global-error.tsx/not-found.tsx; API client parses{detail, request_id} - Monitoring —
@sentry/nextjs(DSN-from-env gated),instrumentation*.ts+sentry.*.config.ts - Styling — Tailwind CSS v4 via
@tailwindcss/postcss(postcss.config.mjs); design tokens live in the@themeblock ofsrc/app/globals.css, dark theme overrides the same custom properties under[data-theme='dark'] - Test — Vitest + v8 coverage; E2E coverage via SWC instrument (
NEXT_COVERAGE)
Layout
| Path | What it holds |
src/app/ | App Router: layout.tsx, page.tsx, login/, error.tsx, global-error.tsx, not-found.tsx, globals.css |
src/middleware.ts | Edge auth gating |
src/lib/ | api.ts, auth.ts, runtime-config.ts, runtime-config-script.ts, sentry.ts, types.ts |
src/components/ | AuthProvider, Providers, ThemeProvider, Layout, Toast, ConfirmDialog, ErrorScaffold, Dashboard, LoginForm |
tests/ | Vitest suites (mirror src/, never co-located under src/) |
next.config.ts | output: 'standalone', security headers via headers() |
Dockerfile.ejs | Multi-stage standalone build |
Quality gates (root §"Per-template gates")
pnpm format:check (prettier) → pnpm lint (eslint flat config) → pnpm typecheck (tsc --noEmit) → pnpm build (next build) → pnpm test (vitest, v8 ≥80%). Locally bash ../scripts/ci-local.sh nextjs.
Things that bite
- Tests live in
tests/, not co-located undersrc/— same rule as the other JS templates. NEXT_PUBLIC_vars are the only env exposed to the client; runtime config is server-injected, not build-time inlined — don't reach forprocess.envin client components.- OIDC env required at runtime: the auth module fails loud without its OIDC config — CI/tests provide it (see the vitejs
VITE_OIDC_*precedent; nextjs usesNEXT_PUBLIC_OIDC_*). - Standalone Docker serves
node server.json port 3000 — no nginx/certbot (unlikevitejs). - pnpm 11 config lives in
pnpm-workspace.yaml— thepostcssoverride andallowBuilds(sharp/@sentry/clidisabled; they ship prebuilt binaries) go there, not the package.jsonpnpmfield. Adding a native dep with a build script means adding it toallowBuildsor pnpm 11 blocks it. - The
brace-expansionoverride is scoped to the 5.x line (>=5.0.0 <5.0.8→>=5.0.8 <6), never a blanket<5.0.8— a blanket bound forcesminimatch@9(via@vitest/coverage-v8) off its nativebrace-expansion@2.xonto5.x, whose CJS export shape crashes coverage (brace_expansion_1.default is not a function). Same constraint asfastify. @themevs:rootinglobals.css— a token goes in@themewhen Tailwind should generate a utility from it (--color-*,--spacing-*,--text-*,--radius-*,--shadow-*,--font-*,--font-weight-*,--leading-*). Tokens only ever read by CSS (--z-*,--sidebar-w,--transition-*,--ring-*,--border-width) stay in:root— putting them in@themegenerates nothing and implies a utility axis that doesn't exist.- Never
@theme inline— inline mode bakes the value into each utility, which silently breaks the[data-theme='dark']override model. Plain@themeemitsvar()references, so flipping a custom property reskins every utility. For the same reason there is nodark:variant anywhere in this template. - Tailwind namespaces are load-bearing — font weights must be
--font-weight-*, not--font-*(that namespace is font-family), and the spacing scale must be--spacing-*, not--space-*. Getting these wrong generates broken or missing utilities rather than erroring.
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
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.

