dkyazzentwatwa/supernavigator/backend-endpoint
Claude Code and agent skill by dkyazzentwatwa/supernavigator
- community
Checking that the SKILL.md file is still in the repository.
Create REST/GraphQL API endpoint with validation, error handling, and tests. Auto-invoke when user says "add endpoint", "create API", "new route", or "add route".
Install
npx vskill@latest install dkyazzentwatwa/supernavigator/backend-endpointSKILL.md
Backend API Endpoint Generator
Generate production-ready REST or GraphQL endpoints with request validation, error handling, and comprehensive tests.
When to Invoke
Auto-invoke when user mentions:
- "Add endpoint"
- "Create API"
- "New route"
- "Add route"
- "Create API endpoint for [resource]"
What This Does
- Generates route handler with proper HTTP methods
- Adds request validation (body, params, query)
- Implements error handling
- Creates test file with request/response tests
- Follows REST/GraphQL conventions
- Includes authentication middleware (if needed)
Execution Steps
Step 1: Gather Endpoint Requirements
Ask user for endpoint details:
Validate endpoint path:
- Use predefined function:
functions/route_validator.py - Ensure RESTful conventions
- Check path parameters syntax
- No trailing slashes
Step 1.5: Verify Understanding (ToM Checkpoint) [EXECUTE]
IMPORTANT: This step MUST be executed for high-stakes operations.
Before generating code, confirm interpretation with user.
Display verification:
Skip verification if (HIGH-STAKES ONLY mode):
- Simple CRUD operation (single resource, single path parameter)
- User explicitly said "quick", "just do it", or "skip confirmation"
- No custom authentication logic specified
- Standard GET/POST/PUT/DELETE without complex business logic
Always verify if:
- Multiple path parameters (e.g.,
/users/:userId/posts/:postId) - Custom authorization logic specified
- Non-standard HTTP methods or patterns
- GraphQL mutations with side effects
- Endpoints involving financial or sensitive data
Step 1.8: Declare Belief State (Optional - ToM Anchor)
Before generating code, optionally declare explicit assumptions (enabled by tom_features.belief_anchors in config).
Display belief state anchor:
Skip belief anchor if:
tom_features.belief_anchorsis false in config- User said "skip", "just do it", "quick"
- Simple endpoint with no custom logic
Show belief anchor if:
- Complex endpoint with multiple integrations
- User profile indicates preference for detailed explanations
- First endpoint in a new project (establishing patterns)
Step 2: Generate Route Handler
Based on HTTP method and framework:
Use predefined function: functions/endpoint_generator.py
Template includes:
- Route definition
- Request validation middleware
- Controller/handler function
- Error handling
- Response formatting
- TypeScript types
Step 3: Generate Validation Schema
Use predefined function: functions/validation_generator.py
Supported validation libraries:
- Zod (default, TypeScript-first)
- Joi (JavaScript schema)
- Yup (object schema)
- Express-validator (middleware-based)
Output example (Zod):
Step 4: Generate Error Handling Middleware
Use predefined function: functions/error_handler_generator.py
Error handler includes:
- HTTP status code mapping
- Error response formatting
- Logging integration
- Development vs production modes
- Validation error handling
Step 5: Generate Test File
Use predefined function: functions/test_generator.py
Test template includes:
- Success case (200/201)
- Validation errors (400)
- Not found (404)
- Unauthorized (401)
- Server errors (500)
- Edge cases
Example test:
Step 6: Generate API Documentation Comment
JSDoc or OpenAPI annotation:
Step 7: Show Endpoint Summary
Display generated files and usage:
Predefined Functions
1. route_validator.py
Validates route path follows REST conventions.
Usage:
Checks:
- RESTful naming (plural resources)
- Path parameter syntax (
:idor{id}) - No trailing slashes
- HTTP method matches intent
Returns: Valid path or error message
2. endpoint_generator.py
Generates endpoint handler from template.
Usage:
Parameters:
--path: API endpoint path--method: HTTP method--resource: Resource name (singular, PascalCase)--framework: Backend framework--auth: Include auth middleware--validation: Include validation middleware--template: Template file path
Returns: Generated endpoint code
3. validation_generator.py
Generates request validation schema.
Usage:
Supported field types:
string,number,booleanemail,url,uuidarray,objectdate,datetime
Returns: Validation schema code
4. error_handler_generator.py
Generates error handling middleware.
Usage:
Returns: Error handler middleware code
5. test_generator.py
Generates endpoint integration tests.
Usage:
Generates tests for:
- Success responses
- Validation errors
- Authentication errors
- Not found errors
- Server errors
Returns: Generated test code
Templates
express-route-template.ts
Express.js route handler template.
Placeholders:
${ROUTE_PATH}- API endpoint path${HTTP_METHOD}- HTTP method (lowercase)${RESOURCE_NAME}- Resource name (PascalCase)${VALIDATION_MIDDLEWARE}- Validation middleware${AUTH_MIDDLEWARE}- Authentication middleware
fastify-route-template.ts
Fastify route handler template (alternative).
graphql-resolver-template.ts
GraphQL resolver template (alternative).
validation-zod-template.ts
Zod validation schema template.
endpoint-test-template.spec.ts
Integration test template with supertest.
Placeholders:
${ENDPOINT_PATH}- Endpoint to test${HTTP_METHOD}- HTTP method${TEST_CASES}- Generated test cases
Examples
See examples/ directory for reference implementations:
- users-get.ts - GET endpoint with auth
- users-post.ts - POST endpoint with validation
- graphql-resolver.ts - GraphQL mutation example
Each example includes:
- Route/resolver implementation
- Validation schema
- Error handling
- Test file
- Usage documentation
Best Practices
REST API Design
- Use plural nouns for resources (
/users, not/user) - Use HTTP methods correctly (GET=read, POST=create, PUT/PATCH=update, DELETE=remove)
- Nest resources properly (
/users/:userId/posts/:postId) - Return proper status codes (200, 201, 400, 401, 404, 500)
Request Validation
- Validate all inputs (body, params, query)
- Fail fast (validate before business logic)
- Clear error messages (tell user what's wrong)
- Sanitize inputs (prevent injection attacks)
Error Handling
- Centralized error handler (DRY principle)
- Consistent error format (always same structure)
- Don't expose internals (sanitize stack traces in production)
- Log errors (for debugging)
Security
- Authentication (verify identity)
- Authorization (check permissions)
- Rate limiting (prevent abuse)
- Input sanitization (prevent XSS, SQL injection)
Testing
- Test happy path (success cases)
- Test error cases (validation, auth, not found)
- Test edge cases (empty data, large data)
- Mock external dependencies (database, APIs)
Troubleshooting
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationFailed, 50 of 100Degrading. 1 run. Evaluated 8 months ago.
Source
- SKILL.md in the repositoryCheckingnavigator-main/skills/backend-endpoint/SKILL.md
Popularity
- Repository stars
- 31
- Repository forks
- 2
- 7-day trend score
- 17
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 18 Apr 2026, 6 months ago.
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/dkyazzentwatwa/supernavigator/backend-endpoint)