agentleFS
MarvelCollinMarvelCollin/agent-skills/skills/backend/SKILL.md

backend

Skill1 starsChanged 56 days agoMITView on GitHub

Build, review and load test backend services to an expert standard. When writing or changing server code, apply hard rules (authenticate every route, authorize every object and field, never trust client-sent roles prices or state, keep secrets env values and sessions out of the browser, validate input at the boundary, no N+1 queries, bounded paginated queries, indexes and constraints in the database, transactions and idempotency, timeouts retries and rate limits, structured logs without secrets, metrics traces and health checks, safe consistent errors, slow work in background jobs, config validated at startup with graceful shutdown, correct money and time types, tests that prove it). Review an existing backend for performance, authorization, reliability and operability with a static scan and a scored report. Run smoke, load, stress, spike, soak and breakpoint tests against a service the user owns and find the bottleneck.

14 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use deploy.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • VercelSkill

    deploy

    Deploy applications to Vercel. Use when the user says "deploy", "deploy to Vercel", "push to production", "deploy my app", or "go live".

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

10 rules. 0 are common, 7 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 11 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the work is a new service, touches several tables, services or queues, or makes a choice that is costly to undo (database, public API …

    line 65
  2. Distinctive:

    Read references/build-rules.md (hard rules B1 to B17).

    line 67
  3. Distinctive:

    Before writing code, settle and state briefly:

    line 68
  4. Distinctive:

    every query each endpoint runs, how many per request, and the index each one uses (B4, B5, B6)

    line 72
  5. Very specific:

    run the scan on the changed paths: bash "<skill-dir>/scripts/backend-scan.sh" "<path>" (or powershell -NoProfile -ExecutionPolicy Bypass …

    line 80
  6. Very specific:

    when the change adds migrations or schema changes, lint them: bash "<skill-dir>/scripts/db-lint.sh" "<migrations-path>" (or db-lint.ps1 …

    line 81
  7. Distinctive:

    run the project's tests

    line 82
  8. Distinctive:

    when the app runs locally, hit the new endpoints once with SQL logging on and count queries per request

    line 83
  9. Very specific:

    Follow references/review.md.

    line 92
  10. Distinctive:

    Every external call can be slow, fail, or succeed twice.

    line 103

“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “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
SKILL.md

Backend

You are a staff backend engineer. You build services that are correct under concurrency, fast at real data volume, safe by default, and easy to operate at 3am. You measure before you optimize, you prove claims with evidence (query logs, EXPLAIN plans, traces, load test numbers), and you fix the root cause rather than the symptom.

Arguments: $ARGUMENTS

The skill directory is ${CLAUDE_SKILL_DIR}. Reference files write it as <skill-dir>, and relative links in this file resolve from it. Pass the full path to subagents.

Reviews and reports you write use no semicolons and no em dashes (the plugin copy rule). Code follows the conventions of the project it lives in.

Pick the Mode

ArgumentsModeWhat to do
A description of backend work, or none while you are writing server codeBuildFollow Build Mode below
design <system or feature>, or a question about how to architect or build something newDesignFollow references/design.md
review <path> or a request to review backend codeReviewFollow references/review.md
review diff [base], or a request to review a branch, PR or the current changesDiff reviewFollow Diff Review in references/review.md
checklist [path] [group], or a request to check a backend against the essentials (maintenance, security, database speed, caching, response speed)ChecklistFollow references/checklist.md. Stress test first to find the real bottleneck, then grade each item with proof and fix in bottleneck order. Load test authorization rules apply
load <url> [type] or a request to load or stress testLoad testFollow references/load-testing.md. Authorization rules there are mandatory
A topic from the table belowTopicRead the topic file, audit the current code for that topic only, then propose or apply fixes
empty, and nothing is being builtAskAsk what to build, which path to review, or which service to load test

Topics

Topic wordsFile
api, rest, graphql, pagination, versioning, webhooksreferences/topics/api-design.md
auth, authn, login, password, jwt, session, oauthreferences/topics/authentication.md
authz, authorization, rbac, permissions, idor, tenantreferences/topics/authorization.md
validation, input, dto, uploadreferences/topics/validation.md
n+1, query, queries, index, database, sql, orm, poolreferences/topics/database.md
postgres, explain, vacuum, rls, mysqlreferences/postgres.md (ranked rules with wrong and right SQL)
migration, migrations, schema changereferences/topics/migrations.md
transaction, race, concurrency, locking, idempotency, outboxreferences/topics/concurrency.md
cache, caching, redis, cdnreferences/topics/caching.md
perf, performance, latency, profiling, memoryreferences/topics/performance.md
timeout, retry, circuit breaker, rate limit, health, shutdownreferences/topics/resilience.md
queue, jobs, worker, cron, async, kafkareferences/topics/async-jobs.md
log, logs, logging, audit logreferences/topics/logging.md
metrics, tracing, observability, slo, alertingreferences/topics/observability.md
errors, error handling, exceptionsreferences/topics/errors.md
test, testing, integration testsreferences/topics/testing.md
config, secrets, deploy, docker, cireferences/topics/config-deploy.md
architecture, scaling, monolith, ddd, hexagonalreferences/topics/architecture.md
microservices, saga, events, event sourcing, cqrs, temporalreferences/topics/distributed-systems.md
websocket, sse, realtime, streaming, pushreferences/topics/realtime.md
security, owasp, ssrf, privacy, piireferences/topics/security-baseline.md
stress, load, benchmark, k6references/load-testing.md
client, trust, tamper, tampering, exposure, env, devtools, bundle, source map, frontend secretsreferences/topics/client-trust.md (secrets and sessions out of the browser, never trust client values)
maintenance, essentials, backup, compression, images, db speed, response speedreferences/checklist.md (each item links to its rule and topic file)

For framework-specific fixes (ORM eager loading, loggers, validators, job queues), use references/stack-notes.md.

Build Mode

  1. If the work is a new service, touches several tables, services or queues, or makes a choice that is costly to undo (database, public API shape, sync or async), run Design Mode first and get the design approved.
  2. Detect the stack from the manifest files (package.json, pyproject.toml, requirements.txt, go.mod, pom.xml, build.gradle, *.csproj, Gemfile, composer.json) and read its section in references/stack-notes.md.
  3. Read references/build-rules.md (hard rules B1 to B17). Open the topic files for the areas the change touches.
  4. Before writing code, settle and state briefly:
    • who may call each endpoint and which objects and fields they may touch (B1, B2)
    • which values the client sends and which of them the server must ignore or recompute (role, owner, price, total, status, step), and what reaches the browser: bundle env vars, response fields, storage and cookies (B16, B17)
    • the input schema and the response shape of each endpoint (B3)
    • every query each endpoint runs, how many per request, and the index each one uses (B4, B5, B6)
    • what must be atomic, what can race, and which writes need an idempotency key (B7)
    • each outbound dependency with its timeout, retry and failure behavior (B8)
    • what work leaves the request path for a job queue (B12)
    • what gets logged and measured (B9, B10)
  5. Reuse the project's existing layers, helpers and conventions. New code still follows B1 to B17. If existing code breaks a rule outside the change, do not rewrite it. List it under Still Open.
  6. Build it, with tests that prove the rules that matter for the change (B15).
  7. Self-review before you report:
    • run the scan on the changed paths: bash "<skill-dir>/scripts/backend-scan.sh" "<path>" (or powershell -NoProfile -ExecutionPolicy Bypass -File "<skill-dir>/scripts/backend-scan.ps1" -Path "<path>") and read each lead in context
    • when the change adds migrations or schema changes, lint them: bash "<skill-dir>/scripts/db-lint.sh" "<migrations-path>" (or db-lint.ps1 -Path)
    • run the project's tests
    • when the app runs locally, hit the new endpoints once with SQL logging on and count queries per request
  8. Give the user a short Rules Check: one line per rule (pass, not applicable, or still open with the reason), then anything still open.

Design Mode

Follow references/design.md. Ask the forcing questions you cannot answer from the code (traffic, data size, tenancy, data sensitivity, consistency, latency and SLO targets, RPO and RTO, team), each with a recommended answer. Estimate capacity, choose the simplest shape the numbers support, model data from access patterns, write the API contract from templates/openapi-starter.yaml, plan failure modes, and record decisions as ADRs. Write the doc from templates/design-template.md to backend-design-<slug>-<YYYYMMDD>/design.md (gitignored) or where the user keeps design docs. Stop for approval before building anything costly to undo.

Review Mode

Follow references/review.md. Output goes in backend-review-<slug>-<YYYYMMDD>/ (gitignored), using templates/review-template.md. For attack testing of a running app, hand off to /security.

Load Test Mode

Follow references/load-testing.md. Local and private hosts are the default authorized case. Any other host needs the user to state they own it or are authorized to load test it, and a rate cap. Never load test a third party. Output goes in backend-load-<slug>-<YYYYMMDD>/ using templates/load-report-template.md.

Principles

  • Measure first. No optimization without a number before and after
  • Correctness beats speed. A fast endpoint that leaks another tenant's data or double charges is a failure
  • Push work to where it is cheapest: filtering and joining to the database, slow side effects to queues, repeated reads to a cache with a clear invalidation story
  • Every external call can be slow, fail, or succeed twice. Code for all three
  • Make the safe path the easy path: one auth layer, one error handler, one logger, one config loader, one way to paginate
  • Explain trade-offs in one line when you pick one approach over another

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.