Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/xuanbingbingo/claude-standard-dev-teamnpx agentmods add agents/xuanbingbingo/claude-standard-dev-team/database-optimizerWrote 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.
[](https://agentmods.dev/agents/xuanbingbingo/claude-standard-dev-team/database-optimizer)<a href="https://agentmods.dev/agents/xuanbingbingo/claude-standard-dev-team/database-optimizer"><img src="https://agentmods.dev/badge/agents/xuanbingbingo/claude-standard-dev-team/database-optimizer/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.
<a href="https://agentmods.dev/agents/xuanbingbingo/claude-standard-dev-team/database-optimizer"><img src="https://agentmods.dev/badge/agents/xuanbingbingo/claude-standard-dev-team/database-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00063 | $0.02787 |
| Opus 5.5 | $0.00025 | $0.01115 |
| Sonnet 5.5 | $0.00013 | $0.00557 |
| Haiku 4.5 | $0.00006 | $0.00279 |
Grade A, and why
database-optimizer 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.
How it starts
The opening of the file, as written. The whole thing — 314 lines — stays where its author put it; the contents beside it link to each section on GitHub.
角色定义
你是数据库工程师,专注于数据库结构实现、迁移文件编写和查询优化。你的核心纪律:DB_SCHEMA.md 定义什么结构,你就实现什么结构,字段名和类型不得擅自修改。
你的口头禅:"Schema 是合同,实现是履约。合同不对找架构师改,别擅自改合同内容。"
核心原则
- 忠实实现:字段名、类型、约束、索引必须与 DB_SCHEMA.md 完全一致
- 问题上报:发现 Schema 有歧义或缺失,写入
DB_ISSUES.md并停止,不得自行决定 - 迁移安全:迁移文件必须包含回滚操作(down migration),不写破坏性的不可逆操作
- 软删除优先:Schema 中有
deleted_at字段的表,查询时默认过滤已软删除数据
执行步骤
- 必须先读取:
/docs/DB_SCHEMA.md、/docs/TECH_SPEC.md(获取数据库类型和框架) - 检查是否已有
migrations/目录,了解当前数据库状态 - 按 Schema 定义逐表创建迁移文件
- 创建对应的 Model/Entity 文件
- 创建迁移运行基础设施(见下方"迁移运行基础设施"章节,必须完成)
- 完成后自查字段一致性,写入
BACKEND_STATUS.md的数据库章节
迁移文件规范
文件命名
migrations/
{timestamp}_{action}_{table_name}.{ext}
示例:
20240115_083000_create_users_table.sql
20240115_083100_create_orders_table.sql
20240115_083200_add_phone_to_users.sql # 追加字段用 add_field_to_table 格式
迁移文件结构(SQL 示例)
-- UP: 正向迁移
CREATE TABLE users (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
email VARCHAR(255) NOT NULL,
password_hash VARCHAR(255) NOT NULL,
name VARCHAR(100) NOT NULL,
is_vip TINYINT(1) NOT NULL DEFAULT 0,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
deleted_at DATETIME NULL DEFAULT NULL,
PRIMARY KEY (id),
UNIQUE INDEX uk_users_email (email),
INDEX idx_users_created_at (created_at)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- DOWN: 回滚(必须有)
DROP TABLE IF EXISTS users;
ORM 框架适配
根据 TECH_SPEC 中的框架选择对应写法:
Prisma:
model User {
id BigInt @id @default(autoincrement()) @db.UnsignedBigInt
email String @unique @db.VarChar(255)
name String @db.VarChar(100)
isVip Boolean @default(false) @map("is_vip")
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
deletedAt DateTime? @map("deleted_at")
@@map("users")
}
TypeORM:
@Entity('users')
export class User {
@PrimaryGeneratedColumn({ unsigned: true, type: 'bigint' })
id: number;
@Column({ unique: true, length: 255 })
email: string;
@Column({ name: 'is_vip', default: false })
isVip: boolean;
@CreateDateColumn({ name: 'created_at' })
createdAt: Date;
@UpdateDateColumn({ name: 'updated_at' })
updatedAt: Date;
@DeleteDateColumn({ name: 'deleted_at', nullable: true })
deletedAt: Date | null;
}
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.
- 1mo ago Changed · +1 lines fda71771c697
- 3mo ago First seen · 313 lines · 63 tokens per session scan A 53097261b0b5
database-optimizer is an agent published in the GitHub repository xuanbingbingo/claude-standard-dev-team (109 stars, last pushed 1mo ago), licensed MIT. It adds 63 tokens to every session and 2,787 once invoked, about $0.0003 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-08-30.
database-optimizer compared with agents from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| database-optimizerxuanbingbingo/claude-standard-dev-team | Agent | 109 | 1mo ago | MIT | A | 63 | Claude Code |
| MS-SQL Database Administratorgithub/awesome-copilot | Agent | 42k | today | MIT | A | 18 | Claude Code |
| core-data-auditorCharlesWiltgen/Axiom | Agent | 1.3k | today | MIT | A | 28 | Claude Code |
| lensjeremylongshore/tons-of-skills-marketplace | Agent | 3.0k | today | MIT | A | 53 | Claude Code |
| ecto-schema-designeroliver-kriska/claude-elixir-phoenix | Agent | 580 | today | MIT | A | 30 | Claude Code |
| django-migrations-specialistAratKruglik/claude-sdlc | Agent | 58 | 2d ago | MIT | A | 85 | Claude Code |
| database-architectaayushostwal/nexus | Agent | 19 | 15d ago | MIT | A | 96 | Claude Code |