Skip to content
Skills Library
Programming · Building & coding

build-backend

/build-backend

[Orbit 2.4.8 Implementation] Backend: permissions on every request, migrations, background jobs, integrations through approved gateways. Use when: «авторизация», «миграции», «интеграция с API», «бэкенд сервиса»; backend auth, integrations, background jobs.

Licence
MIT
Last repository change
09.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 09.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

[Orbit 2.4.8 Implementation] Backend: permissions on every request, migrations, background jobs, integrations through approved gateways. Use when: «авторизация», «миграции», «интеграция с API», «бэкенд сервиса»; backend auth, integrations, background jobs.

Original author description

[Orbit 2.4.8 Implementation] Backend: permissions on every request, migrations, background jobs, integrations through approved gateways. Use when: «авторизация», «миграции», «интеграция с API», «бэкенд сервиса»; backend auth, integrations, background jobs.

How it works

  1. When to use
  2. Inputs
  3. Procedure
  4. Output
  5. Check
  6. Pitfalls
  7. Portability
  8. What's improved vs the source
  9. Based on
Original SKILL.md headings · 149 lines, 1,258 words
SKILL.md preview
---
name: build-backend
description: '[Orbit 2.4.8 Implementation] Backend: permissions on every request, migrations, background jobs, integrations through approved gateways. Use when: «авторизация», «миграции», «интеграция с API», «бэкенд сервиса»; backend auth, integrations, background jobs.'
---

# build-backend — backend: access, data, integrations

> **Orbit · ② Build · step 2.4.8 Implementation**
> **Input:** architecture ← `build-screens`
> **Output:** a backend → next `find-root-cause`
> **Works with:** `design-data`, `review-security`
> **Shared rules:** reply in the user's language per `speak-plain`; generated content defaults to English; act within `stay-in-scope`; artifacts go to `.orbit/` (contract: `ARTIFACTS.md`).

The server side built to the agreed architecture: authentication, migrations and data access
rights, background jobs, mail and payments, integrations — through official APIs and
company-approved gateways. The order matters: access control and data shape before
features, integrations last, because everything else depends on them.

## When to use

- The architecture and the data design exist (`plan-rebuild`, `design-data`) and server
  work starts.
- An existing service gets a new endpoint, migration, job or integration.
- A rebuild must reproduce the reference's backend capabilities on your own stack.
- Before release, to run the access-control and secrets gate.
- Not for a pure UI task with a contract stub: use the stub and go to `build-screens`.

## Inputs

- `.orbit/product/<name>/architecture.md` (or the architecture from `design-services`):
  components, data flows, sync/async boundaries, auth model.
- The data design: schema, migrations folder, access rules (`design-data`).
- The API contract: `docs/api/` — endpoints, request/response shapes, error codes.
- Repo conventions: `README.md`, `CONTRIBUTING.md`, `Makefile`, `package.json` scripts —
  the real test, lint, migrate and run commands live there.
- Infrastructure facts: how secrets are supplied (vault/environment), which providers are
  company-approved, which gateways exist for mail, payments and notifications.
- If an input is missing — no architecture, no contract, no approved provider list — ask;
  do not choose a provider or invent an endpoint on your own.

## Procedure

1. **Inventory before coding.** List every endpoint, job and integration from
   `architecture.md` and `docs/api/`, and mark which exist already:
   `rg -n "route|handler|controller|endpoint" <src>/ | head -60`.
   The diff is your scope; anything not in the architecture goes back to the plan.
2. **Auth and sessions first.** Use corporate OIDC/SSO if available; store sessions per the
   architecture. Roles and permissions are checked on **every** request, in the handler or
   a middleware that cannot be skipped — not in the UI, not on the route client-side.
3. **Close IDOR explicitly.** For every resource by id, the handler verifies the caller owns
   it: `/orders/{id}` checks owner or an explicit admin grant. Write a test that
   authenticates as user A and requests user B's resource, expecting 403/404.
4. **Migrations from the data design, forward-only.** One migration per logical change,
   committed with the code; never edit an applied migration. Run the repo's command
   (`<migrate-command>`, e.g. `npm run migrate` or `alembic upgrade head`) against a fresh
   database and against the current one.
5. **Push access rights to the database where possible.** Row-level security (RLS), separate
   roles for read/write/admin, least-privilege credentials per service. The app check is a
   second layer, not the only one.
6. **API by the architecture's flows.** Validate input at the edge (shape, size, types),
   map to domain types, return the status codes and error bodies in `docs/api/`. Keep
   transport DTOs separate from domain types (see `code-backend`).
7. **Background jobs: idempotent, retryable, observable.** Every job can run twice without
   duplicating side effects; retries are bounded with backoff; failures land in a
   dead-letter queue; each job emits a metric and a structured log line.
8. **Integrations through official APIs and approved gateways only.** No scraping, no
   unofficial endpoints, no public SaaS where the company has a gateway. Secrets come from
   the vault or environment — never code, config committed to git, or request values.
   Apply timeouts and a bounded retry at the integration edge.
9. **Mail, payments and notifications through company-approved providers** and internal
   gateways. Payments require idempotency keys and a reconciliation path; mail requires a
   suppression list and a test mode.
10. **Run the security gate and record evidence.** Permissions test, secret scan, input
    validation, request-size and rate limits. Append command → output → conclusion to
    `.orbit/task/<id>/evidence.md`, tick the items in `.orbit/task/<id>/plan.md`, and hand
    the full check to `review-security`.

## Output

Code in the repo (handlers, services, migrations, jobs, integration adapters) plus:

- `docs/api/` — the endpoint contract kept in sync with the implementation: method, path,
  auth, request, response, error codes.
- `.orbit/task/<id>/evidence.md` — the release-gate proof:

```markdown
## 2026-11-08 17:20 — backend gate (orders service)
$ pytest tests/api -q → 42 passed
IDOR: GET /orders/7 as user B → 403 (test_orders.py::test_other_user_forbidden)
$ git diff --cached | grep -iE 'token|password|secret' → no matches
Migrations: <migrate-command> applied 3 on fresh DB; re-run → "already at head"
Jobs: order.charge retried 3× then DLQ; metric jobs.dlq.count present
Integrations: payment provider via <gateway>; timeout 5s; retry 2 with backoff
Review: full security pass delegated to review-security
```

## Check

```bash
pytest tests/api -q                          # or: go test ./... , npm test -- api
<app-test> -k idor                           # caller cannot read another user's resource
<app-test> -k migration                      # fresh DB migrates cleanly
git diff --cached | grep -iE 'token|password|secret'   # must be empty
curl -s -o /dev/null -w "%{http_code}" <app-url>/healthz   # 200
docker compose up -d <db-service>            # integration tests have a database
```

Pass rule: the full API suite passes; the IDOR test fails for a foreign resource and passes
for the owner; a fresh database migrates to head with no manual step; the staged diff
contains no secrets; request-size and rate limits are configured and tested; every
integration uses an approved provider or gateway with a timeout. The full security review is
`review-security` — this checklist is the pre-release gate, not a replacement.

## Pitfalls

- **Permissions checked in the UI only.** A hidden button is not authorization; every
  endpoint enforces the same rule, and a direct request proves it.
- **IDOR by omission.** `find(id)` without an owner filter leaks other users' data; write
  the foreign-resource test for every id-based endpoint.
- **Editing an applied migration.** Environments diverge and the fix ships as a new
  migration, not an edited file; forward-only means forward.
- **Retries without idempotency.** A retried job charges twice or sends the mail twice;
  idempotency keys or a dedupe table first, retries second.
- **Secrets in code or logs.** Tokens, connection strings and webhook secrets end up in
  logs and error reports; read them from the vault/env at startup.
- **Public SaaS where a gateway exists.** Data leaves the approved boundary; use the
  company gateway even when the public API is easier.
- **Validation only on the client.** Server-side shape/size validation at the edge is the
  contract; client validation is UX.
- **Integration without timeouts.** A hanging third party pins workers; timeouts and
  bounded retries at the edge keep the service responsive.

## Portability

Language- and framework-neutral: the sequence (access → data → API → jobs → integrations)
and the gate commands map to any stack. The test runner, migration and run commands come
from the repo, so the skill names tools generically (git, grep, curl, docker, pytest/go/npm)
and never a specific framework. No subagents or slash commands; if a delegation tool exists,
the security review can be delegated to another agent with the same evidence contract.

## What's improved vs the source

- Integrations and payments go through company-approved providers and gateways, not public
  SaaS by default.
- A test on someone else's resource (IDOR) is mandatory, not a suggestion.
- Jobs must be idempotent with a DLQ and metrics, and migrations are forward-only with a
  fresh-DB check.
- The release gate produces `evidence.md` and hands the full check to `review-security`.

## Based on

- [Replica](https://github.com/Jakeschincariol/replica-skill) — method «replica-backend» (MIT). Rewritten in our own words and improved — see "What's improved".

Versions

The database has no other skills named build-backend.

Database snapshot: 13.11.2026 · package version 5f5726bb7e36 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90may-backend
    Use when server-side behavior involves API contracts, domain rules, database queries or transactions, concurrency, background jobs, external integrations, performance or backend regressions.
  • 90backend-engineering
    Build, refactor, debug, or review production backend services, APIs, integrations, and background jobs. Use for Python, TypeScript, Java, Go, or other server-side applications involving business logic, persistence, identity, reliability, or external systems.
  • 100replica-backend
    Build the backend of an app clone for its region: auth (VK ID, Yandex ID, Sber ID or Sign in with Apple and Google), database migrations and access rules, payments (YooKassa or CloudPayments with 54-FZ receipts, or Stripe), email, jobs and official integrations, plus a security…
  • 100backend-api-builder
    Designs and builds backend APIs and services in Python or Node: routes, auth, databases, background jobs, rate limits and deployment. Use when the user asks for an API, server, bot backend, database layer, webhook handler, or help deploying a backend.
  • 90backend-craft
    Backend engineering standards — API design, layering, database patterns, caching, error handling, auth, background jobs, logging, and the production-readiness checklist. Use when building any server-side code (endpoints, services, models, migrations, jobs).
  • 100replica-backend
    Builds the backend of an app clone: auth, database migrations and access rules, payments with Stripe, email, background jobs and third-party integrations through official APIs only, plus a security checklist. Use when the user says "add login", "set up auth", "wire up the…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.