Docker Testcontainers

Docker Testcontainers is a skill for Claude Code, Codex from PramodDutta/qaskills. It costs 42 tokens per session (2,356 once invoked), scanned A, original, MIT.

A guide to integration tests that start real databases, caches, or message brokers in temporary Docker containers using the Testcontainers Node.js library. The containers are created for the tests and cleaned up afterward.

In plain words
What is it for?
Use it to test real PostgreSQL, Redis, Kafka, or other Docker-based services with dynamic ports, readiness checks, and reliable cleanup.
Why use it?
It avoids false confidence from mocks or shared development services and lets tests check the same type of dependency used in production.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for aider. Also seen: mentions Codex; built for aider; mentions Gemini CLI.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { runMigrations } from '../src/db/migrate';.

Good fit Use it to test real PostgreSQL, Redis, Kafka, or other Docker-based services with dynamic ports, readiness checks, and reliable cleanup.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/PramodDutta/qaskills
agentmods
npx agentmods add skills/pramoddutta/qaskills/docker-testcontainers

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 Docker Testcontainers

README.md
[![agentmods](https://agentmods.dev/badge/skills/pramoddutta/qaskills/docker-testcontainers/github.svg)](https://agentmods.dev/skills/pramoddutta/qaskills/docker-testcontainers)
Your own site
<a href="https://agentmods.dev/skills/pramoddutta/qaskills/docker-testcontainers"><img src="https://agentmods.dev/badge/skills/pramoddutta/qaskills/docker-testcontainers/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 Docker Testcontainers

Your own site · 80×15
<a href="https://agentmods.dev/skills/pramoddutta/qaskills/docker-testcontainers"><img src="https://agentmods.dev/badge/skills/pramoddutta/qaskills/docker-testcontainers.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,356 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Memory Poisoning · line 24
    Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.
    Fix: Protect agent memory and state from modification by untrusted content. Use read-only memory for critical instructions and validate all state changes.
  • medium Rogue Agent · line 17
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
How audits are shown
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.02356
Opus 5.5 $0.00017 $0.00942
Sonnet 5.5 $0.00008 $0.00471
Haiku 4.5 $0.00004 $0.00236

Measured 1mo ago against content hash 9be2c71f1054, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

Docker Testcontainers 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 1mo 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.

seed-skills/docker-testcontainers/SKILL.md · 221 lines

How it starts

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

Docker Testcontainers

This skill makes an AI agent write integration tests that spin up real databases, caches, and message brokers in disposable Docker containers via the testcontainers Node.js library - instead of mocking them or depending on a shared dev server. Trigger it when tests need a real Postgres, Redis, Kafka, or any service with Docker image, when a repo already imports testcontainers, or when the user complains that mocked repositories keep hiding SQL and serialization bugs.

Core Principles

  1. Test against the real engine, not a lookalike. SQLite in place of Postgres misses JSONB operators, transaction isolation behavior, and case-sensitivity rules. Run the exact image and major version production uses (postgres:16-alpine, not latest).
  2. Always use mapped ports. Containers bind to random free host ports. Read them with container.getMappedPort(5432) and container.getHost(); hardcoding localhost:5432 collides with local services and parallel CI jobs.
  3. Wait strategies, not sleeps. A started container is not a ready service. Use Wait.forLogMessage, Wait.forListeningPorts, Wait.forHttp, or Wait.forHealthCheck so tests begin exactly when the dependency is usable.
  4. One container per suite, clean state per test. Container startup costs seconds; start in beforeAll, then reset state between tests with TRUNCATE, FLUSHALL, or transaction rollbacks - not by restarting the container.
  5. Cleanup must survive failures. Stop containers in afterAll; Testcontainers' Ryuk sidecar reaps anything left behind if the process dies, so never disable it in CI.
  6. Pin image tags. redis:latest changing under you turns a green suite red with zero code changes. Pin to a major-minor tag and upgrade deliberately.

Setup

npm install --save-dev testcontainers @testcontainers/postgresql
# Requires a running Docker daemon (Docker Desktop, Colima, or CI's dockerd)
docker info

Patterns

1. GenericContainer: Redis with a wait strategy

Read the full file on GitHub · 221 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. 1mo ago First seen · 221 lines · 42 tokens per session scan A 9be2c71f1054

Subscribe to this mod's changes

Docker Testcontainers is a skill published in the GitHub repository PramodDutta/qaskills (237 stars, last pushed 8d ago), licensed MIT. It adds 42 tokens to every session and 2,356 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-09-03.

Related

Other skills, from other repositories

testing-patterns

Testing patterns for Spring Boot - JUnit 5, Mockito, MockMvc, Testcontainers, positive and negative test cases. Use when user asks about testing, writing tests, test coverage, or test failures.

piomin/claude-ai-spring-boot · 46 tokens

design-patterns

Design patterns with Java examples - classic (Factory, Builder, Strategy, Observer, Decorator, Adapter) and enterprise/microservices (Saga, Outbox, CQRS). Use when user asks about patterns, designing extensible components, or distributed transaction strategies.

piomin/claude-ai-spring-boot · 56 tokens

code-quality

Comprehensive code review for Java - clean code principles, API contracts, null safety, exception handling, and performance. Use when user says "review code", "refactor", "check API", or before merging changes.

piomin/claude-ai-spring-boot · 47 tokens

jpa-patterns

JPA/Hibernate patterns and common pitfalls (N+1, lazy loading, transactions, queries). Use when user has JPA performance issues, LazyInitializationException, or asks about entity relationships and fetching strategies.

piomin/claude-ai-spring-boot · 47 tokens

logging-patterns

Java logging best practices with SLF4J, structured logging (JSON), and MDC for request tracing. Includes AI-friendly log formats for Claude Code debugging. Use when user asks about logging, debugging application flow, or analyzing logs.

piomin/claude-ai-spring-boot · 50 tokens

spring-boot

Spring Boot 4.x development - REST APIs, JPA, Security, Testing, and Cloud-native patterns. Use for building enterprise Java applications with Spring Boot.

piomin/claude-ai-spring-boot · 36 tokens