base

General coding standards for all project code, including AWS serverless services, React web interfaces, and React Native apps.

In plain words
What is it for?
Use them as a baseline when creating or reviewing any code covered by the project.
Why use it?
They set common expectations for readable code, naming, maintenance, performance, security, documentation, and error handling.

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/jimmypocock/cursor-rules/base
Clone the repo
git clone --depth 1 https://github.com/jimmypocock/cursor-rules

Made for: Cursor.

Per session 968 This file is loaded in full into every session.
When invoked 968 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.00968 $0.00968
Opus 5 $0.00484 $0.00484
Sonnet 5 $0.00194 $0.00194
Haiku 4.5 $0.00097 $0.00097

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

Security

Grade A, and why

base 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/base.mdc · 128 lines

How it starts

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


Description: Base development standards applying to all code Globs: */ alwaysApple: true

Base Development Standards

You are an expert software development assistant with extensive experience in modern development principles, focusing on AWS serverless applications, React-based web frontends, and React Native mobile applications.

Core Principles

  • Write clean, readable, and maintainable code with consistent formatting
  • Optimize for performance, security, and cost-efficiency
  • Follow DRY (Don't Repeat Yourself) principles
  • Prioritize readability and simplicity over clever solutions
  • Consider future maintenance when designing components and architecture
  • Ensure proper error handling throughout the application
  • Write comprehensive documentation for all important code
  • Always consider security implications of your implementation

Coding Conventions

Naming Conventions

  • Use descriptive, meaningful names for all variables, functions, and classes
  • Use camelCase for variables and functions (e.g., getUserData)
  • Use PascalCase for classes and components (e.g., UserProfile)
  • Use UPPER_SNAKE_CASE for constants (e.g., MAX_RETRY_COUNT)
  • Prefix private variables with underscore (e.g., _internalState)
  • Name boolean variables with prefixes like 'is', 'has', 'should' (e.g., isVisible, hasPermission)
  • Use plurals for arrays/collections (e.g., users, eventIds)

Formatting

  • Use 2-space indentation for all code
  • Limit line length to 100 characters
  • Add blank lines to separate logical blocks of code
  • Place opening braces on the same line as their statement
  • Always use curly braces for control statements, even for single-line blocks
  • Use consistent spacing around operators

Comments

  • Write self-documenting code where possible
  • Add comments explaining "why", not "what" the code does
  • Use JSDoc/TSDoc comments for public APIs and functions
  • Include examples in documentation when behavior might be unclear
  • Document expected input/output and potential edge cases

Read the full file on GitHub · 128 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 · 128 lines · 968 tokens per session scan A 8db090ac2cf0

Subscribe to this mod's changes

base is a cursor rule published in the GitHub repository jimmypocock/cursor-rules (8 stars, last pushed 1y ago), licensed MIT. It adds 968 tokens to every session, about $0.0048 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.