Contracts
Use when Codex needs to derive Rest Assured test scenarios from OpenAPI or Swagger contracts, including endpoints, methods, schemas, auth rules, status codes, and error conditions.From its SKILL.md
npx -y skills add jovd83/restassured-skill --skill contractsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
- runs commandsInstructs the agent to run 1 command, including `python scripts/extract_openapi_summary.py --input <path-or-url>`.
SKILL.md
3.6 KB, 629 tokens by cl100k_base, as published. Nobody here has run it
Analyze REST Contracts
1. Load The Contract
- Prefer OpenAPI or Swagger files already in the repo.
- Run
python scripts/extract_openapi_summary.py --input <path-or-url>to produce a normalized summary. - Read openapi-swagger-analysis.md when the contract contains advanced features.
2. Extract Testable Surface
- List paths, methods, tags, and operation IDs.
- List auth schemes and which operations require them.
- List path, query, header, and body parameters.
- List required vs optional request fields.
- List documented status codes, response schemas, and error payloads.
- Use the script output as the baseline summary, then read the raw contract only for unresolved details.
3. Choose The Assertion Mode
- Use
runtime-alignedmode when the suite exists to prove the live service behavior that consumers actually receive. - Use
contract-enforcementmode when the goal is strict specification conformance, drift detection, or contract hardening. - Use
mixedmode when both matter: keep runtime-aligned regression tests separate from contract-enforcement checks. - Record the chosen mode in the coverage plan so implementation and reporting stay consistent.
- Record the dominant OpenAPI tags and any explicit user priority for tags so coverage planning can order work intentionally.
4. Convert To Test Candidates
- Create happy-path candidates for every in-scope operation.
- Create validation candidates for required fields, formats, enums, and boundaries.
- Create authorization candidates from security requirements.
- Create negative candidates from documented
4xxand5xxresponses. - In
contract-enforcementormixedmode, add explicit drift-detection candidates for status, content type, auth, required fields, and schema shape. - Flag undocumented behavior instead of inventing expected results.
- Group candidates by tag before handing them to coverage planning when the contract is tag-rich or the user asked for domain-priority ordering.
5. Merge With Business Requirements
- Prefer business requirements when they are more specific than the contract.
- Flag conflicts instead of silently choosing one source.
- Hand the merged result to
../../coverage_plan/generation/SKILL.md.
5. Examples
- Input:
Derive tests from openapi/orders.yaml.Output: A normalized matrix of operations, validations, auth rules, and error responses ready for coverage planning.
6. Troubleshooting
- Problem: The contract is YAML and parsing fails.
Fix: Install
PyYAMLor convert the file to JSON, then rerun the script. - Problem: The contract omits business rules such as inventory side effects. Fix: Merge in user stories before finalizing the scenario list.
- Problem: The live runtime already diverges from the contract.
Fix: Choose
mixedmode unless the user asked for pure contract enforcement.
What ships with it: 3 files
8.6 KB alongside SKILL.md, 1 of them executable
agents/
- openai.yaml229 B
references/
scripts/
- extract_openapi_summary.pyruns7.7 KB