general

A project-wide set of coding rules for a reusable data-table library built with TypeScript, React, and Next.js.

In plain words
What is it for?
Use it when adding or changing library code, types, styles, tests, exports, or build configuration.
Why use it?
It keeps code, styling, testing, building, and type definitions consistent across the project.

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/ninsau/nextjs-reusable-table/general
Clone the repo
git clone --depth 1 https://github.com/ninsau/nextjs-reusable-table

Made for: Cursor.

Per session 582 This file is loaded in full into every session.
When invoked 582 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.00582 $0.00582
Opus 5 $0.00291 $0.00291
Sonnet 5 $0.00116 $0.00116
Haiku 4.5 $0.00058 $0.00058

Measured 2d ago against content hash 8708c6e3bcd6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

general 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 2d 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/general.mdc · 53 lines

How it starts

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

nextjs-reusable-table — General Conventions

Tech Stack

  • Language: TypeScript 5.x (strict mode, no any)
  • Framework: React 18+ / Next.js 13+ (App Router, "use client" directive required on all components)
  • Styling: Tailwind CSS utility classes in JSX + scoped @layer rtbl { ... } CSS in src/styles/tableStyles.css
  • Linter/Formatter: Biome 2.x (npm run check:fix to auto-fix)
  • Build: tsup (ESM + CJS dual output) + Tailwind CLI for CSS
  • Tests: Jest 30 + React Testing Library

Code Style (Biome enforced)

  • Indent: 2 spaces, LF line endings, 80-char line width
  • Quotes: double for JS/JSX ("use client", JSX attributes)
  • Semicolons: always
  • Arrow functions: always parenthesise ((x) => x)
  • No any — use proper interfaces. No non-null assertion without comment.

TypeScript Patterns

  • Table data is always generic <T> — never typed as object or Record<string, unknown>
  • Props interfaces follow ComponentNameProps<T> naming and live in src/types/index.ts
  • Use ReadonlyArray<keyof T> for props/columns arrays
  • Export types from src/index.ts via export * from "./types"

Key Constraints

  • All components must include "use client" at the top (line 1)
  • Never use React Context for state that can be passed as props
  • useMemo / useCallback hooks must be called before any early returns (Rules of Hooks)
  • CSS class prefix is rtbl- — never introduce bare element or global selectors in tableStyles.css
  • react-loading-skeleton CSS is loaded by TableSkeleton.tsx JS import only — do NOT re-add @import to the CSS file

Quality Checks (run before committing)

npm run check:fix   # fix lint + format
npm run type-check  # TypeScript
npm run test        # Jest
npm run build       # tsup + Tailwind CSS

File Layout

src/components/          # React components (TableComponent, ActionDropdown, …)
src/components/__tests__ # Jest tests (*.test.tsx)
src/types/index.ts       # All TypeScript interfaces
src/utils/helpers.ts     # Pure utility functions
src/styles/tableStyles.css
src/index.ts             # Public exports

Read the full file on GitHub · 53 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. 2d ago First seen · 53 lines · 582 tokens per session scan A 8708c6e3bcd6

Subscribe to this mod's changes

general is a cursor rule published in the GitHub repository ninsau/nextjs-reusable-table (6 stars, last pushed 5mo ago), licensed 0BSD. It adds 582 tokens to every session, about $0.0029 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.