packages-rules

packages-rules is a cursor rule for Cursor from proyecto26/projectx. It costs 2,860 tokens per session, scanned A, original, MIT.

A set of rules for shared backend packages that provide database, authentication, email, payment, and workflow code.

In plain words
What is it for?
Use it when working on shared core utilities, PostgreSQL and Prisma database code, SendGrid email, Stripe payments, or Temporal workflows.
Why use it?
It documents what each package does, which systems it connects to, and how packages should be built and exported.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is workflowsPath: path.join(__dirname, '../workflows'),.

Good fit Use it when working on shared core utilities, PostgreSQL and Prisma database code, SendGrid email, Stripe payments, or Temporal workflows.

Compare 6 cursor rules from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/proyecto26/projectx
agentmods
npx agentmods add rules/proyecto26/projectx/packages-rules

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 packages-rules

README.md
[![agentmods](https://agentmods.dev/badge/rules/proyecto26/projectx/packages-rules/github.svg)](https://agentmods.dev/rules/proyecto26/projectx/packages-rules)
Your own site
<a href="https://agentmods.dev/rules/proyecto26/projectx/packages-rules"><img src="https://agentmods.dev/badge/rules/proyecto26/projectx/packages-rules/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 packages-rules

Your own site · 80×15
<a href="https://agentmods.dev/rules/proyecto26/projectx/packages-rules"><img src="https://agentmods.dev/badge/rules/proyecto26/projectx/packages-rules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,860 This file is loaded in full into every session.
When invoked 2,860 The same file — it is already loaded in full.
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.02860 $0.02860
Opus 5.5 $0.01144 $0.01144
Sonnet 5.5 $0.00572 $0.00572
Haiku 4.5 $0.00286 $0.00286

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

Security

Grade A, and why

packages-rules 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 1mo 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/backend/packages-rules.mdc · 434 lines

How it starts

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

Backend Packages Rules

Package Overview

Core (@projectx/core)

  • Purpose: Shared backend utilities, authentication, health checks, logging
  • Module System: Dual (CJS + ESM via tsup)
  • Exports: AuthService, JwtAuthGuard, HealthModule, Logger utilities
  • Dependencies: NestJS, Passport, JWT

DB (@projectx/db)

  • Purpose: Prisma client and database utilities
  • Module System: Dual (CJS + ESM via tsup)
  • Exports: PrismaService, DbModule, Prisma client
  • Database: PostgreSQL with PostGIS extension

Email (@projectx/email)

  • Purpose: Email sending via SendGrid
  • Module System: Dual (CJS + ESM via tsup)
  • Exports: EmailService, EmailModule
  • Provider: SendGrid

Payment (@projectx/payment)

  • Purpose: Stripe payment integration
  • Module System: Dual (CJS + ESM via tsup)
  • Exports: StripeService, PaymentModule
  • Provider: Stripe

Workflows (@projectx/workflows)

  • Purpose: Temporal workflow client and worker management
  • Module System: Dual (CJS + ESM via tsup)
  • Exports: ClientService, WorkerService, WorkflowsModule
  • Integration: Temporal.io

Build Configuration

All packages use tsup for dual builds

{
  "scripts": {
    "build": "tsup src/index.ts --format cjs,esm --sourcemap --clean"
  }
}

Build outputs:

  • dist/index.js - CommonJS (for NestJS apps)
  • dist/index.mjs - ESM (for web app)
  • dist/index.d.ts - TypeScript declarations
  • Source maps for both formats

Critical: Declaration files

# Always generate declaration files
tsup src/index.ts --format cjs,esm --sourcemap --clean && \
tsc -p tsconfig.json --emitDeclarationOnly --outDir dist

Package: @projectx/core

Exports

// Authentication
export { AuthService } from './lib/auth/auth.service';
export { JwtAuthGuard } from './lib/auth/auth.guard';
export { JwtStrategy } from './lib/auth/jwt.strategy';
export { AuthModule } from './lib/auth/auth.module';
// Decorators
export { AuthenticatedUser } from './lib/auth/auth.decorator';
// Health checks
export { HealthModule } from './lib/health/health.module';
// Logger
export { createLoggerOptions } from './lib/logger';
// Workflows (Temporal)
export { 
  verifyLoginCodeUpdate,
  createOrderUpdate,
  getOrderStateQuery,
  cancelWorkflowSignal,
  paymentWebHookEventSignal 
} from './workflows';
// Types
export type { AuthUser, OrderWorkflowData, PaymentWebhookEvent };

Read the full file on GitHub · 434 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. 1mo ago First seen · 434 lines · 2,860 tokens per session scan A 2c0e01dc78a8

Subscribe to this mod's changes

packages-rules is a cursor rule published in the GitHub repository proyecto26/projectx (83 stars, last pushed 6mo ago), licensed MIT. It adds 2,860 tokens to every session, about $0.0114 per session on Opus 5.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-30.