agentleFS
vndeevndee/engineering-skills/.claude/skills/react-scaffold/SKILL.md

react-scaffold

Skill3 starsChanged 8 months agoMITView on GitHub

Use when starting a new React/Vite/Bun frontend with testing-library, feature-based structure, and typed API client

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    REQUIRED: Update CLAUDE.md with stack, commands, directories, and conventions (claude-md)

    line 130
  2. Very specific:

    Use react-feature for adding features

    line 132

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

React Project Scaffold

Overview

Bootstrap a React/Vite/Bun frontend with feature-based architecture, Vitest + testing-library, typed API client, and production Docker build.

Core principle: Feature modules with co-located tests. Type-safe API layer from day one.

Setup

bun create vite project-name --template react-ts
cd project-name
bun add @tanstack/react-query axios
bun add -d vitest @testing-library/react @testing-library/jest-dom @testing-library/user-event happy-dom msw

Directory Structure

src/
  features/                  # Feature modules
    auth/
      components/
      hooks/
      api/
      types/
      index.ts
  shared/
    components/              # Shared UI components
    hooks/                   # Shared hooks
    utils/                   # Utilities
  api/
    client.ts                # Axios instance with interceptors
    types.ts                 # Shared API types (envelope, pagination)
  mocks/
    handlers.ts              # MSW handlers
    server.ts                # MSW server setup
  App.tsx
  main.tsx
  router.tsx

Key Configurations

vite.config.ts

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

export default defineConfig({
  plugins: [react()],
  server: {
    proxy: {
      '/api': 'http://localhost:8000',
    },
  },
  test: {
    globals: true,
    environment: 'happy-dom',
    setupFiles: './src/test-setup.ts',
  },
})

src/test-setup.ts

import '@testing-library/jest-dom'
import { server } from './mocks/server'

beforeAll(() => server.listen())
afterEach(() => server.resetHandlers())
afterAll(() => server.close())

Typed API Client

// src/api/client.ts
import axios from 'axios'

export const api = axios.create({ baseURL: '/api/v1' })

export interface ApiResponse<T> {
  data: T
  meta?: { total?: number; page?: number }
}

export interface ApiError {
  error: { code: string; message: string }
}

Dockerfile (Multi-stage)

FROM oven/bun:1 AS build
WORKDIR /app
COPY package.json bun.lock ./
RUN bun install --frozen-lockfile
COPY . .
RUN bun run build

FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80

Initial Test (TDD)

REQUIRED: Invoke superpowers:test-driven-development for App.test.tsx.

import { render, screen } from '@testing-library/react'
import App from './App'

it('renders app', () => {
  render(<App />)
  expect(screen.getByRole('main')).toBeInTheDocument()
})

Chains

  • REQUIRED: Update CLAUDE.md with stack, commands, directories, and conventions (claude-md)
  • Pairs with go-scaffold or py-scaffold for full-stack
  • Use react-feature for adding features

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.