api-contract-validation
Skill0 starsChanged 5 months agoMITView on GitHub
Discovers and validates API endpoints between frontend and backend. Use after creating or modifying API endpoints, or when investigating FE-BE contract mismatches. Simplified to endpoint discovery; full contract comparison deferred to dedicated tools.
In this repository38 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- architecture-scannerSkill
- auto-approve-policySkill
- auto-learningSkill
- backend-patternsSkill
- branch-syncSkill
- browser-testSkill
- browseSkill
- build-checkSkill
- cache-refreshSkill
- codebase-explainerSkill
- coding-standardsSkill
- commit-styleSkill
- context-switchingSkill
- continuous-learningSkill
- db-preflightSkill
- env-preflightSkill
- eval-harnessSkill
- feature-completenessSkill
- file-indexSkill
- frontend-patternsSkill
- function-extractSkill
- idev-initSkill
- import-graphSkill
- lessons-learnedSkill
- post-creation-verifySkill
- pre-ship-verifySkill
- project-mapSkill
- self-reviewSkill
- session-resumeSkill
- skill-benchmarkSkill
- skilloptSkill
- smart-contextSkill
- strategic-compactSkill
- task-journalSkill
- tdd-workflowSkill
- test-coverageSkill
- test-mapSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 9 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
After creating a new API endpoint (backend) or service function (frontend)
- Distinctive: line 13
When user reports a 404 or data mismatch between FE and BE
- Distinctive: line 14
When asked to "validate API contracts" or "check endpoint alignment"
- Distinctive: line 41
Check if the backend route exists
- Distinctive: line 42
Check if the frontend has a corresponding service call
- Distinctive: line 92
Do NOT assume casing matches — check JSON serializer config
- Distinctive: line 93
Do NOT flag Guid→string as a type error — it serializes fine
- Distinctive: line 94
Do NOT run full validation after every single file change — run after feature completion
- Distinctive: line 95
Do NOT try to validate response shapes — focus on URL and method alignment
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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 Validation — Simplified
Purpose
Discover API endpoints on both frontend and backend, and flag obvious mismatches (missing endpoints, wrong HTTP methods, broken URL patterns). This is a lightweight discovery tool, not a full contract comparison engine.
Activation
- After creating a new API endpoint (backend) or service function (frontend)
- When user reports a 404 or data mismatch between FE and BE
- When asked to "validate API contracts" or "check endpoint alignment"
How It Works
Endpoint Discovery
Backend — scan for route definitions:
.NET: grep for [Route("api/"] or [Http*(" in *.cs
Express: grep for "app.get|app.post|router.get|router.post" in *.ts/*.js
FastAPI: grep for "@app.get|@app.post|@router" in *.py
Django: grep for "path(" in urls.py
Spring: grep for "@GetMapping|@PostMapping|@RequestMapping" in *.java
Go: grep for "HandleFunc|Handle|r.GET|r.POST" in *.goFrontend — scan for API calls:
TS/JS: grep for "api/|/api" in *.service.ts, *.api.ts, api/*.ts
Python: grep for "requests.get|requests.post|httpx"
Flutter: grep for "http.get|http.post|dio"Quick Validation
For each discovered endpoint:
- Check if the backend route exists
- Check if the frontend has a corresponding service call
- Flag: missing backend route, missing frontend call, HTTP method mismatch
- Report results in a compact table
Phase 1: Discover Endpoints
Scan both sides and build a mapping:
{
"generated": "YYYY-MM-DD",
"endpoints": [
{
"path": "api/orders/get-all",
"method": "GET",
"backend": "path/to/OrdersController.cs",
"frontend": "path/to/orders.service.ts",
"status": "aligned|missing-backend|missing-frontend"
}
]
}Write to .claude/idev/api-contract-validation/cache.json.
Phase 2: Report
API Endpoint Discovery: 12 endpoints found
✓ GET api/orders/get-all → aligned
✓ POST api/orders/create → aligned
✗ GET api/orders/get-by-key → missing frontend call
✗ POST api/customers/import → missing backend route
Summary: 10 aligned, 1 missing-frontend, 1 missing-backendWhen to Use Full Contract Comparison
For detailed type/field validation (request/response shapes, DTO alignment), use a dedicated OpenAPI/Swagger tool or generate contracts from code. This skill focuses on URL and method alignment — the most common source of runtime 404s.
Anti-Patterns
- Do NOT assume casing matches — check JSON serializer config
- Do NOT flag Guid→string as a type error — it serializes fine
- Do NOT run full validation after every single file change — run after feature completion
- Do NOT try to validate response shapes — focus on URL and method alignment
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.

