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/ddr187/cursor-howto/frontend-rulesgit clone --depth 1 https://github.com/DDR187/cursor-howtoWhat 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.01411 |
| Opus 5 | $0.00000 | $0.00705 |
| Sonnet 5 | $0.00000 | $0.00282 |
| Haiku 4.5 | $0.00000 | $0.00141 |
Grade A, and why
frontend-rules scanned grade A with 0 findings 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 2d ago.
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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 321 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Frontend Development Rules
Tech Stack
- React 18+
- TypeScript 5+
- Tailwind CSS
- React Router v6
- React Query / SWR
Component Standards
Component Structure
ComponentName/
├── index.tsx # Component entry
├── ComponentName.tsx # Component implementation
├── styles.css # Style file
├── types.ts # Type definitions
├── hooks.ts # Component Hooks
└── __tests__/ # Test files
└── ComponentName.test.tsx
Component Template
import { FC } from 'react';
interface ComponentNameProps {
title: string;
onClick?: () => void;
}
export const ComponentName: FC<ComponentNameProps> = ({
title,
onClick
}) => {
return (
<div className="component-container" onClick={onClick}>
<h1>{title}</h1>
</div>
);
};
Component Principles
- Single responsibility principle
- Appropriate component granularity
- Clear Props types
- Reasonable default values
State Management
Local State
// Simple state
const [count, setCount] = useState(0);
// Complex state
const [state, dispatch] = useReducer(reducer, initialState);
Global State
- Use Zustand for global state
- Use React Query for server state
- Avoid overusing global state
State Selectors
// Use selectors for performance optimization
const user = useUserStore(state => state.user);
const isLoading = useUserStore(state => state.isLoading);
Style Standards
Tailwind CSS
// Recommended approach
<div className="flex items-center justify-between p-4 bg-white rounded-lg shadow-md">
{/* content */}
</div>
// Extract complex styles as components
const Card = ({ children }) => (
<div className="p-4 bg-white rounded-lg shadow-md">
{children}
</div>
);
CSS Variables
:root {
--color-primary: #3b82f6;
--color-secondary: #64748b;
--spacing-md: 1rem;
}
Responsive Design
// Mobile-first principle
<div className="w-full md:w-1/2 lg:w-1/3">
{/* content */}
</div>
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.
- 2d ago First seen · 321 lines · 0 tokens per session scan A 8cc983d0657b
frontend-rules is a cursor rule published in the GitHub repository DDR187/cursor-howto (2 stars, last pushed 5mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,411 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other cursor rules, from other repositories
cursorrules-cursor-ai-nextjs-14-tailwind-seo-setup
Cursor rules for Next.js development with Tailwind CSS and SEO optimization.
cursor-ai-react-typescript-shadcn-ui-cursorrules-p
Cursor rules for Cursor AI development with React, TypeScript, and shadcn/ui integration.
general
Wonder Blocks design system conventions, component patterns, and coding standards.
frontend-best-practices
Standards for modern Frontend development using Next.js 16 (App Router), React 19, Tailwind CSS v4, and Shadcn/UI. Apply when working on apps/web or packages/ui.
react
Cursor rule "react" from iloveitaly/llm-ide-rules, covering react, mock data, react hook form and styling.
01-code-style
Cursor rule "01-code-style" from refly-ai/refly, covering code style guidelines, typescript/javascript style, react performance optimization, error handling and css guidelines.