CommunityCodierung & Entwicklunggithub.com

API-Design-Prinzipien

Beherrsche REST- und GraphQL-API-Designprinzipien, um intuitive, skalierbare und wartbare APIs zu entwickeln, die Entwickler begeistern.

Was ist API-Design-Prinzipien?

Diese Fähigkeit (Skill) bietet umfassende Richtlinien für das Design von REST- und GraphQL-APIs, die sowohl für die Neuentwicklung als auch für die Überarbeitung bestehender APIs geeignet sind. Sie behandelt die Kernprinzipien des REST-Architekturstils (ressourcenorientiertes Design, semantische HTTP-Methoden) und des GraphQL-Designs (schema-first, Queries, Mutations, Subscriptions). Ein besonderer Schwerpunkt liegt auf praktischen Aspekten wie API-Versionierungsstrategien (URL-, Header-, Query-Parameter-Versionierung), Best Practices (Namenskonventionen, Statuscodes, Paginierung, Rate Limiting) und der Vermeidung häufiger Fallstricke wie Over-fetching, Breaking Changes und inkonsistenten Fehlerformaten. Die Fähigkeit unterstützt Entwickler dabei, konsistente, gut dokumentierte und entwicklerfreundliche APIs zu erstellen, und ist plattformunabhängig einsetzbar (z. B. für Claude Code, Cursor, Codex).

Funktioniert mit~Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/mianhtsys/landingMod3/tree/HEAD/MODULO_3_DESARROLLO_AL_LADO_DEL_CLIENTE_Y_SERVIDOR_WEB/architecture-skills-framework/.agents/skills/api-design-principles

Installed? Explore more Codierung & Entwicklung skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

In Ihrer bevorzugten KI fragen

Öffnet einen neuen Chat, in dem dieser Agent-Skill bereits geladen ist.

Dokumentation

Was macht API-Design-Prinzipien?

Beherrsche REST- und GraphQL-API-Designprinzipien, um intuitive, skalierbare und wartbare APIs zu entwickeln, die Entwickler begeistern und die Zeit überdauern.

Wann diese Fähigkeit eingesetzt wird

  • Entwicklung neuer REST- oder GraphQL-APIs
  • Refactoring bestehender APIs für eine bessere Benutzerfreundlichkeit
  • Festlegung von API-Designstandards für Ihr Team
  • Überprüfung von API-Spezifikationen vor der Implementierung
  • Migration zwischen API-Paradigmen (REST zu GraphQL usw.)
  • Erstellung entwicklerfreundlicher API-Dokumentationen
  • Optimierung von APIs für spezifische Anwendungsfälle (Mobilgeräte, Drittanbieter-Integrationen)

Kernkonzepte

1. REST-Designprinzipien

Ressourcenorientierte Architektur

  • Ressourcen sind Nomen (User, Orders, Products), keine Verben
  • Verwenden Sie HTTP-Methoden für Aktionen (GET, POST, PUT, PATCH, DELETE)
  • URLs repräsentieren Ressourcenhierarchien
  • Konsistente Namenskonventionen

Semantik der HTTP-Methoden:

  • GET: Ressourcen abrufen (idempotent, sicher)
  • POST: Neue Ressourcen erstellen
  • PUT: Vollständige Ressource ersetzen (idempotent)
  • PATCH: Teilweise Ressourcenaktualisierungen
  • DELETE: Ressourcen entfernen (idempotent)

2. GraphQL-Designprinzipien

Schema-First-Entwicklung

  • Typen definieren Ihr Domainmodell
  • Queries zum Lesen von Daten
  • Mutations zum Ändern von Daten
  • Subscriptions für Echtzeit-Updates

Query-Struktur:

  • Clients fordern genau das an, was sie benötigen
  • Ein Endpunkt, mehrere Operationen
  • Stark typisiertes Schema
  • Introspection ist eingebaut

3. API-Versionierungsstrategien

URL-Versionierung:

/api/v1/users
/api/v2/users

Header-Versionierung:

Accept: application/vnd.api+json; version=1

Query-Parameter-Versionierung:

/api/users?version=1

Detaillierte Muster und ausgearbeitete Beispiele

Detaillierte Musterdokumentation befindet sich in references/details.md. Lesen Sie diese Datei, wenn die oben genannte Navigationsebene nicht ausreicht.

Best Practices

REST-APIs

  1. Konsistente Benennung: Verwenden Sie Plural-Nomen für Collections (/users, nicht /user)
  2. Zustandslosigkeit: Jede Anfrage enthält alle notwendigen Informationen
  3. HTTP-Statuscodes korrekt verwenden: 2xx Erfolg, 4xx Client-Fehler, 5xx Server-Fehler
  4. API versionieren: Planen Sie von Anfang an für Breaking Changes
  5. Paginierung: Paginieren Sie immer große Collections
  6. Rate Limiting: Schützen Sie Ihre API mit Ratenbegrenzungen
  7. Dokumentation: Verwenden Sie OpenAPI/Swagger für interaktive Dokumentationen

GraphQL-APIs

  1. Schema zuerst: Designen Sie das Schema, bevor Sie Resolver schreiben
  2. N+1 vermeiden: Verwenden Sie DataLoader für effizientes Datenabrufen
  3. Eingabevalidierung: Validieren Sie auf Schema- und Resolver-Ebene
  4. Fehlerbehandlung: Geben Sie strukturierte Fehler in den Mutation-Payloads zurück
  5. Paginierung: Verwenden Sie cursor-basierte Paginierung (Relay-Spezifikation)
  6. Deprecation: Nutzen Sie die @deprecated-Direktive für schrittweise Migration
  7. Monitoring: Verfolgen Sie Query-Komplexität und Ausführungszeit

Häufige Fallstricke

  • Over-fetching/Under-fetching (REST): In GraphQL behoben, erfordert jedoch DataLoader
  • Breaking Changes: Versionieren Sie APIs oder verwenden Sie Deprecation-Strategien
  • Inkonsistente Fehlerformate: Standardisieren Sie Fehlerantworten
  • Fehlende Ratenbegrenzungen: APIs ohne Limits sind anfällig für Missbrauch
  • Schlechte Dokumentation: Undokumentierte APIs frustrieren Entwickler
  • Ignorieren der HTTP-Semantik: POST für idempotente Operationen bricht Erwartungen
  • Enge Kopplung: Die API-Struktur sollte nicht das Datenbankschema widerspiegeln

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

mianhtsys/landingMod3

Implement WCAG 2.2 compliant interfaces with mobile accessibility, inclusive design patterns, and assistive technology support. Use when auditing accessibility, implementing ARIA patterns, building for screen readers, or ensuring inclusive user experiences.

mianhtsys/landingMod3

Diseña y compara alternativas arquitectónicas trazables a RF/RNF sin implementar código.

mianhtsys/landingMod3

Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. Use this skill when designing clean architecture for a new microservice, when refactoring a monolith to use bounded contexts, when implementing hexagonal or onion architecture patterns, or when debugging dependency cycles between application layers.

mianhtsys/landingMod3

Revisión adversarial de la arquitectura contra RF/RNF, detectando contradicciones, cobertura faltante y complejidad innecesaria.

mianhtsys/landingMod3

Master authentication and authorization patterns including JWT, OAuth2, session management, and RBAC to build secure, scalable access control systems. Use when implementing auth systems, securing APIs, or debugging security issues.

mianhtsys/landingMod3

>- Generate grounded-and-verified, engine-agnostic database documentation that reaches 100% parity with the real schema. Introspects the LIVE database as ground truth and cross-validates it against ORM models, migrations, generated types, seeds, and application queries, then proves completeness by diffing the docs back against the database. Produces ER diagrams (mermaid), per-table data dictionaries, and a machine-readable schema.json. Works with PostgreSQL, MySQL, SQL Server, and SQLite across any ORM (Prisma, TypeORM, Drizzle, Sequelize, Knex, Django, Rails) or raw SQL. Use when asked to document a database, produce an ERD or data dictionary, write db/schema docs, audit schema drift, or refresh existing DB docs.

mianhtsys/landingMod3

Compara estrategias de persistencia y motores de datos según consistencia, concurrencia, volumen, recuperación y operación.

mianhtsys/landingMod3

Design robust, scalable database schemas for SQL and NoSQL databases. Provides normalization guidelines, indexing strategies, migration patterns, constraint design, and performance optimization. Ensures data integrity, query performance, and maintainable data models.

mianhtsys/landingMod3

Consolida análisis especializados en una recomendación arquitectónica, matriz de decisión, ADR y plan de validación.

mianhtsys/landingMod3

Master error handling patterns across languages including exceptions, Result types, error propagation, and graceful degradation to build resilient applications. Use when implementing error handling, designing APIs, or improving application reliability.

mianhtsys/landingMod3

Build and maintain web frontends — component architecture, state management, API integration, responsive layout, client-side performance, and frontend testing patterns. Framework agnostic, focused on web frontend implementation. Do not use for backend service implementation, data engineering, or platform infrastructure work.

mianhtsys/landingMod3

Evalúa despliegue, contenedores, escalado, alta disponibilidad, observabilidad, backup, recuperación y CI/CD de forma proporcional.

mianhtsys/landingMod3

Execute read-only SQL queries against multiple Microsoft SQL Server databases. Use when: (1) querying MSSQL/SQL Server databases, (2) exploring database schemas/tables, (3) running SELECT queries for data analysis, (4) checking database contents. Supports multiple database connections with descriptions for intelligent auto-selection. Blocks all write operations (INSERT, UPDATE, DELETE, DROP, etc.) for safety.

mianhtsys/landingMod3

Generate and maintain OpenAPI 3.1 specifications from code, design-first specs, and validation patterns. Use when creating API documentation, generating SDKs, or ensuring API contract compliance.

mianhtsys/landingMod3

PHP 8.0+ development — XAMPP, RESTful APIs, PDO/MySQL/MariaDB, and authentication. Use when building PHP backends, creating API endpoints, configuring XAMPP, or integrating PHP with databases.

mianhtsys/landingMod3

Use this skill when designing or reviewing a PostgreSQL-specific schema. Covers best-practices, data types, indexing, constraints, performance patterns, and advanced features

mianhtsys/landingMod3

Analiza requisitos funcionales y no funcionales, reglas, restricciones, capacidad y ambigüedades antes de seleccionar tecnologías.

mianhtsys/landingMod3

Implement modern responsive layouts using container queries, fluid typography, CSS Grid, and mobile-first breakpoint strategies. Use when building adaptive interfaces, implementing fluid layouts, or creating component-level responsive behavior.

mianhtsys/landingMod3

>- Use when designing or implementing software securely: define security requirements, threat-model a feature, choose secure defaults, design authentication and authorization, handle untrusted data and secrets, evaluate dependencies, design multi-tenant trust boundaries, or review security-sensitive changes. Use for prevention during requirements, design, implementation, and review; not for post-build security assessments or scanning an existing codebase.

mianhtsys/landingMod3

Revisa seguridad arquitectónica, identidad, autorización, secretos, APIs, auditoría, fraude y resiliencia antes de implementar.

Verwandte Skills