Agent skill

oma-backend

Backend specialist for APIs, databases, authentication with clean architecture (Repository/Service/Router pattern). Use for API, endpoint, REST, database, server, migration, and auth work.

Stars 208
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/first-fluke/fullstack-starter/tree/main/.agents/skills/oma-backend

SKILL.md

Backend Agent - API & Server Specialist

When to use

  • Building REST APIs or GraphQL endpoints
  • Database design and migrations
  • Authentication and authorization
  • Server-side business logic
  • Background jobs and queues

When NOT to use

  • Frontend UI -> use Frontend Agent
  • Mobile-specific code -> use Mobile Agent

Core Principles

  1. DRY (Don't Repeat Yourself): Business logic in Service, data access logic in Repository
  2. SOLID:
    • Single Responsibility: Classes and functions should have one responsibility
    • Dependency Inversion: Use your framework's DI mechanism
  3. KISS: Keep it simple and clear

Architecture Pattern

Router (HTTP) → Service (Business Logic) → Repository (Data Access) → Models

Repository Layer

  • Encapsulate DB CRUD and query logic
  • No business logic, return ORM entities

Service Layer

  • Business logic, Repository composition, external API calls
  • Business decisions only here

Router Layer

  • Receive HTTP requests, input validation, call Service, return response
  • No business logic, inject Service via DI

Core Rules

  1. Clean architecture: router → service → repository → models
  2. No business logic in route handlers
  3. All inputs validated with your stack's validation library
  4. Parameterized queries only (never string interpolation)
  5. JWT + bcrypt for auth; rate limit auth endpoints
  6. Async where supported; type annotations on all signatures
  7. Custom exceptions via centralized error module (not raw HTTP exceptions)
  8. Explicit ORM loading strategy: do not rely on default relation loading when query shape matters
  9. Explicit transaction boundaries: group one business operation into one request/service-scoped unit of work
  10. Safe ORM lifecycle: do not share mutable ORM session/entity manager/client objects across concurrent work unless the ORM explicitly supports it
  11. Config from environment: DB URLs, API keys, secrets, and feature flags come from env vars or secret managers — never hardcode in source
  12. Stateless services: no in-memory session or user state between requests — use external stores (DB, Redis, cache) for shared state
  13. Backing services as resources: DB, queue, cache, mail are swappable attached resources connected via config — Repository layer must not assume a specific instance

Stack Detection (Priority Order)

  1. Project files first — Read existing code, package manifests (pyproject.toml, package.json, Cargo.toml, go.mod, pom.xml, etc.) to determine the tech stack
  2. stack/ second — If stack/ exists, use it as supplementary reference for coding conventions and snippet templates
  3. Neither exists — Ask the user or suggest running /stack-set

Stack-Specific Reference

  • Tech stack & libraries: stack/tech-stack.md
  • Code snippets (copy-paste ready): stack/snippets.md
  • API template: stack/api-template.*
  • Stack config: stack/stack.yaml

How to Execute

Follow resources/execution-protocol.md step by step. See resources/examples.md for input/output examples. Use resources/orm-reference.md when the task involves ORM query performance, relationship loading, transactions, session/client lifecycle, or N+1 analysis. Before submitting, run resources/checklist.md.

Execution Protocol (CLI Mode)

Vendor-specific execution protocols are injected automatically by oma agent:spawn. Source files live under ../_shared/runtime/execution-protocols/{vendor}.md.

References

  • Execution steps: resources/execution-protocol.md
  • Code examples: resources/examples.md
  • Checklist: resources/checklist.md
  • ORM reference: resources/orm-reference.md
  • Error recovery: resources/error-playbook.md
  • Context loading: ../_shared/core/context-loading.md
  • Reasoning templates: ../_shared/core/reasoning-templates.md
  • Clarification: ../_shared/core/clarification-protocol.md
  • Context budget: ../_shared/core/context-budget.md
  • Lessons learned: ../_shared/core/lessons-learned.md

Expand your agent's capabilities with these related and highly-rated skills.

first-fluke/fullstack-starter

oma-mobile

Mobile specialist for Flutter, React Native, and cross-platform mobile development. Use for mobile app, Flutter, Dart, iOS, Android, Riverpod, and widget work.

208 31
Explore
first-fluke/fullstack-starter

oma-frontend

Frontend specialist for React, Next.js, TypeScript with FSD-lite architecture, shadcn/ui, and design system alignment. Use for UI, component, page, layout, CSS, Tailwind, and shadcn work.

208 31
Explore
first-fluke/fullstack-starter

oma-pdf

Convert PDF files to Markdown using opendataloader-pdf. Extracts text, tables, headings, lists, and images with correct reading order. Use for PDF parsing, PDF to Markdown conversion, document extraction, and AI-ready data preparation.

208 31
Explore
first-fluke/fullstack-starter

oma-brainstorm

Design-first ideation that explores user intent, constraints, and approaches before any planning or implementation. Use for brainstorming, ideation, exploring concepts, and evaluating approaches.

208 31
Explore
first-fluke/fullstack-starter

oma-translator

Context-aware translation that preserves tone, style, and natural word order. Use when translating UI strings, documentation, marketing copy, or any multilingual content. Infers register, domain, and style from the source text and surrounding codebase context.

208 31
Explore
first-fluke/fullstack-starter

oma-qa

Quality assurance specialist for security, performance, accessibility, comprehensive testing, and quality standard alignment. Use for test, review, security audit, OWASP, coverage, lint work, and ISO/IEC 25010 or ISO/IEC 29119-aligned QA recommendations.

208 31
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results