fastify-typescript — community fastify-typescript, underchat, contatomaycon, community, ai agent skill, ide skills, agent automation, AI agent skills, Claude Code, Cursor, Windsurf

v1.0.0
GitHub

About this Skill

Ideal for Backend Development Agents requiring high-performance, type-safe API construction. Guidelines for building high-performance APIs with Fastify and TypeScript, covering validation, Prisma integration, and testing best practices

contatomaycon contatomaycon
[0]
[0]
Updated: 3/9/2026

Quality Score

Top 5%
45
Excellent
Based on code quality & docs
Installation
SYS Universal Install (Auto-Detect)
> npx killer-skills add contatomaycon/underchat/fastify-typescript
Supports 19+ Platforms
Cursor
Windsurf
VS Code
Trae
Claude
OpenClaw
+12 more

Agent Capability Analysis

The fastify-typescript skill by contatomaycon is an open-source community AI agent skill for Claude Code and other IDE workflows, helping agents execute tasks with better context, repeatability, and domain-specific guidance.

Ideal Agent Persona

Ideal for Backend Development Agents requiring high-performance, type-safe API construction.

Core Value

Enables agents to build rigorously typed Fastify APIs with strict type enforcement and maintainable code structures. Provides expert guidance on TypeScript integration, schema validation, and performance optimization for backend services.

Capabilities Granted for fastify-typescript

Generating type-safe API endpoints
Validating request/response schemas
Optimizing backend performance with Fastify
Enforcing strict TypeScript compliance

! Prerequisites & Limits

  • Requires TypeScript expertise
  • Limited to Fastify framework
  • Backend-focused only
Project
SKILL.md
5.8 KB
.cursorrules
1.2 KB
package.json
240 B
Ready
UTF-8

# Tags

[No tags]
SKILL.md
Readonly

Fastify TypeScript Development

You are an expert in Fastify and TypeScript development with deep knowledge of building high-performance, type-safe APIs.

TypeScript General Guidelines

Basic Principles

  • Use English for all code and documentation
  • Always declare types for variables and functions (parameters and return values)
  • Avoid using any type - create necessary types instead
  • Use JSDoc to document public classes and methods
  • Write concise, maintainable, and technically accurate code
  • Use functional and declarative programming patterns; avoid classes
  • Prefer iteration and modularization to adhere to DRY principles

Nomenclature

  • Use PascalCase for types and interfaces
  • Use camelCase for variables, functions, and methods
  • Use kebab-case for file and directory names
  • Use UPPERCASE for environment variables
  • Use descriptive variable names with auxiliary verbs: isLoading, hasError, canDelete
  • Start each function with a verb

Functions

  • Write short functions with a single purpose
  • Use arrow functions for simple operations
  • Use async/await consistently throughout the codebase
  • Use the RO-RO pattern (Receive an Object, Return an Object) for multiple parameters

Types and Interfaces

  • Prefer interfaces over types for object shapes
  • Avoid enums; use maps or const objects instead
  • Use Zod for runtime validation with inferred types
  • Use readonly for immutable properties
  • Use import type for type-only imports

Fastify-Specific Guidelines

Project Structure

src/
  routes/
    {resource}/
      index.ts
      handlers.ts
      schemas.ts
  plugins/
    auth.ts
    database.ts
    cors.ts
  services/
    {domain}Service.ts
  repositories/
    {entity}Repository.ts
  types/
    index.ts
  utils/
  config/
  app.ts
  server.ts

Route Organization

  • Organize routes by resource/domain
  • Use route plugins for modular registration
  • Define schemas alongside route handlers
  • Use route prefixes for API versioning
typescript
1import { FastifyPluginAsync } from 'fastify'; 2 3const usersRoutes: FastifyPluginAsync = async (fastify) => { 4 fastify.get('/', { schema: listUsersSchema }, listUsersHandler); 5 fastify.get('/:id', { schema: getUserSchema }, getUserHandler); 6 fastify.post('/', { schema: createUserSchema }, createUserHandler); 7 fastify.put('/:id', { schema: updateUserSchema }, updateUserHandler); 8 fastify.delete('/:id', { schema: deleteUserSchema }, deleteUserHandler); 9}; 10 11export default usersRoutes;

Schema Validation with JSON Schema / Ajv

  • Define JSON schemas for all request/response validation
  • Use @sinclair/typebox for type-safe schema definitions
  • Leverage Fastify's built-in Ajv integration
typescript
1import { Type, Static } from '@sinclair/typebox'; 2 3const UserSchema = Type.Object({ 4 id: Type.String({ format: 'uuid' }), 5 name: Type.String({ minLength: 1 }), 6 email: Type.String({ format: 'email' }), 7 createdAt: Type.String({ format: 'date-time' }), 8}); 9 10type User = Static<typeof UserSchema>; 11 12const createUserSchema = { 13 body: Type.Object({ 14 name: Type.String({ minLength: 1 }), 15 email: Type.String({ format: 'email' }), 16 }), 17 response: { 18 201: UserSchema, 19 400: ErrorSchema, 20 }, 21};

Plugins and Decorators

  • Use plugins for shared functionality
  • Decorate Fastify instance with services and utilities
  • Register plugins with proper encapsulation
typescript
1import fp from 'fastify-plugin'; 2 3const databasePlugin = fp(async (fastify) => { 4 const prisma = new PrismaClient(); 5 6 await prisma.$connect(); 7 8 fastify.decorate('prisma', prisma); 9 10 fastify.addHook('onClose', async () => { 11 await prisma.$disconnect(); 12 }); 13}); 14 15export default databasePlugin;

Prisma Integration

  • Use Prisma as the ORM for database operations
  • Create repository classes for data access
  • Use transactions for complex operations
typescript
1class UserRepository { 2 constructor(private prisma: PrismaClient) {} 3 4 async findById(id: string): Promise<User | null> { 5 return this.prisma.user.findUnique({ where: { id } }); 6 } 7 8 async create(data: CreateUserInput): Promise<User> { 9 return this.prisma.user.create({ data }); 10 } 11}

Error Handling

  • Use Fastify's built-in error handling
  • Create custom error classes for domain errors
  • Return consistent error responses
typescript
1import { FastifyError } from 'fastify'; 2 3class NotFoundError extends Error implements FastifyError { 4 code = 'NOT_FOUND'; 5 statusCode = 404; 6 7 constructor(resource: string, id: string) { 8 super(`${resource} with id ${id} not found`); 9 this.name = 'NotFoundError'; 10 } 11} 12 13// Global error handler 14fastify.setErrorHandler((error, request, reply) => { 15 const statusCode = error.statusCode || 500; 16 17 reply.status(statusCode).send({ 18 error: error.name, 19 message: error.message, 20 statusCode, 21 }); 22});

Testing with Jest

  • Write unit tests for services and handlers
  • Use integration tests for routes
  • Mock external dependencies
typescript
1import { build } from '../app'; 2 3describe('Users API', () => { 4 let app: FastifyInstance; 5 6 beforeAll(async () => { 7 app = await build(); 8 }); 9 10 afterAll(async () => { 11 await app.close(); 12 }); 13 14 it('should list users', async () => { 15 const response = await app.inject({ 16 method: 'GET', 17 url: '/api/users', 18 }); 19 20 expect(response.statusCode).toBe(200); 21 expect(JSON.parse(response.payload)).toBeInstanceOf(Array); 22 }); 23});

Performance

  • Fastify is one of the fastest Node.js frameworks
  • Use schema validation for automatic serialization optimization
  • Enable logging only when needed in production
  • Use connection pooling for database connections

Security

  • Use @fastify/helmet for security headers
  • Implement rate limiting with @fastify/rate-limit
  • Use @fastify/cors for CORS configuration
  • Validate all inputs with JSON Schema
  • Use JWT for authentication with @fastify/jwt

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is fastify-typescript?

Ideal for Backend Development Agents requiring high-performance, type-safe API construction. Guidelines for building high-performance APIs with Fastify and TypeScript, covering validation, Prisma integration, and testing best practices

How do I install fastify-typescript?

Run the command: npx killer-skills add contatomaycon/underchat/fastify-typescript. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for fastify-typescript?

Key use cases include: Generating type-safe API endpoints, Validating request/response schemas, Optimizing backend performance with Fastify, Enforcing strict TypeScript compliance.

Which IDEs are compatible with fastify-typescript?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for fastify-typescript?

Requires TypeScript expertise. Limited to Fastify framework. Backend-focused only.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add contatomaycon/underchat/fastify-typescript. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use fastify-typescript immediately in the current project.

Related Skills

Looking for an alternative to fastify-typescript or another community skill for your workflow? Explore these related open-source skills.

View All

widget-generator

Logo of f
f

Generate customizable widget plugins for the prompts.chat feed system

149.6k
0
Design

flags

Logo of vercel
vercel

The React Framework

138.4k
0
Browser

pr-review

Logo of pytorch
pytorch

Tensors and Dynamic neural networks in Python with strong GPU acceleration

98.6k
0
AI

antd-commit-msg

Logo of ant-design
ant-design

Generate a single-line commit message for ant-design by reading the projects git staged area and recent commit style. Use when the user asks for a commit message, says msg, commit msg, 写提交信息, or wants

97.8k
0
Design