api-contract
Skill2 starsChanged 5 days agoMITView on GitHub
Use when defining, validating, or modifying API data contracts, request/response validation schemas (Zod, OpenAPI), or boundary safety layers.
14 other projects use a version of this.
Adopted by
Most recently taken up by
- jDxve/avengers-kittheir own version, first seen Nov 8, 2026
- Eliahhango/nullbyte-securitytheir own version, first seen Nov 1, 2026
- Echo-Scion/portable-brainvibingword for word, first seen Oct 15, 2026
- ChenyCHENYU/Robot_Admintheir own version, first seen Oct 8, 2026
- gonimar/claude-web-studiotheir own version, first seen Sep 27, 2026
- ryktara/Foundrytheir own version, first seen Sep 25, 2026
Used with
Projects with it also use design-system and release.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
AnthropicSkilldesign-system
Audit, document, or extend your design system. Use when checking for naming inconsistencies or hardcoded values across components, writing documentation for a component's variants, states, and accessibility notes, or designing a new pattern that fits the existing system.
Also in 3 projects that use this
MicrosoftSkillrelease
Use ONLY when the user explicitly asks to cut/publish a Huabu desktop release or tag a version. Performs an outward action — bumps the version in apps/desktop/package.json, commits + annotated-tags vX.Y.Z, and pushes the branch + tag. That tag push auto-builds the macOS/Windows installers and publishes a GitHub Release. Provides `status`, `bump`, `tag-push`, and a one-command `run` (bump → tag-push).
Also in 3 projects that use this
Other versions14 projects use a version of this.
Word for word · 1
- Echo-Scion/portable-brainvibing★ 2100% same
Edited · 0
None found.
Wrote their own version · 13
- ChenyCHENYU/Robot_Admin★ 1ksame name
- Eliahhango/nullbyte-security★ 4same name
- gonimar/claude-web-studio★ 4same name
- digitaldreams/tuhin★ 3same name
- PatriotAgenticLLC/better_claude_skillz★ 3same name
- vndee/engineering-skills★ 3same name
- 1398281322-a11y/java-backend-guardrails★ 2same name
- njt2810/claude-code-framework★ 1same name
- YouRen1320/agent-project-kit★ 1same name
- camilo-acevedo/claude-skills★ 0same name
3 more not listed
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 repository21 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ai-engineerSkill
- app-lifecycleSkill
- brain-graphSkill
- code-reviewSkill
- cost-optimizerSkill
- data-logicSkill
- feature-discoverySkill
- frontend-experienceSkill
- integrity-sentinelSkill
- meta-agent-adminSkill
- paletteSkill
- project-architectSkill
- project-operatorSkill
- saas-strategistSkill
- self-evolveSkill
- session-offloadSkill
- strict-tddSkill
- systematic-debuggingSkill
- ui-finishSkill
- worker-delegateSkill
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 7 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 11 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
When writing API endpoints, use these exact templates:
- Distinctive: line 45
Never guess API shape. Code without a validated specification is speculative guessing.
- Distinctive: line 48
When a requirement spans multiple independently testable sub-domains (e.g., auth, billing, notifications):
- Distinctive: line 61
FORBIDDEN (Raw DB Exception Leaks): Never expose internal database error messages, stack traces, table names, or raw SQL queries in …
- Distinctive: line 67
Every HTTP endpoint must return a structured, predictable response envelope:
- Distinctive: line 101
Before implementing the route handler:
- Distinctive: line 102
Write an automated unit test supplying invalid, malicious, or extraneous parameters.
- Very specific: line 103
Verify that the contract layer rejects the payload with an explicit HTTP 400/422 and matching error code before connecting business logic.
“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
API Contract Guard
Your role is to ensure zero malformed data reaches the database.
Zod Schema Templates (MANDATORY)
When writing API endpoints, use these exact templates:
1. The Auth/Registration Template
export const RegisterSchema = z.object({
email: z.string().email("Invalid email format"),
password: z.string().min(8, "Minimum 8 characters").regex(/[0-9]/, "Must contain a number"),
name: z.string().min(2).max(50)
});2. The Pagination Template (GET Requests)
export const PaginationQuerySchema = z.object({
page: z.coerce.number().int().positive().default(1),
limit: z.coerce.number().int().positive().max(100).default(20),
search: z.string().optional()
});3. The Strict Update Template (PATCH Requests)
export const UpdateProfileSchema = z.object({
bio: z.string().max(200).optional(),
avatarUrl: z.string().url().optional()
}).strict(); // Prevents injection of arbitrary fields like `isAdmin`The Agent MUST never proceed with an API implementation without defining the validation schema (Zod, Pydantic, or OpenAPI) first.
📜 Specification-First Architecture & Protocol (SDD)
Never guess API shape. Code without a validated specification is speculative guessing. Follow this 4-phase protocol:
Phase 0: Scope & Capability Mapping
When a requirement spans multiple independently testable sub-domains (e.g., auth, billing, notifications):
- Decompose First: Define an explicit Capability Map before drafting individual endpoint schemas:
| Module ID | Responsibility | Dependencies | |---|---|---| | auth | Accounts, JWT tokens, RBAC | — | | billing | Invoicing, payment webhooks | auth | | notifications | Email dispatch, alerts | auth, billing | - Acyclic Dependency Invariant: Dependency arrows must point in one direction. Cyclical dependencies between modules are strictly forbidden.
Phase 1: Contract Invariants & Negative Refusals
- FORBIDDEN (Untyped Any Payloads): Loosely typed request bodies (
any,dynamic, raw dictionaries, untyped maps) are strictly forbidden across boundary layers. Every endpoint MUST validate incoming parameters against an explicit Zod, Pydantic, or OpenAPI contract. - FORBIDDEN (Raw DB Exception Leaks): Never expose internal database error messages, stack traces, table names, or raw SQL queries in client-facing HTTP responses. Internal exceptions MUST be caught, logged server-side, and mapped to standard error envelopes.
- FORBIDDEN (Mass-Assignment): Mutation schemas MUST enforce strict key stripping (
.strict()in Zod,extra="forbid"in Pydantic). Rejecting unexpected payload properties is non-negotiable. - Immutable DTO First: Define the complete contract DTO before authoring service or repository logic.
Phase 2: Standard Unified Response Envelopes
Every HTTP endpoint must return a structured, predictable response envelope:
Success Envelope (HTTP 200/201):
{
"success": true,
"data": {},
"error": null,
"meta": {
"timestamp": "2026-10-11T22:45:00Z",
"version": "v1"
}
}Error Envelope (HTTP 4xx/5xx):
{
"success": false,
"data": null,
"error": {
"code": "VALIDATION_FAILED",
"message": "Field 'email' failed format validation",
"details": [
{ "field": "email", "issue": "Invalid email address format" }
]
},
"meta": {
"timestamp": "2026-10-11T22:45:00Z"
}
}Phase 3: Contract Rejection Tests (Red-First & TDD Handoff)
Before implementing the route handler:
- Write an automated unit test supplying invalid, malicious, or extraneous parameters.
- Verify that the contract layer rejects the payload with an explicit
HTTP 400/422and matching error code before connecting business logic. - Hand off validated payload schemas to
/data-logicfor immutable model mapping and execute the full cycle under/strict-tdd.
📚 Mandatory Knowledge Routing (JIT References)
If your current task intersects with these domains, you MUST execute view_file on the target BEFORE writing code:
| If User Prompt/Task Relates To... | Immediately Load (view_file) |
| API Safety Patterns | .agents/skills/api-contract/references/api_safety_patterns.md |
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.

