← Browse

@semkoo/niko-table-registry

B

Niko Table Registry - AI Assistant Rules

rulescursor

Install

agr install @semkoo/niko-table-registry --target cursor

Writes 1 file into .cursor/rules/, pinned to git-cc26a371.

  • .cursorrules

Document

Niko Table Registry - AI Assistant Rules

You are an expert AI coding assistant working in the "niko-table-registry" repository. This project is a shadcn-compatible data table registry built on top of TanStack Table.

Core Principles

  1. Shadcn/UI Architecture: Follow the shadcn pattern. Components are meant to be copied by the user (via CLI), not installed via opaque npm wrappers. Code should be readable, verbose enough to self-document, and highly modular.
  2. No Component Barrel Imports: Do NOT create or use barrel files (e.g., export * from './components') for UI components. Always use direct file imports. The only exception is for TypeScript types (e.g., src/components/niko-table/types/index.ts), which are stripped at build time.
  3. Deterministic Mock Data: Never use Math.random(), Date.now(), or other non-deterministic functions in mock data or component examples. This prevents SSR/CSR hydration mismatches (especially for developers copying this into Next.js/Remix). Always use deterministic, index-based values for mocks.

Table & Component Specific Rules

  1. Virtualization Requirements: When working with virtualized tables (like DataTableVirtualizedBody), always ensure the parent <DataTable> has an explicit fixed height (e.g., height={600} or className="max-h-[600px]"). The virtualizer requires a constrained scroll container to compute visible areas.
  2. Infinite Scroll: When implementing infinite scroll on virtualized tables, prefer onNearEnd (index-driven) over onScrolledBottom (pixel-driven) to trigger fetches. Always guard loaders against rapid double-fetches using isFetching states.
  3. Extending Types: Utilize strict TypeScript. When extending TanStack Table configurations or adding custom filters, extend @tanstack/react-table using TypeScript module augmentation and keep global types inside types/index.ts.
  4. Scoping: Avoid monolithic files. If logic scales (like handling deep row expansions vs. complex faceted filters), break it down into clean sub-components or composable children.

Tech Stack & Context

  • Frameworks: React, Astro (for the documentation site).
  • Styling: Tailwind CSS, Lucide Icons (or configured default icons).
  • Core Libraries: @tanstack/react-table, @base-ui/react, Radix UI primitives.

Trustgrade B

  • passBody integrity

    Whether the stored document is plausibly the kind of file the artifact declares, rather than something fetched by mistake.

  • passType matchnot applicable to this artifact type

    Whether the artifact is really the kind of thing its metadata claims it is.

  • passFreshness

    How long since the source repository was last pushed to.

  • passPrompt injection

    Scans the artifact's own text for instructions aimed at your agent rather than at you.

  • warnLicenseno SPDX license detected

    Whether the source repository declares an SPDX license permissive enough to redistribute.

How the grade is calculated

Each check contributes 0 points when it passes, 1 when it warns, and 2 when it fails. The total maps to a letter:

  • Aevery check passed
  • Bone warning
  • Ctwo warnings
  • Dprompt injection or body integrity failed, or three warnings
  • Fone of those failed, and something else is wrong

These are automated hygiene checks, not a security audit, and not a dependency or vulnerability scan. A grade of A means nothing was flagged — not that the artifact is safe.

Versions

  • git-cc26a37197222026-08-06