| name | backend-engineering |
| description | Always-on backend engineering quality kernel for Rust/Axum harness work. Use when changing or reviewing backend services, servers, workers, contracts, repo-tools, platform-facing backend metadata, or backend documentation. Guides invariant-first design, boundary discipline, evidence language, and template-quality code judgment without overriding ownership skills.
|
Backend Engineering
Use this skill as the default quality lens for backend harness work.
Workflow skills guide judgment. Ownership skills still decide writable boundaries.
Objective
Keep the template small, explicit, typed, testable, and production-minded without pretending it is production-proven.
Prefer the smallest design that preserves:
- backend correctness
- hard service, protocol, server, worker, and platform boundaries
- topology-late growth
- executable evidence
- template-user simplicity
- agent resistance to drift
Decision Kernel
Before changing backend behavior, answer:
- What invariant must not be violated?
- Which boundary owns the violated or changed behavior?
- What is synchronous, asynchronous, durable, idempotent, replayable, or eventually consistent?
- What is the cheapest correct design that restores the invariant?
- What evidence can honestly be claimed after this change?
Boundary Rules
services/** are business capability libraries by default, not service processes.
servers/** adapt protocols and compose services; handlers do not own domain logic.
workers/** advance async state and must make retry, idempotency, checkpoint/replay, dedupe, and recovery explicit when touched.
packages/contracts/** owns shared protocol shapes before external API or event changes land elsewhere.
platform/model/** describes platform-level metadata and global defaults; service-local semantics stay in services/<name>/model.yaml.
- Generated artifacts are read-only; change sources and regenerate.
- Optional app shells and UI packages must not become backend-core prerequisites.
Quality Rules
- Represent important invariants in types, constructors, constraints, or final transaction boundaries.
- Keep expected failures typed and matchable; do not leak internal dependency details to clients.
- Retries for side-effecting work require durable idempotency or an explicit reason they are safe.
- Cross-boundary events require a clear atomic state mutation and publication story, usually outbox-driven.
- Async work must have bounded concurrency, cancellation/shutdown behavior, timeout or backpressure expectations, and observable failure paths when relevant.
- Do not add traits, managers, adapters, compatibility layers, or generic repositories unless they protect a real boundary or remove proven duplication.
- Prefer reference-module reuse over new structure, but do not copy business semantics blindly.
- Fix the smallest causal closed loop; avoid broad rewrites without an invariant-driven reason.
Evidence Rules
Use evidence terms precisely:
declared: docs, metadata, manifests, or model files state intent.
checked: schema, static validation, typecheck, drift check, or boundary check inspected structure.
tested: automated tests exercised behavior.
proven: a relevant executed gate or runtime/operational evidence supports the claimed invariant.
Never upgrade a claim from declared to checked, tested, or proven without executable evidence.
When To Deepen Review
Use focused workflow skills only when risk justifies deeper analysis:
- architecture review, release readiness, or template admission work
- distributed semantics, replay, idempotency, outbox, or worker recovery changes
- security, secrets, authorization, or tenant boundary changes
- broad backend refactors or cross-boundary protocol changes
- user explicitly asks for top-level backend review or code-quality audit