/configure:api-tests Check and configure API contract testing infrastructure for validating API contracts, schemas, and consumer-provider agreements. When to Use This Skill | Use this skill when... | Use another approach when... | |------------------------|------------------------------| | Setting up API contract testing (Pact, OpenAPI, schema) | Running existing API tests (use or test runner directly) | | Validating OpenAPI specification compliance | Editing OpenAPI spec content (use editor directly) | | Adding breaking change detection to CI | General CI workflow setup (use ) | | Checking A…

, '[email protected]'),\n }\n\n (pact_setup\n .given('a user with ID 1 exists')\n .upon_receiving('a request to get user 1')\n .with_request('GET', '/api/users/1')\n .will_respond_with(200, body=expected))\n\n with pact_setup:\n result = requests.get(f'{pact_setup.uri}/api/users/1')\n\n assert result.status_code == 200\n assert 'id' in result.json()\n assert 'name' in result.json()\n\ndef test_get_nonexistent_user(pact_setup):\n \"\"\"Test 404 response for non-existent user.\"\"\"\n (pact_setup\n .given('no user with ID 999 exists')\n .upon_receiving('a request to get non-existent user')\n .with_request('GET', '/api/users/999')\n .will_respond_with(404, body={\n 'error': Like('User not found'),\n 'code': Like('USER_NOT_FOUND'),\n }))\n\n with pact_setup:\n result = requests.get(f'{pact_setup.uri}/api/users/999')\n\n assert result.status_code == 404\n```\n\n## OpenAPI Validation (JavaScript/TypeScript)\n\n### Install Dependencies\n\n```bash\nbun add --dev @apidevtools/swagger-parser ajv ajv-formats\nbun add --dev openapi-typescript # For TypeScript types from OpenAPI\n```\n\n### OpenAPI Validator Helper\n\nCreate `tests/api/openapi-validator.ts`:\n\n```typescript\nimport Ajv from 'ajv';\nimport addFormats from 'ajv-formats';\nimport SwaggerParser from '@apidevtools/swagger-parser';\nimport { OpenAPIV3 } from 'openapi-types';\n\nexport class OpenAPIValidator {\n private ajv: Ajv;\n private spec: OpenAPIV3.Document | null = null;\n private schemas: Map\u003cstring, object> = new Map();\n\n constructor() {\n this.ajv = new Ajv({ allErrors: true, strict: false });\n addFormats(this.ajv);\n }\n\n async loadSpec(specPath: string): Promise\u003cvoid> {\n this.spec = await SwaggerParser.validate(specPath) as OpenAPIV3.Document;\n\n // Register all schemas from components\n if (this.spec.components?.schemas) {\n for (const [name, schema] of Object.entries(this.spec.components.schemas)) {\n this.schemas.set(name, schema);\n this.ajv.addSchema(schema, `#/components/schemas/${name}`);\n }\n }\n }\n\n validateResponse(\n path: string,\n method: string,\n statusCode: number,\n body: unknown\n ): { valid: boolean; errors: string[] } {\n if (!this.spec) {\n throw new Error('OpenAPI spec not loaded. Call loadSpec() first.');\n }\n\n const pathItem = this.spec.paths?.[path];\n if (!pathItem) {\n return { valid: false, errors: [`Path ${path} not found in spec`] };\n }\n\n const operation = pathItem[method.toLowerCase() as keyof OpenAPIV3.PathItemObject] as OpenAPIV3.OperationObject;\n if (!operation) {\n return { valid: false, errors: [`Method ${method} not found for path ${path}`] };\n }\n\n const response = operation.responses?.[statusCode] || operation.responses?.['default'];\n if (!response) {\n return { valid: false, errors: [`Status ${statusCode} not defined for ${method} ${path}`] };\n }\n\n const responseObj = response as OpenAPIV3.ResponseObject;\n const content = responseObj.content?.['application/json'];\n if (!content?.schema) {\n // No schema defined, consider valid\n return { valid: true, errors: [] };\n }\n\n const validate = this.ajv.compile(content.schema);\n const valid = validate(body);\n\n return {\n valid: !!valid,\n errors: validate.errors?.map(e => `${e.instancePath} ${e.message}`) || [],\n };\n }\n\n validateRequest(\n path: string,\n method: string,\n body: unknown\n ): { valid: boolean; errors: string[] } {\n if (!this.spec) {\n throw new Error('OpenAPI spec not loaded. Call loadSpec() first.');\n }\n\n const pathItem = this.spec.paths?.[path];\n if (!pathItem) {\n return { valid: false, errors: [`Path ${path} not found in spec`] };\n }\n\n const operation = pathItem[method.toLowerCase() as keyof OpenAPIV3.PathItemObject] as OpenAPIV3.OperationObject;\n if (!operation?.requestBody) {\n return { valid: true, errors: [] };\n }\n\n const requestBody = operation.requestBody as OpenAPIV3.RequestBodyObject;\n const content = requestBody.content?.['application/json'];\n if (!content?.schema) {\n return { valid: true, errors: [] };\n }\n\n const validate = this.ajv.compile(content.schema);\n const valid = validate(body);\n\n return {\n valid: !!valid,\n errors: validate.errors?.map(e => `${e.instancePath} ${e.message}`) || [],\n };\n }\n}\n\n// Helper for tests\nexport async function createValidator(specPath: string = './openapi.yaml'): Promise\u003cOpenAPIValidator> {\n const validator = new OpenAPIValidator();\n await validator.loadSpec(specPath);\n return validator;\n}\n```\n\n### OpenAPI Compliance Test Template\n\nCreate `tests/api/users.openapi.test.ts`:\n\n```typescript\nimport { describe, it, expect, beforeAll } from 'vitest';\nimport request from 'supertest';\nimport { app } from '../../src/app';\nimport { createValidator, OpenAPIValidator } from './openapi-validator';\n\ndescribe('Users API - OpenAPI Compliance', () => {\n let validator: OpenAPIValidator;\n\n beforeAll(async () => {\n validator = await createValidator('./openapi.yaml');\n });\n\n describe('GET /api/users', () => {\n it('response matches OpenAPI schema', async () => {\n const response = await request(app)\n .get('/api/users')\n .expect(200);\n\n const result = validator.validateResponse('/api/users', 'GET', 200, response.body);\n\n expect(result.valid).toBe(true);\n if (!result.valid) {\n console.error('Validation errors:', result.errors);\n }\n });\n });\n\n describe('POST /api/users', () => {\n it('request matches OpenAPI schema', async () => {\n const requestBody = {\n name: 'Test User',\n email: '[email protected]',\n };\n\n const requestValidation = validator.validateRequest('/api/users', 'POST', requestBody);\n expect(requestValidation.valid).toBe(true);\n\n const response = await request(app)\n .post('/api/users')\n .send(requestBody)\n .expect(201);\n\n const responseValidation = validator.validateResponse('/api/users', 'POST', 201, response.body);\n expect(responseValidation.valid).toBe(true);\n });\n\n it('rejects invalid request body', async () => {\n const invalidBody = {\n name: 123, // Should be string\n // Missing required email\n };\n\n const validation = validator.validateRequest('/api/users', 'POST', invalidBody);\n expect(validation.valid).toBe(false);\n expect(validation.errors.length).toBeGreaterThan(0);\n });\n });\n\n describe('GET /api/users/:id', () => {\n it('404 response matches OpenAPI schema', async () => {\n const response = await request(app)\n .get('/api/users/99999')\n .expect(404);\n\n const result = validator.validateResponse('/api/users/{id}', 'GET', 404, response.body);\n expect(result.valid).toBe(true);\n });\n });\n});\n```\n\n## OpenAPI Breaking Change Detection\n\n### Install oasdiff\n\n```bash\n# Via npm/bun\nbun add --dev @oasdiff/oasdiff\n\n# Or via homebrew\nbrew install oasdiff\n```\n\n### CI Breaking Change Check\n\n```yaml\n- name: Check for breaking API changes\n run: |\n # Fetch main branch spec\n git fetch origin main\n git show origin/main:openapi.yaml > openapi-main.yaml\n\n # Check for breaking changes\n oasdiff breaking openapi-main.yaml openapi.yaml --fail-on ERR\n\n # Generate changelog\n oasdiff changelog openapi-main.yaml openapi.yaml\n```\n\n## Schema Testing with Zod\n\n### Install Dependencies\n\n```bash\nbun add zod\nbun add --dev @anatine/zod-openapi # Optional: generate OpenAPI from Zod\n```\n\n### Schema Definitions Template\n\nCreate `src/schemas/user.ts`:\n\n```typescript\nimport { z } from 'zod';\n\nexport const UserSchema = z.object({\n id: z.number().int().positive(),\n name: z.string().min(1).max(100),\n email: z.string().email(),\n createdAt: z.string().datetime(),\n updatedAt: z.string().datetime().optional(),\n});\n\nexport const CreateUserSchema = UserSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n});\n\nexport const UpdateUserSchema = CreateUserSchema.partial();\n\nexport const UserListSchema = z.array(UserSchema);\n\nexport type User = z.infer\u003ctypeof UserSchema>;\nexport type CreateUser = z.infer\u003ctypeof CreateUserSchema>;\nexport type UpdateUser = z.infer\u003ctypeof UpdateUserSchema>;\n```\n\n### Schema Validation Test Template\n\nCreate `tests/api/schema.test.ts`:\n\n```typescript\nimport { describe, it, expect } from 'vitest';\nimport request from 'supertest';\nimport { app } from '../../src/app';\nimport { UserSchema, UserListSchema } from '../../src/schemas/user';\n\ndescribe('API Schema Validation', () => {\n describe('GET /api/users', () => {\n it('response matches User list schema', async () => {\n const response = await request(app)\n .get('/api/users')\n .expect(200);\n\n const result = UserListSchema.safeParse(response.body);\n\n expect(result.success).toBe(true);\n if (!result.success) {\n console.error('Schema errors:', result.error.format());\n }\n });\n });\n\n describe('GET /api/users/:id', () => {\n it('response matches User schema', async () => {\n // Assuming user 1 exists\n const response = await request(app)\n .get('/api/users/1')\n .expect(200);\n\n const result = UserSchema.safeParse(response.body);\n\n expect(result.success).toBe(true);\n });\n });\n});\n```\n\n## CI/CD Workflow Template\n\nCreate `.github/workflows/api-tests.yml`:\n\n```yaml\nname: API Contract Tests\n\non:\n push:\n branches: [main]\n pull_request:\n paths:\n - 'openapi.yaml'\n - 'src/api/**'\n - 'tests/contract/**'\n\njobs:\n consumer-tests:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n\n - uses: oven-sh/setup-bun@v2\n\n - name: Install dependencies\n run: bun install --frozen-lockfile\n\n - name: Run consumer contract tests\n run: bun run test:contract:consumer\n\n - name: Upload pacts\n uses: actions/upload-artifact@v4\n with:\n name: pacts\n path: pacts/\n\n provider-tests:\n runs-on: ubuntu-latest\n needs: consumer-tests\n services:\n postgres:\n image: postgres:16-alpine\n env:\n POSTGRES_USER: test\n POSTGRES_PASSWORD: test\n POSTGRES_DB: test_db\n ports:\n - 5432:5432\n\n steps:\n - uses: actions/checkout@v4\n\n - uses: oven-sh/setup-bun@v2\n\n - name: Install dependencies\n run: bun install --frozen-lockfile\n\n - name: Download pacts\n uses: actions/download-artifact@v4\n with:\n name: pacts\n path: pacts/\n\n - name: Run provider verification\n run: bun run test:contract:provider\n env:\n DATABASE_URL: postgresql://test:test@localhost:5432/test_db\n\n openapi-validation:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n\n - name: Validate OpenAPI spec\n run: |\n bunx @apidevtools/swagger-cli validate openapi.yaml\n\n - name: Check for breaking changes\n if: github.event_name == 'pull_request'\n run: |\n git fetch origin main\n git show origin/main:openapi.yaml > openapi-main.yaml || echo \"No existing spec\"\n\n if [ -f openapi-main.yaml ]; then\n bunx oasdiff breaking openapi-main.yaml openapi.yaml --fail-on ERR\n fi\n\n # Optional: Publish to Pact Broker\n publish-pacts:\n runs-on: ubuntu-latest\n needs: [consumer-tests, provider-tests]\n if: github.ref == 'refs/heads/main'\n steps:\n - uses: actions/checkout@v4\n\n - name: Download pacts\n uses: actions/download-artifact@v4\n with:\n name: pacts\n path: pacts/\n\n - name: Publish to Pact Broker\n run: |\n curl -X PUT \\\n -H \"Content-Type: application/json\" \\\n -d @pacts/frontend-app-user-service.json \\\n \"${{ secrets.PACT_BROKER_URL }}/pacts/provider/user-service/consumer/frontend-app/version/${{ github.sha }}\"\n env:\n PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }}\n```\n\n## Package.json Scripts\n\nAdd these scripts to `package.json`:\n\n```json\n{\n \"scripts\": {\n \"test:contract\": \"bun run test:contract:consumer && bun run test:contract:provider\",\n \"test:contract:consumer\": \"vitest run tests/contract/consumer/\",\n \"test:contract:provider\": \"vitest run tests/contract/provider/\",\n \"test:openapi\": \"vitest run tests/api/*.openapi.test.ts\",\n \"test:schema\": \"vitest run tests/api/schema.test.ts\",\n \"openapi:validate\": \"bunx @apidevtools/swagger-cli validate openapi.yaml\",\n \"openapi:bundle\": \"bunx @apidevtools/swagger-cli bundle openapi.yaml -o dist/openapi.json\",\n \"openapi:types\": \"bunx openapi-typescript openapi.yaml -o src/types/api.d.ts\"\n }\n}\n```\n\n## Final Report Template\n\n```\nAPI Testing Configuration Complete\n===================================\n\nContract Testing: Pact\nSchema Validation: Zod\nOpenAPI: 3.1\n\nConfiguration Applied:\n - @pact-foundation/pact installed\n - Consumer contract tests created\n - Provider verification configured\n - OpenAPI validator created\n - Zod schemas configured\n\nTest Structure:\n - tests/contract/consumer/ - Consumer tests\n - tests/contract/provider/ - Provider verification\n - tests/api/*.openapi.test.ts - OpenAPI validation\n - pacts/ - Generated contracts\n\nScripts Added:\n - bun run test:contract (all contract tests)\n - bun run test:contract:consumer (consumer only)\n - bun run test:contract:provider (provider only)\n - bun run test:openapi (OpenAPI validation)\n - bun run openapi:validate (spec validation)\n\nCI/CD:\n - Consumer tests job\n - Provider verification job\n - OpenAPI breaking change detection\n - Pact artifact upload\n\nNext Steps:\n 1. Run consumer tests:\n bun run test:contract:consumer\n\n 2. Verify provider:\n bun run test:contract:provider\n\n 3. Validate OpenAPI spec:\n bun run openapi:validate\n\n 4. Check API compliance:\n bun run test:openapi\n\nDocumentation:\n - Pact: https://docs.pact.io\n - OpenAPI: https://swagger.io/specification\n - Zod: https://zod.dev\n```\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":20502,"content_sha256":"92742a2515514ab10e50d1b7d391947c85e07ad5c226c568d3d755ffc4d8f7e2"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"/configure:api-tests","type":"text"}]},{"type":"paragraph","content":[{"text":"Check and configure API contract testing infrastructure for validating API contracts, schemas, and consumer-provider agreements.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"When to Use This Skill","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Use this skill when...","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Use another approach when...","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Setting up API contract testing (Pact, OpenAPI, schema)","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Running existing API tests (use ","type":"text"},{"text":"bun test","type":"text","marks":[{"type":"code_inline"}]},{"text":" or test runner directly)","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Validating OpenAPI specification compliance","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Editing OpenAPI spec content (use editor directly)","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Adding breaking change detection to CI","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"General CI workflow setup (use ","type":"text"},{"text":"/configure:workflows","type":"text","marks":[{"type":"code_inline"}]},{"text":")","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Checking API testing infrastructure status","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Unit or integration test setup (use ","type":"text"},{"text":"/configure:tests","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"/configure:integration-tests","type":"text","marks":[{"type":"code_inline"}]},{"text":")","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Configuring Pact consumer/provider workflows","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Debugging specific API endpoint failures (use test runner with verbose output)","type":"text"}]}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Context","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Lock files: !","type":"text"},{"text":"find . -maxdepth 1 \\( -name 'bun.lockb' -o -name 'bun.lock' -o -name 'package-lock.json' -o -name 'yarn.lock' \\)","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Project files: !","type":"text"},{"text":"find . -maxdepth 1 \\( -name 'tsconfig.json' -o -name 'pyproject.toml' -o -name 'package.json' \\)","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Pact installed: !","type":"text"},{"text":"find . -maxdepth 1 \\( -name package.json -o -name 'requirements*.txt' -o -name pyproject.toml \\) -exec grep -l \"pact-foundation/pact\\|pact-python\" {} +","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"OpenAPI spec: !","type":"text"},{"text":"find . -maxdepth 2 \\( -name 'openapi.yaml' -o -name 'openapi.yml' -o -name 'openapi.json' -o -name 'swagger.json' -o -name 'swagger.yaml' \\)","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Schema validator: !","type":"text"},{"text":"grep -l '\"ajv\"\\|\"zod\"' package.json","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"OpenAPI validation lib: !","type":"text"},{"text":"grep -l \"swagger-parser\\|@apidevtools\" package.json","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Pact contracts dir: !","type":"text"},{"text":"find . -maxdepth 1 -type d -name \\'pacts\\'","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Contract tests: !","type":"text"},{"text":"find . -maxdepth 3 -type d -name 'contract'","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"API test files: !","type":"text"},{"text":"find . -maxdepth 4 \\( -name '*.pact.*' -o -name '*.openapi.*' -o -name '*.contract.*' \\)","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"CI workflows: !","type":"text"},{"text":"find .github/workflows -maxdepth 1 \\( -name '*api*' -o -name '*contract*' -o -name '*pact*' \\)","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Parameters","type":"text"}]},{"type":"paragraph","content":[{"text":"Parse ","type":"text"},{"text":"$ARGUMENTS","type":"text","marks":[{"type":"code_inline"}]},{"text":" for these flags:","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Flag","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Description","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Default","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"--check-only","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Report status without making changes","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Off","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"--fix","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Apply all fixes automatically without prompting","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Off","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"--type \u003ctype>","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Focus on specific type: ","type":"text"},{"text":"pact","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"openapi","type":"text","marks":[{"type":"code_inline"}]},{"text":", or ","type":"text"},{"text":"schema","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"All types","type":"text"}]}]}]}]},{"type":"paragraph","content":[{"text":"API Testing Types:","type":"text","marks":[{"type":"strong"}]}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Type","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Use Case","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Pact","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Microservices, multiple consumers, breaking change detection","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"OpenAPI","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"API-first development, documentation-driven testing","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Schema","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Simple validation, GraphQL APIs, single service","type":"text"}]}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Execution","type":"text"}]},{"type":"paragraph","content":[{"text":"Execute this API testing compliance check:","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 1: Detect project infrastructure","type":"text"}]},{"type":"paragraph","content":[{"text":"Scan the project for existing API testing indicators:","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Indicator","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Component","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Check","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"pact","type":"text","marks":[{"type":"code_inline"}]},{"text":" in dependencies","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Pact contract testing","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"package.json","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"pyproject.toml","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"openapi.yaml","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"swagger.json","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"OpenAPI specification","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Root or ","type":"text"},{"text":"docs/","type":"text","marks":[{"type":"code_inline"}]},{"text":" directory","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"@apidevtools/swagger-parser","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"OpenAPI validation","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"package.json","type":"text","marks":[{"type":"code_inline"}]},{"text":" devDependencies","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"ajv","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"zod","type":"text","marks":[{"type":"code_inline"}]},{"text":" in dependencies","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Schema validation","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"package.json","type":"text","marks":[{"type":"code_inline"}]},{"text":" dependencies","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"pacts/","type":"text","marks":[{"type":"code_inline"}]},{"text":" directory","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Pact contracts","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Project root","type":"text"}]}]}]}]},{"type":"paragraph","content":[{"text":"If ","type":"text"},{"text":"--type","type":"text","marks":[{"type":"code_inline"}]},{"text":" is specified, only check the relevant component.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 2: Analyze current state","type":"text"}]},{"type":"paragraph","content":[{"text":"Check completeness of each API testing component:","type":"text"}]},{"type":"paragraph","content":[{"text":"Contract Testing (Pact):","type":"text","marks":[{"type":"strong"}]}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Check if ","type":"text"},{"text":"@pact-foundation/pact","type":"text","marks":[{"type":"code_inline"}]},{"text":" (JS/TS) or ","type":"text"},{"text":"pact-python","type":"text","marks":[{"type":"code_inline"}]},{"text":" (Python) is installed","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Look for consumer tests in ","type":"text"},{"text":"tests/contract/consumer/","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Look for provider verification in ","type":"text"},{"text":"tests/contract/provider/","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Check for Pact Broker configuration in CI files","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Check for ","type":"text"},{"text":"can-i-deploy","type":"text","marks":[{"type":"code_inline"}]},{"text":" CI gate","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"OpenAPI Validation:","type":"text","marks":[{"type":"strong"}]}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Verify OpenAPI specification file exists and is valid","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Check for request validation middleware","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Check for response validation in tests","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Look for breaking change detection (oasdiff)","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Schema Testing:","type":"text","marks":[{"type":"strong"}]}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Check for JSON Schema or Zod definitions","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Verify validator is installed (","type":"text"},{"text":"ajv","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"zod","type":"text","marks":[{"type":"code_inline"}]},{"text":")","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Look for response validation test helpers","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 3: Generate compliance report","type":"text"}]},{"type":"paragraph","content":[{"text":"Print a formatted compliance report:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"API Testing Compliance Report\n==============================\nProject: [name]\nAPI Type: [REST | GraphQL | gRPC]\n\nContract Testing (Pact):\n Package: [INSTALLED | MISSING]\n Consumer tests: [FOUND | NONE]\n Provider tests: [FOUND | NONE]\n Pact Broker: [CONFIGURED | OPTIONAL]\n\nOpenAPI Validation:\n OpenAPI spec: [EXISTS | MISSING]\n Spec version: [CURRENT | OUTDATED]\n Request validation: [CONFIGURED | MISSING]\n Response validation: [CONFIGURED | MISSING]\n Breaking change CI: [CONFIGURED | OPTIONAL]\n\nSchema Testing:\n JSON Schemas: [EXISTS | N/A]\n Schema validator: [INSTALLED | MISSING]\n Response validation: [CONFIGURED | MISSING]\n\nOverall: [X issues found]\nRecommendations: [list specific actions]","type":"text"}]},{"type":"paragraph","content":[{"text":"If ","type":"text"},{"text":"--check-only","type":"text","marks":[{"type":"code_inline"}]},{"text":" is set, stop here.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 4: Apply configuration","type":"text"}]},{"type":"paragraph","content":[{"text":"If ","type":"text"},{"text":"--fix","type":"text","marks":[{"type":"code_inline"}]},{"text":" is set or user confirms, apply fixes for missing components. Use the project language detected in Context to select TypeScript or Python templates.","type":"text"}]},{"type":"paragraph","content":[{"text":"For each missing component, create the appropriate files using templates from ","type":"text"},{"text":"REFERENCE.md","type":"text","marks":[{"type":"link","attrs":{"href":"REFERENCE.md","title":null}}]},{"text":":","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Pact Contract Testing","type":"text","marks":[{"type":"strong"}]},{"text":": Install dependencies, create consumer test template, create provider verification template","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"OpenAPI Validation","type":"text","marks":[{"type":"strong"}]},{"text":": Install validation libraries, create OpenAPI validator helper, create compliance tests","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Schema Testing (Zod)","type":"text","marks":[{"type":"strong"}]},{"text":": Install Zod, create schema definitions, create schema validation tests","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"OpenAPI Breaking Change Detection","type":"text","marks":[{"type":"strong"}]},{"text":": Install oasdiff, add CI step","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 5: Configure CI/CD integration","type":"text"}]},{"type":"paragraph","content":[{"text":"Create or update ","type":"text"},{"text":".github/workflows/api-tests.yml","type":"text","marks":[{"type":"code_inline"}]},{"text":" with jobs for:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Consumer contract tests","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Provider verification (with database service if needed)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"OpenAPI spec validation and breaking change detection","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Pact artifact publishing (main branch only)","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Add test scripts to ","type":"text"},{"text":"package.json","type":"text","marks":[{"type":"code_inline"}]},{"text":". Use CI workflow template from ","type":"text"},{"text":"REFERENCE.md","type":"text","marks":[{"type":"link","attrs":{"href":"REFERENCE.md","title":null}}]},{"text":".","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 6: Update standards tracking","type":"text"}]},{"type":"paragraph","content":[{"text":"Update ","type":"text"},{"text":".project-standards.yaml","type":"text","marks":[{"type":"code_inline"}]},{"text":" with API testing configuration:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"yaml"},"content":[{"text":"components:\n api_tests: \"2025.1\"\n api_tests_contract: \"[pact|none]\"\n api_tests_openapi: true\n api_tests_schema: \"[zod|ajv|none]\"\n api_tests_breaking_change_ci: true","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 7: Generate final report","type":"text"}]},{"type":"paragraph","content":[{"text":"Print a summary of all changes applied including:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Configuration files created","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Dependencies installed","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Test commands available (with exact ","type":"text"},{"text":"bun run","type":"text","marks":[{"type":"code_inline"}]},{"text":" / ","type":"text"},{"text":"npm run","type":"text","marks":[{"type":"code_inline"}]},{"text":" commands)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"CI/CD jobs configured","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Recommended next steps for verification","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Agentic Optimizations","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Context","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Command","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Quick status check","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"/configure:api-tests --check-only","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Auto-fix all issues","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"/configure:api-tests --fix","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Pact-only setup","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"/configure:api-tests --fix --type pact","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"OpenAPI-only setup","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"/configure:api-tests --fix --type openapi","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Check for OpenAPI spec","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"find . -maxdepth 2 \\( -name 'openapi.yaml' -o -name 'swagger.json' \\) 2>/dev/null","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Check Pact installed","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"grep -l \"pact-foundation\" package.json 2>/dev/null","type":"text","marks":[{"type":"code_inline"}]}]}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Examples","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Check compliance and offer fixes\n/configure:api-tests\n\n# Check only, no modifications\n/configure:api-tests --check-only\n\n# Auto-fix all issues\n/configure:api-tests --fix\n\n# Configure Pact only\n/configure:api-tests --fix --type pact\n\n# Configure OpenAPI validation only\n/configure:api-tests --fix --type openapi","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Error Handling","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Error","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Resolution","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"No OpenAPI spec found","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Offer to create template","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Pact version mismatch","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Suggest upgrade path","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Schema validation fails","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Report specific errors","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Pact Broker not configured","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Provide setup instructions","type":"text"}]}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"See Also","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"/configure:tests","type":"text","marks":[{"type":"code_inline"}]},{"text":" - Unit testing configuration","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"/configure:integration-tests","type":"text","marks":[{"type":"code_inline"}]},{"text":" - Integration testing","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"/configure:all","type":"text","marks":[{"type":"code_inline"}]},{"text":" - Run all compliance checks","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Pact documentation","type":"text","marks":[{"type":"link","attrs":{"href":"https://docs.pact.io","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"OpenAPI specification","type":"text","marks":[{"type":"link","attrs":{"href":"https://swagger.io/specification","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Zod documentation","type":"text","marks":[{"type":"link","attrs":{"href":"https://zod.dev","title":null}}]}]}]}]},{"type":"hr","attrs":{"markup":"---"}}]},"metadata":{"args":"[--check-only] [--fix] [--type \u003cpact|openapi|schema>]","date":"2026-06-05","name":"api-tests","author":"@skillopedia","source":{"stars":35,"repo_name":"claude-plugins","origin_url":"https://github.com/laurigates/claude-plugins/blob/HEAD/api-plugin/skills/api-tests/SKILL.md","repo_owner":"laurigates","body_sha256":"5a17e47beb1ecf3505bb62f41333409451761ac59973b57a9f865cd331a51bef","cluster_key":"e56747e9a4aef13b536671c55605268cd6b1a5b3b69a3bd4a0e99856513a3c2e","clean_bundle":{"format":"clean-skill-bundle-v1","source":"laurigates/claude-plugins/api-plugin/skills/api-tests/SKILL.md","attachments":[{"id":"175e9dd0-37b3-5fee-975d-39ea0fa1f892","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/175e9dd0-37b3-5fee-975d-39ea0fa1f892/attachment.md","path":"REFERENCE.md","size":20502,"sha256":"92742a2515514ab10e50d1b7d391947c85e07ad5c226c568d3d755ffc4d8f7e2","contentType":"text/markdown; charset=utf-8"}],"bundle_sha256":"cd8dac55ac2ff54a390722adadeab585538583fe7953f120bea2871436cfb314","attachment_count":1,"text_attachments":1,"attachment_storage":"skillopedia-attachments-v1","binary_attachments":0,"excluded_attachments":[]},"cluster_size":1,"skill_md_path":"api-plugin/skills/api-tests/SKILL.md","import_metadata":{"date":"2026-06-05","author":"@skillopedia","version":"v1","category":"testing-qa","category_label":"Testing"},"exact_dupes_collapsed_into_this":0},"created":"2025-12-16T00:00:00.000Z","version":"v1","category":"testing-qa","modified":"2026-05-09T00:00:00.000Z","reviewed":"2025-12-16T00:00:00.000Z","import_tag":"clean-skills-v1","description":"API contract testing with Pact, OpenAPI validation, and Zod/AJV schemas. Use when setting up contract tests, validating OpenAPI compliance, or adding breaking-change CI checks.","allowed-tools":"Glob, Grep, Read, Write, Edit, Bash(curl *), Bash(http *), Bash(jq *), AskUserQuestion, TodoWrite","argument-hint":"[--check-only] [--fix] [--type \u003cpact|openapi|schema>]"}},"renderedAt":1782979392643}

/configure:api-tests Check and configure API contract testing infrastructure for validating API contracts, schemas, and consumer-provider agreements. When to Use This Skill | Use this skill when... | Use another approach when... | |------------------------|------------------------------| | Setting up API contract testing (Pact, OpenAPI, schema) | Running existing API tests (use or test runner directly) | | Validating OpenAPI specification compliance | Editing OpenAPI spec content (use editor directly) | | Adding breaking change detection to CI | General CI workflow setup (use ) | | Checking A…