Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计通过

configure-api-testsconfigure API tests 搜索

Agent Skill

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。它适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿、检查字段命名、整理错误码或辅助前后端联调。使用时需要确认真实业务语义、鉴权方式、分页和错误处理规则;涉及生成接口文档时,应避免凭空补字段,最好从现有代码、schema 或接口样例中提取事实。

总安装

1,248

周安装

52

GitHub Stars

28

下载量

416
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:configure-api-tests(configure API tests 搜索)
来源仓库:https://github.com/laurigates/claude-plugins
仓库路径:skills/configure-api-tests
安装命令:
npx skills add https://github.com/laurigates/claude-plugins --skill configure-api-tests
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/laurigates/claude-plugins --skill configure-api-tests

简介

configure-api-tests 配置 API 契约测试基础设施,验证消费者提供者协议。

  • 适用于 Pact 合同测试和 OpenAPI 请求响应校验。
  • 支持 JSON Schema 和 Zod 模式验证,确保接口一致性。
  • 安装前请确认权限范围、维护状态及是否会执行测试命令。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

/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 Pact consumer/provider contract testsWriting individual unit tests (/configure:tests)
Configuring OpenAPI request/response validationValidating a single API endpoint manually
Adding JSON Schema or Zod schema testingChecking general test coverage (/configure:coverage)
Detecting breaking API changes in CIReviewing API design decisions (code-review agent)
Auditing API testing compliance across a projectConfiguring general CI/CD workflows (/configure:workflows)

Context

  • Project root:!pwd
  • Package files:!find. -maxdepth 1 \(-name 'package.json' -o -name 'pyproject.toml' \)
  • Pact deps:!find. -maxdepth 1 \(-name package.json -o -name pyproject.toml \) -exec grep -l 'pact' {} +
  • OpenAPI spec:!find. -maxdepth 1 \(-name 'openapi.yaml' -o -name 'openapi.json' -o -name 'swagger.json' \)
  • Pact dir:!find. -maxdepth 1 -type d -name 'pacts'
  • Contract tests:!find tests -maxdepth 2 -type d -name 'contract'
  • Project standards:!find. -maxdepth 1 -name '.project-standards.yaml'

Parameters

Parse from command arguments:

  • --check-only: Report compliance status without modifications (CI/CD mode)
  • --fix: Apply fixes automatically without prompting
  • --type <pact|openapi|schema>: Focus on specific type

API Testing Types:

TypeUse Case
PactMicroservices, multiple consumers, breaking change detection
OpenAPIAPI-first development, documentation-driven testing
SchemaSimple validation, GraphQL APIs, single service

Execution

Execute this API testing compliance check:

Step 1: Detect existing API testing infrastructure

Check for these indicators:

IndicatorComponentStatus
pact in dependenciesPact contract testingInstalled
openapi.yaml or swagger.jsonOpenAPI specificationPresent
@apidevtools/swagger-parserOpenAPI validationConfigured
ajv in dependenciesJSON Schema validationConfigured
pacts/ directoryPact contractsPresent

Step 2: Analyze current state

For each detected component, check completeness:

Contract Testing (Pact):

  • @pact-foundation/pact installed (JS) or pact-python (Python)
  • Consumer tests defined
  • Provider verification configured
  • Pact Broker or PactFlow configured (optional)
  • CI/CD pipeline integration

OpenAPI Validation:

  • OpenAPI specification file exists
  • Request validation middleware configured
  • Response validation in tests
  • Schema auto-generation configured
  • Breaking change detection

Schema Testing:

  • JSON Schema definitions exist
  • ajv or similar validator installed
  • Response validation helpers
  • Schema versioning strategy

Step 3: Generate compliance report

Print a formatted compliance report:

API Testing Compliance Report
==============================
Project: [name]
API Type: [REST | GraphQL | gRPC]

Contract Testing (Pact):
  @pact-foundation/pact    package.json               [INSTALLED | MISSING]
  Consumer tests           tests/contract/consumer/   [FOUND | NONE]
  Provider tests           tests/contract/provider/   [FOUND | NONE]
  Pact Broker              CI configuration           [CONFIGURED | OPTIONAL]
  can-i-deploy             CI gate                    [CONFIGURED | OPTIONAL]

OpenAPI Validation:
  OpenAPI spec             openapi.yaml               [EXISTS | MISSING]
  Spec version             OpenAPI 3.1                [CURRENT | OUTDATED]
  Request validation       middleware                 [CONFIGURED | MISSING]
  Response validation      test helpers               [CONFIGURED | MISSING]
  Breaking change CI       oasdiff                    [CONFIGURED | OPTIONAL]

Schema Testing:
  JSON Schemas             schemas/                   [EXISTS | N/A]
  Schema validator         ajv/zod                    [INSTALLED | MISSING]
  Response validation      test helpers               [CONFIGURED | MISSING]

Overall: [X issues found]

Recommendations:
  - Add Pact consumer tests for service dependencies
  - Configure OpenAPI response validation in tests
  - Add breaking change detection to CI

If --check-only, stop here.

Step 4: Configure API testing (if --fix or user confirms)

Apply fixes based on detected project type. Use templates from REFERENCE.md for:

  1. Pact Contract Testing - Install dependencies and create consumer/provider test files
  2. OpenAPI Validation - Install validator and create test helpers
  3. Schema Testing with Zod - Install Zod and create schema definitions
  4. Breaking Change Detection - Install oasdiff and add CI check

For JavaScript/TypeScript projects, install with bun add --dev. For Python, install with uv add --group dev.

Step 5: Configure CI/CD integration

Create .github/workflows/api-tests.yml with jobs for:

  • Consumer contract tests
  • Provider verification (with service containers if needed)
  • OpenAPI spec validation
  • Breaking change detection on PRs

Add npm/bun scripts to package.json for local testing. Use workflow templates from REFERENCE.md.

Step 6: Update standards tracking

Update .project-standards.yaml:

standards_version: "2025.1"
last_configured: "[timestamp]"
components:
  api_tests: "2025.1"
  api_tests_contract: "[pact|none]"
  api_tests_openapi: true
  api_tests_schema: "[zod|ajv|none]"
  api_tests_breaking_change_ci: true

Step 7: Print final report

Print a summary of all changes applied, scripts added, and next steps for the user to verify the configuration.

For detailed templates and code examples, see REFERENCE.md.

Agentic Optimizations

ContextCommand
Quick compliance check/configure:api-tests --check-only
Auto-fix all issues/configure:api-tests --fix
Pact contracts only/configure:api-tests --fix --type pact
OpenAPI validation only/configure:api-tests --fix --type openapi
Schema testing only/configure:api-tests --fix --type schema

Flags

FlagDescription
--check-onlyReport status without offering fixes
--fixApply all fixes automatically without prompting
--type <type>Focus on specific type (pact, openapi, schema)

Examples

# Check compliance and offer fixes
/configure:api-tests

# Check only, no modifications
/configure:api-tests --check-only

# Auto-fix all issues
/configure:api-tests --fix

# Configure Pact only
/configure:api-tests --fix --type pact

# Configure OpenAPI validation only
/configure:api-tests --fix --type openapi

Error Handling

  • No OpenAPI spec found: Offer to create template
  • Pact version mismatch: Suggest upgrade path
  • Schema validation fails: Report specific errors
  • Pact Broker not configured: Provide setup instructions

See Also

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

32.94%
按下载量换算137

Claude

31.36%
按下载量换算130

Cursor

17.05%
按下载量换算71

Gemini CLI

9.08%
按下载量换算38

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/laurigates/claude-plugins --skill configure-api-tests 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills