claude-config-studio: Skill for Claude Code

.claude/skills/backend-patterns/SKILL.md

backend-patterns is a skill for Claude Code from znlnzi/claude-config-studio. It costs 14 tokens per session (386 once invoked), scanned A, original, MIT.

A collection of backend development patterns for APIs, databases, transactions, migrations, caching, and error handling.

In plain words
What is it for?
Use it when designing REST APIs, improving database queries, writing migrations, choosing cache behaviour, or structuring backend errors.
Why use it?
It provides consistent guidance for validating requests, shaping responses, querying data, updating caches, and handling failures.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is znlnzi/claude-config-studio's own configuration. It tells Claude Code how to work on claude-config-studio itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything claude-config-studio configures →

Reuse

Borrowing it

Nothing to install: this file belongs to znlnzi/claude-config-studio. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/znlnzi/claude-config-studio/main/.claude/skills/backend-patterns/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/znlnzi/claude-config-studio

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for backend-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/znlnzi/claude-config-studio/backend-patterns.svg)](https://agentmods.dev/skills/znlnzi/claude-config-studio/backend-patterns)
Your own site
<a href="https://agentmods.dev/skills/znlnzi/claude-config-studio/backend-patterns"><img src="https://agentmods.dev/badge/skills/znlnzi/claude-config-studio/backend-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 14 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 386 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00014 $0.00386
Opus 5 $0.00007 $0.00193
Sonnet 5 $0.00003 $0.00077
Haiku 4.5 $0.00001 $0.00039

Measured 6d ago against content hash 72ec697ecafd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

backend-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/backend-patterns/SKILL.md · 62 lines

What it actually says

后端开发模式技能

API 设计

RESTful 规范

  • 使用名词复数作为资源路径
  • HTTP 方法语义正确(GET/POST/PUT/DELETE)
  • 状态码使用正确(200/201/400/404/500)
  • 支持分页、排序、过滤

请求验证

  • 在路由层验证请求格式
  • 在服务层验证业务规则
  • 返回结构化的错误响应

响应格式

  • 统一的响应包装
  • 包含 data、error、meta 字段
  • 错误响应包含 code 和 message

数据库模式

查询优化

  • 只查询需要的字段
  • 使用索引优化查询
  • 避免 N+1 查询问题
  • 大数据量使用分页

事务管理

  • 明确事务边界
  • 最小化事务范围
  • 处理事务失败和重试

迁移

  • 每次变更一个迁移文件
  • 迁移可回滚
  • 数据迁移与结构迁移分离

缓存策略

缓存层次

  1. 应用内存缓存(热数据)
  2. 分布式缓存(Redis)
  3. CDN 缓存(静态资源)

缓存更新

  • Cache-aside 模式(先查缓存,未命中查数据库)
  • 设置合理的 TTL
  • 数据变更时主动失效

错误处理

分层错误处理

  • 数据层: 抛出具体的数据库错误
  • 服务层: 转换为业务错误
  • 路由层: 转换为 HTTP 响应
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 62 lines · 14 tokens per session scan A 72ec697ecafd

Subscribe to this mod's changes

backend-patterns is a skill published in the GitHub repository znlnzi/claude-config-studio (0 stars, last pushed 6mo ago), licensed MIT. It adds 14 tokens to every session and 386 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

api-caching-strategies

Application-level caching strategies, HTTP caching, cache invalidation, and stampede prevention.

agents-inc/skills · 23 tokens

api-database-redis

Redis in-memory data store patterns with ioredis and node-redis -- caching, sessions, rate limiting, pub/sub, streams, queues, transactions, cluster.

agents-inc/skills · 38 tokens

api-performance-api-performance

Query optimization, caching, indexing, connection pooling, async patterns.

agents-inc/skills · 17 tokens

nosql-database-design

Designs a NoSQL data model by leading with access pattern analysis. Covers DynamoDB single-table design (PK/SK/GSI) and MongoDB embedding vs referencing, consistency models, and capacity planning. Invoked when the user asks to design a DynamoDB schema, MongoDB data model, or NoSQL data model.

soulcodex/agentic · 71 tokens

sql-query-optimization

Diagnoses and optimises slow SQL queries using EXPLAIN ANALYZE. Covers identifying bottlenecks (sequential scans, bad estimates, heap fetches), index strategy, query rewrites, and verification. Invoked when the user asks to optimize a query, fix a slow database query, or improve database performance.

soulcodex/agentic · 70 tokens

performance-caching-rate-limits

Use this capability for performance optimization, load tests, k6/JMeter/Locust plans, caching, Redis, CDN, Cache-Control, invalidation, rate limiting, quotas, token bucket, sliding window, 429 behavior, abuse protection, and cost-based throttling.

KyaniteLabs/checkyourself · 62 tokens