specwright/templates/skills/api-implementation-patterns/SKILL.md
--- name: [PROJECT]-api-patterns description: [PROJECT] REST API implementation patterns and conventions globs: ["**/*.{java,ts,js,py,rb,go}"] --- # API Implementation Patterns > **Template for project-specific API implementation skill** > Fill in [CUSTOMIZE] sections with your project's detected or chosen patterns **Project**: [PROJECT NAME] **Framework**: [CUSTOMIZE: Spring Boot / Express.js / FastAPI / Django / Ruby on Rails / Gin] **Language**: [CUSTOMIZE: Java / TypeScript / Python / Rub
npx skillsauth add michsindlinger/specwright specwright/templates/skills/api-implementation-patternsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Template for project-specific API implementation skill Fill in [CUSTOMIZE] sections with your project's detected or chosen patterns
Project: [PROJECT NAME] Framework: [CUSTOMIZE: Spring Boot / Express.js / FastAPI / Django / Ruby on Rails / Gin] Language: [CUSTOMIZE: Java / TypeScript / Python / Ruby / Go] Last Updated: [DATE]
Location: [CUSTOMIZE: src/main/java/controllers / src/controllers / app/routers]
Naming Convention: [CUSTOMIZE: UserController / UsersController / user_controller / user.routes]
Pattern Type: [CUSTOMIZE: Class-based / Function-based / Decorator-based]
[CUSTOMIZE WITH YOUR PROJECT'S ACTUAL PATTERN]
Example - GET Endpoint:
[CUSTOMIZE: Show actual code pattern from your project]
Example patterns:
- Spring Boot: @GetMapping("/users")
- Express: router.get('/users', async (req, res) => {...})
- FastAPI: @router.get("/users")
- Django: viewsets.ModelViewSet
- Rails: resources :users
Example - POST Endpoint with Validation:
[CUSTOMIZE: Show create/post pattern]
Example - PUT/PATCH Endpoint:
[CUSTOMIZE: Show update pattern]
Example - DELETE Endpoint:
[CUSTOMIZE: Show delete pattern]
Request Body Parsing: [CUSTOMIZE: @RequestBody / req.body / Request / request.data]
Response Format: [CUSTOMIZE: ResponseEntity / res.json() / JSONResponse / render]
Status Codes: [CUSTOMIZE: Which codes used - 200, 201, 204, 400, 404, 500]
Location: [CUSTOMIZE: src/main/java/services / src/services / app/services]
Naming: [CUSTOMIZE: UserService / UsersService / user_service / UserService.ts]
Pattern: [CUSTOMIZE: Class-based / Function-based / Module-based]
[CUSTOMIZE WITH ACTUAL PATTERN]
Example - CRUD Operations:
[CUSTOMIZE: Show service class/module structure]
Example:
- Create: createUser(data) → validates, saves, returns
- Read: getUserById(id) → finds, throws if not found
- Update: updateUser(id, data) → finds, validates, updates
- Delete: deleteUser(id) → checks dependencies, deletes
Approach: [CUSTOMIZE: @Transactional / BEGIN/COMMIT / context manager / transaction.atomic]
Isolation Level: [CUSTOMIZE: READ_COMMITTED / Default / Custom]
Location: [CUSTOMIZE: src/main/java/repositories / src/repositories / app/models]
Naming: [CUSTOMIZE: UserRepository / UsersRepository / user_repository]
Pattern: [CUSTOMIZE: Spring Data JPA / Prisma / SQLAlchemy / ActiveRecord / Raw SQL]
[CUSTOMIZE WITH ACTUAL PATTERN]
Standard Queries:
[CUSTOMIZE: Show query methods]
Examples:
- findById(id)
- findAll()
- save(entity)
- delete(id)
Custom Queries:
[CUSTOMIZE: How custom queries are defined]
Examples:
- Spring Data: findByEmail(email)
- Prisma: findMany({ where: {...}})
- SQLAlchemy: query.filter_by(email=email)
Strategy: [CUSTOMIZE: @EntityGraph / .include() / select_related() / eager loading]
Location: [CUSTOMIZE: src/main/java/entities / src/models / app/models]
Naming: [CUSTOMIZE: User / UserEntity / user.model / User.java]
Convention: [CUSTOMIZE: camelCase / snake_case / PascalCase]
Examples:
Pattern: [CUSTOMIZE: @OneToMany / hasMany / ForeignKey / references]
Example:
[CUSTOMIZE: How relationships are defined]
Location: [CUSTOMIZE: Entity level / DTO level / Separate validators]
Approach: [CUSTOMIZE: Annotations / Decorators / Validator classes / Schemas]
Location: [CUSTOMIZE: src/main/java/dto / src/dto / app/serializers]
Naming Convention: [CUSTOMIZE: UserDTO / UserResponse / CreateUserDTO / user_schema]
Pattern: [CUSTOMIZE: Records / Classes / Interfaces / Pydantic models]
Example:
[CUSTOMIZE: Show CreateRequest pattern]
Validation: [CUSTOMIZE: @Valid / class-validator / Pydantic / Rails validations]
Pattern: [CUSTOMIZE: Same as request / Separate / ViewModels]
Example:
[CUSTOMIZE: Show Response DTO]
Approach: [CUSTOMIZE: Manual / MapStruct / class-transformer / Serializer]
Location: [CUSTOMIZE: src/exceptions / src/errors / app/exceptions]
Naming: [CUSTOMIZE: ResourceNotFoundException / NotFoundError / ResourceNotFound]
Example:
[CUSTOMIZE: Show custom exception]
Pattern: [CUSTOMIZE: @ControllerAdvice / middleware / exception_handler / rescue_from]
Error Response Format:
[CUSTOMIZE: Show your error response structure]
{
"status": 404,
"message": "User not found",
"timestamp": "2025-12-30T10:00:00Z"
}
Framework: [CUSTOMIZE: JUnit 5 / Jest / Pytest / RSpec]
Mocking: [CUSTOMIZE: Mockito / sinon / unittest.mock / RSpec mocks]
Test Structure: [CUSTOMIZE: AAA / Given-When-Then / Arrange-Act-Assert]
Example:
[CUSTOMIZE: Show unit test pattern]
Framework: [CUSTOMIZE: Spring Test / Supertest / TestContainers / Django TestCase]
Database: [CUSTOMIZE: TestContainers / In-memory / Rollback / Fixtures]
Example:
[CUSTOMIZE: Show integration test]
Approach: [CUSTOMIZE: OpenAPI/Swagger / JSDoc / Docstrings / YARD / Inline comments]
Location: [CUSTOMIZE: api-mocks/ / mocks/ / fixtures/]
Format:
[CUSTOMIZE: Show mock structure]
Where: [CUSTOMIZE: Controller / DTO / Middleware / Before filter]
How: [CUSTOMIZE: Annotations / Decorators / Manual checks / Validators]
Approach: [CUSTOMIZE: Parameterized queries / ORM only / Prepared statements]
Pattern: [CUSTOMIZE: JWT / Session / OAuth / API Keys]
When generating API code, always include:
[CUSTOMIZE - ADD PROJECT GOTCHAS AND PREFERENCES]
Customization Complete: Replace all [CUSTOMIZE] sections with project-detected or chosen patterns.
Auto-generated by: /add-skill api-implementation-patterns command (with code analysis)
tools
Session Handoff: Erstellt eine vollständige Zusammenfassung der aktuellen Session für einen sauberen Kontextwechsel. NUR bei explizitem Aufruf (/session-handoff). NICHT automatisch auslösen. Geeignet wenn der User die Session resetten will, den Kontext aufräumen will, oder bei ~120k Tokens angelangt ist.
development
Pre-Mortem Risk Analysis: Strukturierte Prospective-Hindsight-Übung um launch-blocking Risiken vor Commitment aufzudecken. Team stellt sich vor, das Produkt sei 14 Tage nach Launch gefloppt, und arbeitet rückwärts. Klassifiziert Risiken in Tigers (echt), Paper Tigers (hypothetisch), Elephants (unausgesprochen). Nutze diesen Skill vor Build-Commitment, bei zu hoher Stakeholder-Confidence, vor Major-Releases, oder wenn das Team vage Sorgen nicht artikulieren kann. Trigger: /pre-mortem, 'pre-mortem', 'risk analysis', 'was könnte schiefgehen', 'risiken vor launch'.
testing
Six-Sigma Atomicity Validator for create-spec stories
tools
UX pattern definition guidance for navigation, user flows, interactions, and accessibility