backend-patterns

backend-patterns is a skill for Claude Code, Codex from kensaurus/cursor-kenji. It costs 55 tokens per session (3,223 once invoked), scanned A, original, MIT.

A backend design guide for choosing common server patterns such as job queues, caching, request limits, server actions, and edge functions.

In plain words
What is it for?
Use it when adding background jobs, a cache, rate limiting, server actions, or edge functions to an application.
Why use it?
It helps keep slow or repeated work out of the main request and prevents unsafe or poorly placed backend changes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { createTRPCRouter, protectedProcedure, publicProcedure } from '../trpc'.

Good fit Use it when adding background jobs, a cache, rate limiting, server actions, or edge functions to an application.

Compare 6 skills 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/kensaurus/cursor-kenji
agentmods
npx agentmods add skills/kensaurus/cursor-kenji/backend-patterns

Made for: Claude Code, Codex.

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-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/kensaurus/cursor-kenji/backend-patterns.svg)](https://agentmods.dev/skills/kensaurus/cursor-kenji/backend-patterns)
Your own site
<a href="https://agentmods.dev/skills/kensaurus/cursor-kenji/backend-patterns"><img src="https://agentmods.dev/badge/skills/kensaurus/cursor-kenji/backend-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,223 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Data Exfiltration · line 342
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
How audits are shown
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.00055 $0.03223
Opus 5 $0.00028 $0.01612
Sonnet 5 $0.00011 $0.00645
Haiku 4.5 $0.00006 $0.00322

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

Security

Grade A, and why

backend-patterns 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 4d 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.

skills/backend-patterns/SKILL.md · 509 lines

How it starts

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

Backend Patterns Skill

Degree of freedom: MIXED. Which pattern to apply [HIGH freedom]; existing-architecture probes and the validation list [LOW freedom — run exactly].

How to reason

  1. Observe — existing server/api/actions, ORM, queues, cache
  2. Interpret — missing pattern vs duplicate vs wrong layer
  3. Classify — reuse / add-queue / add-cache / add-rate-limit / edge-fn
  4. Severity — unauthenticated mutation outranks a missing cache

Worked example

Observe: createOrder sends email inline; no Inngest/queue; checkout p95 4s. Interpret: confirmation is post-response work, not request-path. Classify: after() or an order/created job; keep the write transactional. Verify: order row commits; email/inventory run after response; retries do not double-charge.

Self-critique before reporting

  • Existing first — searched server/api/actions before adding a second pattern
  • Auth + validate — every mutation checks session and Zod
  • Idempotent — retries on the new path do not double-apply
  • Right owner — which architecture to pick → audit-backend-architecture

Design scalable, maintainable backend architectures using modern patterns and best practices.

Code examples lean on Next.js App Router + Supabase/Prisma. The patterns are stack-agnostic — adapt ORMs, client libraries, and deploy targets to your detected ecosystem.

CRITICAL: Check Existing First [LOW freedom — run exactly]

Before implementing ANY backend pattern, verify:

  1. Check existing architecture:
ls -la src/server/ src/api/ app/api/ supabase/functions/ 2>/dev/null
cat package.json | grep -i "prisma\|drizzle\|supabase\|trpc"
  1. Check existing patterns:
rg "createTRPCRouter|publicProcedure" --type ts -l
rg "'use server'" --type ts -l
ls -la supabase/migrations/*.sql 2>/dev/null | tail -5
  1. Check database setup:
cat prisma/schema.prisma 2>/dev/null | head -50
cat supabase/config.toml 2>/dev/null

Read the full file on GitHub · 509 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 4d ago First seen · 509 lines · 55 tokens per session scan A 3ced826ffcc1

Subscribe to this mod's changes

backend-patterns is a skill published in the GitHub repository kensaurus/cursor-kenji (9 stars, last pushed 10d ago), licensed MIT. It adds 55 tokens to every session and 3,223 once invoked, about $0.0003 per session on Opus 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-09-03.