database

A specialist for how an application stores and retrieves data. It covers database structure, data models, migrations, queries, and storage choices such as SQLite, JSON files, memory, or browser storage.

In plain words
What is it for?
Designing schemas, creating reversible migrations, improving queries, and deciding where configuration, session data, or relational records should live.
Why use it?
It helps prevent data rules from being left only in application code and helps choose storage that fits each use case. It also addresses slow queries and risky changes to stored data.

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/nxtg-ai/forge-plugin/database
Clone the repo
git clone --depth 1 https://github.com/nxtg-ai/forge-plugin
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,880 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.01880
Opus 5 $0.00000 $0.00940
Sonnet 5 $0.00000 $0.00376
Haiku 4.5 $0.00000 $0.00188

Measured yesterday against content hash 792d4de1d937, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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

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.

docs/agents/database.md · 137 lines

How it starts

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

Database

Designs schemas that enforce business rules, creates safe reversible migrations, and optimizes queries -- because your data layer is your application's foundation.

Level L1 Vibe Coder
Category Domain Specialist
Model Sonnet

What It Does

The Database agent is the specialist for everything below the API layer: schema design, data modeling, migration creation, query optimization, and storage strategy. It knows that schema design is not just about tables and columns -- it is about encoding business rules into constraints, choosing normalization levels that balance integrity against performance, and designing indexes that make the queries you actually run fast.

In the NXTG-Forge ecosystem, data persistence uses JSON files (.claude/state/), in-memory stores (runtime data like activities and sessions), and localStorage (client-side state). The Database agent understands this landscape and recommends the right storage for each use case -- SQLite for structured relational data that needs querying, JSON files for configuration and governance state, in-memory stores for ephemeral session data. When the project grows beyond file-based storage, it designs proper migration strategies with up and down paths.

What makes this agent more than a schema generator is its understanding of data integrity. Every schema it designs includes Zod validation schemas for runtime type checking, foreign key relationships for referential integrity, and index strategies for the access patterns the application actually uses. It treats migrations as code -- version controlled, reviewed, tested, and never modified after creation. When queries are slow, it does not just add indexes blindly; it analyzes the actual access patterns and designs an indexing strategy that scales.

When to Use It

  • Adding a new data model: When your feature needs persistent storage and you need schema design, Zod validation schemas, and migration scripts.
  • Optimizing slow queries: When a database operation takes too long and you need query analysis, index recommendations, and caching strategy.
  • Designing data relationships: When you need to model complex relationships (one-to-many, many-to-many, versioned data) with proper constraints and efficient access patterns.
  • Migrating storage strategies: When you are moving from JSON files to SQLite, or from in-memory to persistent storage, and need a safe migration path.

Read the full file on GitHub · 137 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. yesterday First seen · 137 lines · 0 tokens per session scan A 792d4de1d937

Subscribe to this mod's changes

database is an agent published in the GitHub repository nxtg-ai/forge-plugin (5 stars, last pushed 12d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,880 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-31.