From aj-geddes-useful-ai-prompts-4
Verifies API contracts between services using Pact, OpenAPI, JSON Schema, and tools like REST Assured to prevent breaking changes in microservices and integrations.
npx claudepluginhub joshuarweaver/cascade-code-languages-misc-1 --plugin aj-geddes-useful-ai-prompts-4This skill uses the workspace's default tool permissions.
- [Overview](#overview)
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
Contract testing verifies that APIs honor their contracts between consumers and providers. It ensures that service changes don't break dependent consumers without requiring full integration tests. Contract tests validate request/response formats, data types, and API behavior independently.
Minimal working example:
// tests/pact/user-service.pact.test.ts
import { PactV3, MatchersV3 } from "@pact-foundation/pact";
import { UserService } from "../../src/services/UserService";
const { like, eachLike, iso8601DateTimeWithMillis } = MatchersV3;
const provider = new PactV3({
consumer: "OrderService",
provider: "UserService",
port: 1234,
dir: "./pacts",
});
describe("User Service Contract", () => {
const userService = new UserService("http://localhost:1234");
describe("GET /users/:id", () => {
test("returns user when found", async () => {
await provider
.given("user with ID 123 exists")
.uponReceiving("a request for user 123")
.withRequest({
method: "GET",
path: "/users/123",
headers: {
// ... (see reference guides for full implementation)
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| Pact for Consumer-Driven Contracts | Pact for Consumer-Driven Contracts |
| OpenAPI Schema Validation | OpenAPI Schema Validation |
| JSON Schema Validation | JSON Schema Validation |
| REST Assured for Java | REST Assured for Java |
| Contract Testing with Postman | Contract Testing with Postman |
| Pact Broker Integration | Pact Broker Integration |