Backend Development

MoizIbnYousaf/ai-agent-skills/skills/backend-development

by MoizIbnYousaf6d95c788aa22ce39a4807b9a4c31c758a2036dc6MITListed Oct 9, 2026Updated Oct 9, 2026

Backend API design, database architecture, microservices patterns, and test-driven development. Use for designing APIs, database schemas, or backend system architecture.

Instructions onlySoftware Development
AI-generated overview

Reference guidance for backend API design, database schema patterns, authentication, caching, rate limiting and observability.

What it does
This skill supplies reference material and code patterns for backend engineering: RESTful endpoint conventions, JSON response and error formats, SQL schema and query patterns, JWT authentication with middleware, cache-aside caching, rate limiting, and observability practices. It is instruction-only and produces no files or scripts; the agent applies the patterns when designing or reviewing backend systems.
When to use it
Use it when designing APIs, database schemas, or backend system architecture, or when a task needs conventional patterns for authentication, caching, rate limiting, or observability.
Requirements
No tools, packages, or credentials are required; it ships no scripts and is instructions only. The examples reference PostgreSQL, Redis, and TypeScript libraries such as jsonwebtoken and express-rate-limit, but these are illustrative and not bundled.

Backend Development

API Design

RESTful Conventions

GET    /users          # List usersPOST   /users          # Create userGET    /users/:id      # Get userPUT    /users/:id      # Update user (full)PATCH  /users/:id      # Update user (partial)DELETE /users/:id      # Delete user
GET    /users/:id/posts  # List user's postsPOST   /users/:id/posts  # Create post for user

Response Format

json
{  "data": { ... },  "meta": {    "page": 1,    "per_page": 20,    "total": 100  }}

Error Format

json
{  "error": {    "code": "VALIDATION_ERROR",    "message": "Invalid input",    "details": [      { "field": "email", "message": "Invalid format" }    ]  }}

Database Patterns

Schema Design

sql
-- Use UUIDs for public IDsCREATE TABLE users (  id SERIAL PRIMARY KEY,  public_id UUID DEFAULT gen_random_uuid() UNIQUE,  email VARCHAR(255) UNIQUE NOT NULL,  created_at TIMESTAMPTZ DEFAULT NOW(),  updated_at TIMESTAMPTZ DEFAULT NOW());
-- Soft deletesALTER TABLE users ADD COLUMN deleted_at TIMESTAMPTZ;
-- IndexesCREATE INDEX idx_users_email ON users(email);CREATE INDEX idx_users_created ON users(created_at DESC);

Query Patterns

sql
-- Pagination with cursorSELECT * FROM postsWHERE created_at < $cursorORDER BY created_at DESCLIMIT 20;
-- Efficient countingSELECT reltuples::bigint AS estimateFROM pg_class WHERE relname = 'users';

Authentication

JWT Pattern

typescript
interface TokenPayload {  sub: string;      // User ID  iat: number;      // Issued at  exp: number;      // Expiration  scope: string[];  // Permissions}
function verifyToken(token: string): TokenPayload {  return jwt.verify(token, SECRET) as TokenPayload;}

Middleware

typescript
async function authenticate(req: Request, res: Response, next: Next) {  const token = req.headers.authorization?.replace('Bearer ', '');  if (!token) {    return res.status(401).json({ error: 'Unauthorized' });  }
  try {    req.user = verifyToken(token);    next();  } catch {    res.status(401).json({ error: 'Invalid token' });  }}

Caching Strategy

typescript
// Cache-aside patternasync function getUser(id: string): Promise<User> {  const cached = await redis.get(`user:${id}`);  if (cached) return JSON.parse(cached);
  const user = await db.users.findById(id);  await redis.setex(`user:${id}`, 3600, JSON.stringify(user));  return user;}
// Cache invalidationasync function updateUser(id: string, data: Partial<User>) {  await db.users.update(id, data);  await redis.del(`user:${id}`);}

Rate Limiting

typescript
const limiter = rateLimit({  windowMs: 60 * 1000,  // 1 minute  max: 100,             // 100 requests per window  keyGenerator: (req) => req.ip,  handler: (req, res) => {    res.status(429).json({ error: 'Too many requests' });  }});

Observability

  • Logging: Structured JSON logs with request IDs
  • Metrics: Request latency, error rates, queue depths
  • Tracing: Distributed tracing with correlation IDs
  • Health checks: /health and /ready endpoints

Source and attribution

Source:MoizIbnYousaf/ai-agent-skillsinskills/backend-developmentat commit6d95c78

License: MIT

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal