inceptyon-labs/tenet-skills/tenet-api-contract
Claude Code and agent skill by inceptyon-labs/tenet-skills
- community
Checking that the SKILL.md file is still in the repository.
Audits API consistency: schemas, errors, status codes, pagination, versioning, and idempotency.
Install
npx vskill@latest install inceptyon-labs/tenet-skills/tenet-api-contractSKILL.md
The same SKILL.md was published earlier as inceptyon-labs/tenet-skills/tenet-api-contract.
Tenet API Contract
Evaluates whether your API surface is consistent, predictable, and well-designed.
Purpose
This skill audits the API layer of a project for design consistency and contract quality. A well-designed API follows predictable patterns: every resource returns the same response shape, error responses use a uniform schema, HTTP verbs map to their intended semantics, status codes are precise, and pagination follows a single strategy. This skill detects deviations from those principles and flags them as findings.
APIs are the public contract of a service. Inconsistencies in response shapes, verb semantics, or status codes create integration friction, increase client-side error handling complexity, and signal a codebase where conventions are not enforced. This dimension catches those issues before they reach consumers.
Calibration — read first
Follow shared/scan-discipline.md (complete every step, enumerate rather than sample, and §2a: report only issues that actually exist), shared/verification.md (every finding is confirmed against the code before it ships; unconfirmed candidates are dropped, not demoted), and shared/severity.md (severity is confirmed impact, never a hedge for doubt).
A finding must exist in this codebase on a path that can run. Do not report hypotheticals, dead code, style preferences, or anything an upstream check already prevents. Zero findings for a step is the normal result on healthy code; do not fill a step to show you looked. Do not overthink it: read the code and its context, decide, move on.
Language Support Matrix
Applicability Detection
This skill is applicable when ANY of the following are detected:
- Express/Fastify/Koa/Hono route handlers — files containing
app.get(,app.post(,router.get(,fastify.get(, etc. - Next.js API routes — files under
pages/api/orapp/*/route.ts - Flask/Django views —
@app.route,@api_view,urlpatternswith view references - tRPC routers —
createTRPCRouter,publicProcedure,protectedProcedure - NestJS controllers —
@Controller,@Get(),@Post()decorators - OpenAPI/Swagger specs —
openapi.yaml,openapi.json,swagger.yaml,swagger.json - GraphQL schemas —
.graphqlfiles,typeDefs,gqltagged templates - SvelteKit endpoints —
+server.ts/+server.jsfiles - FastAPI and Go routers —
@app.get(,@router.post(,.HandleFunc(, gin/echo/chi route calls - Desktop IPC commands —
#[tauri::command],ipcMain.handle(
A mobile or desktop app that only consumes someone else's API has no API surface of its own and is not applicable. If the same repo also contains the server it talks to, the dimension is applicable and Step 9 checks the two sides against each other.
If none of these are detected, write the dimension report with applicable: false and score: null.
Toolchain Inputs
This skill does NOT consume toolchain outputs directly. It performs its own code analysis using Grep, Glob, and Read to examine route handlers and API definitions.
However, if .healthcheck/toolchain/eslint.json exists, check for any ESLint findings related to API patterns (e.g., consistent-return) and incorporate them to avoid duplicate work.
Procedure
Step 1: Detect API Framework and Enumerate Routes
Identify which API framework(s) are in use and build a route inventory. Use the enumeration recipes in `shared/entry-points.md` for every stack present: Express/Fastify/Koa, Hono, tRPC, Next.js (App Router, Pages, server actions), SvelteKit, FastAPI/Flask/Django and Go. This dimension needs the route list from those recipes, not the auth table that file also describes. Enumerate every route; a route that is not in the inventory is not checked by any later step.
Recipes for surfaces that file does not cover:
Django REST Framework:
NestJS:
Desktop IPC (Tauri, Electron). Commands the UI calls are an API surface with the same consistency concerns:
For these, Steps 2 and 3 apply (return shapes and error shapes across commands). Skip the HTTP steps (4 to 8) and mark their checks skipped.
Build a route table:
| Method | Path | File | Line | Handler | |
|---|---|---|---|---|---|
| GET | /api/users | src/routes/users.ts | 12 | listUsers | |
| POST | /api/users | src/routes/users.ts | 45 | createUser | |
| ... | ... | ... | ... | ... |
Step 2: Check Response Shape Uniformity
For each resource (group of routes sharing a base path like /api/users), examine the response bodies:
What to check:
- All success responses for a resource should wrap data in the same envelope (e.g.,
{ data: ..., meta: ... }or bare objects) - If one endpoint returns
{ data: users, total: 100 }, another should not return{ results: users, count: 100 } - Collection endpoints (GET /resources) vs. singleton endpoints (GET /resources/:id) should use consistent wrapping
Detection method:
- Read each handler and look for
res.json(,res.send(,return Response.json(,jsonify(,JsonResponse( - Extract the top-level keys of the response object
- Compare across handlers in the same resource group
Severity: minor for inconsistent shapes within a resource, major if the inconsistency spans the entire API (no two resources use the same envelope).
Step 3: Check Error Response Schemas
Examine error handling across all routes:
What to check:
- Error responses should follow a uniform schema (e.g.,
{ error: { code: string, message: string } }) - Different error handlers should not return different shapes (one returning
{ error: "msg" }and another{ message: "msg", status: 400 }) - Express error middleware, NestJS exception filters, Flask errorhandlers should be consistent
Detection method:
- Search for error response patterns:
res.status(4,res.status(5,HttpException,abort(,raise Http - Extract the response body shape from each error path
- Check for a centralized error handler vs. ad-hoc error responses
Severity: major if no consistent error schema exists, minor if most errors are consistent with a few outliers.
Step 4: Validate HTTP Verb Semantics
Check that HTTP methods are used according to their semantics:
Rules:
| Verb | Expected Semantics | Flag if... | |
|---|---|---|---|
| GET | Read-only, no side effects | Handler writes to DB, sends emails, creates records | |
| POST | Create a resource or trigger an action | Used for idempotent updates (should be PUT/PATCH) | |
| PUT | Full replacement, idempotent | Handler does partial updates (should be PATCH) | |
| PATCH | Partial update | Handler requires all fields (should be PUT) | |
| DELETE | Remove a resource, idempotent | Handler has non-idempotent side effects |
Detection method:
- For GET handlers: look for
save(),create(),insert,delete,update,sendEmail,publish, write operations on DB models - For POST handlers used for updates: check if the path contains an
:idparam and the handler does a full replacement - For PUT handlers: check if the handler merges/patches rather than replaces
Severity: major for GET with side effects (violates HTTP spec and breaks caching), minor for PUT/PATCH confusion.
Step 5: Check Versioning Strategy
Examine how (or if) the API is versioned:
Detection method:
- URL-based: paths starting with
/v1/,/v2/,/api/v1/ - Header-based: checks for
Acceptheader version parsing,X-API-Versionheaders - No versioning: all routes under a flat path
What to flag:
- Mixed versioning strategies (some routes versioned in URL, others in headers)
- Multiple API versions with identical implementations (dead versions)
- No versioning at all on a public API (info-level suggestion)
Severity: minor for mixed strategies, info for missing versioning on public APIs.
Step 6: Validate Idempotency on PUT and DELETE
PUT and DELETE requests MUST be idempotent (calling them N times produces the same result as calling once).
Detection method:
- PUT handlers that use auto-increment IDs or generate new records instead of upserting
- PUT handlers that append to collections rather than replace
- DELETE handlers that throw errors on already-deleted resources instead of returning 204/404
What to look for in code:
Severity: major for non-idempotent PUT, minor for DELETE that errors on missing resources.
Step 7: Validate Status Codes
Check that HTTP status codes match the operation:
Rules:
| Operation | Expected Status | Flag if... | |
|---|---|---|---|
| Create (POST) | 201 Created | Returns 200 | |
| Delete | 204 No Content (or 200 with body) | Returns 200 with empty body | |
| Update (PUT/PATCH) | 200 OK | Returns 204 when body is returned | |
| Not Found | 404 | Returns 200 with null/empty | |
| Validation Error | 400 or 422 | Returns 500 | |
| Auth failure | 401 or 403 | Returns 400 or 500 |
Detection method:
- Read POST handlers and check for
res.status(201)vsres.status(200)or no explicit status - Read DELETE handlers and check for
res.status(204)orres.sendStatus(204) - Flag handlers that return 200 for everything regardless of operation
Severity: minor for incorrect but functional status codes (200 instead of 201), major for misleading codes (200 for errors, 500 for validation).
Step 8: Check Pagination Consistency
For collection endpoints that return lists, check pagination:
What to check:
- All list endpoints should use the same pagination strategy (offset-based, cursor-based, or page-based)
- Pagination parameters should have consistent names (
page/per_pagevsoffset/limitvscursor/after) - Responses should include pagination metadata consistently (
total,next_cursor,has_more) - Default and maximum page sizes should be enforced
Detection method:
- Find all GET endpoints that return arrays/lists
- Check query parameter parsing for pagination params
- Compare pagination metadata shapes across endpoints
Severity: minor for inconsistent parameter naming, major for some endpoints paginated and others returning unbounded lists (performance risk).
Step 9: Additional Checks
Content-Type consistency:
- All JSON endpoints should set
Content-Type: application/json - Mixed content types without Accept header negotiation
HATEOAS/Links (info only):
- Note whether the API includes hypermedia links for discoverability
Rate limiting headers:
- Check if rate limiting headers are set consistently (
X-RateLimit-Limit,X-RateLimit-Remaining)
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/tenet-api-contract/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/inceptyon-labs/tenet-skills/tenet-api-contract)