db-designer

db-designer is a skill for Claude Code, Codex from miniidealab/openlogos. It costs 0 tokens per session (2,423 once invoked), scanned A, original, Apache-2.0.

A database design assistant that turns an API specification into SQL table definitions for the selected database system.

In plain words
What is it for?
Use it to derive tables from API requests and responses, generate database-specific SQL, plan indexes, and document fields and security rules.
Why use it?
It helps keep stored data, field types, rules, indexes, and access controls aligned with the API. It also identifies when the required API design or database choice is missing.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/miniidealab/openlogos/db-designer
Any agent
npx skills add miniidealab/openlogos --skill db-designer
Clone the repo
git clone --depth 1 https://github.com/miniidealab/openlogos

Made for: Claude Code, Codex.

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 db-designer

README.md
[![agentmods](https://agentmods.dev/badge/skills/miniidealab/openlogos/db-designer.svg)](https://agentmods.dev/skills/miniidealab/openlogos/db-designer)
Your own site
<a href="https://agentmods.dev/skills/miniidealab/openlogos/db-designer"><img src="https://agentmods.dev/badge/skills/miniidealab/openlogos/db-designer.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,423 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00000 $0.02423
Opus 5 $0.00000 $0.01211
Sonnet 5 $0.00000 $0.00485
Haiku 4.5 $0.00000 $0.00242

Measured 4d ago against content hash ea65b2f6edcd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

db-designer 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 4d 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.

examples/flowtask/logos/skills/db-designer/SKILL.md · 213 lines

How it starts

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

Skill: DB Designer

从 API 规格推导数据库表结构,生成对应方言的 SQL DDL。数据库类型由 Phase 3 Step 0 技术选型确定,确保字段类型、约束、索引和安全策略与 API 端点完全对齐。

触发条件

  • 用户要求设计数据库或编写 SQL
  • 用户提到 "Phase 3 Step 2"、"DB 设计"、"表结构"
  • 已有 API YAML 规格,需要推导数据库设计
  • 用户提供了数据模型需要转化为 DDL

核心能力

  1. 从 API 请求/响应结构推导表结构
  2. 读取 logos-project.yamltech_stack.database 确定数据库类型
  3. 生成对应数据库方言的 SQL DDL
  4. 设计索引并说明设计理由
  5. 设计安全策略(RLS / 应用层权限)
  6. 为每张表、每个字段添加注释

前置依赖

  • logos/resources/api/ 中包含 API YAML 规格(api-designer 产出)
  • logos-project.yamltech_stack.database 已填写

如果 API 目录为空,提示用户先完成 Phase 3 Step 2 的 API 设计(api-designer)。如果 tech_stack.database 未填写,提示用户先完成 Phase 3 Step 0(architecture-designer)。

执行步骤

Step 1: 确认数据库类型

读取 logos/logos-project.yamltech_stack 字段,确定数据库类型和方言:

  • PostgreSQL → 使用 UUID、TIMESTAMPTZ、RLS、JSONB 等特性
  • MySQL → 使用 InnoDB、utf8mb4、TIMESTAMP 等特性
  • SQLite → 使用 INTEGER PRIMARY KEY、TEXT 等简化类型
  • 其他 → 与用户确认后选择最接近的方言

Step 2: 提取数据实体

从 API YAML 中提取所有需要持久化的数据实体:

  1. 扫描所有端点的 requestBodyresponses,识别核心数据对象
  2. 区分"需要持久化"与"仅传输用"的数据:
    • 有 CRUD 操作的对象 → 需要建表(如 usersprojects
    • 只出现在请求/响应中但不直接存储的 → 不建表(如 loginRequest
  3. 为每个对象标注来源 API 端点

输出实体清单供用户确认:

从 API 规格中识别到 N 个需要持久化的数据实体:

| # | 实体 | 来源端点 | 核心字段 |
|---|------|---------|---------|
| 1 | users | auth.yaml → register, login | email, password, status |
| 2 | projects | projects.yaml → create, list, get | name, description, owner_id |
| 3 | subscriptions | billing.yaml → subscribe | plan, status, expires_at |

Step 3: 设计表结构

为每个实体设计完整的表结构,遵循当前数据库方言:

每张表必须包含

  • 主键(UUID 或自增 ID,视方言决定)
  • 业务字段(从 API schema 映射,类型转换为数据库类型)
  • 审计字段:created_atupdated_at
  • 软删除字段:deleted_at(按需)
  • 字段约束:NOT NULLUNIQUECHECKDEFAULT

类型映射原则

  • API string + format: emailTEXT NOT NULL(配合 CHECK 约束或应用层校验)
  • API string + format: uuidUUID(PostgreSQL)/ CHAR(36)(MySQL)
  • API integerINTEGER / BIGINT
  • API booleanBOOLEAN(PostgreSQL)/ TINYINT(1)(MySQL)
  • API string + enumTEXT + CHECK 约束(列出枚举值)
  • 金额字段 → INTEGER(存分值),禁止 DECIMAL/FLOAT

Read the full file on GitHub · 213 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. 4d ago First seen · 213 lines · 0 tokens per session scan A ea65b2f6edcd

Subscribe to this mod's changes

db-designer is a skill published in the GitHub repository miniidealab/openlogos (71 stars, last pushed 8d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 2,423 tokens. 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

schema-exploration

Lists tables, describes columns and data types, identifies foreign key relationships, and maps entity relationships in a database. Use when the user asks about database schema, table structure, column types, what tables exist, ERD, foreign keys, or how entities relate.

langchain-ai/deepagents · 57 tokens

agent-platform-rag-engine-management

Manage and query Agent Platform RAG Engine Corpora and retrieve grounded contexts using the Google GenAI SDK. Use when listing RAG corpora or files, inspecting a corpus, retrieving contexts, or generating content grounded in a RAG corpus. Do not use for standard database queries (use SQL/Spanner skills), Google…

google/skills · 85 tokens

deploy-docker-compose

Run the Omnigent server as a Docker compose stack (server + Postgres) on any Docker host — your laptop, a VPS, EC2 by hand, or as the base layer of any container-platform deploy. Invoke when the user wants to build the image, bring up the compose stack, debug the stack on a host they already have, or extend the stack…

omnigent-ai/omnigent · 84 tokens

moderator-page-migration

Port a moderator page from the main Next.js app (src/pages/moderator/) into apps/moderator. Use when asked to migrate, move or cut over a /moderator/ page to the spoke, or to port its tRPC procedures and Prisma services to SvelteKit loads/actions and Kysely.

civitai/civitai · 71 tokens

dsql

Build with Aurora DSQL — manage schemas, execute queries, handle migrations, diagnose query plans, diagnose cluster performance, load data, and develop applications with a serverless, distributed SQL database. Covers IAM auth, multi-tenant patterns, MySQL-to-DSQL and PostgreSQL-to-DSQL schema conversion, foreign key…

awslabs/agent-plugins · 229 tokens

sql-translate

Translate SQL queries between database dialects (Snowflake, BigQuery, PostgreSQL, MySQL, etc.).

AltimateAI/altimate-code · 26 tokens