frontend-foundation
/frontend-foundation
Scaffolds and extends production frontends on the user's standard stack: Next.js (latest stable, App Router), TypeScript strict, pnpm, Tailwind CSS + shadcn/ui, React Query + axios services, zod, Feature-Sliced Design with kebab-case files, Airbnb-based ESLint + Prettier, I/T/E type prefixes and UPPER_CASE constants, SEO metadata and static generation, next/image only, WCAG 2.2 AA with keyboard shortcuts, Vitest + MSW + Playwright with a 90% coverage gate, Husky hooks, GitHub CI and Lighthouse budgets, and a binding AGENTS.md. TRIGGER when: starting a new frontend or web product ("new frontend
- Author
- albkhachikyan ↗
- Repository
- nextjs-frontend-foundation ↗
- Licence
- MIT
- Last repository change
- 04.11.2026
Assessment and security
- Files in this package
- 8
- Scripts
- 1
- HTML comments
- 1
- URLs in SKILL.md
- 1
No signals detected. Repository changed on 04.11.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
- 1 scripts in this package. Review them before installing, as Claude may execute them.
- SKILL.md zawiera komentarze HTML (1). Nie widać ich w podglądzie Markdown, a model je czyta.
Scripts: install.sh
What it does and when to use it
Scaffolds and extends production frontends on the user's standard stack: Next.js (latest stable, App Router), TypeScript strict, pnpm, Tailwind CSS + shadcn/ui, React Query + axios services, zod, Feature-Sliced Design with kebab-case files, Airbnb-based ESLint + Prettier, I/T/E type prefixes and UPPER_CASE constants, SEO metadata and static generation, next/image only, WCAG 2.2 AA with keyboard shortcuts, Vitest + MSW + Playwright with a 90% coverage gate, Husky hooks, GitHub CI and Lighthouse budgets, and a binding AGENTS.md. TRIGGER when: starting a new frontend or web product ("new frontend
Arguments
/frontend-foundation new <name> | feature <description>
Original author description
Scaffolds and extends production frontends on the user's standard stack: Next.js (latest stable, App Router), TypeScript strict, pnpm, Tailwind CSS + shadcn/ui, React Query + axios services, zod, Feature-Sliced Design with kebab-case files, Airbnb-based ESLint + Prettier, I/T/E type prefixes and UPPER_CASE constants, SEO metadata and static generation, next/image only, WCAG 2.2 AA with keyboard shortcuts, Vitest + MSW + Playwright with a 90% coverage gate, Husky hooks, GitHub CI and Lighthouse budgets, and a binding AGENTS.md. TRIGGER when: starting a new frontend or web product ("new frontend
How it works
- Ground rules (both modes)
- Mode new: scaffold a product
- Mode feature: add to an existing project
- Updating the skill itself
- Files
SKILL.md preview
---
name: frontend-foundation
description: >-
Scaffolds and extends production frontends on the user's standard stack: Next.js
(latest stable, App Router), TypeScript strict, pnpm, Tailwind CSS + shadcn/ui,
React Query + axios services, zod, Feature-Sliced Design with kebab-case files,
Airbnb-based ESLint + Prettier, I/T/E type prefixes and UPPER_CASE constants, SEO
metadata and static generation, next/image only, WCAG 2.2 AA with keyboard shortcuts,
Vitest + MSW + Playwright with a 90% coverage gate, Husky hooks, GitHub CI and
Lighthouse budgets, and a binding AGENTS.md.
TRIGGER when: starting a new frontend or web product ("new frontend", "scaffold a
Next app", "set up the client side"), adding a page, feature, entity or widget to a
project that has this skill's AGENTS.md, or the user invokes /frontend-foundation.
Modes: `new <name>` scaffolds a project; `feature <description>` adds code under the
project conventions.
argument-hint: "new <name> | feature <description>"
---
# frontend-foundation
You build frontends that pass strict, automated quality gates. The templates in this skill
are a complete, verified reference app. Copy them, then adapt them. Do not write the
infrastructure from scratch.
Paths below are relative to this skill's directory, `SKILL_DIR`: the folder that holds this
file. The real files sit behind the symlink in `~/.claude/skills/frontend-foundation`.
## Ground rules (both modes)
1. **The conventions are binding.** In a generated project, `AGENTS.md` is the source of
truth. Read it before you write code, and follow it exactly. Every rule names its
enforcing check. If a check fails, fix the code. NEVER add `eslint-disable`, `@ts-ignore`,
`--no-verify` or a lower coverage threshold. The two existing documented disables are the
only exceptions.
2. **Read the installed Next.js docs before you touch routing, caching, metadata, images or
config.** Use `node_modules/next/dist/docs/`. Next changes faster than your training
data. Known breaking points are listed in `references/versions.md`.
3. **Done means every gate passes.** Run `pnpm lint`, `pnpm typecheck`,
`pnpm test:coverage`, `pnpm build:mock`, `pnpm test:e2e` and `pnpm lhci`. Report real
numbers (coverage %, Lighthouse scores, test counts). If a gate fails and you cannot fix
it, say which gate failed and show its output.
4. **Deterministic work goes to the scripts.** Use `scripts/scaffold.sh` and
`scripts/new-slice.sh` instead of hand-writing boilerplate. They are tested, and they
cost nothing in tokens. If `/task-splitter` is running, scaffolding counts as T0 (inline
shell).
5. **Never commit or push unless the user asks.** Never write real secrets. Only
`.env.example` is committed.
## Mode `new`: scaffold a product
1. **Collect inputs.** If the request does not already give them, ask once with
AskUserQuestion:
- product title and a kebab-case package name
- a one-line description
- the main entities (nouns) and the main user actions (verbs)
- the API base URL, or "mock for now"
- the target directory (default `~/Desktop/<name>`)
2. **Scaffold.**
```bash
bash SKILL_DIR/scripts/scaffold.sh <target> --name <kebab> --title "<Title>" --description "<line>"
```
The script:
- checks Node (22.12 or newer) and pnpm
- copies `templates/project`, fills the placeholders and sets `packageManager`
- installs the latest versions, keeping the pins in `references/versions.md`
- adds the shadcn components and fixes their `cn` import
- sets up Husky and installs Playwright Chromium
It refuses to write into a directory that is not empty. Add `--no-browsers` when
Playwright is not needed yet.
3. **Verify the baseline before changing anything.** Run `pnpm lint && pnpm typecheck &&
pnpm test:coverage && pnpm build:mock`. The reference app must be green before you add
anything. If it fails on a fresh scaffold, read `references/versions.md` first: a new
upstream release has usually broken a pin.
4. **Replace the reference domain.** The reference implements `posts` in four slices:
`entities/post`, `features/create-post`, `widgets/post-list`, and
`views/posts` + `views/post-detail`. For each real entity:
- Run `bash SKILL_DIR/scripts/new-slice.sh entities <name> --endpoint /<path>`, then
fill in the types, schema, service, queries, hooks and card. Copy patterns from
`entities/post`.
- Add MSW handlers and fixtures in `mocks/`. Extend `mocks/server.mjs` so `dev:mock`
and E2E keep working without a backend.
- Add features, widgets and views the same way. Wire the routes in `src/app` (thin
files), plus `ROUTES`, `NAV_ITEMS` and the sitemap.
- Delete the post slices only after their replacements pass, and remove their E2E specs
at the same time. Keep the patterns: static generation, prefetch with hydration,
the four UI states and Server Action revalidation.
5. **Fill in the README.**
- Replace every `<!-- FILL ... -->` block with real product content.
- Update the Features list and the env table.
- Keep it plain: no emojis, no marketing, no filler.
- Run `grep -n "FILL\|__APP_" -r README.md src` and confirm it finds nothing.
6. **Run every gate** (ground rule 3) and fix what fails. Then summarise for the user:
- what was built
- the gate results
- how to run the app
- what still needs a real backend
## Mode `feature`: add to an existing project
1. **Read the project's `AGENTS.md`.** If the project has none, it was not built with this
skill: ask whether to adopt the conventions, using `references/` as a guide, before you
change anything.
2. **Place the work in FSD.** Decide which layer and slice the work belongs in, using
`references/architecture-fsd.md`. When two slices of the same layer need each other,
move the shared part down a layer. NEVER cross-import.
3. **Create the skeleton** with `new-slice.sh` (it prints next steps for each layer), or
extend an existing slice.
4. **Implement** with the matching reference:
| Work | Reference |
|---|---|
| data fetching and mutations | `references/data-layer.md` |
| loading, error and empty states; toasts; error boundaries | `references/ui-states-errors.md` |
| new routes, metadata, static generation | `references/seo-rendering.md` |
| interactive UI | `references/accessibility.md` |
| env variables, headers, external origins | `references/security.md` |
5. **Test as you go** (`references/testing.md`):
- unit or component tests next to each new file, with an axe check on UI
- MSW handlers for new endpoints
- a Playwright spec for every new user flow
- new pages added to the a11y spec
6. **Run every gate** (ground rule 3).
## Updating the skill itself
When a gate fails because of an upstream change (a new Next, ESLint or Tailwind release):
1. Fix it in a scaffolded project.
2. Port the fix into `templates/project`.
3. Record the reason in `references/versions.md`.
4. Re-run a fresh `scaffold.sh` and every gate.
The skill repo is https://github.com/albkhachikyan/nextjs-frontend-foundation (local clone: `~/Desktop/claude-skills/nextjs-frontend-foundation`).
## Files
```
scripts/scaffold.sh new project from templates/project (deterministic)
scripts/new-slice.sh FSD slice skeleton that already passes lint, types and tests
templates/project/ the verified reference app (AGENTS.md, configs, src, tests, CI)
references/versions.md version pins, why they exist, and known upstream pitfalls
references/architecture-fsd.md layers, slices, segments, public API, file naming
references/data-layer.md axios client, services, React Query, SSR prefetch, mutations
references/ui-states-errors.md skeletons, pending buttons, error boundaries, toasts, 404
references/seo-rendering.md metadata, static generation and ISR, sitemap, JSON-LD, semantics
references/accessibility.md WCAG 2.2 AA checklist, shortcuts, focus, testing
references/testing.md unit, component, E2E and coverage patterns
references/security.md env split, CSP and headers, supply chain
references/ci-hooks.md hooks, CI jobs, Lighthouse budgets, troubleshooting
```
Files in this package (8)
- .gitignore 1 KB
- CHANGELOG.md 1 KB
- CITATION.cff 1 KB
- LICENSE 1 KB
- README.md 17 KB
- SKILL.md 8 KB
- install.sh 1 KB
- llms.txt 3 KB
Versions
The database has no other skills named frontend-foundation.
Database snapshot: 13.11.2026 · package version e860bf484a6f (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100frontend-implement
Phase 4 (frontend tasks). Implements one PLAN.md task in React + TypeScript + Tailwind + shadcn/ui with the UI-state and edge-case checklist. Use for each unticked frontend task after the plan is approved. - 100react-frontend-patterns
React 19+, TypeScript, Tailwind CSS, shadcn/ui component patterns, accessibility, forms, state management. Use when building or reviewing React components, pages, or frontend architecture. - 100fastreact
Scaffold and build a full-stack web app: FastAPI backend (Python, uv, SQLModel, Postgres, Alembic, JWT + Google OAuth, boto3/S3) + React frontend (Vite, TypeScript, shadcn/ui + Tailwind, TanStack Router/Query/Table, Zod, Axios), wired with Docker Compose. Use this skill whenever… - 100react-ts-vite
React + TypeScript + Vite frontend development. Use whenever building, scaffolding, extending or refactoring a React app in TypeScript: "create a React component", "build a page with React", "add a feature to my React app", "scaffold a new Vite project", "write a custom hook",… - 100react-feature-architecture
Set up, complete, or extend a Vite + React frontend (JavaScript or TypeScript) using a Feature-Based (Hybrid) folder architecture with Tailwind CSS v4, shadcn/ui, Redux Toolkit + RTK Query (injectEndpoints, centralized response adapter, 401 → single-flight token refresh),… - 90frontend-typescript-testing
使用仓库已配置的 React 测试与浏览器测试工具(包括 RTL、MSW、Vitest,以及存在时的 Playwright)设计前端测试。适用于新增或评审组件测试、加载/错误状态测试、集成测试或前端 E2E 测试时。