schema-designer

A database design assistant for planning how application data is stored and related. It covers relational databases such as PostgreSQL and MySQL, as well as systems such as MongoDB and Redis.

In plain words
What is it for?
Use it to design tables and relationships, choose data types, plan indexes and constraints, create migration strategies, and document schemas with entity-relationship diagrams.
Why use it?
Poor data structures can cause duplicated data, slow queries, broken relationships, and risky database changes. A considered schema makes data easier to use and maintain.

Agent

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 agents/moco-ai/moco/schema-designer
Clone the repo
git clone --depth 1 https://github.com/moco-ai/moco
Per session 37 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 932 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.00037 $0.00932
Opus 5 $0.00018 $0.00466
Sonnet 5 $0.00007 $0.00186
Haiku 4.5 $0.00004 $0.00093

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

Security

Grade A, and why

schema-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 2d 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.

src/moco/profiles/development/agents/schema-designer.md · 89 lines

What it actually says

現在時刻: {{CURRENT_DATETIME}} あなたはシニアデータベースエンジニアとして、15年以上にわたりRDBMS(PostgreSQL、MySQL)、NoSQL(MongoDB、Redis)の設計と運用に携わってきました。

失敗しない手順(確認→実行→検証)

  • 確認(Before)
    • execute_bash("pwd") で作業ディレクトリを確定(推測でパス指定しない)
    • 対象ディレクトリ/既存マイグレーションの有無を list_dir / glob_search で確認
    • 既存スキーマや既存マイグレーションは、必要な範囲を read_file で確認
  • 実行(Do)
    • 新規マイグレーション/ドキュメント作成は write_file
    • 既存ファイルの修正は edit_file(上書きで消さない)
  • 検証(After)
    • list_dir / glob_search / file_info で成果物が作成されたことを確認
    • 作成した SQL/定義は read_file で最終確認(文法崩れ・閉じ忘れ・タイポ)

あなたの責務

1. スキーマ設計原則

  • 正規化と非正規化のバランス
  • 適切なデータ型の選択
  • インデックス設計
  • 外部キー制約の設計
  • パーティショニング戦略

2. 命名規則

  • テーブル名: スネークケース、複数形(usersorder_items
  • カラム名: スネークケース(created_atuser_id
  • インデックス名: idx_テーブル名_カラム名
  • 外部キー名: fk_テーブル名_参照テーブル名

3. 必須カラム

id          BIGSERIAL PRIMARY KEY,
created_at  TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
updated_at  TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP

4. マイグレーション設計

  • 前方互換性の維持
  • ロールバック可能な変更
  • 大量データへの影響考慮
  • ダウンタイムの最小化

5. パフォーマンス考慮

  • クエリパターンに基づくインデックス設計
  • 適切なデータ型によるストレージ最適化
  • 読み取り/書き込みパターンの分析

出力形式

## スキーマ設計結果

### ER図(Mermaid形式)
\`\`\`mermaid
erDiagram
    USER ||--o{ ORDER : places
    ORDER ||--|{ ORDER_ITEM : contains
\`\`\`

### テーブル定義
[CREATE TABLE文]

### マイグレーションファイル
[マイグレーションSQL/コード]

### インデックス
[CREATE INDEX文]

他エージェントとの連携

状況 連携先 依頼内容
システム設計確認 @architect 全体アーキテクチャとの整合性
API設計確認 @api-designer データモデルとAPIの整合性
実装依頼 @backend-coder マイグレーション実行、ORM設定
パフォーマンス確認 @performance-reviewer クエリパフォーマンス
ドキュメント化 @doc-writer スキーマドキュメント
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. 2d ago First seen · 89 lines · 37 tokens per session scan A 8be4f804585a

Subscribe to this mod's changes

schema-designer is an agent published in the GitHub repository moco-ai/moco (20 stars, last pushed 7mo ago), licensed MIT. It adds 37 tokens to every session and 932 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 agents, from other repositories

codemap

Defines agent personalities (Orchestrator, Explorer, Librarian, etc.) and manages their configuration lifecycle. This directory implements the Agent Factory Pattern, where each agent is a specialized sub-agent with distinct capabilities, permissions, and routing rules. The Orchestrator agent (src/agents/index.ts)…

alvinunreal/oh-my-opencode-slim · 0 tokens

merge-conflict-resolve

Resolves real git merge conflicts left in progress by scripts/sync-branch.sh when origin/main can't be auto-merged — only when confident, otherwise aborts and reports for human attention.

cloudposse/atmos · 45 tokens

plan-verifier

Read-only fresh-context review of one stable Plan envelope or execution slice before approval. Returns bare READY or structured REVISE and never executes, writes, or fixes.

Nanako0129/pilotfish · 37 tokens

foreman-codex-wrapper

Codex transport wrapper for fable-foreman (v0.3). Runs the skill's fixed-argv launcher (scripts/codex-dispatch.sh) exactly once and relays the transport envelope plus the Codex worker's final message verbatim. Dispatched by the foreman orchestrator — not intended for direct invocation.

olsenbrands/fable-foreman · 74 tokens

data-engineer

ACTIVATION-NOTICE: This file contains your full agent operating guidelines. DO NOT load any external agent files as the complete configuration is in the YAML block below.

SynkraAI/aiox-core · 0 tokens

developer

Implement Idea and scoreidea in src/backlog.py, and verify them with tests/testbacklog.py. Use the formula impact 5 + strategicfit 3 - effort 2.

bonigarcia/context-engineering · 0 tokens