kim-crud

kim-crud is a command for Claude Code from KimYx0207/Kim_Service. It costs 18 tokens per session (1,404 once invoked), scanned A, original, MIT.

A code-generation command that creates the usual parts of database CRUD operations—create, read, update, and delete—from a table name and its fields.

In plain words
What is it for?
It helps generate CRUD code for frameworks such as FastAPI, Express, or Spring after checking the project’s existing structure.
Why use it?
It reduces the manual work of building matching database models, input and output definitions, routes, and service code.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions Codex.

Good fit It helps generate CRUD code for frameworks such as FastAPI, Express, or Spring after checking the project’s existing structure.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/kimyx0207/kim_service/kim-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.

Clone the repo
git clone --depth 1 https://github.com/KimYx0207/Kim_Service

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 kim-crud

README.md
[![agentmods](https://agentmods.dev/badge/commands/kimyx0207/kim_service/kim-crud/github.svg)](https://agentmods.dev/commands/kimyx0207/kim_service/kim-crud)
Your own site
<a href="https://agentmods.dev/commands/kimyx0207/kim_service/kim-crud"><img src="https://agentmods.dev/badge/commands/kimyx0207/kim_service/kim-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 kim-crud

Your own site · 80×15
<a href="https://agentmods.dev/commands/kimyx0207/kim_service/kim-crud"><img src="https://agentmods.dev/badge/commands/kimyx0207/kim_service/kim-crud.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 18 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,404 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.00018 $0.01404
Opus 5.5 $0.00007 $0.00562
Sonnet 5.5 $0.00004 $0.00281
Haiku 4.5 $0.00002 $0.00140

Measured 1mo ago against content hash 5b4d67346c46, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

kim-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 1mo 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.

tools/claudecode-codex-gemini/host/claude/commands/kim-crud.md · 178 lines

How it starts

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

Kim Service 执行门(必须先执行)

  1. 先复述原始用户意图,并列出本次计划调用的 MCP 工具、目标目录和拟新增或修改的文件;不要把本命令扩展成 Router 或自动验收流程。
  2. 任何项目写入、依赖安装、外部访问或环境变更都必须先获得对应的人类批准。未批准时只分析并展示计划。
  3. 写入前读取现有目标;目标已存在时不得用重定向、空文件或整文件覆盖。只做受管更新,遇到冲突停止并展示差异。
  4. 新文件只能在已批准的项目根目录内安全创建;不得写用户级配置。MCP 仅使用本 Tool 的 cli.mjs mcp codex 或 cli.mjs mcp gemini 运行时及其已注册工具。

Kim CRUD生成命令

输入表名和字段,生成完整的增删改查代码(Model + Schema + Router + Service)

你现在要生成CRUD代码:$ARGUMENTS

模式说明:这是模板化生成模式,专门处理数据库CRUD操作。

执行流程

阶段1:信息收集

首先分析用户输入,提取:

  • 表名:如 User、Product、Order
  • 字段列表:字段名、类型、约束
  • 技术栈:FastAPI/Express/Spring(检测项目现有框架)

如果信息不完整,询问用户:

📝 请补充以下信息:

1. 表名:User(已识别)
2. 字段(格式:字段名:类型:约束):
   - id: int: 主键,自增
   - username: str: 唯一,必填
   - email: str: 唯一,必填
   - password_field: str: 必填
   - created_at: datetime: 默认当前时间

请确认或补充字段:

阶段2:检测项目技术栈

使用Glob和Read检测项目使用的框架:

# 检测FastAPI
ls pyproject.toml requirements.txt 2>/dev/null | xargs grep -l "fastapi"

# 检测Express
ls package.json 2>/dev/null | xargs grep -l "express"

# 检测Spring
ls pom.xml build.gradle 2>/dev/null

阶段3:调用Codex生成代码

使用MCP工具调用Codex,根据检测到的框架生成代码。

FastAPI模板(Python):

生成以下文件:
1. models/{table_name}.py - SQLAlchemy ORM模型
2. schemas/{table_name}.py - Pydantic验证模型
3. routers/{table_name}.py - FastAPI路由(5个端点)
4. services/{table_name}.py - 业务逻辑层

Express模板(Node.js):

生成以下文件:
1. models/{table_name}.js - Sequelize/Prisma模型
2. validators/{table_name}.js - Joi/Zod验证
3. routes/{table_name}.js - Express路由
4. services/{table_name}.js - 业务逻辑

阶段4:生成并保存代码

初始化工作目录并保存生成的代码:

先展示工作目录和实际代码目标清单并获得项目写入批准。批准后安全创建目录;如果 .kim-orchestrator/crud_result.md 已存在则先读取并受管更新,不得清空或整文件覆盖。

将生成的代码保存到 .kim-orchestrator/crud_result.md,同时在项目中创建实际文件。


生成的API端点

方法 端点 描述
POST /api/{table}s 创建记录
GET /api/{table}s 获取列表(分页)
GET /api/{table}s/{id} 获取单条记录
PUT /api/{table}s/{id} 更新记录
DELETE /api/{table}s/{id} 删除记录

使用示例

# 基础用法
/kim-crud "User表:id, username, email, password_field, created_at"

# 详细描述
/kim-crud "创建Product表,字段:id主键、name名称、price价格decimal、stock库存int、category分类"

# 指定框架
/kim-crud "用FastAPI生成Order表的CRUD,字段:订单号、用户ID、金额、状态"

Read the full file on GitHub · 178 lines

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. 1mo ago First seen · 178 lines · 18 tokens per session scan A 5b4d67346c46

Subscribe to this mod's changes

kim-crud is a command published in the GitHub repository KimYx0207/Kim_Service (177 stars, last pushed 5d ago), licensed MIT. It adds 18 tokens to every session and 1,404 once invoked, about $0.0001 per session on Opus 5.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-09-14.