integration-testing — Claude Code skill: what it does, how to install
Helps design and implement integration tests for APIs, databases, message queues, and external services. Useful for validating end-to-end interactions between system components.
npx skills add aj-geddes/useful-ai-prompts --skill integration-testing -a claude-codeWhat integration-testing does
This skill guides the design and implementation of integration tests for backend services. Unit tests isolate single functions. This skill focuses on interactions between multiple components, including HTTP endpoints and databases. The repository organizes specific patterns across four guides in the references/ folder.
The instructions enforce testing against real database instances instead of mocked connections. You must prepare containerized or in-memory databases before running these test suites. The skill also requires testing error branches and clearing test data between runs so that tests never share state.
What it helps with
- Write integration tests for API endpoints with real database connections
- Configure database cleanup and transaction boundaries between test runs
- Validate message queue consumers and producers
- Verify authentication flows and error response handling
Example prompts for the agent
- Write an integration test for the
POST /api/usersendpoint usingsupertestand a test database - Help me set up database cleanup and transaction rollback routines using
database-integration-testing.md - Draft an integration test suite for our message queue consumer and producer
How to install integration-testing
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill integration-testing -a claude-code2Manually: put the files in place
~/.claude/skills/integration-testing/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/integration-testing/
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill integration-testing -a codex2Manually: put the files in place
.agents/skills/integration-testing/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill integration-testing -a cursor2Manually: put the files in place
.cursor/skills/integration-testing/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install aj-geddes/useful-ai-prompts integration-testing2Manually: put the files in place
.github/skills/integration-testing/SKILL.md1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill integration-testing -a gemini-cli2Platform CLI
gemini skills install https://github.com/aj-geddes/useful-ai-prompts --path skills/integration-testingManually: put the files in place
.devin/skills/integration-testing/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill integration-testing -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about integration-testing
How do I install the integration-testing skill in Claude Code?
Run npx skills add aj-geddes/useful-ai-prompts --skill integration-testing -a claude-code in your terminal. You can also place the file directly at ~/.claude/skills/integration-testing/SKILL.md.
What does the integration-testing skill do?
It provides patterns and rules for testing API endpoints, database interactions, message queues, and third-party services. The skill enforces testing with real databases, validating error paths, and isolating test state.
Does the skill allow mocking database connections?
No, the skill explicitly forbids mocking database connections in integration tests. It mandates running real databases in containers or in-memory setups to test real queries and transaction handling.
Source text
SKILL.md · MIT
---
name: integration-testing
description: >
Design and implement integration tests that verify component interactions, API
endpoints, database operations, and external service communication. Use for
integration test, API test, end-to-end component testing, and service layer
validation.
---
# Integration Testing
## Table of Contents
- [Overview](#overview)
- [When to Use](#when-to-use)
- [Quick Start](#quick-start)
- [Reference Guides](#reference-guides)
- [Best Practices](#best-practices)
## Overview
Integration testing validates that different components, modules, or services work correctly together. Unlike unit tests that isolate single functions, integration tests verify the interactions between multiple parts of your system including databases, APIs, external services, and infrastructure.
## When to Use
- Testing API endpoints with real database connections
- Verifying service-to-service communication
- Validating data flow across multiple layers
- Testing repository/DAO layer with actual databases
- Checking authentication and authorization flows
- Verifying message queue consumers and producers
- Testing third-party service integrations
## Quick Start
Minimal working example:
```javascript
// test/api/users.integration.test.js
const request = require("supertest");
const app = require("../../src/app");
const { setupTestDB, teardownTestDB } = require("../helpers/db");
describe("User API Integration Tests", () => {
beforeAll(async () => {
await setupTestDB();
});
afterAll(async () => {
await teardownTestDB();
});
beforeEach(async () => {
await clearUsers();
});
describe("POST /api/users", () => {
it("should create a new user with valid data", async () => {
const userData = {
email: "[email protected]",
name: "Test User",
password: "SecurePass123!",
};
// ... (see reference guides for full implementation)
```
## Reference Guides
Detailed implementations in the `references/` directory:
| Guide | Contents |
|---|---|
| [API Integration Testing](references/api-integration-testing.md) | API Integration Testing |
| [Database Integration Testing](references/database-integration-testing.md) | Database Integration Testing |
| [External Service Integration](references/external-service-integration.md) | External Service Integration |
| [Message Queue Integration](references/message-queue-integration.md) | Message Queue Integration |
## Best Practices
### ✅ DO
- Use real databases in integration tests (in-memory or containers)
- Test actual HTTP requests, not mocked responses
- Verify database state after operations
- Test transaction boundaries and rollbacks
- Include authentication/authorization in tests
- Test error scenarios and edge cases
- Use test containers for isolated environments
- Clean up data between tests
### ❌ DON'T
- Mock database connections in integration tests
- Skip testing error paths
- Leave test data in databases
- Use production databases for testing
- Ignore transaction management
- Test only happy paths
- Share state between tests
- Hardcode URLs or credentials
© aj-geddes · MIT · aj-geddes/useful-ai-prompts