backend-policy

backend-policy is a cursor rule for Cursor from vanessamarely/ai-playbook-reposito. It costs 0 tokens per session (732 once invoked), scanned A, original, MIT.

A set of coding rules for backend services written in Node.js or TypeScript, Java, and Python, covering APIs, security, errors, and project conventions.

In plain words
What is it for?
Use it when building or reviewing backend services, validating input, handling errors, logging, organizing code, or scaffolding Nest.js endpoints.
Why use it?
It helps keep server code consistent with the language and framework already used by the project.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when building or reviewing backend services, validating input, handling errors, logging, organizing code, or scaffolding Nest.js endpoints.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/vanessamarely/ai-playbook-reposito/backend-policy
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.

Clone the repo
git clone --depth 1 https://github.com/vanessamarely/ai-playbook-reposito

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 backend-policy

README.md
[![agentmods](https://agentmods.dev/badge/rules/vanessamarely/ai-playbook-reposito/backend-policy/github.svg)](https://agentmods.dev/rules/vanessamarely/ai-playbook-reposito/backend-policy)
Your own site
<a href="https://agentmods.dev/rules/vanessamarely/ai-playbook-reposito/backend-policy"><img src="https://agentmods.dev/badge/rules/vanessamarely/ai-playbook-reposito/backend-policy/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 backend-policy

Your own site · 80×15
<a href="https://agentmods.dev/rules/vanessamarely/ai-playbook-reposito/backend-policy"><img src="https://agentmods.dev/badge/rules/vanessamarely/ai-playbook-reposito/backend-policy.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 732 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00000 $0.00732
Opus 5 $0.00000 $0.00366
Sonnet 5 $0.00000 $0.00146
Haiku 4.5 $0.00000 $0.00073

Measured 10d ago against content hash 84536a17d8de, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

backend-policy 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 10d 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.

ai-playbook/.cursor/rules/backend-policy.mdc · 70 lines

How it starts

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

Backend Policy

Multi-Language Support

Backend services may use different ecosystems. Follow the conventions of each project's chosen language and framework.

Language-Specific Guidelines

Node.js / TypeScript

Project detection: package.json present; TypeScript via tsconfig.json. Common frameworks: Express, Nest, Fastify.

Conventions:

  • Use ES modules (import/export) when "type": "module" in package.json; otherwise CommonJS.
  • Follow existing import ordering conventions.
  • Use async/await for asynchronous operations.
  • Validate incoming data with Zod, Joi, or class-validator.
  • Use structured logging (avoid console.log in production code).
  • Handle errors with centralized middleware or interceptors.

Nest.js specifics: decorators for controllers/services/modules; constructor-based dependency injection; DTO classes with validation decorators; exception filters for HTTP error responses; guards for auth.

For scaffolding endpoints, run /node-microservice-builder.

Java

Project detection: pom.xml (Maven) or build.gradle/build.gradle.kts (Gradle). Common frameworks: Spring Boot, Quarkus, Micronaut.

Conventions:

  • Package structure: com.organization.service.module.
  • Use annotations for configuration (Spring: @Service, @RestController, etc.).
  • Constructor-based dependency injection preferred; builder patterns for complex object construction.
  • Validate inputs with Bean Validation (@Valid, @NotNull, etc.).
  • Handle exceptions with @ControllerAdvice or similar.
  • PascalCase for classes, camelCase for methods. Respect the project's Maven/Gradle module structure.

Python

Project detection: pyproject.toml, setup.py, or requirements.txt. Common frameworks: FastAPI, Django, Flask.

Conventions:

  • Follow PEP 8; use type hints (PEP 484) for function signatures.
  • Respect .venv/ or venv/.
  • Use async/await with FastAPI or aiohttp where applicable.
  • Validate with Pydantic models (FastAPI) or framework-specific validators.
  • Use structured logging (not print).
  • Catch specific exception types, never bare except.
  • Test with pytest; respect existing test structure.

Read the full file on GitHub · 70 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. 10d ago First seen · 70 lines · 0 tokens per session scan A 84536a17d8de

Subscribe to this mod's changes

backend-policy is a cursor rule published in the GitHub repository vanessamarely/ai-playbook-reposito (2 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 732 tokens. 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.