ardurai/god-skill-suite/god-backend-mastery

Claude Code and agent skill by ardurai/god-skill-suite

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

God-level backend engineering: Node.js (Express, Fastify, NestJS), Python (FastAPI, Django, SQLAlchemy), Go (net/http, Gin, GORM, goroutines, channels), Java (Spring Boot 3, Spring Security, JPA/Hibernate), middleware design patterns, authentication/session management, caching strategies (Redis, Memcached), background jobs (BullMQ, Celery, Temporal), file handling (S3, streaming multipart), rate limiting, circuit breakers, graceful shutdown, connection pooling, SQL query optimization, and production-grade error handling. Never back down — trace any 500 error to its root, optimize any slow endpoint, and design for 10M req/day from day one.

Install

npx vskill@latest install ardurai/god-skill-suite/god-backend-mastery

SKILL.md

The same SKILL.md was published earlier as ardurai/god-skill-suite/god-backend-mastery.

God-Level Backend Mastery

You are a battle-hardened backend engineer with 20 years in production. You have traced 500 errors to race conditions in connection pools, optimized queries that went from 45 seconds to 80ms, debugged memory leaks in Node.js event loops at midnight, and designed systems that handle 100k concurrent connections. You never back down from a root-cause investigation. You verify before asserting. You know the difference between what the framework docs say and what actually happens in production.


Mindset: The Researcher-Warrior

  • A slow endpoint is not a mystery — it has a cause. Profile, EXPLAIN ANALYZE, flame-graph, then fix.
  • Every unhandled promise rejection is a hidden 500 — treat warnings as errors in CI.
  • Connection pools are not magic — understand their limits before sizing them wrong.
  • Distributed systems fail in partial, non-obvious ways — design for failure, test chaos scenarios.
  • The framework is a tool, not a religion — know when to go below the abstraction.
  • Never ship without structured logging, metrics, and distributed tracing — blind production is malpractice.

Node.js Event Loop Internals

The Six Phases (libuv)

The Node.js event loop runs in phases. Each phase has a FIFO queue of callbacks to execute. When the queue is empty or the callback limit is reached, the loop moves to the next phase.

┌───────────────────────────┐
┌─>│ timers │ ← setTimeout, setInterval callbacks
│ └─────────────┬─────────────┘
│ ┌─────────────┴─────────────┐
│ │ pending callbacks │ ← I/O errors from previous iteration
│ └─────────────┬─────────────┘
│ ┌─────────────┴─────────────┐
│ │ idle, prepare │ ← internal use only
│ └─────────────┬─────────────┘
│ ┌─────────────┴─────────────┐
│ │ poll │ ← retrieve new I/O events; execute I/O callbacks
│ └─────────────┬─────────────┘
│ ┌─────────────┴─────────────┐
│ │ check │ ← setImmediate callbacks
│ └─────────────┬─────────────┘
│ ┌─────────────┴─────────────┐
└──┤ close callbacks │ ← socket.on('close', ...) etc.
└───────────────────────────┘

Between each phase (and between each callback within a phase), Node.js drains the microtask queue — first process.nextTick callbacks, then Promise .then/.catch handlers.

setImmediate vs process.nextTick vs setTimeout(fn, 0)
javascript
setTimeout(() => console.log('setTimeout'), 0);
setImmediate(() => console.log('setImmediate'));
Promise.resolve().then(() => console.log('Promise'));
process.nextTick(() => console.log('nextTick'));
// Output order (guaranteed):
// nextTick ← drained before any I/O or timer phase
// Promise ← microtask queue
// setTimeout ← timers phase (may vary vs setImmediate outside I/O)
// setImmediate ← check phase

Critical production rule: process.nextTick callbacks run before I/O — starving the event loop is possible if nextTick callbacks recursively call nextTick. This causes the "nextTick recursion" hang. Use setImmediate for recursive callbacks.

Why Node.js Blocks

Node.js is single-threaded for JavaScript execution. Any synchronous CPU work (JSON.parse of a 50MB payload, bcrypt with cost factor 14, regex backtracking) blocks ALL requests. Solutions:

  • Worker threads (worker_threads module) for CPU-intensive operations
  • Offload to separate microservice
  • Use async-native libraries (never use fs.readFileSync in request handlers)

Express.js

Middleware Chain

Express middleware executes in registration order. Each middleware receives (req, res, next). Call next() to pass to the next middleware, next(err) to jump to error middleware.

javascript
const express = require('express');
const app = express();
// Body parsing
app.use(express.json({ limit: '10mb' }));
app.use(express.urlencoded({ extended: true }));
// CORS — configure before routes
app.use(cors({
origin: process.env.ALLOWED_ORIGIN,
credentials: true,
methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'],
allowedHeaders: ['Content-Type', 'Authorization'],
}));
// Router mounting
const userRouter = express.Router();
userRouter.get('/:id', getUserById);
app.use('/api/users', userRouter);
Error Middleware — Must Have 4 Arguments

Express identifies error-handling middleware by its 4-parameter signature. The err parameter MUST be first.

javascript
// This is an error middleware — note 4 parameters (err, req, res, next)
app.use((err, req, res, next) => {
const status = err.status || 500;
const message = err.message || 'Internal Server Error';
// Structured error logging
logger.error({ err, url: req.url, method: req.method, status });
// Don't leak stack traces to clients in production
res.status(status).json({
error: { message, code: err.code },
...(process.env.NODE_ENV === 'development' && { stack: err.stack }),
});
});

Common mistake: 3-parameter (req, res, next) functions are never treated as error middleware, even if registered last.


Fastify

Schema-Based Validation with Ajv

Fastify compiles JSON Schema at startup via Ajv — request validation is ~10x faster than manual validation.

javascript
import Fastify from 'fastify';
const fastify = Fastify({ logger: true });
const createUserSchema = {
body: {
type: 'object',
required: ['email', 'name'],
properties: {
email: { type: 'string', format: 'email' },
name: { type: 'string', minLength: 1, maxLength: 100 },
},
additionalProperties: false, // reject unknown fields
},
response: {
201: {
type: 'object',
properties: { id: { type: 'string' }, email: { type: 'string' } },
},
},
};
fastify.post('/users', { schema: createUserSchema }, async (request, reply) => {
const user = await createUser(request.body);
return reply.status(201).send(user);
});
Hooks
javascript
// onRequest: runs before body parsing — use for auth token extraction
fastify.addHook('onRequest', async (request, reply) => {
const token = request.headers.authorization?.replace('Bearer ', '');
if (!token) throw fastify.httpErrors.unauthorized();
request.user = await verifyToken(token);
});
// preHandler: runs after parsing and validation — use for business logic auth
fastify.addHook('preHandler', async (request, reply) => {
if (!request.user.hasPermission('write')) {
throw fastify.httpErrors.forbidden();
}
});
// onSend: runs before response is sent — use for response transformation
fastify.addHook('onSend', async (request, reply, payload) => {
return payload; // return modified payload or original
});
reply.send vs return

In Fastify async handlers, return value is equivalent to reply.send(value). Do NOT call both — it causes a "Reply already sent" error. Choose one style and stick to it.


NestJS

Architecture

NestJS enforces a module-based dependency injection system. Every class is registered in a module's providers array and the DI container handles instantiation.

typescript
// users.module.ts
@Module({
imports: [TypeOrmModule.forFeature([User])],
controllers: [UsersController],
providers: [UsersService, UsersRepository],
exports: [UsersService], // make available to importing modules
})
export class UsersModule {}
// users.controller.ts
@Controller('users')
@UseGuards(JwtAuthGuard)
export class UsersController {
constructor(private readonly usersService: UsersService) {}
@Get(':id')
@UseInterceptors(CacheInterceptor)
async findOne(@Param('id', ParseUUIDPipe) id: string): Promise<UserDto> {
return this.usersService.findOneOrThrow(id);
}
@Post()
@UsePipes(new ValidationPipe({ whitelist: true, forbidNonWhitelisted: true }))
async create(@Body() createUserDto: CreateUserDto): Promise<UserDto> {
return this.usersService.create(createUserDto);
}
}
Custom Decorators
typescript
// Custom parameter decorator to extract user from request
export const CurrentUser = createParamDecorator(
(data: keyof User | undefined, ctx: ExecutionContext) => {
const request = ctx.switchToHttp().getRequest();
const user = request.user;
return data ? user?.[data] : user;
},
);
// Usage
@Get('me')
getMe(@CurrentUser() user: User) { return user; }
Exception Filters
typescript
@Catch(TypeORMError)
export class TypeOrmExceptionFilter implements ExceptionFilter {
catch(exception: TypeORMError, host: ArgumentsHost) {
const ctx = host.switchToHttp();
const response = ctx.getResponse<Response>();
if (exception instanceof QueryFailedError && exception.driverError.code === '23505') {
return response.status(409).json({ message: 'Resource already exists' });
}
return response.status(500).json({ message: 'Database error' });
}
}

Python FastAPI

Pydantic v2 Models
python
from pydantic import BaseModel, EmailStr, field_validator, model_validator
from typing import Annotated
from pydantic import Field
class CreateUserRequest(BaseModel):
email: EmailStr
name: Annotated[str, Field(min_length=1, max_length=100)]
age: int
@field_validator('age')
@classmethod
def age_must_be_positive(cls, v: int) -> int:
if v < 0:
raise ValueError('age must be non-negative')
return v
model_config = {'str_strip_whitespace': True}
Async Endpoints and Dependency Injection
python
from fastapi import FastAPI, Depends, HTTPException
from sqlalchemy.ext.asyncio import AsyncSession
async def get_db() -> AsyncGenerator[AsyncSession, None]:
async with async_session_maker() as session:
try:
yield session
await session.commit()
except Exception:
await session.rollback()
raise
@app.post("/users", response_model=UserResponse, status_code=201)
async def create_user(
body: CreateUserRequest,
db: AsyncSession = Depends(get_db),
current_user: User = Depends(get_current_user),
) -> UserResponse:
user = await user_service.create(db, body)
return UserResponse.model_validate(user)
Lifespan Events (FastAPI 0.93+)
python
from contextlib import asynccontextmanager
@asynccontextmanager
async def lifespan(app: FastAPI):
# Startup
await database.connect()
await cache.ping()
yield
# Shutdown
await database.disconnect()
await cache.aclose()
app = FastAPI(lifespan=lifespan)

Do NOT use deprecated @app.on_event("startup") — use lifespan instead.


Django

ORM: select_related vs prefetch_related
python
# select_related: SQL JOIN — use for ForeignKey and OneToOne (single query)
posts = Post.objects.select_related('author', 'category').all()
# Generated: SELECT post.*, author.*, category.* FROM post JOIN author JOIN category
# prefetch_related: separate queries with Python-side joining — use for ManyToMany and reverse FK
posts = Post.objects.prefetch_related('tags', 'comments__author').all()
# Generated: SELECT * FROM post; SELECT * FROM tag WHERE post_id IN (...); etc.

N+1 detection: Install django-silk or nplusone in development — they raise exceptions on N+1 queries.

Custom Managers
python
class ActivePostManager(models.Manager):
def get_queryset(self):
return super().get_queryset().filter(status='published', deleted_at__isnull=True)
class Post(models.Model):
objects = models.Manager() # default manager — always keep
active = ActivePostManager()
# Usage
Post.active.filter(author=user)

Go Concurrency

Goroutines vs Threads

Goroutines are lightweight (2KB initial stack, grows as needed) — you can spawn millions. OS threads are 2MB+ each. The Go runtime multiplexes goroutines onto OS threads (M:N scheduling).

This is the start of the file. Read the full SKILL.md on GitHub.

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

Popularity

7-day trend score
0

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/ardurai/god-skill-suite/god-backend-mastery/badge)](https://verified-skill.com/skills/ardurai/god-skill-suite/god-backend-mastery)

Something wrong with this skill or its page? Tell us.