agentleFS
stoffl6781stoffl6781/claude-skill/skills/backend/SKILL.md

backend

Skill1 starsChanged 7 months agoMITView on GitHub

Backend-Implementierung nach Spec: Models, Services, Controllers, Jobs, Migrations. Nutze bei: 'Backend bauen', 'Service erstellen', 'Controller', 'Migration', 'API', 'Route anlegen'.

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 3 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

  • 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

  • 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

  • MicrosoftSkill

    api-design

    Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.

    Also in 3 projects that use this

The file

Files
SKILL.md

/backend – Backend-Implementierung

Du bist ein Backend-Entwickler der nach Spec implementiert. Saubere Architektur, getestet, sicher.

Vor dem Start (immer!)

  1. Spec + Architektur lesen: Feature-Spec mit Architektur-Abschnitt vorhanden?
  2. Bestand prüfen: Existierende Models, Services, Controllers inventarisieren
  3. Stack erkennen: Laravel? WordPress? Node?
  4. Patterns verstehen: Wie macht das Projekt es bisher?

Bestand prüfen

# Laravel
ls app/Models/ app/Services/ app/Http/Controllers/ app/Enums/ 2>/dev/null
php artisan route:list --compact 2>/dev/null | head -20
ls database/migrations/ | tail -10
# WordPress
grep -r "register_post_type\|add_action\|add_filter" functions.php 2>/dev/null | head -10

Workflow

  1. Migration erstellen (Datenbank zuerst)
  2. Model mit Relations, Casts, Scopes
  3. Enum falls nötig (Status, Typen)
  4. Service für Business-Logik (nicht im Controller!)
  5. Controller dünn – ruft Service auf, gibt Response
  6. Routes registrieren
  7. Form Request für Validierung
  8. Job falls async nötig
  9. Policy falls Authorization nötig
  10. Tests schreiben (oder an /qa übergeben)

Implementierungs-Regeln

Laravel (Primär-Stack)

Allgemein:

  • declare(strict_types=1) in jeder Datei
  • Return Types und Parameter Types immer annotieren
  • Kein any, keine mixed wenn vermeidbar
  • Dependency Injection statt Facades wo möglich

Models:

  • $fillable explizit definieren (kein $guarded = [])
  • Relationen typisiert: public function team(): BelongsTo
  • Casts für JSON, Enums, Dates
  • Scopes für häufige Queries: scopeActive(), scopeForTeam()

Services:

  • Eine Klasse = eine Verantwortlichkeit
  • Max. ~200 Zeilen. Länger? Aufteilen
  • Methoden max. ~20 Zeilen
  • Keine DB-Queries im Controller – immer via Service
  • Exceptions werfen statt null/false zurückgeben

Controllers:

  • Dünn: Validierung → Service → Response
  • Form Requests für Validierung (keine Inline-Validation)
  • $this->authorize() für Authorization
  • Resource-Controller wenn CRUD: index, create, store, show, edit, update, destroy

Migrations:

  • Immer down() implementieren
  • Foreign Keys mit onDelete('cascade') oder onDelete('set null')
  • Indexes auf WHERE/ORDER BY/JOIN Spalten
  • $table->id(), $table->timestamps() Standard

Jobs:

  • implements ShouldQueue immer
  • $tries, $maxExceptions, $backoff definieren
  • Idempotent: Mehrfach-Ausführung darf nichts kaputt machen
  • Rate Limiting bei externen APIs

Security (Pflicht):

  • Escaping: {{ }} in Blade (kein {!! !!} ohne Grund)
  • Prepared Statements: Query Builder/Eloquent, kein DB::raw() mit User-Input
  • CSRF: Automatisch via Middleware, Webhooks explizit excluden
  • Authorization: Policies oder $this->authorize() in jedem Controller
  • Keine Secrets in Code – immer config() (nicht env() direkt)

WordPress

  • Hooks vor direkten Calls: add_action, add_filter
  • $wpdb->prepare() für alle DB-Queries
  • Nonces bei Forms und AJAX
  • Capabilities prüfen: current_user_can()

API-Endpunkte

  • RESTful: Nomen statt Verben (/projects, nicht /getProjects)
  • Konsistente Response-Struktur: { data: ..., meta: ... }
  • HTTP-Status korrekt: 200, 201, 204, 400, 401, 403, 404, 422, 429, 500
  • Rate Limiting auf öffentlichen Endpunkten
  • Pagination bei Listen (.paginate(), nie ->get() bei unbekannter Menge)

Qualitäts-Checklist

Vor dem Abschluss:

Datenbank

  • Migration hat up() UND down()?
  • Foreign Keys definiert?
  • Indexes auf kritischen Spalten?
  • $fillable auf allen neuen Models?

Logik

  • Business-Logik in Service (nicht Controller)?
  • Controller ist dünn (< 30 Zeilen pro Methode)?
  • Validation via Form Request?
  • Error-Handling: Exceptions statt stille Fehler?
  • Keine N+1 Queries (Eager Loading)?

Security

  • Authorization (Policy/authorize()) auf jedem Endpunkt?
  • Kein DB::raw() mit User-Input?
  • Kein dd(), dump(), var_dump()?
  • Keine hardcodierten Secrets?
  • Rate Limiting auf öffentlichen Routes?

Qualität

  • declare(strict_types=1) in jeder Datei?
  • Return Types annotiert?
  • Variablen selbsterklärend (kein $x, $tmp)?
  • Methoden < 20 Zeilen?
  • Build/Lint erfolgreich?

Handoff

Nach Abschluss:

Backend ist implementiert. Nächster Schritt: /frontend für die UI, oder /qa zum Testen.

INDEX aktualisieren

Status des Features auf In Progress setzen (oder belassen falls Frontend auch nötig).

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.