ai-project-template / frontend
CLAUDE.md9 starsChanged 16 months agoMITView on GitHub
- Reads credentials
In this repository2 other files it gives its agents.
- backend/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
The file
We split this CLAUDE.md into the rules it gives an agent
5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 144
Use Server Components by default
- Distinctive: line 145
Add 'use client' only when needed
- Distinctive: line 146
Keep components small and focused
- Distinctive: line 148
Follow Tailwind CSS conventions
- Distinctive: line 149
Test critical user flows with Playwright
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md 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 AI Instructions
🏗️ Frontend Architecture
- Framework: Next.js 15 with App Router
- Language: TypeScript (strict mode)
- Styling: Tailwind CSS + shadcn/ui
- State: Zustand for global state
- API Client: Native fetch with typed wrappers
📁 Project Structure
src/
├── app/ # Next.js App Router
│ ├── layout.tsx # Root layout
│ ├── page.tsx # Home page
│ └── (auth)/ # Auth group
├── components/
│ ├── ui/ # shadcn/ui components
│ └── features/ # Feature components
├── lib/
│ ├── api.ts # API client
│ └── utils.ts # Utilities
└── types/ # TypeScript types📝 Component Patterns
Server Components (default)
// app/products/page.tsx
export default async function ProductsPage() {
const products = await getProducts()
return (
<div>
{products.map(product => (
<ProductCard key={product.id} product={product} />
))}
</div>
)
}Client Components
'use client'
import { useState } from 'react'
export function Counter() {
const [count, setCount] = useState(0)
return (
<button onClick={() => setCount(count + 1)}>
Count: {count}
</button>
)
}🎨 UI Components
Adding shadcn/ui components
npx shadcn@latest add button
npx shadcn@latest add form
npx shadcn@latest add dialogComponent usage
import { Button } from '@/components/ui/button'
import { Dialog } from '@/components/ui/dialog'
export function MyComponent() {
return (
<Button variant="outline" size="sm">
Click me
</Button>
)
}🔧 Common Tasks
Create new page
# Create directory and page
mkdir -p src/app/products
touch src/app/products/page.tsxAPI Integration
// lib/api.ts
const API_BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8000/api'
export async function getProducts() {
const res = await fetch(`${API_BASE}/products/`)
if (!res.ok) throw new Error('Failed to fetch')
return res.json()
}State Management
// stores/auth.ts
import { create } from 'zustand'
interface AuthState {
user: User | null
login: (user: User) => void
logout: () => void
}
export const useAuthStore = create<AuthState>((set) => ({
user: null,
login: (user) => set({ user }),
logout: () => set({ user: null }),
}))🧪 Testing
# Run E2E tests
npm run test:e2e
# Run with UI
npm run test:e2e:ui🛡️ Best Practices
- Use Server Components by default
- Add 'use client' only when needed
- Keep components small and focused
- Use TypeScript strictly
- Follow Tailwind CSS conventions
- Test critical user flows with Playwright
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.

