crud

crud is a skill for Claude Code from zhe-qi/clhoria-template. It costs 45 tokens per session (767 once invoked), scanned A, original, MIT.

A guide for creating or changing CRUD modules—APIs that let software create, read, update, and delete records. It covers routes, types, validation, handlers, and optional database schemas and tests.

In plain words
What is it for?
Use it to add or modify management APIs, routes, fields, database tables, and related request handling.
Why use it?
It gives these modules a consistent structure and keeps public, client, and admin routes organized with the right authentication rules.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it to add or modify management APIs, routes, fields, database tables, and related request handling.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zhe-qi/clhoria-template/crud
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add zhe-qi/clhoria-template --skill crud
Clone the repo
git clone --depth 1 https://github.com/zhe-qi/clhoria-template

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 crud

README.md
[![agentmods](https://agentmods.dev/badge/skills/zhe-qi/clhoria-template/crud/github.svg)](https://agentmods.dev/skills/zhe-qi/clhoria-template/crud)
Your own site
<a href="https://agentmods.dev/skills/zhe-qi/clhoria-template/crud"><img src="https://agentmods.dev/badge/skills/zhe-qi/clhoria-template/crud/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for crud

Your own site · 80×15
<a href="https://agentmods.dev/skills/zhe-qi/clhoria-template/crud"><img src="https://agentmods.dev/badge/skills/zhe-qi/clhoria-template/crud.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 767 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00045 $0.00767
Opus 5 $0.00023 $0.00383
Sonnet 5 $0.00009 $0.00153
Haiku 4.5 $0.00005 $0.00077

Measured 11d ago against content hash 9bb0ce86abfd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

crud 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 11d 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.

.agents/skills/crud/SKILL.md · 107 lines

How it starts

The opening of the file, as written. The whole thing — 107 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CRUD 模块生成/修改指南

模块文件结构

src/routes/{tier}/{category}/{feature}/
├── {feature}.index.ts       # 必需:路由入口
├── {feature}.routes.ts      # 必需:OpenAPI 路由定义
├── {feature}.handlers.ts    # 必需:处理器实现
├── {feature}.types.ts       # 必需:类型定义
├── {feature}.schema.ts      # 可选:Zod 验证
├── {feature}.services.ts    # 可选:复杂业务逻辑或模块内复用
└── __tests__/               # 可选:单元测试

路由层级

Tier 路径前缀 认证 说明
public /api/public/* 公开接口
client /api/client/* JWT 客户端用户
admin /api/admin/* JWT + RBAC + 审计 后台管理

生成步骤

1. 数据库 Schema(如需新表)

参考 db-schema.md

// src/db/schema/{tier}/{category}/{feature}.ts
export const {feature}s = snakeCase.table("{tier}_{feature}s", {
  ...baseColumns,
  // 字段定义...
});

2. 类型文件

参考 templates/types.md

3. Schema 文件

参考 zod-schema.md

4. 路由文件

参考 templates/routes.md

5. 处理器文件

参考 templates/handlers.md

6. 入口文件

// {feature}.index.ts
import { createRouter } from "@/lib/core/create-app";
import * as handlers from "./{feature}.handlers";
import * as routes from "./{feature}.routes";

export default createRouter()
  .openapi(routes.list, handlers.list)
  .openapi(routes.create, handlers.create)
  .openapi(routes.get, handlers.get)
  .openapi(routes.update, handlers.update)
  .openapi(routes.remove, handlers.remove);

关键规则

响应包装(必须)

return c.json(Resp.ok(data), HttpStatusCodes.OK);
return c.json(Resp.fail("错误信息"), HttpStatusCodes.BAD_REQUEST);

日志格式(必须)

logger.info({ userId }, "[模块名]: 操作描述");
// 数据对象放第一个参数

审计字段

  • 创建时设置 createdBy: sub
  • 更新时设置 updatedBy: sub
  • subc.get("jwtPayload") 获取

命名约定

  • 文件:kebab-case(user-roles.ts
  • 类型:PascalCase(SystemUserRouteHandlerType
  • 枚举值:UPPER_SNAKE_CASE(Status.ENABLED

完整示例

Read the full file on GitHub · 107 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 11d ago First seen · 107 lines · 45 tokens per session scan A 9bb0ce86abfd

Subscribe to this mod's changes

crud is a skill published in the GitHub repository zhe-qi/clhoria-template (190 stars, last pushed 1mo ago), licensed MIT. It adds 45 tokens to every session and 767 once invoked, about $0.0002 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-30.

Related

Other skills, from other repositories

event-store-design

Design and implement event stores for event-sourced systems. Use when building event sourcing infrastructure, choosing event store technologies, or implementing event persistence patterns.

wshobson/agents · 33 tokens

convex-explain-app

Explain an existing Convex app — data model + relationships, public vs internal functions, auth/ownership model, components, a request→data flow — read from the schema and function surface. Read-only.

openclaw/clawhub · 47 tokens

platform-custom-field-generate

Use this skill when users need to create, generate, or validate Salesforce Custom Field metadata. Trigger when users mention custom fields, field types, Roll-up Summary fields, Master-Detail relationships, Lookup relationships, formula fields, picklists, dependent (controlling) picklists, referencing a value set from…

forcedotcom/sf-skills · 194 tokens

durable-objects

Build, debug, or review Cloudflare Durable Objects code for persistent state and coordination.

fcakyon/claude-codex-settings · 22 tokens

field-service-sobject-create-configure

Headless 360 REST API deployment step for creating sObject records. Handles describe-based field discovery, required-field derivation, entity-relationship ordering, and composite graph transactions. Use this skill when a designer skill (or a user directly) needs to create sObject records after design confirmation…

forcedotcom/sf-skills · 74 tokens

nornicdb-grpc

Drive NornicDB over gRPC — the Qdrant-compatible surface (Collections, Points, Snapshots) plus the additive NornicSearch service. Use when ingesting via Qdrant SDKs, migrating from Qdrant, or running hybrid text+vector search from a non-Bolt client. Covers connection, RPC catalog, collection→database mapping…

orneryd/NornicDB · 98 tokens