frontend-rules

frontend-rules is a cursor rule for Cursor from airweave-ai/airweave. It costs 0 tokens per session (3,221 once invoked), scanned A, original, MIT.

A set of frontend rules for Airweave's web application, built with React and TypeScript. It describes the project layout, user interface components, data loading, authentication, and live sync updates.

In plain words
What is it for?
Use it when adding pages, components, API calls, sign-in behavior, application state, or real-time synchronisation progress to the frontend.
Why use it?
It helps developers place code consistently and follow the application's existing patterns when changing the interface.

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/airweave-ai/airweave/frontend-rules
Clone the repo
git clone --depth 1 https://github.com/airweave-ai/airweave

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 frontend-rules

README.md
[![agentmods](https://agentmods.dev/badge/rules/airweave-ai/airweave/frontend-rules.svg)](https://agentmods.dev/rules/airweave-ai/airweave/frontend-rules)
Your own site
<a href="https://agentmods.dev/rules/airweave-ai/airweave/frontend-rules"><img src="https://agentmods.dev/badge/rules/airweave-ai/airweave/frontend-rules.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 3,221 The whole file, excluding the scripts and references it only reads on demand.
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.1 $0.00000 $0.03221
Opus 5 $0.00000 $0.01611
Sonnet 5 $0.00000 $0.00644
Haiku 4.5 $0.00000 $0.00322

Measured 5d ago against content hash db0e64e4e373, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

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 5d 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.

.cursor/rules/frontend-rules.mdc · 395 lines

How it starts

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

Airweave Frontend Architecture & Guidelines

Tech Stack & Core Technologies

  • React 18 with TypeScript for type-safe component development
  • Vite for fast development builds and HMR
  • TailwindCSS with ShadCN UI components for consistent design
  • Radix UI primitives with Lucide icons for accessible components
  • React Router for client-side routing with file-based organization
  • Zustand for state management with persistence
  • React Query for server state and data fetching
  • Auth0 for authentication with custom context wrapper
  • SSE (Server-Sent Events) for real-time sync progress

Project Structure

frontend/src/
├── components/         # Reusable UI components
│   ├── ui/            # ShadCN UI primitives
│   ├── shared/        # Shared business components
│   └── [feature]/     # Feature-specific components
├── pages/             # Route-level components
├── lib/               # Core utilities and providers
│   ├── api.ts         # API client with auth integration
│   ├── stores/        # Zustand state stores
│   └── auth-context.tsx # Auth provider
├── hooks/             # Custom React hooks
├── services/          # Business logic services
├── config/            # Configuration files
├── constants/         # App constants
└── styles/            # Global CSS styles
    └── toast.css      # Custom toast styling

API Layer (lib/api.ts)

The API client is the central hub for all backend communication with sophisticated features:

Core Features

  • Token Management: Automatic token injection via provider pattern
  • Request Queuing: Queues requests while auth initializes
  • Organization Context: Auto-injects X-Organization-ID header
  • Session Tracking: Auto-injects X-Airweave-Session-ID header with PostHog session ID for session replay linking
  • Auto-Retry: Refreshes token on 401/403 and retries
  • Organization Auto-Switching: Detects resource org mismatches and switches context
  • Type-Safe Responses: Returns typed Response objects

Read the full file on GitHub · 395 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. 5d ago First seen · 395 lines · 3,221 tokens per session scan A db0e64e4e373

Subscribe to this mod's changes

frontend-rules is a cursor rule published in the GitHub repository airweave-ai/airweave (6,566 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,221 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-30.