frontend-scaffolding
Skill1 starsChanged 10 months agoMITView on GitHub
Scaffold a React frontend with Tailwind CSS, React Router, React Query, and standard project structure. Use when asked to "create a frontend", "scaffold webapp", "set up React app", or "initialize frontend structure".
- Reads credentials
- Installs packages
In this repository14 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skill-creatorSkill
- backend-ai-agentSkill
- backend-ai-toolsSkill
- backend-auth-clerkSkill
- backend-compressionSkill
- backend-metricsSkill
- backend-model-creationSkill
- backend-route-creationSkill
- backend-scaffoldingSkill
- backend-websocketSkill
- frontend-auth-clerkSkill
- frontend-hooks-creationSkill
- new-project-scaffoldingSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
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
- Very specific: line 134
Check API connection: Ensure backend is running on http://localhost:3333
- Very specific: line 140
API layer separation: Keep API functions in api/, hooks in hooks/
- Distinctive: line 143
Type everything: Use TypeScript for all props and functions
- Distinctive: line 145
Handle loading/error states: Always show appropriate UI
- Distinctive: line 147
Consistent query keys: Use predictable patterns for cache invalidation
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
Frontend Scaffolding
Scaffold a React frontend with Tailwind CSS v4, React Router v6, React Query (TanStack Query), Axios API client, and established patterns.
Structure Overview
apps/webapp/src/
├── app/
│ └── app.tsx # Main app component with routes
├── api/
│ ├── client.ts # Axios client configuration
│ └── {resource}.ts # Resource-specific API functions
├── components/
│ ├── common/ # Shared components (Button, Card, etc.)
│ ├── layouts/ # Layout components
│ └── nav/ # Navigation components
├── pages/
│ └── Home.tsx # Page components
├── hooks/
│ └── use{Resource}.ts # React Query hooks
├── lib/
│ └── queryClient.ts # React Query client
├── styles.css # Global styles and Tailwind theme
└── main.tsx # Application entry pointInstallation
npm install react react-dom react-router-dom axios @tanstack/react-query
npm install -D tailwindcss @tailwindcss/viteImplementation Steps
1. Main Entry Point (main.tsx)
import { StrictMode } from 'react';
import * as ReactDOM from 'react-dom/client';
import { BrowserRouter } from 'react-router-dom';
import { QueryClientProvider } from '@tanstack/react-query';
import App from './app/app';
import { queryClient } from './lib/queryClient';
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
root.render(
<StrictMode>
<QueryClientProvider client={queryClient}>
<BrowserRouter>
<App />
</BrowserRouter>
</QueryClientProvider>
</StrictMode>
);2. React Query Client (lib/queryClient.ts)
import { QueryClient } from '@tanstack/react-query';
export const queryClient = new QueryClient({
defaultOptions: {
queries: {
staleTime: 60 * 1000, // 1 minute
retry: 1,
},
},
});3. API Client (api/client.ts)
import axios from 'axios';
const API_BASE_URL = process.env.NX_API_URL || 'http://localhost:3333';
export const apiClient = axios.create({
baseURL: API_BASE_URL,
headers: { 'Content-Type': 'application/json' },
});
apiClient.interceptors.response.use(
(response) => response,
(error) => {
const message = error.response?.data?.message || error.message || 'An error occurred';
console.error('API Error:', message);
return Promise.reject(error);
}
);4. App Component (app/app.tsx)
import { Route, Routes } from 'react-router-dom';
import Home from '../pages/Home';
export function App() {
return (
<Routes>
<Route path="/" element={<Home />} />
</Routes>
);
}
export default App;5. Global Styles, Components, and Hooks
See references/examples.md for complete code examples including:
- Tailwind CSS v4 theme configuration with design tokens
- Navigation components (NavButton, HeaderNav)
- Common components (Button, Card, LoadingSpinner)
- Example API module and React Query hooks
- Page with data fetching pattern
- Form with mutation pattern
Checklist
- Install dependencies:
npm install - Start frontend:
just serve-webapp - Test home page: Open
http://localhost:4200 - Check API connection: Ensure backend is running on
http://localhost:3333
Best Practices
- Use Tailwind CSS: Style with utility classes, no component libraries
- Design tokens in CSS variables: Define colors in
:root, extend with@theme - API layer separation: Keep API functions in
api/, hooks inhooks/ - React Query for server state: Wrap API calls with
useQueryanduseMutation - Keep pages thin: Extract route params, render feature components
- Type everything: Use TypeScript for all props and functions
- Import types from @{project}/types: Share types with backend
- Handle loading/error states: Always show appropriate UI
- Use
classNameprop: Allow style overrides on components - Consistent query keys: Use predictable patterns for cache invalidation
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.

