# Backend patterns

> Backend patterns is an open-source agent skill for developer tools. Guides an agent through Node.js and Express API design, data access and server patterns. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/smartworldarafath/REA_Skill/tree/main/.agents/skills/backend-patterns
- **Repository:** https://github.com/smartworldarafath/rea_skill
- **GitHub stars:** 66
- **License:** MIT
- **Skill name:** backend-patterns
- **Collection:** https://github.com/smartworldarafath/REA_Skill
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

This skill gives the agent a reference of server-side patterns for Node.js, Express and Next.js API routes. It covers REST endpoint layout with filtering and pagination, repository and service layers, middleware, and query work such as avoiding N+1 fetches, selecting only needed columns and batching lookups. It also includes examples for caching with Redis or cache-aside, centralized error handling, retries with exponential backoff, JWT checks and role-based permissions.

The guidance is delivered as TypeScript code samples that the agent can adapt to a project. The examples lean on Supabase client calls and Zod validation, so the agent will need to map them onto whatever database and validation libraries the codebase actually uses. The skill also covers simple in-memory rate limiting, a basic job queue, and structured JSON logging.

The skill is plain instructional content with no bundled scripts. It expects a Node.js project and works with the agent reading and writing code in that project.

## When your agent uses it

> Backend architecture patterns, API design, database optimization, and server-side best practices for Node.js, Express, and Next.js API routes. Use when building or reviewing Node.js, Express, or Next.js API routes and their data access.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/smartworldarafath/REA_Skill/tree/HEAD/.agents/skills/backend-patterns)
- [License: MIT](https://github.com/smartworldarafath/REA_Skill/tree/HEAD/.agents/skills/backend-patterns)

## Features

- **REST endpoint structure:** Resource-based URL layout with filtering, sorting and pagination query parameters.
- **Repository and service layers:** Separates data access from business logic using interfaces and service classes.
- **Database query optimization:** Covers column selection, N+1 avoidance through batch fetching and transactions via stored functions.
- **Caching strategies:** Shows a Redis caching repository and cache-aside lookups with invalidation.
- **Auth and permissions:** JWT token validation and role-based access checks for route handlers.
- **Error handling and retries:** Centralized API error responses and exponential backoff retry helpers.
- **Rate limiting and logging:** In-memory request limits, a simple job queue and structured JSON logging.

## Good for

- Design a REST API for a resource with pagination and filtering
- Find and fix N+1 queries in a data-fetching route
- Add a Redis cache in front of a database lookup
- Add JWT authentication and role checks to Next.js API routes
- Standardize error responses across Express or Next.js endpoints

## Install

### Claude Code

This skill ships in the `rea-skills` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add smartworldarafath/REA_Skill
/plugin install rea-skills@smartworldarafath
```

Or copy only this skill to `~/.claude/skills/backend-patterns`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/backend-patterns &&
cp -R "$tmp/.agents/skills/backend-patterns" ~/.claude/skills/backend-patterns &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/backend-patterns` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/backend-patterns` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/backend-patterns &&
cp -R "$tmp/.agents/skills/backend-patterns" ~/.agents/skills/backend-patterns &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/backend-patterns` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/backend-patterns` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/backend-patterns &&
cp -R "$tmp/.agents/skills/backend-patterns" ~/.cursor/skills/backend-patterns &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/backend-patterns` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/smartworldarafath/REA_Skill.git --path .agents/skills/backend-patterns
```

Or copy the folder to `~/.gemini/skills/backend-patterns` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/backend-patterns`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/backend-patterns &&
cp -R "$tmp/.agents/skills/backend-patterns" ~/.copilot/skills/backend-patterns &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/backend-patterns` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git
```

Then copy `REA_Skill/.agents/skills/backend-patterns` into your agent's skills folder as `backend-patterns`. Agents that support SKILL.md read one folder per skill.

## FAQ

### Which frameworks does Backend patterns target?

It focuses on Node.js, Express and Next.js API routes, and its examples use TypeScript.

### Does the skill run any scripts or install anything?

No scripts are included. It provides code patterns the agent can reference and adapt.

### When does the skill activate?

It is meant for building or reviewing Node.js, Express or Next.js API routes and their data access.

### How do I install Backend patterns in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/backend-patterns to use it in all your projects, or to .claude/skills/backend-patterns in one project. Or install the rea-skills plugin, which includes it: /plugin marketplace add smartworldarafath/REA_Skill, then /plugin install rea-skills@smartworldarafath.

### Does Backend patterns run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Backend patterns?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Backend patterns?

The closest alternatives to Backend patterns are API design, API SDK generator, Django patterns, Error handling and Vue data.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [API design](https://ai-powered.com/skills/api-design): API design is an open-source agent skill for developer tools.
- [API SDK generator](https://ai-powered.com/skills/api-sdk-generator): API SDK generator is an open-source agent skill for developer tools.
- [Django patterns](https://ai-powered.com/skills/django-patterns): Django patterns is an open-source agent skill for developer tools.
- [Error handling](https://ai-powered.com/skills/error-handling): Error handling is an open-source agent skill for developer tools.
- [Vue data](https://ai-powered.com/skills/vue-data): Vue data is an open-source agent skill for developer tools.
- [API GraphQL GRPC](https://ai-powered.com/skills/api-graphql-grpc): API GraphQL GRPC is an open-source agent skill for developer tools.
- [API designer](https://ai-powered.com/skills/api-designer): API designer is an open-source agent skill for developer tools.
- [API integration](https://ai-powered.com/skills/api-integration): API integration is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/backend-patterns
