services

services is a cursor rule for Cursor from Scopeo/draftnrun. It costs 0 tokens per session (325 once invoked), scanned A, original, Apache-2.0.

A set of service-layer rules for a monorepo, a repository containing multiple related projects or services. It covers business logic, database sessions, background work, external requests, and handling secrets.

In plain words
What is it for?
It is for implementing backend services and APIs, including Redis-backed queues, external HTTP calls, encrypted secrets, and database-backed components.
Why use it?
It keeps service code consistent and reduces risks such as blocking requests, exposing secret values, or opening database sessions incorrectly.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit It is for implementing backend services and APIs, including Redis-backed queues, external HTTP calls, encrypted secrets, and database-backed components.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/scopeo/draftnrun/services
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/Scopeo/draftnrun

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 services

README.md
[![agentmods](https://agentmods.dev/badge/rules/scopeo/draftnrun/services.svg)](https://agentmods.dev/rules/scopeo/draftnrun/services)
Your own site
<a href="https://agentmods.dev/rules/scopeo/draftnrun/services"><img src="https://agentmods.dev/badge/rules/scopeo/draftnrun/services.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 325 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.00325
Opus 5 $0.00000 $0.00162
Sonnet 5 $0.00000 $0.00065
Haiku 4.5 $0.00000 $0.00032

Measured 2d ago against content hash 3bade3d64fbb, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

services 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/services.mdc · 21 lines

What it actually says

Service Layer Conventions

  • Services encapsulate business logic between routers and repositories.
  • Services receive a Session from the router (via Depends(get_db)).
  • Heavy operations: use the Redis run queue (don't block the request).
  • External calls (Supabase Edge Functions, Nango, S3): always use httpx.AsyncClient with timeouts.
  • Secrets: encrypted with Fernet before storage, decrypted on read via ada_backend/utils/encryption.py.
  • Runtime secret values passed toward the engine should use SecretStr (pydantic.SecretStr) until an explicit execution boundary requires plaintext.
  • When passing constructor params to engine factories or placeholder/template resolvers, unwrap secrets explicitly and as late as possible.
  • During graph component instantiation, resolve DB-backed factory inputs with the existing builder Session; do not add nested get_db_session() calls in factory parameter processors for per-component metadata.
  • Never log full parameter dicts after replace_secret_placeholders(); log only parameter names (list(params.keys())). Apply the same rule to structured extra= logger kwargs.
  • Prefer UUID-typed identifiers in service-facing schemas and payload models; only stringify UUIDs at API/JSON boundaries.
  • Prefer typed schemas/models for service return payloads; avoid untyped dict returns when a stable shape exists.
  • Public callback URLs for provider integrations must be built from explicit settings such as ADA_URL; do not hardcode production fallbacks.
  • See ada_backend/docs/ for domain-specific documentation.
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 · 21 lines · 0 tokens per session scan A 3bade3d64fbb

Subscribe to this mod's changes

services is a cursor rule published in the GitHub repository Scopeo/draftnrun (30 stars, last pushed 4d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 325 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-09-04.