agentleFS
amariwanamariwan/FastApi-template/.claude/skills/backend/SKILL.md

backend

Skill0 starsChanged 6 months agoMITView on GitHub

Architecture rules for this backend project. Use this skill whenever writing backend code, creating new services, adding tests, handling imports between services, or adjusting folder structures. Also applies to refactoring, new modules, migrations, or CI pipeline changes in the backend context.

19 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use security, devops and 5 more.

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.
  • 0xSeroSkill

    security

    Also in 5 projects that use this

  • mrgoonieSkill

    devops

    Deploy to Cloudflare (Workers, R2, D1), Docker, GCP (Cloud Run, GKE), Kubernetes (kubectl, Helm). Use for serverless, containers, CI/CD, GitOps, security audit.

    Also in 3 projects that use this

  • MicrosoftSkill

    help

    Entry point for the MedImageInsight plugin, covering the getting-started walkthrough, how the skills work, what MI2 is, and troubleshooting.

    Also in 3 projects that use this

  • OpenAISkill

    supabase

    Use when doing ANY task involving Supabase. Triggers: Supabase products (Database, Auth, Edge Functions, Realtime, Storage, Vectors, Cron, Queues); client libraries and SSR integrations (supabase-js, @supabase/ssr) in Next.js, React, SvelteKit, Astro, Remix; auth issues (login, logout, sessions, JWT, cookies, getSession, getUser, getClaims, RLS); Supabase CLI or MCP server; schema changes, migrations, security audits, Postgres extensions (pg_graphql, pg_cron, pg_vector).

    Also in 3 projects that use this

  • 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

  • NVIDIASkill

    testing

    Run Python and Rust tests for physicsnemo-curator using uv + pytest with coverage reporting via pytest-cov, and cargo-nextest for Rust tests. Includes benchmark workflows with pytest-benchmark and criterion.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 16 edited versions we read keep these.

  • 1

    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:

    Every service is a fully independent module.

    line 38
  2. Very specific:

    Goal: If Service A is deleted, Service B continues to work without any code changes.

    line 59
  3. Very specific:

    If logic is needed in multiple services → extract it into core/ or shared/, never duplicate or cross-import.

    line 60
  4. Very specific:

    Never: place service-specific tests in /workspace/backend/tests/.

    line 94

“Common” is measured: kept by at least 6 in 10 of the 16 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 Rules

Project Structure

/workspace/backend/
├── tests/                        ← E2E / integration tests for core & shared ONLY
├── src/
│   ├── core/
│   │   └── core_auth/
│   │       ├── service.py
│   │       └── service_test.py   ← unit test co-located next to source
│   ├── shared/
│   └── app/
│       └── services/
│           ├── docgen/
│           │   ├── some_module.py
│           │   ├── some_module_test.py  ← unit test co-located
│           │   └── tests/              ← E2E / integration tests only
│           │       └── e2e/
│           └── docmanager/
│               ├── some_module.py
│               ├── some_module_test.py
│               └── tests/
│                   ├── e2e/
│                   └── integration/

Rule 1: Service Isolation (strict)

Every service is a fully independent module.

Allowed:

  • Imports from core/ and shared/
  • Own models, schemas, routers, utils within the service folder

Forbidden:

  • Direct imports between services
  • Shared state or shared DB models between services
# ✅ OK
from app.core.database import get_db
from app.shared.utils import paginate

# ❌ FORBIDDEN
from app.services.docgen.models import Document  # inside docmanager

Goal: If Service A is deleted, Service B continues to work without any code changes. If logic is needed in multiple services → extract it into core/ or shared/, never duplicate or cross-import.


Rule 2: Test Structure

Three-tier pattern — pick the right tier:

TierPatternWhere
Unit testsmodule_test.py co-located next to sourcesame folder as the file under test
E2E / Integration (service)test_*.py in tests/e2e/ or tests/integration/inside service folder
E2E / Integration (core/shared)test_*.py/workspace/backend/tests/
# ✅ Correct

# Unit test — co-located
src/app/services/docgen/application/orchestrator.py
src/app/services/docgen/application/orchestrator_test.py

# E2E — inside service tests folder
src/app/services/docgen/tests/e2e/test_builddoc_file.py
src/app/services/docmanager/tests/e2e/test_workflow.py
src/app/services/docmanager/tests/integration/test_api.py

# Core/shared E2E
tests/e2e/test_core.py

# ❌ Wrong
tests/e2e/test_docgen_orchestrator.py   ← service test in root tests/
src/app/services/docgen/tests/test_orchestrator.py  ← unit test should be co-located

Never place service-specific tests in /workspace/backend/tests/.


Rule 3: Creating a New Service

Checklist:

  • Own folder under src/app/services/<n>/
  • Unit tests co-located as <module>_test.py next to each file
  • Own tests/e2e/ and/or tests/integration/ for higher-level tests
  • No imports from other service folders
  • Shared logic extracted to core/ or shared/, never duplicated
  • Service registered in the app router, not directly coupled to other services

Rule 4: core/ vs shared/

core/shared/
DB session, Base modelsPagination, Response wrappers
Auth / JWT / PermissionsCustom exceptions
Config / SettingsValidators, Helpers
Logging setupMixins

Rule of thumb: core/ = infrastructure, shared/ = utilities without business logic.

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.