engine-cursorrules: Cursor rule for Cursor

.cursorrules

cursorrules is a cursor rule for Cursor from KeelStack-me/engine-cursorrules. It costs 6,496 tokens per session, scanned A, original, MIT.

A set of Cursor instructions for developing the KeelStack SaaS backend with TypeScript, Node.js, and Express. It tells the coding agent how to extend the existing system and respect its layer boundaries.

In plain words
What is it for?
Adding backend features, wiring frontends to the engine, following import and layer rules, and writing strict TypeScript code.
Why use it?
It gives the agent project-specific rules so changes are smaller, safer, tested, and consistent with the backend's architecture.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

This is KeelStack-me/engine-cursorrules's own configuration. It tells Cursor how to work on engine-cursorrules itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything engine-cursorrules configures →

Reuse

Borrowing it

Nothing to install: this file belongs to KeelStack-me/engine-cursorrules. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/KeelStack-me/engine-cursorrules/main/.cursorrules
Clone the repo
git clone --depth 1 https://github.com/KeelStack-me/engine-cursorrules

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cursorrules

README.md
[![agentmods](https://agentmods.dev/badge/rules/keelstack-me/engine-cursorrules/cursorrules/github.svg)](https://agentmods.dev/rules/keelstack-me/engine-cursorrules/cursorrules)
Your own site
<a href="https://agentmods.dev/rules/keelstack-me/engine-cursorrules/cursorrules"><img src="https://agentmods.dev/badge/rules/keelstack-me/engine-cursorrules/cursorrules/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cursorrules

Your own site · 80×15
<a href="https://agentmods.dev/rules/keelstack-me/engine-cursorrules/cursorrules"><img src="https://agentmods.dev/badge/rules/keelstack-me/engine-cursorrules/cursorrules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 6,496 This file is loaded in full into every session.
When invoked 6,496 The same file — it is already loaded in full.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.06496 $0.06496
Opus 5.5 $0.02598 $0.02598
Sonnet 5.5 $0.01299 $0.01299
Haiku 4.5 $0.00650 $0.00650

Measured 2mo ago against content hash 96dc76122df3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cursorrules scanned grade A with 1 finding 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 2mo 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

queryFn: () => axios.get(pollUrl).then(r => r.data),
.cursorrules · 692 lines

How it starts

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

============================================================

KeelStack v1.1 — .cursorrules

Production-grade Node.js + TypeScript SaaS backend engine

AI safety · vibe-coding-safe guardrails · full-stack ready

============================================================

Authoritative layer reference: src/07-AI/boundaries/AIBoundary.ts

UI Starter reference: https://github.com/KeelStack-me/keelstack-ui-starter

Last updated: v1.1.1

============================================================

──────────────────────────────────────────────

0. WHO YOU ARE

──────────────────────────────────────────────

You are a senior TypeScript + Node.js engineer working inside KeelStack v1.1 — a production-grade, vibe-coding-safe SaaS backend engine built on Node.js + Express + TypeScript.

Your role is to:

  • Extend existing features safely, minimally, and correctly
  • Follow strict layer boundaries and import rules at all times
  • Never touch human-only layers without explicit instruction
  • Write idiomatic, tested, TypeScript-strict code
  • Prefer the simplest, smallest, most reversible change
  • Help users wire any frontend (Next.js, React, Vue, etc.) to the engine safely using documented API patterns
  • Never invent features, clients, or infrastructure that do not already exist in the codebase

You are NOT allowed to:

  • Modify security-critical layers without explicit human approval
  • Skip idempotency or webhook dedup on any mutating route
  • Instantiate Stripe, Redis, or DB clients outside src/05-Infra
  • Call LLM APIs directly — always use the llmClient singleton
  • Swallow errors silently or remove safety guards
  • Introduce unrelated refactors in the same commit as a feature
  • Expose secrets, API keys, or credentials in any file

──────────────────────────────────────────────

1. LAYER WRITE PERMISSIONS

──────────────────────────────────────────────

Authoritative reference: src/07-AI/boundaries/AIBoundary.ts

Layer AI Write? Notes
01-Core ❌ NO Security-critical: middleware, guards, errors. Human only.
02-Common ✅ YES DTOs, types, shared utils. Low risk.
03-Policies ❌ NO Business rules. Wrong policy = revenue leak or data loss.
04-Modules ✅ YES Feature modules. Auth/billing changes need human review.
05-Infra ❌ NO DB schema + infra gateways. Schema changes need migrations.
06-Background ✅ YES New job payload types and handler files are safe.
RetryableJobRunner.ts + WorkerPool.ts = ❌ human review only.
07-AI ❌ NO LLMClient controls costs. AI must not modify its own limits.
08-Web ✅ YES Routes safe to add. Must use full middleware chain.

Read the full file on GitHub · 692 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. 2mo ago First seen · 692 lines · 6,496 tokens per session scan A 96dc76122df3

Subscribe to this mod's changes

cursorrules is a cursor rule published in the GitHub repository KeelStack-me/engine-cursorrules (1 stars, last pushed 7mo ago), licensed MIT. It adds 6,496 tokens to every session, about $0.0260 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

cursorrules compared with cursor rules from other repositories

cursorrules next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
cursorrulesKeelStack-me/engine-cursorrulesCursor rule17mo agoMITA6,496Cursor
structural-analogyFrigateCaptain/ElucidatingYourLLMCursor rule1426d agoMITA0Cursor
integrationsyerdaulet-damir/vibe-coding-rulesCursor rule346mo agoMITA2,188Cursor
code-organizationCommon-ka/ai-agent-unity-rulesCursor rule4310mo agoMITA1,948Cursor
unity-coreCommon-ka/ai-agent-unity-rulesCursor rule4310mo agoMITA1,779Cursor
unity-performanceCommon-ka/ai-agent-unity-rulesCursor rule4310mo agoMITA2Cursor
unity-ecsCommon-ka/ai-agent-unity-rulesCursor rule4310mo agoMITA16Cursor