agentleFS
roedyrustamroedyrustam/vibes-plug/.cursor/rules/vibes-plug-backend.mdc

vibes-plug / rules

Cursor rule129 starsChanged 10 days agoMITView on GitHub

Vibes-Plug Backend & Systems Engineering — Node 24, Bun 1.2, Hono, Fastify, Prisma 6, Drizzle, PostgreSQL DDL with RLS, and RFC 9457 errors

  • Deletes or force-pushes

The file

We split this vibes-plug-backend.mdc into the rules it gives an agent

6 rules. About 0 are common, 1 is distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When editing backend APIs, server routes, database schemas, or microservices, Cursor AI MUST enforce these standards:

    line 9
  2. Very specific:

    PostgreSQL DDL: Every table MUST have id UUID PRIMARY KEY DEFAULT gen_random_uuid(), created_at TIMESTAMPTZ NOT NULL DEFAULT now(), …

    line 12
  3. Very specific:

    Foreign Keys: Every foreign key MUST have an explicit index (CREATE INDEX idx_...

    line 13
  4. Very specific:

    Multi-Tenant Security: Every tenant-partitioned table MUST enable Row Level Security (ALTER TABLE ...

    line 14
  5. Very specific:

    Safe Migrations: Never use destructive DROP TABLE or DROP COLUMN in production migrations without multi-step deprecation.

    line 15
  6. Very specific:

    Idempotency: All mutation endpoints (POST/PUT/PATCH) handling financial transactions or billing MUST enforce idempotency keys …

    line 21

≈ “Common” is an estimate: at least 1 in 5 of the 7,324 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
vibes-plug-backend.mdc
---
alwaysApply: false
description: "Vibes-Plug Backend & Systems Engineering — Node 24, Bun 1.2, Hono, Fastify, Prisma 6, Drizzle, PostgreSQL DDL with RLS, and RFC 9457 errors"
globs: "**/*.{sql,prisma,go,rs,py,route.ts,controller.ts,model.ts,service.ts,entity.ts}"
---

# Vibes-Plug Backend & Systems Engineering (2026 Edition)

When editing backend APIs, server routes, database schemas, or microservices, Cursor AI MUST enforce these standards:

## 1. Schema & Database Invariants
- **PostgreSQL DDL**: Every table MUST have `id UUID PRIMARY KEY DEFAULT gen_random_uuid()`, `created_at TIMESTAMPTZ NOT NULL DEFAULT now()`, `updated_at TIMESTAMPTZ NOT NULL DEFAULT now()`.
- **Foreign Keys**: Every foreign key MUST have an explicit index (`CREATE INDEX idx_... ON ...(...)`).
- **Multi-Tenant Security**: Every tenant-partitioned table MUST enable Row Level Security (`ALTER TABLE ... ENABLE ROW LEVEL SECURITY;`) with an explicit tenant isolation policy (`CREATE POLICY tenant_isolation ...`).
- **Safe Migrations**: Never use destructive `DROP TABLE` or `DROP COLUMN` in production migrations without multi-step deprecation.

## 2. API Contract & Error Resilience
- **Error Standard**: Return RFC 9457 Problem Details (`{ type, title, status, detail, instance }`) on all HTTP 4xx/5xx responses.
- **Validation**: Strict runtime validation at every boundary using `Zod` or `TypeSpec`.
- **Zero Silent Errors**: Catch blocks that swallow errors (`catch (e) {}`) are strictly banned. Always log structured context via `Pino` or `Sentry`.
- **Idempotency**: All mutation endpoints (POST/PUT/PATCH) handling financial transactions or billing MUST enforce idempotency keys (`Idempotency-Key` header with atomic database locking).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.