API Contract Testing
OpenAPI to Portman to Newman pipeline with auth injection for API contract testing. Use when building API tests from OpenAPI specs, injecting authentication into test collections, running contract tests, or when user mentions OpenAPI, Portman, API contract, Swagger, API testing pipeline, auth injection.
What this skill does
# API Contract Testing
**CRITICAL: The description field above controls when Claude auto-loads this skill.**
## Overview
Provides a complete pipeline for API contract testing: OpenAPI spec -> Portman config -> Postman collection -> Newman execution with auth injection. Replaces the legacy `newman-testing` and `postman-collection-manager` skills with a unified, production-ready approach.
## Instructions
### 1. The Pipeline
```
OpenAPI Spec (openapi.yaml/json)
-> Portman (transforms to Postman collection with tests)
-> Auth Injection (adds authentication to requests)
-> Newman (executes tests with reporting)
```
### 2. Quick Start
**Generate collection from OpenAPI:**
```bash
bash scripts/openapi-to-collection.sh openapi.yaml api-tests.postman_collection.json
```
**Run tests with auth:**
```bash
bash scripts/run-api-contract-tests.sh api-tests.postman_collection.json --auth supabase
```
**Full pipeline:**
```bash
bash scripts/openapi-to-collection.sh openapi.yaml collection.json
bash scripts/inject-auth.sh collection.json supabase_cookie
bash scripts/run-api-contract-tests.sh collection.json
```
### 3. Auth Strategy Injection
The pipeline supports multiple auth strategies:
| Strategy | Auth Header | Token Source |
|----------|-------------|--------------|
| `supabase_cookie` | Cookie-based | Supabase auth session |
| `clerk_jwt` | Authorization: Bearer | Clerk JWT token |
| `auth0_token` | Authorization: Bearer | Auth0 access token |
| `bearer_token` | Authorization: Bearer | Generic JWT |
| `api_key` | X-API-Key | API key from env |
| `none` | No auth | Public endpoints |
**Auth injection reads credentials from environment variables (never hardcoded):**
```bash
# Supabase
SUPABASE_URL=your_supabase_url_here
SUPABASE_ANON_KEY=your_supabase_anon_key_here
# Clerk
CLERK_SECRET_KEY=your_clerk_secret_key_here
# Generic
API_KEY=your_api_key_here
AUTH_TOKEN=your_auth_token_here
```
### 4. Portman Configuration
Portman generates test assertions from OpenAPI specs:
- Status code validation
- Response schema validation
- Required field checks
- Content-type validation
See `templates/portman-config.json` for the default configuration.
### 5. Syncing Collections from Routes
For projects without OpenAPI specs, sync collections from route files:
```bash
bash scripts/sync-from-routes.sh src/app/api/ collection.json
```
This scans route files for HTTP handlers and creates a basic collection.
### 6. CI Integration
```bash
bash scripts/run-newman-ci.sh collection.json
```
CI-optimized runner with:
- JUnit XML output for CI reporting
- Non-zero exit code on failure
- Summary report to stdout
- Results artifact for upload
## Available Scripts
1. **openapi-to-collection.sh** - Convert OpenAPI spec to Postman collection via Portman
2. **run-api-contract-tests.sh** - Execute Newman with auth injection and reporting
3. **inject-auth.sh** - Inject authentication strategy into collection
4. **sync-from-routes.sh** - Sync collection from route file directory
5. **run-newman-ci.sh** - CI-optimized Newman runner with JUnit output
## Available Templates
1. **portman-config.json** - Default Portman configuration for test generation
2. **newman-environment.json** - Environment variable template for Newman
3. **collection-with-auth.json** - Example collection with auth pre-request scripts
4. **github-actions-api-tests.yml** - GitHub Actions workflow for API contract tests
## Available Examples
1. **openapi-pipeline.md** - Full OpenAPI to Newman pipeline walkthrough
2. **auth-injection-supabase.md** - Supabase cookie auth injection example
3. **auth-injection-clerk.md** - Clerk JWT auth injection example
4. **auth-injection-generic.md** - Generic bearer token and API key examples
## Requirements
- Node.js for Newman and Portman
- `npm install -g newman` for test execution
- `npm install -g @apideck/portman` for OpenAPI conversion (optional)
- `jq` for JSON manipulation
- Environment variables for auth credentials
## Progressive Disclosure
- Read `examples/openapi-pipeline.md` for the full pipeline
- Read `examples/auth-injection-supabase.md` for Supabase auth setup
- Read `templates/portman-config.json` for Portman configuration options
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.