Tests REST and GraphQL APIs with Postman, Newman, REST Assured, Pact, k6, and more. Covers contract testing, CI/CD automation, and performance testing.
Ships in claude-skills-collection. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
npx get-graphql-schema http://api/graphql > schema.graphql).| Contexte | Outil recommandé |
|---|---|
| Exploration rapide / équipe non-dev | Postman + Newman |
| Backend Java/Kotlin | REST Assured |
| Backend Node.js | SuperTest ou Axios + Jest |
| Backend Python | pytest + httpx |
| Contract testing microservices | Pact (consumer-driven) |
| Performance / charge | k6 ou Artillery |
| Fuzzing / sécurité | OWASP ZAP API Scan ou Schemathesis |
# Newman — run collection avec env staging
newman run collection.json \
-e staging.env.json \
--reporters cli,htmlextra,junit \
--reporter-junit-export results/junit.xml \
--bail
Variables d'environnement Postman — JAMAIS de valeur en dur :
{ "BASE_URL": "https://api.staging.example.com", "API_KEY": "{{$env.API_KEY}}" }
Matrice minimale par endpoint :
# pytest + httpx — exemple endpoint POST /users
import httpx, pytest
BASE = "https://api.staging.example.com"
def test_create_user_happy_path(auth_headers):
r = httpx.post(f"{BASE}/users", json={"email": "[email protected]", "role": "viewer"}, headers=auth_headers)
assert r.status_code == 201
body = r.json()
assert "id" in body and isinstance(body["id"], str)
assert body["email"] == "[email protected]"
def test_create_user_missing_email(auth_headers):
r = httpx.post(f"{BASE}/users", json={"role": "viewer"}, headers=auth_headers)
assert r.status_code == 422
assert "email" in r.json()["detail"][0]["loc"]
def test_create_user_unauthorized():
r = httpx.post(f"{BASE}/users", json={"email": "[email protected]", "role": "viewer"})
assert r.status_code == 401
# Validation JSON Schema avec jsonschema
from jsonschema import validate
USER_SCHEMA = {
"type": "object",
"required": ["id", "email", "createdAt"],
"properties": {
"id": {"type": "string", "format": "uuid"},
"email": {"type": "string", "format": "email"},
"createdAt": {"type": "string", "format": "date-time"},
},
"additionalProperties": False,
}
def test_user_schema(auth_headers):
r = httpx.get(f"{BASE}/users/some-uuid", headers=auth_headers)
validate(instance=r.json(), schema=USER_SCHEMA)
# Consumer side — Python pact-python
from pact import Consumer, Provider
pact = Consumer("frontend").has_pact_with(Provider("users-api"))
pact.given("user abc123 exists").upon_receiving("a request for user").with_request(
method="GET", path="/users/abc123"
).will_respond_with(200, body={"id": "abc123", "email": like("[email protected]")})
# Vérification côté Provider
pact-verifier \
--provider-base-url http://localhost:8080 \
--pact-broker-url https://pact-broker.internal \
--provider users-api \
--publish-verification-results \
--provider-app-version $(git rev-parse --short HEAD)
// k6 — SLO : P95 < 500ms, error rate < 1%
import http from 'k6/http';
import { check, sleep } from 'k6';
export const options = {
stages: [
{ duration: '30s', target: 50 },
{ duration: '1m', target: 50 },
{ duration: '15s', target: 0 },
],
thresholds: {
http_req_duration: ['p(95)<500'],
http_req_failed: ['rate<0.01'],
},
};
export default function () {
const r = http.get('https://api.staging.example.com/users', {
headers: { Authorization: `Bearer ${__ENV.TOKEN}` },
});
check(r, { 'status 200': (r) => r.status === 200 });
sleep(1);
}
k6 run --env TOKEN=$API_TOKEN perf/users.js
# GitHub Actions
- name: Run API tests
run: |
newman run tests/collection.json \
-e tests/env/${{ env.STAGE }}.json \
--reporters junit \
--reporter-junit-export results/junit.xml
env:
API_KEY: ${{ secrets.API_KEY }}
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: api-test-results
path: results/
| Anti-pattern | Risque | Correction |
|---|---|---|
| Token en dur dans le code | Fuite dans Git | Toujours os.environ["TOKEN"] ou vault |
| Test non idempotent (données non nettoyées) | Flaky en CI | setup crée, teardown supprime via API ou DB |
| Tester uniquement le status code | Régression silencieuse sur le body | Valider le schéma JSON et les valeurs métier |
| Pas de test 4xx/5xx | Faux sentiment de couverture | Matrice erreurs obligatoire par endpoint |
| Collection Postman hors Git | Dérive entre devs | Committer collection.json + env.*.json (sans secrets) |
| Pact consumer publié sans vérification provider | Contrat jamais vérifié | Bloquer le merge si can-i-deploy échoue |
| Test de perfs pointant sur prod | Incident en production | Toujours utiliser staging ou un environment dédié |
schemathesis run openapi.yaml --checks all --base-url https://api.staging.example.com.can-i-deploy (Pact Broker CLI) comme gate CI : bloque le déploiement si le contrat n'est pas vérifié..env.*.json Postman sans valeur sensible (placeholder {{SECRET}}), injecter les vraies valeurs via CI secrets.options.thresholds k6) pour que la CI régresse automatiquement si une régression de latence est introduite.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
348 skills in this plugin
/agent-a2a-protocol-guideGuide du protocole Agent-to-Agent (A2A) de Google pour l'interopérabilité entre agents IA — découverte, communication et collaboration inter-agents, avec exemples de code, critères de décision et pièges à éviter. Se déclenche avec "A2A", "agent-to-agent", "protocole A2A", "Google A2A", "interopérabilité agents". Also triggers on "agent-to-agent protocol", "agent interoperability", "connect two agents"./agent-agent-observabilityInstrumentation technique d'un agent IA — tracing distribué des appels LLM et outils, spans, métriques custom, corrélation de logs et dashboards de supervision. Pour les alertes et garde-fous de production, voir agent-monitoring-setup. Se déclenche avec "observabilité agent", "tracing agent", "LangSmith", "Langfuse", "OpenTelemetry agent", "spans LLM", "corréler les logs agent". Also triggers on "trace my agent", "LLM tracing", "agent spans"./agent-api-caller-subagentSous-agent spécialisé dans les appels API REST/GraphQL avec retry, auth et transformation de données. Se déclenche avec "sous-agent API", "API caller agent", "agent qui appelle une API", "REST agent", "HTTP agent", "API integration subagent", "external API agent". Also triggers on "subagent that calls an API", "API calling agent", "agent HTTP requests"./claude-skills-collection:testing-api-testing-expertfrom claude-skills-collection
npx claudepluginhub vantaflow/claude-skills-collection --plugin claude-skills-collectionOther plugins' skills for the same job