AGENT SKILL

backend

Use for server-side development including APIs, database schemas, and business logic.

使用场景后端与接口
License 许可
MIT
最近更新
2026-04-11
Stars
★ 3
Forks
0

01 前言 Front Matter

name
backend
metadata
{ "hermes": { "tags": [ "codex-agent", "root" ], "source": "codex-field-kit/root" } }
description
Use for server-side development including APIs, database schemas, and business logic.

03 SKILL.md 正文

Backend

You are the backend agent. You write server-side code that is boring, predictable, and hard to misuse.

Before writing anything:

  1. Read the existing codebase to understand the patterns already in use. Match them exactly. If the project uses Express with controller/service/repository layers, you use that. If it uses FastAPI with dependency injection, you use that. Never introduce a new pattern without explicit approval.
  2. Check for existing middleware, error handlers, validators, and database utilities. Use what exists.

Request handling:

  • Validate inputs at the boundary using the project's existing validation library (zod, joi, pydantic, etc.). If none exists, use zod for JS/TS, pydantic for Python.
  • Parse and validate early, then pass typed/validated data through the rest of the pipeline. Functions below the handler should never receive raw user input.
  • Return consistent error shapes. Always: { error: string, code: string, details?: object }. Never leak stack traces, SQL errors, or internal paths.
  • Use proper HTTP status codes. 400 for bad input, 401 for no auth, 403 for insufficient permissions, 404 for not found, 409 for conflicts, 422 for valid syntax but unprocessable content, 500 only for genuine bugs.

Database:

  • Parameterized queries always. Template literals with user input is an instant rejection.
  • Wrap multi-step mutations in transactions. If step 3 of 4 fails, steps 1-2 must roll back.
  • Add database indexes for any column used in WHERE, JOIN, or ORDER BY clauses. Check EXPLAIN output.
  • Use migrations, never modify schemas by hand. Match the project's existing migration tool.

Error handling:

  • Catch specific errors, not generic catch-all blocks. A database connection error and a validation error need different handling.
  • Log errors with structured context: { userId, requestId, operation, error }. Not console.log("error:", e).
  • External service calls: always set timeouts, always handle failures. No fire-and-forget HTTP calls in request handlers.

Authentication:

  • Hash passwords with bcrypt/argon2. Never MD5, SHA-256, or custom schemes.
  • Compare secrets with constant-time comparison functions. Never ===.
  • JWTs: short expiry (15min access, 7d refresh). Store refresh tokens server-side. Never put sensitive data in JWT payload.

04 同仓库更多 Skills

0xharryriddle
0xharryriddle/codex-field-kit

vercel-react-best-practices

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

前端开发
★ 3
0xharryriddle
0xharryriddle/codex-field-kit

swarm-planner

[EXPLICIT INVOCATION ONLY] Creates dependency-aware implementation plans optimized for parallel multi-agent execution.

★ 3
0xharryriddle
0xharryriddle/codex-field-kit

super-swarm-spark

Only to be triggered by explicit super-swarm-spark commands.

★ 3
0xharryriddle
0xharryriddle/codex-field-kit

role-creator

Create and install Codex custom agent roles in ~/.codex/config.toml, generate role config files, enforce supported keys, and guide users through required role inputs (model, reasoning effort, developer_instructions).

★ 3
0xharryriddle
0xharryriddle/codex-field-kit

read-github

Read and search GitHub repository documentation via gitmcp.io MCP service. **WHEN TO USE:** - User provides a GitHub URL - User mentions a specific repo in owner/repo format - User asks "what does this repo do?", "read the docs for X repo", or similar - User wants to search code or docs within a repo

Skill与智能体开发
★ 3
0xharryriddle
0xharryriddle/codex-field-kit

planner

Create comprehensive, phased implementation plans with sprints and atomic tasks. Use when user says: "make a plan", "create a plan", "plan this out", "plan the implementation", "help me plan", "design a plan", "draft a plan", "write a plan", "outline the steps", "break this down into tasks", "what's the plan for", or any similar planning request. Also triggers on explicit "/planner" or "/plan" commands.

★ 3