frontend-web

Frontend development rules for Kaneo's React web application. They cover components, typed properties, naming, destructuring, and conditional rendering, using TanStack Router and TanStack Query for navigation and data access.

In plain words
What is it for?
Use them when building or reviewing React components, pages, routing, data fetching, and typed user-interface code.
Why use it?
They help developers add interface code that fits Kaneo's existing structure and TypeScript practices.

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/usekaneo/kaneo/frontend-web
Clone the repo
git clone --depth 1 https://github.com/usekaneo/kaneo

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,738 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 $0.00000 $0.01738
Opus 5 $0.00000 $0.00869
Sonnet 5 $0.00000 $0.00348
Haiku 4.5 $0.00000 $0.00174

Measured yesterday against content hash 9a9c157e80a2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

frontend-web 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 yesterday.

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-web.mdc · 302 lines

How it starts

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

Frontend Web Guidelines

The Kaneo web application is built with React, TanStack Router, TanStack Query, and Vite. This document outlines conventions and patterns for frontend development.

Framework: React

Component Structure

Components are organized in apps/web/src/components/:

// apps/web/src/components/task/task-card.tsx
import { Task } from "@/types/task";

type TaskCardProps = {
  task: Task;
  onUpdate?: (task: Task) => void;
};

export function TaskCard({ task, onUpdate }: TaskCardProps) {
  return (
    <div className="p-4 border rounded-lg">
      <h3>{task.title}</h3>
      {/* ... */}
    </div>
  );
}

Best Practices

  1. TypeScript: Always type props and component return types
  2. Component naming: Use PascalCase for component files and exports
  3. Props destructuring: Destructure props in function parameters
  4. Conditional rendering: Use ternary or logical operators clearly
// Good: Typed component with clear structure
type ButtonProps = {
  variant?: "primary" | "secondary";
  children: React.ReactNode;
  onClick?: () => void;
};

export function Button({ variant = "primary", children, onClick }: ButtonProps) {
  return (
    <button
      className={cn("px-4 py-2", variant === "primary" && "bg-blue-500")}
      onClick={onClick}
    >
      {children}
    </button>
  );
}

// Bad: Untyped, unclear structure
export function Button(props: any) {
  return <button onClick={props.onClick}>{props.children}</button>;
}

Routing: TanStack Router

File-Based Routing

Routes are defined using file-based routing in apps/web/src/routes/:

// apps/web/src/routes/tasks/$taskId.tsx
import { createFileRoute } from "@tanstack/react-router";
import { useTask } from "@/hooks/queries/task/use-task";

export const Route = createFileRoute("/tasks/$taskId")({
  component: TaskPage,
});

function TaskPage() {
  const { taskId } = Route.useParams();
  const { data: task } = useTask(taskId);

  if (!task) return <div>Loading...</div>;

  return <div>{task.title}</div>;
}

Read the full file on GitHub · 302 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. yesterday First seen · 302 lines · 0 tokens per session scan A 9a9c157e80a2

Subscribe to this mod's changes

frontend-web is a cursor rule published in the GitHub repository usekaneo/kaneo (8,786 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,738 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.