knofler/myai/endpoint-implementation
Claude Code and agent skill by knofler/myai
- community
Checking that the SKILL.md file is still in the repository.
Implement an API endpoint end-to-end — route, controller, service, validation, tests. Triggers: 'implement endpoint', 'create API route', 'build endpoint', 'add route', 'new API endpoint'.
Install
npx vskill@latest install knofler/myai/endpoint-implementationSKILL.md
The same SKILL.md was published earlier as knofler/myai/endpoint-implementation.
Endpoint Implementation
Implement a single API endpoint from contract to working, tested code. Follows a layered architecture: route -> controller -> service -> model.
When to Use
- An API contract exists and is ready for implementation
- Adding a new endpoint to an existing API
- Refactoring an endpoint to match an updated contract
Prerequisites
- API contract defined (see
api-contractskill) - Database schema in place if the endpoint touches persistence
Playbook
1. Read the API Contract
- Locate the contract in
AI/plan/api-contracts/ - Confirm method, path, auth, request/response schemas
- Note any dependencies on other endpoints or services
2. Create the Route File
Express (Node.js):
- Define the route with method, path, middleware chain, and controller reference
- Apply auth middleware if the contract requires it
FastAPI (Python):
- Define the router with path prefix and tags
3. Create the Controller
- Parse and destructure validated request data
- Call the service layer
- Return the correct HTTP status and response envelope
- Handle errors with try/catch, delegate to error middleware
4. Create the Service
- Contain all business logic — no HTTP concerns
- Interact with the database via model/repository
- Throw typed errors (NotFoundError, ConflictError, etc.)
5. Add Validation Schema
Node.js (Zod):
- Define
createSchema,updateSchema,querySchemaas needed - Wire into route via validation middleware
Python (Pydantic):
- Define request/response models — FastAPI validates automatically
6. Add Tests
- Unit test the service layer with mocked dependencies
- Integration test the route with supertest (Express) or httpx (FastAPI)
- Cover: success path, validation errors, auth errors, not-found, conflict
7. Register the Route
- Import and mount the route in the app entry point
- Verify with a manual curl or REST client call
- Confirm the endpoint appears in Swagger if
swagger-openapiskill is active
Checklist Before Done
- [ ] Route registered and reachable
- [ ] Validation rejects bad input with 400
- [ ] Auth middleware blocks unauthenticated requests (if required)
- [ ] Service logic covered by unit tests
- [ ] Integration test passes
- [ ] Response matches the API contract schema exactly
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/endpoint-implementation/SKILL.md
Popularity
- Repository stars
- 1
- 7-day trend score
- 8
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/knofler/myai/endpoint-implementation)