cursorrules

Project rules for AnimAI, an MCP server and command-line tool that inserts prepared 3D and motion components into existing code. An MCP server is a program that gives an AI agent extra tools; an abstract syntax tree is a structured representation of source code.

In plain words
What is it for?
Building or changing AnimAI integrations for Next.js, React Three Fiber, GSAP, and Tailwind CSS, with deterministic JSON output and structured code edits.
Why use it?
The rules guide the agent toward tested templates and safer code edits instead of creating complex graphics code from scratch or modifying files with fragile text replacement.

Cursor rule for Cursor

Install

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.

agentmods
npx agentmods add rules/hajjy22/animai/cursorrules
Clone the repo
git clone --depth 1 https://github.com/Hajjy22/animai

Made for: Cursor.

Per session 627 This file is loaded in full into every session.
When invoked 627 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.00627 $0.00627
Opus 5 $0.00313 $0.00313
Sonnet 5 $0.00125 $0.00125
Haiku 4.5 $0.00063 $0.00063

Measured today against content hash 987641ef151c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 today.

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 · 32 lines

How it starts

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

Animon Project - Agentic Engineering Specification

Project Identity

You are building AnimAI, an MCP (Model Context Protocol) server and CLI tool that injects pre-vetted 3D/motion components into existing codebases using AST (Abstract Syntax Tree) manipulation. Do NOT generate mathematical 3D loops or GLSL shaders from scratch; always retrieve from the static template cache.

Tech Stack

  • Runtime: Node.js (TypeScript)
  • AST Engine: @ast-grep/napi
  • MCP SDK: @modelcontextprotocol/sdk (using stdio transport)
  • Output Targets: Next.js 14/15, React Three Fiber (R3F), GSAP, Tailwind CSS v4

1. MCP Server Constraints

  • Use the stdio transport to act as a local subprocess for IDEs.
  • Keep tool definition schemas completely flat. Do not use deeply nested parameter objects, as this increases agent timeout latency [cite: 4].
  • Tool outputs must be deterministic JSON containing the dependency list, the integration instructions, and the target code.

2. AST Manipulation Rules (CRITICAL)

  • NEVER use Regular Expressions (Regex) or string .replace() to modify user code. It is brittle and corrupts files.
  • ALWAYS use @ast-grep/napi with the "Find & Patch" methodology to safely traverse and inject imports, variables, and JSX nodes [cite: 5, 6].

3. WebGL & React Three Fiber Constraints

  • VRAM Memory Leaks: R3F does not auto-dispose GPU resources [cite: 7]. Every generated 3D component MUST include a manual useEffect cleanup function that traverses the scene and calls .dispose() on all geometries, materials, and textures [cite: 8, 9].
  • Canvas Sizing: The <Canvas> wrapper must always be injected into a parent container with explicit CSS dimensions (e.g., h-screen w-full relative).
  • Inline Assets: For small 3D primitives (.glb), encode them as Base64 data URIs inline to avoid CORS blocking on local dev servers.

4. Next.js 14/15 Constraints

  • SSR Safety: WebGL crashes Node.js servers [cite: 10]. Any file utilizing Three.js, R3F, or window APIs MUST have the "use client" directive at the top [cite: 11].
  • Hydration: When injecting heavy canvas elements into a layout, wrap the import with next/dynamic and set { ssr: false } to prevent hydration mismatches [cite: 12].

Read the full file on GitHub · 32 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. today First seen · 32 lines · 627 tokens per session scan A 987641ef151c

Subscribe to this mod's changes

cursorrules is a cursor rule published in the GitHub repository Hajjy22/animai (0 stars, last pushed 1mo ago), licensed MIT. It adds 627 tokens to every session, about $0.0031 per session on Opus 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-31.