api-integration-test

Instructions for writing API integration tests that use the real application services, such as the database, cache, and queue.

In plain words
What is it for?
Testing API behavior, database changes, queue dispatches, audit records, cookies, headers, and other requirements that depend on a running service stack.
Why use it?
They help distinguish integration tests from unit tests and prevent test data from interfering with parallel runs.

Skill for Claude CodeCodex

Part of the foundry plugin — 47 skills, 8 agents, 8 hooks, 1 MCP server shipped together

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 skills/lukasrepublic/agentic-foundry/api-integration-test
Any agent
npx skills add lukasrepublic/agentic-foundry --skill api-integration-test
Clone the repo
git clone --depth 1 https://github.com/lukasrepublic/agentic-foundry

Made for: Claude Code, Codex.

Or install foundry, the plugin that ships this one along with the rest of its 47 skills, 8 agents, 8 hooks, 1 MCP server.

Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,300 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.02300
Opus 5 $0.00000 $0.01150
Sonnet 5 $0.00000 $0.00460
Haiku 4.5 $0.00000 $0.00230

Measured 2d ago against content hash 4ad39395644b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

api-integration-test 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 2d 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.

packs/stack-profiles/node-web/blueprints/api-integration-test/SKILL.md · 87 lines

How it starts

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

When to trigger

  • The implementing agent authors integration tests for a spec whose ACs require database-state assertions, queue-dispatch verification, or audit-event rows.
  • Test files live under the api package's integration-test directory (e.g. test/*.integration.test.ts).
  • A spec's acceptance criteria reference: cookie Max-Age bounds, Retry-After headers, non-enumeration assertions, audit-event table rows, or queue add side effects.
  • The operator says "author integration tests", "write API integration tests", or "add integration coverage for ".

Procedure

  1. Confirm the live stack is reachable. Boot the project's local development stack and verify the API health endpoint responds before writing any test. Integration tests require the real backing services (database, cache, queue) running — they FAIL against mocked services. The boundary rule: if a test could run without a real database, it is a unit test; route to vitest-unit instead.

  2. Use app.inject() as the default invocation form. Fastify's app.inject({ method, url, headers, payload }) dispatches requests through the full route-handler stack without opening a real socket. This is faster than supertest + an HTTP server and avoids port-collision issues in parallel test runs. Reserve real-socket (app.listen() + fetch()) only when the test exercises HTTP/2 or WebSocket behavior that inject() cannot simulate.

  3. Establish per-test isolation. Choose one of two strategies:

    • Transaction rollback (preferred for speed): wrap each test in a database transaction via BEGIN; roll back in afterEach. Works when the code under test does NOT commit in a nested transaction.
    • Table truncation (required for tests that commit): in afterEach, truncate all affected tables in reverse-FK order. Slower but universally safe. Additionally, namespace test-generated data to prevent bleed between parallel runs: prefix email addresses with the test-file slug, prefix IP addresses with a test-run ID, and prefix queue job IDs where applicable.

Read the full file on GitHub · 87 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. 2d ago First seen · 87 lines · 0 tokens per session scan A 4ad39395644b

Subscribe to this mod's changes

api-integration-test is a skill published in the GitHub repository lukasrepublic/agentic-foundry (1 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,300 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.

Related

Other skills, from other repositories

agent-production-validator

Agent skill for production-validator - invoke with $agent-production-validator.

ruvnet/ruflo · 16 tokens

inspector-workbench

Runs Inspector UI work on the standalone Threads state lab so the agent can see the overlay. Use when a CopilotKit employee asks an agent to fix, polish, add, or debug Inspector UI, chrome, panes, overlay actions, launcher, Home, Threads, Playground, Memory, or any visual behavior in @copilotkit/web-inspector. Don't…

CopilotKit/CopilotKit · 112 tokens

tutti-record-agent-session-replay

From a Tutti checkout, run, audit, freshly replay, publish, or diagnose Session Replay cassettes that are driven by case-repository scenario scripts (CDP), not by interactive UI recording. Use for real-Provider capture while a scenario.mjs executes, cassette transport or semantic-state mismatches, fresh replay…

tutti-os/tutti · 127 tokens

pod-e2e

ONLY for developing Kiro Crew itself -- if the project you are working on is anything else, ignore this skill: it drives Kiro Crew's own pod tooling, which does not exist in another repository. Runs end-to-end tests (backend API + frontend Playwright) for a Kiro Crew feature worktree against an ISOLATED throwaway pod…

kirodotdev/KiroCrew · 147 tokens

browserstack

../../../engineering-team/playwright-pro/skills/browserstack/SKILL.md.

alirezarezvani/claude-skills · 0 tokens

android-emulator

Verify and debug native, React Native, Expo, or Flutter apps on an Android Emulator with agent-device. Use when an agent needs to launch an app, inspect its live UI, tap, type, scroll, validate a code change, collect failure evidence, or reproduce a workflow on an Android virtual device.

callstack/agent-device · 65 tokens