backend-development · moizibnyousaf — Claude Code skill: APIs, DB schemas, TDD
A skill that gives your agent conventions for REST APIs, database schemas and microservice patterns. Useful when backend code should stay consistent across sessions.
npx skills add MoizIbnYousaf/ai-agent-skills --skill backend-development -a claude-codeWhat backend-development does
The skill is a reference file the agent reads before writing backend code. It covers REST routing: GET /users, POST /users, PATCH /users/:id, plus nested routes like GET /users/:id/posts. Responses carry a data object and pagination in meta; errors carry a code, a message and a list of offending fields.
Database guidance is written in SQL. Tables get a SERIAL primary key and a UUID in public_id, soft deletes go through deleted_at, and indexes cover email and created_at DESC. Pagination uses a cursor instead of OFFSET, and row counts come from pg_class rather than a full count. Auth is JWT with sub, iat, exp and scope, checked by middleware that pulls the token from the Authorization header.
Caching follows cache-aside: read from Redis, fall back to the database, then setex for 3600 seconds, and redis.del on update. Rate limiting is 100 requests per minute keyed on IP, answering 429. The examples are TypeScript and SQL, so on another stack you rewrite them by hand.
What it helps with
- lay out REST routes for a new resource
- write a table schema with UUID and soft deletes
- add JWT verification to middleware
- wire cache-aside into a user lookup
- cap request rate per IP
Example prompts for the agent
- Design a REST API for orders following the backend-development skill conventions
- Write the users table with a public_id UUID, deleted_at and indexes
- Add cache-aside for getUser with Redis and invalidate on update
How to install backend-development
1Skills CLI (Vercel)
npx skills add MoizIbnYousaf/ai-agent-skills --skill backend-development -a claude-code2Manually: put the files in place
~/.claude/skills/backend-development/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/backend-development/
1Skills CLI (Vercel)
npx skills add MoizIbnYousaf/ai-agent-skills --skill backend-development -a codex2Manually: put the files in place
.agents/skills/backend-development/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add MoizIbnYousaf/ai-agent-skills --skill backend-development -a cursor2Manually: put the files in place
.cursor/skills/backend-development/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install MoizIbnYousaf/ai-agent-skills backend-development2Manually: put the files in place
.github/skills/backend-development/SKILL.md1Skills CLI (Vercel)
npx skills add MoizIbnYousaf/ai-agent-skills --skill backend-development -a gemini-cli2Platform CLI
gemini skills install https://github.com/MoizIbnYousaf/ai-agent-skills --path skills/backend-developmentManually: put the files in place
.devin/skills/backend-development/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add MoizIbnYousaf/ai-agent-skills --skill backend-development -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about backend-development
How do I install backend-development in Claude?
Run npx skills add MoizIbnYousaf/ai-agent-skills --skill backend-development -a claude-code. The skill file lands at ~/.claude/skills/backend-development/SKILL.md.
What does backend-development do?
It hands the agent templates for API design, database schemas, microservice patterns and test-driven development. The agent applies them when you ask for an API or a schema.
Does the skill require Redis and PostgreSQL?
The skill itself is a text reference and runs nothing. Its cache examples target Redis and its queries and schema target PostgreSQL, so another database means rewriting those parts.
Source text
SKILL.md · MIT
---
name: backend-development
description: Backend API design, database architecture, microservices patterns, and test-driven development. Use for designing APIs, database schemas, or backend system architecture.
source: wshobson/agents
license: MIT
version: 4.1.0
---
# Backend Development
## API Design
### RESTful Conventions
```
GET /users # List users
POST /users # Create user
GET /users/:id # Get user
PUT /users/:id # Update user (full)
PATCH /users/:id # Update user (partial)
DELETE /users/:id # Delete user
GET /users/:id/posts # List user's posts
POST /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 IDs
CREATE 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 deletes
ALTER TABLE users ADD COLUMN deleted_at TIMESTAMPTZ;
-- Indexes
CREATE INDEX idx_users_email ON users(email);
CREATE INDEX idx_users_created ON users(created_at DESC);
```
### Query Patterns
```sql
-- Pagination with cursor
SELECT * FROM posts
WHERE created_at < $cursor
ORDER BY created_at DESC
LIMIT 20;
-- Efficient counting
SELECT reltuples::bigint AS estimate
FROM 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 pattern
async 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 invalidation
async 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
© MoizIbnYousaf · MIT · MoizIbnYousaf/ai-agent-skills
Similar skills
Everything for Backend and APIs →backend-development by other authors comes first.