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.
git clone --depth 1 https://github.com/DDR187/cursor-howtoWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/ddr187/cursor-howto/frontend-rules)<a href="https://agentmods.dev/rules/ddr187/cursor-howto/frontend-rules"><img src="https://agentmods.dev/badge/rules/ddr187/cursor-howto/frontend-rules/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/ddr187/cursor-howto/frontend-rules"><img src="https://agentmods.dev/badge/rules/ddr187/cursor-howto/frontend-rules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What 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.1 | $0.00000 | $0.01411 |
| Opus 5.5 | $0.00000 | $0.00564 |
| Sonnet 5.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 2mo 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.
- 2mo 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 7mo 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
nextjs-react-tailwind-cursorrules-prompt-file
Cursor rules for Next.js development with React and Tailwind CSS integration.
chakra-ui-best-practices
A set of rules for building React interfaces with Chakra UI, a component library for styled and accessible user interfaces. It covers themes, responsive layouts, accessibility, performance, and reusable components.
react-components-creation-cursorrules-prompt-file
Cursor rules for React component creation and development.
react-chakra-ui-cursorrules-prompt-file
Cursor rules for React development with Chakra UI integration.
react-styled-components-cursorrules-prompt-file
Cursor rules for React development with Styled Components integration.
react-chakra-ui---folder-structure
A standard folder layout for React and Chakra UI projects, including separate locations for components, pages, themes, hooks, utilities, and assets. It also defines how Chakra UI theme files are grouped.