maintaining-boilerplate

A set of project rules for extending and maintaining a starter codebase. It explains where to put components, features, translations, environment settings, and service integrations.

In plain words
What is it for?
Use it when adding UI components, features, languages, translation keys, environment variables, analytics, or monitoring integrations.
Why use it?
It keeps new work organized and the starter project reusable instead of letting project-specific code spread through unrelated files.

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/kws-projects/react-boilerplate/maintaining-boilerplate
Clone the repo
git clone --depth 1 https://github.com/kws-projects/react-boilerplate

Made for: Cursor.

Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 702 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.00008 $0.00702
Opus 5 $0.00004 $0.00351
Sonnet 5 $0.00002 $0.00140
Haiku 4.5 $0.00001 $0.00070

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

Security

Grade A, and why

maintaining-boilerplate 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 3d 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/maintaining-boilerplate.mdc · 56 lines

How it starts

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

Maintaining This Boilerplate

This repo is a starter template. When extending it, keep it generic, documented, and easy to fork.

Common tasks

  • Add a UI component: npx shadcn@latest add <component> (lands in src/components/shadcn/), then create a src/components/ui/<component>.tsx wrapper that re-exports or extends it. App code imports from ui/ only. See the add-shadcn-component skill.
  • Adapt this starter into a new project: see the customize-starter skill.
  • Add a feature: create src/features/<feature>/ with components/, hooks/, api/, types/ as needed. Keep features self-contained.
  • Add a language: create src/i18n/locales/<lang>/common.json, register it in src/i18n/config.ts (resources, supportedLanguages), and add to rtlLanguages if it is right-to-left.
  • Add a translation key: update every locale file under src/i18n/locales/.
  • Add an env var: update src/config/env.ts, .env.example, and src/vite-env.d.ts together.
  • Wire a real integration: implement the SDK behind the existing adapter in src/lib/analytics.ts or src/lib/monitoring.ts; do not scatter SDK calls. See the analytics-and-monitoring skill for patterns.
  • Add a color: add CSS variables in :root and .dark in src/index.css, register in @theme inline, then use as Tailwind classes. See the color-management skill. Never use raw hex/rgb/oklch in component classNames.

Analytics & Monitoring

  • Analytics (src/lib/analytics.ts): typed GA4 adapter using gtag.js. Feature code calls analytics.track(...) or uses the useAnalytics() hook. New event types go in src/types/analytics.ts. Never call window.gtag directly outside of analytics.ts.
  • Monitoring (src/lib/monitoring.ts): Sentry adapter. Feature code calls monitoring.captureException(...) or uses the useMonitoring() hook. The app is wrapped in SentryErrorBoundary in App.tsx. React 19 error hooks are wired in main.tsx. Never import @sentry/react directly outside of monitoring.ts.
  • Hooks (src/hooks/): useAnalytics, useMonitoring, and usePageTracking — prefer these in components for testability.
  • Types (src/types/): analytics.ts (event definitions), monitoring.ts (error context, user, breadcrumbs), global.d.ts (window augmentation for dataLayer).

Read the full file on GitHub · 56 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. 3d ago First seen · 56 lines · 8 tokens per session scan A b65fde7c803c

Subscribe to this mod's changes

maintaining-boilerplate is a cursor rule published in the GitHub repository kws-projects/react-boilerplate (3 stars, last pushed 3mo ago), licensed MIT. It adds 8 tokens to every session and 702 once invoked, about $0.0000 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.