api-contract-check
Skill1 starsChanged 7 months agoMITView on GitHub
Validate API contracts (RAML/JSON Schema/OpenAPI) against their implementations. Use when checking for API drift, reviewing schema changes, or verifying contract consistency.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- furenzhong/awoo-vibe-coding-governancetheir own version, first seen Sep 26, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- furenzhong/awoo-vibe-coding-governance★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository15 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- architecture-designSkill
- context-scaffoldSkill
- context-service-guideSkill
- cpp-test-authoringSkill
- dependency-auditSkill
- openspec-apply-changeSkill
- openspec-archive-changeSkill
- openspec-exploreSkill
- openspec-proposeSkill
- pipeline-debugSkill
- review-prSkill
- springboot-api-from-templateSkill
- springboot-service-from-templateSkill
- terraform-validateSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 6 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Before integrating with another context service's API
- Very specific: line 42
Check src/main/resources/application.yaml for springdoc config
- Distinctive: line 68
When context A consumes events from context B:
- Very specific: line 70
Read B's event schema from {b}-domain/{b}-domain-event/src/main/resources/json/schema/
- Distinctive: line 71
Read A's event handler that processes B's events
- Distinctive: line 72
Verify A correctly handles all required fields from B's schema
- Distinctive: line 74
Check version alignment — A's dependency version of B's event artifact
- Very specific: line 126
When extending tests in cpp-apitests, the response assertions in a *IT.java are contract checks in disguise.
- Distinctive: line 130
If the test diverges from the contract, the test — not the contract — is wrong.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
API Contract Check
Validates that API definitions (RAML, JSON Schema, OpenAPI) match their implementations across CP services.
When to Use
- User asks to "check API contracts", "validate schemas", "find API drift"
- User has changed a RAML/schema file and wants to verify consistency
- User wants to understand the API surface of a context service
- Before integrating with another context service's API
Process
Step 1: Identify API Definitions
Legacy Context Services (RAML + JSON Schema)
API definitions live in predictable locations:
{name}-command/{name}-command-api/src/raml/
json/ # Request payloads
json/schema/ # JSON Schema definitions
{context}.command.{action}.raml # RAML endpoint definitions
{name}-query/{name}-query-api/src/raml/
json/ # Response payloads
json/schema/ # JSON Schema definitions
{context}.query.{action}.raml # RAML endpoint definitionsModern by Default Services (OpenAPI/Swagger)
API definitions are generated from annotations:
@Operation,@ApiResponseon controller methods- springdoc-openapi auto-generates
/v3/api-docs - Check
src/main/resources/application.yamlfor springdoc config
Step 2: Cross-Reference with Implementations
For each API definition found:
- Command APIs — verify the command handler processes all fields defined in the schema
- Query APIs — verify the query handler returns all fields defined in the response schema
- Event schemas — verify domain events contain all fields defined in the event schema
- Inter-service contracts — verify consuming services use the same schema version as the producing service
Step 3: Check Schema Consistency
For JSON Schemas, verify:
$refreferences resolve to existing schema files- Required fields are enforced in handler code
- Enum values match actual usage in code
- Date/time formats follow ISO 8601
For RAML definitions, verify:
- Base URI and resource paths match actual deployment
- Request/response types reference correct schemas
- Media types are correct (
application/vnd.{context}.command.{name}+json)
Step 4: Cross-Context Contract Verification
When context A consumes events from context B:
- Read B's event schema from
{b}-domain/{b}-domain-event/src/main/resources/json/schema/ - Read A's event handler that processes B's events
- Verify A correctly handles all required fields from B's schema
- Flag any fields A ignores that might be important
- Check version alignment — A's dependency version of B's event artifact
Step 5: Generate Report
## API Contract Report: [service-name]
### Commands
| Command | Schema | Handler | Status |
|---------|--------|---------|--------|
| {context}.command.{name} | ✅ defined | ✅ implemented | OK |
| {context}.command.{name} | ✅ defined | ❌ missing field X | DRIFT |
### Queries
| Query | Schema | Handler | Status |
|-------|--------|---------|--------|
...
### Domain Events
| Event | Schema | Producer | Status |
|-------|--------|----------|--------|
...
### Cross-Context Contracts
| Consumer | Event | Producer Version | Consumer Version | Status |
|----------|-------|-----------------|-----------------|--------|
...
### Issues Found
- [severity] [description] — suggested fixCommon Content-Type Patterns
CP uses custom media types for command routing:
application/vnd.{context}.command.{action-name}+json
application/vnd.{context}.query.{query-name}+jsonExamples:
application/vnd.hearing.command.schedule-hearing+json
application/vnd.usersgroups.command.set-user-details+json
application/vnd.listing.query.get-court-schedule+jsonThe framework routes commands/queries to the correct handler based on the Content-Type header. Mismatched content types will cause silent routing failures.
Use Alongside cpp-apitests
When extending tests in cpp-apitests, the response assertions in a *IT.java are contract checks in disguise. Before adding or changing an assertion:
- Locate the producing service's contract (RAML for legacy contexts, OpenAPI for Modern by Default services)
- Confirm the asserted field, type, enum value, and required/optional status match the contract
- If the test diverges from the contract, the test — not the contract — is wrong; fix the test or open a contract-change ADR
For authoring guidance in cpp-apitests, see cpp-test-authoring.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

