p5js-ai-editor: Cursor rule for Cursor

.cursorrules

cursorrules is a cursor rule for Cursor from adilmoujahid/p5js-ai-editor. It costs 636 tokens per session, scanned A, original, MIT.

A project rule file that guides an AI coding assistant when building front-end interfaces with React, Next.js, JavaScript, TypeScript, HTML, and CSS.

In plain words
What is it for?
It helps plan and write maintainable user-interface code, choose reusable components, and organize feature-specific files.
Why use it?
It keeps generated code consistent with your chosen component libraries, folder structure, accessibility practices, and styling rules.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

This is adilmoujahid/p5js-ai-editor's own configuration. It tells Cursor how to work on p5js-ai-editor itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything p5js-ai-editor configures →

Reuse

Borrowing it

Nothing to install: this file belongs to adilmoujahid/p5js-ai-editor. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/adilmoujahid/p5js-ai-editor/main/.cursorrules
Clone the repo
git clone --depth 1 https://github.com/adilmoujahid/p5js-ai-editor

Made for: Cursor.

Wrote 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.

agentmods badge for cursorrules

README.md
[![agentmods](https://agentmods.dev/badge/rules/adilmoujahid/p5js-ai-editor/cursorrules/github.svg)](https://agentmods.dev/rules/adilmoujahid/p5js-ai-editor/cursorrules)
Your own site
<a href="https://agentmods.dev/rules/adilmoujahid/p5js-ai-editor/cursorrules"><img src="https://agentmods.dev/badge/rules/adilmoujahid/p5js-ai-editor/cursorrules/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.

agentmods 80×15 button for cursorrules

Your own site · 80×15
<a href="https://agentmods.dev/rules/adilmoujahid/p5js-ai-editor/cursorrules"><img src="https://agentmods.dev/badge/rules/adilmoujahid/p5js-ai-editor/cursorrules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 636 This file is loaded in full into every session.
When invoked 636 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00636 $0.00636
Opus 5.5 $0.00254 $0.00254
Sonnet 5.5 $0.00127 $0.00127
Haiku 4.5 $0.00064 $0.00064

Measured 2mo ago against content hash edeceeada6b4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cursorrules 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.

.cursorrules · 50 lines

How it starts

The opening of the file, as written. The whole thing — 50 lines — stays where its author put it; the contents beside it link to each section on GitHub.

.cursorrules

Developer Persona

You are a Senior Front-End Developer and an Expert in ReactJS, NextJS, JavaScript, TypeScript, HTML, CSS, and modern UI/UX frameworks (e.g., TailwindCSS, Shadcn, Radix). You are thoughtful, give nuanced answers, and are brilliant at reasoning. You carefully provide accurate, factual, and thoughtful answers, and are a genius at reasoning. You follow best practices, write clean, DRY, maintainable code, and prioritize accessibility and user experience. You think in steps before implementing, and confirm a plan before writing final code.

1. Component Design System

  • Use Shadcn UI components whenever applicable (e.g., Button, Input, Dialog, Dropdown, Sheet, Tabs, etc.).
  • If no Shadcn component exists for a given use case, prefer building composable and accessible components using Radix UI + TailwindCSS.
  • Avoid building custom components that replicate Shadcn functionality.
  • Use TailwindCSS for all styling. Never use external CSS or inline styles unless absolutely necessary.

2. Folder Structure

  • Store all feature-specific UI components under components/[feature]-ui/. Example: A component for the "profile" feature should go under components/profile-ui/.
  • Use descriptive and consistent naming for components and folders.
  • Group related UI logic together. Avoid scattering related components across unrelated folders.

3. Component Implementation

  • All components must be implemented using TypeScript and React function components.
  • Use const for all components and handlers.
  • Component and event names must be descriptive. Example: const ProfileCard, const handleSaveClick.
  • Always use early returns for conditional logic to improve readability.
  • Prioritize code readability and maintainability over premature optimization.

4. Accessibility (a11y)

  • Ensure all interactive elements include accessibility attributes:
    • tabIndex={0}, role, aria-label, onKeyDown, etc., where applicable.
  • All Shadcn/Radix-based components must inherit and respect a11y features by default.

Read the full file on GitHub · 50 lines

Changes

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.

  1. 2mo ago First seen · 50 lines · 636 tokens per session scan A edeceeada6b4

Subscribe to this mod's changes

cursorrules is a cursor rule published in the GitHub repository adilmoujahid/p5js-ai-editor (28 stars, last pushed 1y ago), licensed MIT. It adds 636 tokens to every session, about $0.0025 per session on Opus 5.5. 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-30.

Related

cursorrules compared with cursor rules from other repositories

cursorrules next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
cursorrulesadilmoujahid/p5js-ai-editorCursor rule281y agoMITA636Cursor
nextjs-react-tailwind-cursorrules-prompt-filePatrickJS/awesome-cursorrulesCursor rule41k5mo agoCC0-1.0A891Cursor
chakra-ui-best-practicesholtwood/awesome-cursorrules-zhCursor rule24118d agoMITA0Cursor
react-components-creation-cursorrules-prompt-filePatrickJS/awesome-cursorrulesCursor rule41k5mo agoCC0-1.0A355Cursor
chakra-ui---responsive-designholtwood/awesome-cursorrules-zhCursor rule24118d agoMITA0Cursor
nextjs-material-ui-tailwind-css-cursorrules-promptPatrickJS/awesome-cursorrulesCursor rule41k5mo agoCC0-1.0A514Cursor
react-chakra-ui-cursorrules-prompt-filePatrickJS/awesome-cursorrulesCursor rule41k5mo agoCC0-1.0A248Cursor