api
Fastify route development, Zod type providers, OpenAPI documentation, structured logging, and error responses.
Skill by Mihir-Rabari
Chalk Labs
Need help deploying api?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/mihir-rabari-api
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: backend
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions: not checked yet.
What's inside
- Skill name
api- Description
- Fastify route development, Zod type providers, OpenAPI documentation, structured logging, and error responses.
- License
- MIT
- Instructions
- 57 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# API Development Skill
## 1. When to Use
Use this skill when implementing Fastify REST routes, adding Zod input validation schemas, documenting endpoints in OpenAPI, or configuring API error handling.
## 2. Route Registration Convention
All routes must use `FastifyPluginAsyncZod` from `fastify-type-provider-zod`:
```typescript
import type { FastifyPluginAsyncZod } from 'fastify-type-provider-zod';
import { z } from 'zod';
import { requirePermission } from '@packages/iam';
import { HttpErrorResponseSchema } from '@packages/validation';
export const featureRoutes: FastifyPluginAsyncZod = async (fastify) => {
fastify.get(
'/feature/:id',
{
preHandler: [requirePermission('feature:read')],
schema: {
tags: ['Feature'],
params: z.object({ id: z.string().uuid() }),
response: {
200: z.object({ id: z.string(), name: z.string() }),
400: HttpErrorResponseSchema,
401: HttpErrorResponseSchema,
403: HttpErrorResponseSchema,
404: HttpErrorResponseSchema,
},
},
},
async (request, reply) => {
request.log.info({ featureId: request.params.id }, 'Feature retrieved');
return reply.send({ id: request.params.id, name: 'Sample Feature' });
}
);
};
```
## 3. Standard Error Responses & Request Correlation
- Every API response attaches an `x-request-id` header.
- All error responses conform to `HttpErrorResponseSchema` including the matching `requestId`.
- Never expose internal stack traces or connection strings in client error responses.
## 4. OpenAPI Documentation
- Interactive documentation: `/api/docs` (Swagger UI).
- Raw OpenAPI 3.0 specification: `/api/openapi.json`.
- Authentication in OpenAPI is documented as `CookieAuth` (`app_session` cookie).
## 5. Mandatory Testing Expectations
Every new API route requires:
1. **Schema Validation Test**: Verifying invalid parameters return 400 with structured validation details.
2. **Authentication Guard Test**: Verifying unauthenticated requests return 401.
3. **Authorization Guard Test**: Verifying unauthorized roles/users return 403.
4. **Success Test**: Verifying valid requests return expected status codes and matching response schema.
5. **OpenAPI Sync**: Verifying the route appears in `/api/openapi.json`.From Mihir-Rabari/baseline, MIT.
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 1
- Last commit (this folder)
- Oct 3, 2026 (28 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/Mihir-Rabari/baseline
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
More from Mihir-Rabari
- 0.561score
agent
Mihir-Rabari
AI chat agent that acts as the signed-in user, tool registry, staged write actions with confirmation, permission-filtered tools, and prompt-injection rules.
SkillAFreshness: AClaude Code +9 - 0.561score
design
Mihir-Rabari
Visual design law for the generated app — screen structure, colour tokens, typography, icons, spacing, and the states every screen owes the user.
SkillAFreshness: AClaude Code +9 - 0.558score
authentication
Mihir-Rabari
Password hashing (scrypt), server-side session tokens, HTTP-only cookies, and auth events.
SkillAFreshness: AClaude Code +9 - 0.558score
architecture
Mihir-Rabari
Monorepo package boundaries, layering rules, and extension patterns.
SkillAFreshness: AClaude Code +9 - 0.558score
api
Mihir-Rabari
Fastify route development, Zod type providers, OpenAPI documentation, structured logging, and error responses.
SkillAFreshness: AClaude Code +9 - 0.558score
database
Mihir-Rabari
PostgreSQL schema conventions, Drizzle ORM, migrations, deterministic seeding, and database integrity.
SkillAFreshness: AClaude Code +9
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get api running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
api skill. Agent Mart. https://agentmart.dev/skills/mihir-rabari-api (last updated 2026-10-24)