dept-backend
Skill1 starsChanged 59 days agoMITView on GitHub
Waymark · Backend department. Use FIRST to build or change server-side code: \"crear un endpoint\", \"nueva API\", \"webhook\", \"servicio\", \"job en background\", \"cola\", \"websocket\", \"integración con un proveedor\", REST, GraphQL, worker, cron, realtime.
In this repository16 other files it gives its agents.
- browser-verifySkill
- dept-architectureSkill
- dept-dataSkill
- dept-devexSkill
- dept-devopsSkill
- dept-frontendSkill
- dept-productSkill
- dept-qaSkill
- dept-securitySkill
- dept-ux-uiSkill
- library-docsSkill
- ui-auditSkill
- ui-buildSkill
- ui-refineSkill
- ui-systemSkill
- waymarkSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Run the *Waymark protocol → Entry* from the instructions file (already in context.
- Very specific: line 33
Does not own: schema, indexes, caching strategy → dept-data · authn/authz policy, secrets, threat model → dept-security · deploy, infra, CI …
- Distinctive: line 48
MUST: keep handlers thin: parse, authorize, delegate, respond.
- Distinctive: line 51
MUST: avoid N+1 queries; eager-load or batch.
- Distinctive: line 57
SHOULD: follow REST semantics: GET safe and idempotent, PUT/DELETE idempotent, POST for creation.
- Distinctive: line 61
SHOULD: keep functions short and single-purpose.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Backend Engineering
Quick ref
Mission: Ship server logic and APIs that are correct, validated at the boundary, observable and backward compatible. Must: validate input at the boundary · thin handlers, logic in services · paginate lists, no N+1 · uniform error envelope · request/integration test per endpoint Skills by default: library-docs · code-review · run · Explore · engram (MCP) DoD: gates green · request test per endpoint · contract unchanged or versioned · no N+1 · jobs idempotent · no secret in diff
Entry
Run the Waymark protocol → Entry from the instructions file (already in context; do not load the waymark skill for it). No Waymark block in context (guest) → Guest entry, ../waymark/references/coexistence.md §3. Department-specific reads:
- Learnings:
~/.waymark/learnings/dept-backend.mdif it exists. - Stack profile: L1 Commands + Backend, L2+ full.
- Tools: the Tools table below. Open
../waymark/skill-registry.mdonly if a capability there has no installed provider.
Brief questions
The brief must answer before the first edit:
- What — which endpoint/job/channel/integration, and its contract: method + path (or event/topic), request schema, response schema, status and error codes.
- Why / for whom — which consumer (frontend screen, third party, internal job) and which acceptance criterion it satisfies.
- Where — handler, service, validator and test locations per the architecture profile; which existing resource it mirrors.
- Authn / authz — who may call it, how identity is established, which ownership/tenant check applies.
- Consistency — transaction boundary, idempotency (key, upsert, state check), behavior on retry or duplicate delivery.
- Compatibility — additive or breaking; versioning strategy; consumers to inform.
- Observability & limits — logs with request ID, timeouts on outbound calls, pagination max, rate limits.
- How / done — procedure below, skills and MCP chosen, and which tests prove it done.
Scope
- Owns: API design and contracts, request handlers, services/use cases, background jobs, webhooks, realtime channels, server-side validation, error handling, integrations with external APIs.
- Does not own: schema, indexes, caching strategy →
dept-data· authn/authz policy, secrets, threat model →dept-security· deploy, infra, CI →dept-devops· module boundaries →dept-architecture· test strategy →dept-qa.
Procedures
Detailed steps live in procedures.md (same folder). Read only the section you need: search its heading, read that block, not the whole file. Anti-patterns and references are at the end of that file.
- New endpoint
- New background job
- Realtime channel / websocket
- Webhook receiver
- Schema change (backend side)
- Bug fix
- Refactor
Rules
- MUST validate and type every external input (body, query, params, headers, webhook payloads) at the boundary with an allowlist.
- MUST keep handlers thin: parse, authorize, delegate, respond.
- MUST return a uniform error envelope (e.g.
{ "error": { "code", "message", "details" } }) with correct HTTP status codes. - MUST paginate any list that can grow, with a server-enforced maximum page size.
- MUST avoid N+1 queries; eager-load or batch.
- MUST wrap multi-write operations in a transaction; keep external calls outside it.
- MUST make jobs, webhook handlers and retryable POSTs idempotent.
- MUST set timeouts on every outbound HTTP/DB/queue call.
- MUST version breaking contract changes (path or header); only additive changes within a version.
- MUST enforce authorization on the server for every protected resource and channel.
- SHOULD follow REST semantics: GET safe and idempotent, PUT/DELETE idempotent, POST for creation.
- SHOULD return
201with location on create,204on empty success,409on conflict,429on rate limit. - SHOULD log with correlation/request IDs and structured fields; no PII.
- SHOULD move slow work (>~200 ms, external calls, fan-out) out of the request cycle.
- SHOULD keep functions short and single-purpose; no God services.
- MUST NOT mutate state in GET handlers.
- MUST NOT swallow exceptions with catch-alls; catch specific errors or re-raise.
- MUST NOT build SQL or shell commands by concatenating input.
- MUST NOT hardcode secrets, URLs or credentials; read from configuration.
- MUST NOT change a published response shape without versioning.
Tools
| Capability | Skill / MCP / Agent | When | Level |
| docs.library | library-docs (→ the docs MCP servers the user has) | Any framework/ORM/queue API not verified this session; always for new APIs at L2+ | Q |
| memory | engram (MCP) | mem_search before re-reading a resource; mem_save after a non-obvious decision | L1 |
| search.codebase | Explore (agent) | Pattern lookup across >3 locations | L1 |
| claude.api | claude-api | Code that calls the Claude / Anthropic API | L1 |
| app.run | run | Endpoint touches external I/O, realtime or jobs | L2 |
| review.diff | code-review | Before declaring done | L2 |
| plan.implementation | Plan (agent) | New module, cross-cutting change | L3 |
| contract.testing / API spec lint | none yet → waymark references/skills.md | OpenAPI/GraphQL schema validation | L2 |
Definition of Done
- Exit protocol of
waymark(instructions file → Exit; L2+ full:../waymark/references/protocol.md) (gates, architecture conformance, review, learnings) - Every new/changed endpoint has a request/integration test (success + 4xx paths)
- Input validated at the boundary; unknown fields rejected
- Contract unchanged, additive or versioned; consumers informed (
dept-frontend) - No N+1 on list endpoints; lists paginated
- Jobs/webhooks idempotent and tested for retry
- Errors use the uniform envelope; no stack traces to clients
- No secret, token or PII in diff or logs
Hand-offs
- To
dept-data: new table/column/index, query performance, caching, migration design. - To
dept-security: new auth flow, public endpoint, file upload, PII, payments, webhooks, CORS change. - To
dept-frontend: contract change, new error codes, realtime payload change. - To
dept-qa: test strategy for complex flows, flaky tests. - To
dept-devops: new env var, queue/worker process, scheduled job, infra dependency. - To
dept-architecture: new module or boundary, cross-module dependency. - To
dept-product: unclear acceptance criteria or scope.
Learned rules
Grows with use (waymark references/learning.md). Only rules that are general for this department and not already stated above. Format: - [YYYY-MM-DD] <rule> — <why> (source: <project>).
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
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.

