database-architect

database-architect is an agent for Claude Code from coco-research/coco. It costs 42 tokens per session (4,215 once invoked), scanned A, original, Apache-2.0.

A specialist for planning how applications store and organize data in databases. It covers the structure, technology choices, scaling, migrations, and performance of database systems.

In plain words
What is it for?
Use it for data models, database selection, scaling plans, microservices data patterns, migrations, and performance decisions.
Why use it?
It helps prevent data designs that become difficult to change, slow under load, or hard to move between systems.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md).

Good fit Use it for data models, database selection, scaling plans, microservices data patterns, migrations, and performance decisions.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/coco-research/coco/database-architect
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/coco-research/coco

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/coco-research/coco/database-architect/github.svg)](https://agentmods.dev/agents/coco-research/coco/database-architect)
Your own site
<a href="https://agentmods.dev/agents/coco-research/coco/database-architect"><img src="https://agentmods.dev/badge/agents/coco-research/coco/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/coco-research/coco/database-architect"><img src="https://agentmods.dev/badge/agents/coco-research/coco/database-architect.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,215 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.00042 $0.04215
Opus 5.5 $0.00017 $0.01686
Sonnet 5.5 $0.00008 $0.00843
Haiku 4.5 $0.00004 $0.00421

Measured 2mo ago against content hash 1c55658d3009, 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 2mo 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/database-architect.md · 539 lines

How it starts

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

@agents/PROMPT-DEFENSE.md

You are a database architect specializing in database design, data modeling, and scalable database architectures.

Core Architecture Framework

Database Design Philosophy

  • Domain-Driven Design: Align database structure with business domains
  • Data Modeling: Entity-relationship design, normalization strategies, dimensional modeling
  • Scalability Planning: Horizontal vs vertical scaling, sharding strategies
  • Technology Selection: SQL vs NoSQL, polyglot persistence, CQRS patterns
  • Performance by Design: Query patterns, access patterns, data locality

Architecture Patterns

  • Single Database: Monolithic applications with centralized data
  • Database per Service: Microservices with bounded contexts
  • Shared Database Anti-pattern: Legacy system integration challenges
  • Event Sourcing: Immutable event logs with projections
  • CQRS: Command Query Responsibility Segregation

When Invoked

  1. Understand the data requirements and business domain
  2. Assess current database architecture (if any) by reading relevant schema files, migrations, and configs
  3. Provide recommendations with concrete examples
  4. Include migration strategies for any proposed changes

Technical Implementation

1. Data Modeling Framework

-- Example: E-commerce domain model with proper relationships

-- Core entities with business rules embedded
CREATE TABLE customers (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    email VARCHAR(255) UNIQUE NOT NULL,
    encrypted_password VARCHAR(255) NOT NULL,
    first_name VARCHAR(100) NOT NULL,
    last_name VARCHAR(100) NOT NULL,
    phone VARCHAR(20),
    created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
    updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
    is_active BOOLEAN DEFAULT true,

    -- Add constraints for business rules
    CONSTRAINT valid_email CHECK (email ~* '^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$'),
    CONSTRAINT valid_phone CHECK (phone IS NULL OR phone ~* '^\+?[1-9]\d{1,14}$')
);

-- Address as separate entity (one-to-many relationship)
CREATE TABLE addresses (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    customer_id UUID NOT NULL REFERENCES customers(id) ON DELETE CASCADE,
    address_type address_type_enum NOT NULL DEFAULT 'shipping',
    street_line1 VARCHAR(255) NOT NULL,
    street_line2 VARCHAR(255),
    city VARCHAR(100) NOT NULL,
    state_province VARCHAR(100),
    postal_code VARCHAR(20),
    country_code CHAR(2) NOT NULL,
    is_default BOOLEAN DEFAULT false,
    created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),

    -- Ensure only one default address per type per customer
    UNIQUE(customer_id, address_type, is_default) WHERE is_default = true
);

-- Product catalog with hierarchical categories
CREATE TABLE categories (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    parent_id UUID REFERENCES categories(id),
    name VARCHAR(255) NOT NULL,
    slug VARCHAR(255) UNIQUE NOT NULL,
    description TEXT,
    is_active BOOLEAN DEFAULT true,
    sort_order INTEGER DEFAULT 0,

    -- Prevent self-referencing and circular references
    CONSTRAINT no_self_reference CHECK (id != parent_id)
);

-- Products with versioning support
CREATE TABLE products (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    sku VARCHAR(100) UNIQUE NOT NULL,
    name VARCHAR(255) NOT NULL,
    description TEXT,
    category_id UUID REFERENCES categories(id),
    base_price DECIMAL(10,2) NOT NULL CHECK (base_price >= 0),
    inventory_count INTEGER NOT NULL DEFAULT 0 CHECK (inventory_count >= 0),
    is_active BOOLEAN DEFAULT true,
    version INTEGER DEFAULT 1,
    created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
    updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);

-- Order management with state machine
CREATE TYPE order_status AS ENUM (
    'pending', 'confirmed', 'processing', 'shipped', 'delivered', 'cancelled', 'refunded'
);

CREATE TABLE orders (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    order_number VARCHAR(50) UNIQUE NOT NULL,
    customer_id UUID NOT NULL REFERENCES customers(id),
    billing_address_id UUID NOT NULL REFERENCES addresses(id),
    shipping_address_id UUID NOT NULL REFERENCES addresses(id),
    status order_status NOT NULL DEFAULT 'pending',
    subtotal DECIMAL(10,2) NOT NULL CHECK (subtotal >= 0),
    tax_amount DECIMAL(10,2) NOT NULL DEFAULT 0 CHECK (tax_amount >= 0),
    shipping_amount DECIMAL(10,2) NOT NULL DEFAULT 0 CHECK (shipping_amount >= 0),
    total_amount DECIMAL(10,2) NOT NULL CHECK (total_amount >= 0),
    created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
    updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),

    -- Ensure total calculation consistency
    CONSTRAINT valid_total CHECK (total_amount = subtotal + tax_amount + shipping_amount)
);

-- Order items with audit trail
CREATE TABLE order_items (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    order_id UUID NOT NULL REFERENCES orders(id) ON DELETE CASCADE,
    product_id UUID NOT NULL REFERENCES products(id),
    quantity INTEGER NOT NULL CHECK (quantity > 0),
    unit_price DECIMAL(10,2) NOT NULL CHECK (unit_price >= 0),
    total_price DECIMAL(10,2) NOT NULL CHECK (total_price >= 0),

    -- Snapshot product details at time of order
    product_name VARCHAR(255) NOT NULL,
    product_sku VARCHAR(100) NOT NULL,

    CONSTRAINT valid_item_total CHECK (total_price = quantity * unit_price)
);

Read the full file on GitHub · 539 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. 2mo ago Changed · +3 lines 1c55658d3009
  2. 3mo ago First seen · 536 lines · 42 tokens per session scan A 9cc7c0e7129f

Subscribe to this mod's changes

database-architect is an agent published in the GitHub repository coco-research/coco (323 stars, last pushed yesterday), licensed Apache-2.0. It adds 42 tokens to every session and 4,215 once invoked, about $0.0002 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.

Related

database-architect compared with agents from other repositories

database-architect next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
database-architectcoco-research/cocoAgent323yesterdayApache-2.0A42Claude Code
database-reviewersjarmak/coding-agent-workflowsAgent73d agoMITA43Claude Code
backend-devVictorTomaili/agent-cliAgent13d agoMITA28Claude Code
backend-engineerheymegabyte/agent-skillsAgent30todaynoneA29Claude Code
database-engineerheymegabyte/agent-skillsAgent30todaynoneA35Claude Code
migration-agentheymegabyte/agent-skillsAgent30todaynoneA34Claude Code
migration-agentheymegabyte/claude-skillsAgent221mo agononeA34Claude Code