react

react is a cursor rule for Cursor from Thanhdeptr/K8s_AI_Assistant_MCP. It costs 804 tokens per session, scanned A, original, MIT.

A set of coding rules for React and Vite projects. React is a JavaScript user-interface library, while Vite is a tool for developing and building those projects.

In plain words
What is it for?
Use it when adding React features, organizing components and services, connecting Supabase, or applying the project’s Tailwind CSS and file-naming conventions.
Why use it?
It gives contributors consistent choices for folders, naming, routing, API code, and styling.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when adding React features, organizing components and services, connecting Supabase, or applying the project’s Tailwind CSS and file-naming conventions.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/thanhdeptr/k8s_ai_assistant_mcp/react
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.

Clone the repo
git clone --depth 1 https://github.com/Thanhdeptr/K8s_AI_Assistant_MCP

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 react

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

Your own site · 80×15
<a href="https://agentmods.dev/rules/thanhdeptr/k8s_ai_assistant_mcp/react"><img src="https://agentmods.dev/badge/rules/thanhdeptr/k8s_ai_assistant_mcp/react.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 804 This file is loaded in full into every session.
When invoked 804 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.00804 $0.00804
Opus 5.5 $0.00322 $0.00322
Sonnet 5.5 $0.00161 $0.00161
Haiku 4.5 $0.00080 $0.00080

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

Security

Grade A, and why

react 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 1mo 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

mcp-server-kubernetes/.cursor/rules/react.mdc · 157 lines

What it actually says

React + Vite Project Standards

Overview

  • Framework: React + Vite
  • Routing: React Router DOM
  • API Layer: Supabase JavaScript Client (docs)
  • Styling: Tailwind CSS as primary, CSS Modules only for custom overrides

Directory Structure

src/ ├── components/ │ ├── layout/ # Shared layout components │ ├── pages/ # Feature-based pages │ │ ├── home/ # Home page │ │ ├── user/ # User management │ │ └── [feature]/ # Additional modules ├── services/ # API services for each module │ ├── user.ts # User API services │ └── [feature].ts # Feature-specific APIs ├── assets/ # Static assets (images, fonts, icons) ├── styles/ # Global and scoped CSS │ ├── globals.css # Global Tailwind config │ ├── [page].module.css # Page-specific custom styles ├── App.tsx # Root App component ├── main.tsx # Vite entry point └── env.d.ts # Type definitions for env variables


Naming Conventions

  • Components: PascalCase → UserDetail.tsx
  • Service files: camelCase → userApi.ts
  • CSS Modules: kebab-case → user-detail.module.css
  • Directories: lowercase → user, product
  • Hooks: start with use → useUserData.ts

Feature Implementation Workflow

Add a New Module

  1. Create a new folder under src/components/pages/[feature]/
  2. Add API service in src/services/[feature].ts
  3. Add custom CSS in src/styles/[feature].module.css (if needed)

Add a New Page to Existing Module

  1. Add component file: src/components/pages/[module]/[page].tsx
  2. Add optional CSS: src/styles/[module]-[page].module.css
  3. Add route in App.tsx

Add Shared Component

  • Place in src/components/common/ with reusable logic

Add New API

  • Extend the existing service file for the module
  • Return typed responses and handle errors gracefully

Styling Guidelines

  1. Tailwind First: Use utility classes for 90% of styling
  2. Scoped Styles: Use CSS Modules only when Tailwind cannot cover edge cases
  3. Avoid Global Overrides: Keep globals.css minimal
  4. Responsive Design: Mobile-first using Tailwind breakpoints

Page Template

`tsx import { useState, useEffect } from 'react' import { getUserData } from '@/services/user'

export function UserListPage() { const [users, setUsers] = useState([]) const [isLoading, setIsLoading] = useState(true)

useEffect(() => { fetchData() }, [])

async function fetchData() { try { const data = await getUserData() setUsers(data) } catch (error) { console.error('Failed to fetch users:', error) } finally { setIsLoading(false) } }

if (isLoading) return Loading...

return (

User List

{users.map(user => ( {user.name}

))}

) } `


Service API Example

`ts import { supabase } from '@/lib/supabase' import type { User } from '@/types/user'

export async function getUserData(): Promise { const { data, error } = await supabase.from('users').select('*') if (error) throw new Error(Supabase Error: ${error.message}) return data || [] } `


Database Interaction

  • Use supabase-js client strictly per official docs
  • All services return typed results and handle errors upfront

Tools Used

  • Supabase: For database queries
  • Playwright: For browser automation and previews
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. 1mo ago First seen · 157 lines · 804 tokens per session scan A f929004cfcfe

Subscribe to this mod's changes

react is a cursor rule published in the GitHub repository Thanhdeptr/K8s_AI_Assistant_MCP (0 stars, last pushed 1y ago), licensed MIT. It adds 804 tokens to every session, about $0.0032 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-31.