Api conventions
Skill RadKod/claude-agents-kit/nodejs/.claude/skills/api-conventions
Fastify API endpoint olusturma pattern'leri. Route, controller, service, schema. API endpoint yazarken kullan.From its SKILL.md
npx -y skills add RadKod/claude-agents-kit --skill api-conventionsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
1.4 KB, 351 tokens by cl100k_base, as published. Nobody here has run it
Module Olusturma Sirasi
- Drizzle schema (src/db/schema.ts'e ekle)
- Migration (npx drizzle-kit generate)
- Zod schema (src/modules/[name]/[name].schema.ts)
- Service (src/modules/[name]/[name].service.ts)
- Controller (src/modules/[name]/[name].controller.ts)
- Routes (src/modules/[name]/[name].routes.ts)
- Test (src/modules/[name]/tests/)
Route + Controller
// routes.ts
export async function postRoutes(fastify: FastifyInstance) {
fastify.post('/', { schema: createPostSchema }, createPostHandler);
fastify.get('/:id', { schema: getPostSchema }, getPostHandler);
}
// controller.ts
export async function createPostHandler(request: FastifyRequest<{Body: CreatePostInput}>, reply: FastifyReply) {
const post = await postService.create(request.body);
return reply.status(201).send({ data: post });
}
Service
export class PostService {
async create(input: CreatePostInput): Promise<Post> {
const [post] = await db.insert(posts).values(input).returning();
return post;
}
}
Zod Schema
export const createPostSchema = {
body: z.object({ title: z.string().min(1).max(255), body: z.string() }),
response: { 201: z.object({ data: postSchema }) },
};
export type CreatePostInput = z.infer<typeof createPostSchema.body>;
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.