test-database-seeding

test-database-seeding is a skill for Claude Code, Codex from makifbaysal/tasktrooper. It costs 37 tokens per session (825 once invoked), scanned A, original, Apache-2.0.

A procedure for giving automated tests a disposable database containing known data, using the same database engine and migrations as production. Testcontainers is used to start and remove the database for a test run.

In plain words
What is it for?
Use it when tests need database records or SQL behaviour. It starts a real isolated database, applies the application's migrations, loads fixtures, and tears it down after the run.
Why use it?
Shared or production databases can be changed by other work and can put real data at risk. In-memory substitutes may accept queries that fail on the production database engine.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when tests need database records or SQL behaviour. It starts a real isolated database, applies the application's migrations, loads fixtures, and tears it down after the run.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/makifbaysal/tasktrooper/test-database-seeding
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.

Any agent
npx skills add makifbaysal/tasktrooper --skill test-database-seeding
Clone the repo
git clone --depth 1 https://github.com/makifbaysal/tasktrooper

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 test-database-seeding

README.md
[![agentmods](https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/test-database-seeding/github.svg)](https://agentmods.dev/skills/makifbaysal/tasktrooper/test-database-seeding)
Your own site
<a href="https://agentmods.dev/skills/makifbaysal/tasktrooper/test-database-seeding"><img src="https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/test-database-seeding/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 test-database-seeding

Your own site · 80×15
<a href="https://agentmods.dev/skills/makifbaysal/tasktrooper/test-database-seeding"><img src="https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/test-database-seeding.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 825 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.00037 $0.00825
Opus 5.5 $0.00015 $0.00330
Sonnet 5.5 $0.00007 $0.00165
Haiku 4.5 $0.00004 $0.00082

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

Security

Grade A, and why

test-database-seeding 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 8d 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.

catalog/agents/qa-agent/skills/test-database-seeding/SKILL.md · 79 lines

How it starts

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

Test Database Seeding

Overview

Automated tests need a database that is real (same engine as production), isolated (no shared state), and seeded with known data. The answer is a disposable, per-run database — Testcontainers spins up a real Postgres in a container, migrated and seeded, torn down after.

Core principle: Real engine, disposable instance, known seed. Never point tests at a shared dev or production database, and never use an in-memory substitute whose SQL differs from production.

Why not the alternatives

Approach Problem
Shared dev/staging DB Flaky: other work mutates it; tests collide and depend on order
Production DB Never — data risk, and tests would mutate real records
In-memory (H2/SQLite) Dialect gaps: queries pass in H2, fail on Postgres → bugs ship
Disposable real DB (Testcontainers) ✅ real engine, isolated, reproducible

The Pattern

  1. Start a real DB container for the suite (Testcontainers): postgres:<same-major-as-prod>.
  2. Run the real migrations against it — the same migration files the app uses, so the schema is production-accurate.
  3. Seed known fixtures: insert the exact rows the scenario needs (a project, N tasks, a user with a role). Keep fixtures small and explicit — a test asserting "3 tasks" seeds exactly 3.
  4. Isolate per test: each test either runs in a transaction rolled back at the end, or truncates/reseeds between tests. No test sees another's data.
  5. Point the app/config at the container's connection string for the run.
  6. Tear down automatically when the suite ends.

Worked Example

@Testcontainers
class TaskExportIT {
    @Container static PostgreSQLContainer<?> db =
        new PostgreSQLContainer<>("postgres:16");

    @BeforeAll static void migrate() { Flyway.configure().dataSource(db.getJdbcUrl(),
        db.getUsername(), db.getPassword()).load().migrate(); }   // real migrations

    @BeforeEach void seed() {
        // exactly the rows this scenario needs
        insertProject("p1", "Demo");
        insertTasks("p1", 3);
    }

    @Test void export_returns_all_tasks() {
        var csv = export("p1");
        assertEquals(3, csvRows(csv));   // asserts against the known seed
    }
}

Read the full file on GitHub · 79 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. 8d ago First seen · 79 lines · 37 tokens per session scan A b9f1eead7502

Subscribe to this mod's changes

test-database-seeding is a skill published in the GitHub repository makifbaysal/tasktrooper (113 stars, last pushed yesterday), licensed Apache-2.0. It adds 37 tokens to every session and 825 once invoked, about $0.0001 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-10-05.