Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/luxvil/ai-coding-rules/60-stack-frontendgit clone --depth 1 https://github.com/Luxvil/ai-coding-rulesWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.00803 |
| Opus 5 | $0.00000 | $0.00402 |
| Sonnet 5 | $0.00000 | $0.00161 |
| Haiku 4.5 | $0.00000 | $0.00080 |
Grade A, and why
60-stack-frontend scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
fetch(url, { next: { revalidate: 60 } }); This is a copy
100% identical to 60-stack-frontend — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 117 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Frontend (TypeScript/React)
Type Safety
- Ban
any— useunknownwith type guards if needed. - Prefer
interfacefor object shapes,typefor unions/intersections. - Use strict TypeScript configuration.
React Style
- Functional components + hooks only — no class components.
- Avoid unnecessary state; prefer reducer/context for complex state.
- Handle all UI states: loading, empty, error, success.
Exports
- Prefer named exports over default exports.
- One component per file for main components.
Performance
- Avoid unnecessary re-renders; memoize only when justified.
- Use dynamic imports for heavy components.
- Prevent N+1 fetches in UI loops.
Accessibility (A11y)
- Buttons must be
<button>elements. - Inputs must have associated labels.
- Use
aria-labelfor icon-only buttons. - Ensure keyboard navigation for menus/dialogs.
Next.js 15 App Router (Optional)
Apply when working with Next.js 15+ App Router architecture.
Component Strategy
| Type | When to Use | Directive |
|---|---|---|
| Server Component | Default for all components | None needed |
| Client Component | Event handlers, hooks, browser APIs | 'use client' at top |
Rule: Start with Server Components. Add 'use client' only when you need:
useState,useEffect, or other hooks- Event handlers (
onClick,onChange, etc.) - Browser-only APIs (
window,localStorage, etc.)
Data Fetching Patterns
Parallel Fetching (Avoid Waterfalls)
// ❌ BAD: Sequential (waterfall) — slow
const user = await getUser();
const posts = await getPosts();
const comments = await getComments();
// ✅ GOOD: Parallel — fast
const [user, posts, comments] = await Promise.all([
getUser(),
getPosts(),
getComments()
]);
Server Actions for Mutations
// ✅ Preferred: Server Action
async function createPost(formData: FormData) {
'use server';
const title = formData.get('title');
// Validation, DB insert, etc.
revalidatePath('/posts');
}
// Usage in component
<form action={createPost}>
<input name="title" />
<button type="submit">Create</button>
</form>
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 117 lines · 0 tokens per session scan A 6fbbd8e43d59
60-stack-frontend is a cursor rule published in the GitHub repository Luxvil/ai-coding-rules (3 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 803 tokens. A static security scan graded it A with 1 finding (makes network calls). It is 100% identical to 60-stack-frontend, differing in 0 lines, and is treated as a copy.
Other cursor rules, from other repositories
exam-answer-format
Guidelines for writing exam-style answers in a practical, conversational style with definitions first followed by real-world examples.
lecture-reference-linking
Guidelines for including course materials lists and inline references when writing exam answers or documentation that references course materials.
short-answer-version
Guidelines for creating short/concise versions of detailed answers.
documentation-formatting
Guidelines for formatting markdown documentation to improve readability and scannability.
mermaid-diagrams
Guidelines for adding Mermaid diagrams to exam answers and documentation with automatic SVG generation support.
human-writing-style
Rules for writing naturally and authentically - avoid robotic AI tone in documentation, code comments, error messages, and explanations. Write like a human colleague, not a customer service bot.