Help us improve
Share bugs, ideas, or general feedback.
From tauri-skills
Guides Fastify framework usage: routing, plugins, JSON schema validation, hooks, serialization, and performance optimization. Activate when working with Fastify or building high-performance Node.js APIs.
npx claudepluginhub partme-ai/full-stack-skills --plugin vue-skillsHow this skill is triggered — by the user, by Claude, or both
Slash command
/tauri-skills:fastifyThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use this skill whenever the user wants to:
Builds performant Fastify APIs with schema validation, plugins, decorators, and hooks. Includes TypeBox type-safe routes and modular plugin architecture.
Provides Fastify 5 best practices, API reference, and patterns for routes, plugins, hooks, validation, error handling, and TypeScript. Use for writing routes/plugins/hooks, looking up APIs, debugging lifecycle/validation issues, or reviewing anti-patterns.
Builds REST APIs with Fastify and TypeScript, including route creation, TypeBox schema validation, request handling, and plugin architecture.
Share bugs, ideas, or general feedback.
Use this skill whenever the user wants to:
fastify.inject() for testing, deploy with process managerconst fastify = require('fastify')({ logger: true });
// Register plugins
fastify.register(require('@fastify/cors'));
fastify.register(require('@fastify/helmet'));
// Route with JSON Schema validation
fastify.post('/api/items', {
schema: {
body: {
type: 'object',
required: ['name', 'price'],
properties: {
name: { type: 'string', minLength: 1 },
price: { type: 'number', minimum: 0 },
},
},
response: {
201: {
type: 'object',
properties: {
id: { type: 'integer' },
name: { type: 'string' },
price: { type: 'number' },
},
},
},
},
handler: async (request, reply) => {
const item = await createItem(request.body);
reply.code(201).send(item);
},
});
fastify.get('/api/items/:id', async (request, reply) => {
const item = await getItem(request.params.id);
if (!item) {
reply.code(404).send({ error: 'Not found' });
return;
}
return item;
});
fastify.listen({ port: 3000, host: '0.0.0.0' });
// plugins/db.js
async function dbPlugin(fastify, options) {
const pool = createPool(options.connectionString);
fastify.decorate('db', pool);
fastify.addHook('onClose', async () => pool.end());
}
module.exports = require('fastify-plugin')(dbPlugin);
// app.js
fastify.register(require('./plugins/db'), {
connectionString: process.env.DATABASE_URL,
});
fastify.setErrorHandler((error, request, reply) => {
request.log.error(error);
const statusCode = error.statusCode || 500;
reply.code(statusCode).send({
error: error.message,
statusCode,
});
});
fastify-plugin to break encapsulation when sharing decorators across scopesconsole.log in productiononRequest, preHandler) for cross-cutting concernsfastify.inject() without starting a serverfastify, Node.js, high performance, JSON schema, plugins, serialization, hooks, Pino logger