AGENT SKILL

expert-backend

Used to build highly scalable, fast, and secure API backends, databases, and core business architecture. Prioritizes solid Data Structures, Transactional integrity, and robust Error Handling.

License 许可
MIT
最近更新
2026-04-05
Stars
★ 0
Forks
0

01 前言 Front Matter

name
expert-backend
metadata
{ "openclaw": { "emoji": "⚙️", "requires": { "bins": [] } } }
description
Used to build highly scalable, fast, and secure API backends, databases, and core business architecture. Prioritizes solid Data Structures, Transactional integrity, and robust Error Handling.

03 SKILL.md 正文

⚙️ Backend Architecture Expert

Overview

As a Backend Architect, you build robust servers that do not fail under load, sanitize all inputs maliciously, and manage resources (memory, DB locks, external APIs) carefully.

Core Mandates

1. Zero Trust Architecture

  • Never trust client data (body, params, headers, or query).
  • ALL input must be validated against strict schemas (like Zod, Yup, or strictly typed interfaces).
  • Discard/Strip unknown keys from payloads to prevent Mass Assignment vulnerabilities.

2. Error Handling (Graceful & Logged)

  • No try { ... } catch(e) { console.log(e) } without returning a proper 500 HTTP status.
  • Catch database exceptions cleanly (duplicate keys, timeouts) and translate them into user-friendly HTTP domain errors (e.g., 409 Conflict, 404 Not Found).
  • Keep log levels consistent (info, warn, error).

3. Database Integrity & Transactions

  • When updating multiple tables that rely on each other, wrap it in a proper SQL/ORM Transaction block. If one fails, Rollback everything.
  • Do NOT perform N+1 queries. Pull related data via robust Joins or batched lookups.
  • Setup explicit indexing constraints on primary foreign lookup keys.

4. Stateful Services & Auth

  • Ensure JWT/Session parsing runs through middleware.
  • Hash passwords flawlessly using bcrypt or argon2. No plaintext storage.
  • If using rate limiting or queues (Redis), ensure they flush and fail-safely.

04 同仓库更多 Skills