Scaffolds integration tests for any web API stack using Testcontainers to run tests against real databases. Supports ASP.NET Core, Node, Python, Java/Kotlin, and Go.
Ships in AI for Developers Toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Stand up real integration tests for an API: boot the app in-process (or as close as the stack allows), swap in a real database from Testcontainers, reset state between tests, and ship a sample test that exercises the full HTTP pipeline.
Point this at the API project or repo, not a pasted file - inspect what exists first:
git clone --depth 1 <url> /tmp/repo && cd /tmp/repoIf an integration-test setup already exists, review and extend it (flag schema created by "create all" instead of real migrations, unpinned images, a container per test, missing state reset, order-dependent tests) instead of scaffolding from scratch. Pick a representative endpoint for the first test.
| Manifest | Stack | App host for tests | Testcontainers package |
|---|---|---|---|
*.csproj | ASP.NET Core | WebApplicationFactory<Program> | Testcontainers.PostgreSql / .MsSql / .MySql / .Redis |
package.json | Express / Fastify / NestJS | supertest on the app instance / fastify.inject / Test.createTestingModule | @testcontainers/postgresql etc. |
pyproject.toml, requirements*.txt | FastAPI / Django / Flask | TestClient or httpx.AsyncClient / Django Client / app.test_client() | testcontainers (testcontainers.postgres) |
pom.xml, build.gradle(.kts) | Spring Boot | @SpringBootTest + MockMvc / WebTestClient / TestRestTemplate | org.testcontainers:postgresql + junit-jupiter |
go.mod | net/http / chi / gin / echo | httptest.NewServer(handler) | github.com/testcontainers/testcontainers-go/modules/postgres |
Find the entry point and routes, e.g.:
# .NET
find <target> -name Program.cs | grep -vi "/obj/\|/bin/"
grep -rn "MapGet\|MapPost\|: ControllerBase\|ICarterModule" --include=*.cs <target> | head
# Node
grep -rnE "express\(\)|Fastify\(|NestFactory|app\.(get|post)\(" --include=*.{ts,js} <target> | grep -v node_modules | head
# Python
grep -rnE "FastAPI\(|urlpatterns|Flask\(" --include=*.py <target> | head
# Java / Kotlin
grep -rn "@RestController\|@SpringBootApplication" <target>/src | head
# Go
grep -rnE "http\.HandleFunc|chi\.NewRouter|gin\.(New|Default)|echo\.New" --include=*.go <target> | head
Infer the database from the driver/ORM in the manifest; default to PostgreSQL only if nothing points elsewhere.
postgres:16-alpine, not latest).migrate, Flyway/Liquibase, goose/golang-migrate/atlas) - not "create all tables from models".dotnet add package Microsoft.AspNetCore.Mvc.Testing
dotnet add package Testcontainers.PostgreSql # or Testcontainers.MsSql
dotnet add package xunit
dotnet add package FluentAssertions
dotnet add package Respawn # reset DB state between tests
public class IntegrationTestFactory : WebApplicationFactory<Program>, IAsyncLifetime
{
private readonly PostgreSqlContainer _db = new PostgreSqlBuilder()
.WithImage("postgres:16-alpine")
.Build();
protected override void ConfigureWebHost(IWebHostBuilder builder)
{
builder.ConfigureTestServices(services =>
{
// Remove the app's registered DbContext and point it at the container
services.RemoveAll<DbContextOptions<AppDbContext>>();
services.AddDbContext<AppDbContext>(o => o.UseNpgsql(_db.GetConnectionString()));
});
}
public async Task InitializeAsync()
{
await _db.StartAsync();
using var scope = Services.CreateScope();
var ctx = scope.ServiceProvider.GetRequiredService<AppDbContext>();
await ctx.Database.MigrateAsync();
}
public new async Task DisposeAsync() => await _db.DisposeAsync();
}
[CollectionDefinition(nameof(IntegrationCollection))]
public class IntegrationCollection : ICollectionFixture<IntegrationTestFactory> { }
[Collection(nameof(IntegrationCollection))]
public class OrdersApiTests
{
private readonly HttpClient _client;
public OrdersApiTests(IntegrationTestFactory factory) => _client = factory.CreateClient();
[Fact]
public async Task CreateOrder_ReturnsCreated_AndPersists()
{
var request = new { customerId = Guid.NewGuid(), lines = new[] { new { sku = "SKU1", qty = 2 } } };
var response = await _client.PostAsJsonAsync("/orders", request);
response.StatusCode.Should().Be(HttpStatusCode.Created);
var id = await response.Content.ReadFromJsonAsync<Guid>();
(await _client.GetAsync($"/orders/{id}")).StatusCode.Should().Be(HttpStatusCode.OK);
}
}
Program must be reachable - add public partial class Program { } at the bottom of Program.cs with top-level statements.MigrateAsync, not EnsureCreatedAsync (the latter skips migrations)._respawner = await Respawner.CreateAsync(conn, new RespawnerOptions { DbAdapter = DbAdapter.Postgres }); then await _respawner.ResetAsync(conn) in a per-test hook. Respawn needs an open DbConnection for Postgres.listen() so tests can import it; drive it with supertest (Express/NestJS via app.getHttpServer()) or app.inject() (Fastify).globalSetup / Jest globalSetup), set DATABASE_URL, run migrations (prisma migrate deploy, knex migrate:latest, TypeORM runMigrations()), then import the app.TRUNCATE ... RESTART IDENTITY CASCADE in beforeEach. Run test files serially (or one schema/DB per worker) when they share a database.TestClient(app) (sync) or httpx.AsyncClient with ASGITransport(app=app); override settings or the DB dependency via app.dependency_overrides.pytest-django with the django_db marker or TestCase/TransactionTestCase; point DATABASES at the container.with PostgresContainer("postgres:16-alpine") as pg: -> pg.get_connection_url(), run alembic upgrade head (or Django migrations), yield. Per-test: transaction rollback (SQLAlchemy connection + nested transaction) or truncation.@SpringBootTest + @AutoConfigureMockMvc (or webEnvironment = RANDOM_PORT with WebTestClient/TestRestTemplate), @Testcontainers, a static @Container PostgreSQLContainer<?>.@ServiceConnection (Spring Boot 3.1+) or @DynamicPropertySource. Flyway/Liquibase run on startup automatically.@Transactional on a test rolls back only for MockMvc-style in-thread calls - not for RANDOM_PORT HTTP calls; use truncation there.srv := httptest.NewServer(handler); defer srv.Close().TestMain with the testcontainers-go postgres module, run migrations (goose / golang-migrate / atlas), pass the DSN to the app.//go:build integration) or testing.Short() so go test ./... stays fast; reset with TRUNCATE per test.## Detected
<stack, web framework, DB, migration tool, existing test setup (reviewed or new)>
## Packages / dependencies
<exact install commands for the stack>
## Harness
<factory / global setup / fixtures / base class with container + migrations + state reset>
## Sample test
<one passing test against a representative endpoint>
## Notes
<CI requirements (Docker), anything to verify, review findings if a setup existed>
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
PostgreSQL, MySQL, Redis, SQL Server, Express, Fastify, NestJS, Fastapi
integration-testing, testcontainers, api-testing, test-harness
/ai-dev-toolkit:integration-test-setupfrom AI for Developers Toolkit
npx claudepluginhub stefanthecode/ai-for-developers --plugin ai-dev-toolkit45 skills in this plugin
/api-endpoint-scaffolderScaffold HTTP API endpoints in any stack - ASP.NET Core Minimal APIs or controllers, Express, Fastify, NestJS, FastAPI, Django REST Framework, Spring Boot controllers, Go net/http, chi, Gin - one feature per endpoint (REPR style) with request validation, typed responses, route grouping, auth, and OpenAPI metadata. Use this skill whenever the user wants to add an endpoint or route, convert controllers to minimal APIs, structure routes or routers, set up endpoint groups, TypedResults, route handlers, request DTOs/schemas (zod, Pydantic, Bean Validation, binding tags), or asks "how do I add an endpoint / structure my API routes". Always use this skill for endpoint scaffolding; it generates a complete, validated endpoint that matches the project's conventions./architecture-test-generatorGenerate architecture tests / fitness functions that fail the build when architectural rules are violated - layer dependencies, module boundaries, cycles, naming, and visibility conventions - in any stack: NetArchTest or ArchUnitNET (.NET), ArchUnit or Konsist (Java/Kotlin), dependency-cruiser or eslint-plugin-boundaries (TypeScript/JavaScript), import-linter (Python), go-arch-lint or depguard (Go). Use this skill whenever the user wants architecture tests, to enforce layering or the dependency rule, dependency rules as tests, import rules, forbidden imports, no circular dependencies, naming conventions, fitness functions, or asks "how do I stop people breaking the architecture / enforce my layers / keep modules from importing each other". Always use this skill for architecture-test requests; it generates rules matching the project's real structure./async-await-auditorAudit async and concurrent code in any language for correctness and performance bugs - C#/.NET (async/await, Task), JavaScript/TypeScript (Promises, async/await), Python (asyncio), Java/Kotlin (CompletableFuture, virtual threads, coroutines), Go (goroutines, channels, context), Rust (tokio/async). Use this skill whenever the user shares async or concurrent code, or asks about deadlocks, hangs, blocking calls, .Result/.Wait(), async void, ConfigureAwait, floating or unhandled promises, await in a loop vs Promise.all, blocking the event loop, forgotten await, asyncio.gather/TaskGroup, CompletableFuture.join, virtual thread pinning, goroutine leaks, context cancellation, WaitGroup/errgroup, holding a lock across .await, fire-and-forget tasks, cancellation tokens, or "why does my async code hang". Always use this skill for async/concurrency reviews instead of answering from memory; it applies a fixed checklist and rewrites the code./authorization-setupDesign API authorization in any stack - policy-based, role-based, claims/permission-based, and resource-based (ownership) checks. Covers ASP.NET Core policies and AuthorizationHandler, NestJS guards, Express middleware and CASL, FastAPI dependencies/scopes, Django and DRF permission classes, Spring Security (@PreAuthorize, SecurityFilterChain), Go middleware, and Casbin/OPA. Use this skill whenever the user wants authorization policies, role/claim/permission checks, RBAC/ABAC, custom authorization rules, resource-based authorization, IDOR protection, "deny by default", or asks "how do I authorize this / policy vs role / restrict this endpoint to X / stop users seeing other users' data". Always use this skill for authorization requests; it generates policies, handlers, and endpoint wiring./benchmark-setupSet up correct micro-benchmarks in any stack and interpret the results - BenchmarkDotNet (.NET), JMH (Java/Kotlin), pytest-benchmark / pyperf (Python), Vitest bench / tinybench / mitata (JavaScript/TypeScript), Go testing.B + benchstat, Rust criterion. Use this skill whenever the user wants to benchmark code, measure performance, compare two implementations or functions, set up a benchmark harness, or asks "which is faster", "benchmark these two functions", "how do I benchmark this", "is this optimization worth it", or "interpret these benchmark results". Always use this skill for micro-benchmarking requests; it writes correct benchmarks, avoids the classic pitfalls, and explains the numbers./caching-strategy-setupAdd the right caching to an app in any stack - in-process, distributed (Redis/Valkey/Memcached), two-level, or HTTP/output caching - with correct keys, expiration, stampede protection, and invalidation. Covers HybridCache / IMemoryCache / IDistributedCache / output caching in .NET, lru-cache / keyv / cache-manager / ioredis in Node, functools / cachetools / redis-py / Django cache in Python, Spring Cache with Caffeine or Redis in Java/Kotlin, and ristretto / groupcache / singleflight / go-redis in Go. Use this skill whenever the user wants caching, to cache a query/response, Redis caching, @Cacheable, lru_cache, HybridCache, cache-aside, output caching, or asks "how do I cache this / add caching / avoid cache stampede / invalidate this cache". Always use this skill for caching requests; it picks the right layer and wires expiration + invalidation correctly.Other plugins' skills for the same job