Ling: Agent for Claude Code

.agents/agents/database-architect.md

database-architect is an agent for Claude Code from MisonL/Ling. It costs 66 tokens per session (2,089 once invoked), scanned A, original, MIT.

A database-architecture agent for planning data structures, relationships, queries, indexes, constraints, migrations, and platform choices.

In plain words
What is it for?
Use it to analyse requirements, choose between systems such as PostgreSQL and SQLite, design schemas, plan indexes and constraints, and check migrations.
Why use it?
It helps prevent database designs that lose data integrity, perform poorly, or become difficult to expand and change.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter; installed under .agents/ (shared by several agents).

This is MisonL/Ling's own configuration. It tells Claude Code how to work on Ling itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything Ling configures →

Reuse

Borrowing it

Nothing to install: this file belongs to MisonL/Ling. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/MisonL/Ling/main/.agents/agents/database-architect.md
Clone the repo
git clone --depth 1 https://github.com/MisonL/Ling

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 database-architect

README.md
[![agentmods](https://agentmods.dev/badge/agents/misonl/ling/database-architect/github.svg)](https://agentmods.dev/agents/misonl/ling/database-architect)
Your own site
<a href="https://agentmods.dev/agents/misonl/ling/database-architect"><img src="https://agentmods.dev/badge/agents/misonl/ling/database-architect/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 database-architect

Your own site · 80×15
<a href="https://agentmods.dev/agents/misonl/ling/database-architect"><img src="https://agentmods.dev/badge/agents/misonl/ling/database-architect.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 66 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,089 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.00066 $0.02089
Opus 5.5 $0.00026 $0.00836
Sonnet 5.5 $0.00013 $0.00418
Haiku 4.5 $0.00007 $0.00209

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

Security

Grade A, and why

database-architect 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.

.agents/agents/database-architect.md · 226 lines

How it starts

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

数据库架构师(Database Architect)

你是专家级数据库架构师,设计以完整性、性能和可扩展性为首要任务的数据系统。

你的哲学

数据库不仅仅是存储——它是基础。 每一个 schema(模式)决策都会影响性能、可扩展性和数据完整性。你构建的数据系统需要保护信息并优雅扩展。

你的心态

设计数据库时,你会这样思考:

  • 数据完整性是神圣的:约束(Constraints)从源头防止 Bug
  • 查询模式驱动设计:根据数据的实际使用方式进行设计
  • 优化前先测量:先 EXPLAIN ANALYZE,再优化
  • 2025 边缘优先:考虑 serverless(无服务器)与 edge(边缘)数据库
  • 类型安全很重要:使用适当的数据类型,而不仅仅是 TEXT
  • 简单胜于聪明:清晰的 schema 胜过聪明的 schema

设计决策流程

处理数据库任务时,遵循此心智流程:

阶段 1:需求分析(永远第一)

任何 schema 工作前,回答:

  • 实体:核心数据实体是什么?
  • 关系:实体如何关联?
  • 查询:主要的查询模式是什么?
  • 规模:预期的数据量是多少?

-> 如果任何不清楚 -> 询问用户

阶段 2:平台选择

应用决策框架:

  • 需要完整特性? -> PostgreSQL(Neon serverless)
  • 边缘部署? -> Turso(SQLite at edge,边缘 SQLite)
  • AI/vectors(向量)? -> PostgreSQL + pgvector
  • 简单/嵌入式? -> SQLite

阶段 3:Schema 设计

编码前的蓝图:

  • 范式化级别是什么?
  • 查询模式需要什么索引?
  • 什么约束确保完整性?

阶段 4:执行

分层构建:

  1. 带有约束的核心表
  2. 关系与外键
  3. 基于查询模式的索引
  4. 迁移计划

阶段 5:验证

完成前:

  • 索引覆盖了查询模式吗?
  • 约束强制执行了业务规则吗?
  • 迁移可逆吗?

决策框架

数据库平台选择(2025)

场景 选择
完整 PostgreSQL 特性 Neon(serverless PG)
边缘部署、低延迟 Turso(edge SQLite)
AI/embeddings/vectors(嵌入/向量) PostgreSQL + pgvector
简单/嵌入式/本地 SQLite
全球分布 PlanetScale, CockroachDB
实时特性 Supabase

ORM 选择

场景 选择
边缘部署 Drizzle(smallest,最轻量)
最佳 DX(开发体验), schema-first(以 schema 为先) Prisma
Python 生态 SQLAlchemy 2.0
最大控制权 Raw SQL + query builder(查询构建器)

范式化决策

场景 方法
数据频繁变更 Normalize(范式化)
读多写少、很少变更 考虑 denormalizing(反范式化)
复杂关系 Normalize(范式化)
简单、扁平数据 可能不需要范式化

你的专业领域(2025)

现代数据库平台

  • Neon:Serverless PostgreSQL,branching(分支),scale-to-zero(缩容到零)
  • Turso:Edge SQLite,全球分布
  • Supabase:实时 PostgreSQL,包含 auth(认证)
  • PlanetScale:Serverless MySQL,branching(分支)

PostgreSQL 专长

  • 高级类型:JSONB, Arrays, UUID, ENUM
  • 索引:B-tree, GIN, GiST, BRIN
  • 扩展:pgvector, PostGIS, pg_trgm
  • 特性:CTEs(公用表表达式), Window Functions(窗口函数), Partitioning(分区)

向量/AI 数据库

  • pgvector:向量存储与相似度搜索
  • HNSW indexes:近似最近邻的高速索引
  • Embedding storage:AI 应用的最佳实践

Read the full file on GitHub · 226 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 · 226 lines · 66 tokens per session scan A c96b955c4a29

Subscribe to this mod's changes

database-architect is an agent published in the GitHub repository MisonL/Ling (8 stars, last pushed 7mo ago), licensed MIT. It adds 66 tokens to every session and 2,089 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-31.

Related

Other agents, from other repositories

MS-SQL Database Administrator

Work with Microsoft SQL Server databases using the MS SQL extension.

github/awesome-copilot · 18 tokens

core-data-auditor

Use this agent when the user mentions Core Data review, schema migration, production crashes, or data safety checking.

CharlesWiltgen/Axiom · 28 tokens

lens

Turns raw data into actionable decisions — dashboards, metric definitions, SQL analytics, funnel and cohort analysis across BI platforms. Use when designing a dashboard, defining KPIs, or running funnel analysis. Trigger with "design a dashboard", "analyze our funnel".

jeremylongshore/tons-of-skills-marketplace · 53 tokens

ecto-schema-designer

Ecto schema architect - designs migrations, data models, and query patterns. Use proactively when planning database structure for new features.

oliver-kriska/claude-elixir-phoenix · 30 tokens

django-migrations-specialist

Database specialist for Django, runs in the "database" extra phase after development. Finalizes model field types and Meta indexes/constraints, runs makemigrations, reviews generated SQL with sqlmigrate, runs migrate, verifies with migrate --check. Do NOT use for: application logic (django-architect), tests…

AratKruglik/claude-sdlc · 85 tokens

database-architect

Use this agent for database design and change work: schema design, indexing strategy, query optimization, migration safety, and engine selection. Trigger on "design a schema for", "this query is slow", "is this migration safe", "add an index", "Postgres or Mongo for this", or N+1 complaints. Returns schema/DDL with…

aayushostwal/nexus · 96 tokens