backend-test
Generate backend tests (unit, integration, mocks) for existing code. Auto-invoke when user says "write test for", "add test",…
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".
Claude Code
$ npx -y skills add qf-studio/navigator --skill backend-endpoint --agent claude-code
Codex
$ npx skills add qf-studio/navigator --skill backend-endpoint -a codex -y
Cursor
$ npx skills add qf-studio/navigator --skill backend-endpoint -a cursor -y
Gemini CLI
$ npx skills add qf-studio/navigator --skill backend-endpoint -a gemini-cli -y
GitHub Copilot
$ npx skills add qf-studio/navigator --skill backend-endpoint -a github-copilot -y
OpenCode
$ npx skills add qf-studio/navigator --skill backend-endpoint -a opencode -y
Windsurf
$ npx skills add qf-studio/navigator --skill backend-endpoint -a windsurf -y
name: backend-endpoint description: 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". allowed-tools: Read, Write, Edit, Grep, Glob, Bash version: 2.0.0
Generate production-ready REST or GraphQL endpoints with request validation, error handling, and comprehensive tests.
Auto-invoke when user mentions:
1. Generates route handler with proper HTTP methods 2. Adds request validation (body, params, query) 3. Implements error handling 4. Creates test file with request/response tests 5. Follows REST/GraphQL conventions 6. Includes authentication middleware (if needed)
Before gathering requirements, query the knowledge graph for what we already know about API/endpoint work in this project. Mirrors `navigator-research`'s Phase 0.
PLUGIN_DIR="${CLAUDE_PLUGIN_ROOT:-$(cat "${NAVIGATOR_CONFIG_HOME:-${XDG_CONFIG_HOME:-$HOME/.config}/navigator}/plugin-root" 2>/dev/null)}"
[ -d "$PLUGIN_DIR/skills" ] || PLUGIN_DIR="$HOME/.claude/plugins/marketplaces/navigator-marketplace"
python3 "$PLUGIN_DIR/skills/nav-graph/functions/graph_manager.py" \
--action query --concept api \
--graph-path .agent/knowledge/graph.json 2>/dev/null | head -40Also check `authentication`, `validation`, and `security` if the endpoint touches those areas.
If memories surface (`PATTERN`, `PITFALL`, `DECISION` entries), read the full memory files for relevant ones:
ls .agent/knowledge/memories/{patterns,pitfalls,decisions}/ 2>/dev/null**What to do with what you find**:
If the graph returns nothing useful, proceed without it. Skip this step only if the knowledge graph is disabled in `.agent/.nav-config.json`.
**Ask user for endpoint details**:
Endpoint path: [e.g., /api/users/:id] HTTP method: [GET, POST, PUT, PATCH, DELETE] Resource name: [e.g., User, Post, Product] Framework: - express (default) - fastify - nestjs - nextjs (App Router Route Handler — app/api/<resource>/route.ts) - graphql Authentication required: [yes/no] Request validation needed: [yes/no]
**Validate endpoint path**:
**IMPORTANT**: This step MUST be executed for high-stakes operations.
**Before generating code, confirm interpretation with user**.
**Display verification**:
I understood you want:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Endpoint: {METHOD} {PATH}
Resource: {RESOURCE_NAME}
Framework: {FRAMEWORK} (detected from package.json / specified)
Auth required: {yes/no}
Validation needed: {yes/no}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Assumptions I'm making:
- Using {VALIDATION_LIBRARY} for validation (detected from existing validators)
- Error handling follows existing pattern in {ERROR_HANDLER_PATH}
- Route will be registered at {ROUTE_PREFIX} prefix
Proceed with generation? [Y/n]**Skip verification if** (HIGH-STAKES ONLY mode):
**Always verify if**:
**Before generating code, optionally declare explicit assumptions** (enabled by `tom_features.belief_anchors` in config).
**Display belief state anchor**:
📌 BELIEF STATE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
What I know (from context):
✅ Framework: {FRAMEWORK} (from package.json)
✅ TypeScript: {strict/normal} mode (from tsconfig.json)
✅ Validation: {LIBRARY} (from existing validators/)
What I'm assuming (inference):
🔸 Error handler follows pattern in {PATH}
🔸 Routes registered at {PREFIX} prefix
🔸 Using {CONVENTION} commit messages
What I don't know (using defaults):
❓ Request logging preference (will include)
❓ Rate limiting requirements (will skip)
❓ Response envelope format (will use standard)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Adjustments needed before I proceed?**Skip belief anchor if**:
**Show belief anchor if**:
**Based on HTTP method and framework**:
Use predefined function: `functions/endpoint_generator.py`
python3 functions/endpoint_generator.py \ --path "/api/users/:id" \ --method "GET" \ --resource "User" \ --framework "express" \ --auth true \ --validation true \ --template "templates/express-route-template.ts" \ --output "src/routes/users.ts"
**Template includes**:
**Use predefined function**: `functions/val
Generate backend tests (unit, integration, mocks) for existing code. Auto-invoke when user says "write test for", "add test",…
Create database migration with schema changes and rollback. Auto-invoke when user says "create migration", "add table", "modify…
Create React/Vue component with TypeScript, tests, and styles. Auto-invoke when user says "create component", "add component",…
Generate frontend component tests (React Testing Library, Vue Test Utils, snapshot) for existing components. Auto-invoke when…
Render a one-screen intent brief (Goal/Scope/Approach/Limits/Verify/Won't-do/Contradiction) before implementing ambiguous…
Clear conversation context while preserving knowledge via context marker. Use when user says "clear context", "start fresh",…
Use your assigned AgentMail inbox to read email tasks, explicitly send or reply, and check delivery. Provided automatically by…
Create a new Architecture Decision Record with sequential numbering and AgentDB registration