Backend Skill

Build backend application logic including route generation, request/response handling, and database connectivity. Use for server-side development.

majiayu000 49ae537 2 files · 2.0 KB Updated 567 repo stars

File contents

Backend Skill – API Routes & Data Handling

Instructions

  1. Route Generation

    • Define clear and consistent API routes
    • Follow RESTful conventions
    • Organize routes by domain or feature
  2. Request & Response Handling

    • Validate incoming requests
    • Structure consistent response formats
    • Handle errors and edge cases safely
  3. Database Connection

    • Connect to databases using reliable drivers or ORMs
    • Manage transactions properly
    • Handle connection lifecycle and pooling
  4. Business Logic

    • Separate business logic from routing
    • Keep handlers small and readable
    • Reuse shared services and utilities

Best Practices

  • Use clear naming conventions
  • Validate all inputs and outputs
  • Keep routes thin and logic modular
  • Handle errors consistently
  • Follow backend framework best practices

Example Structure

app.post("/users", async (req, res) => {
  const user = await db.user.create(req.body);
  res.status(201).json(user);
});

majiayu000/claude-skill-registry-data/tree/main/development/backend-skill commit 49ae537a7f

Frequently asked questions

npx skillmds add majiayu000/backend-skill