handler

Implement API handlers and repository CRUD methods with Drizzle ORM.

Updated Apr 6, 2026
One-click install
npx skills add https://github.com/monobaselabs/monobase-js --skill handler-monobaselabs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: handler
Source: https://github.com/monobaselabs/monobase-js/tree/main/.claude/skills/handler
Command: npx skills add https://github.com/monobaselabs/monobase-js --skill handler-monobaselabs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The API layer often involves repetitive boilerplate to implement handlers and repositories. This skill provides a repeatable pattern to implement business logic and data access in generated handler stubs.

Core Features & Use Cases

  • Establishes a consistent handler shape that validates input, accesses a shared database, and returns proper HTTP responses.
  • Provides a repository skeleton with common CRUD methods (createOne, findOneById, findMany, updateOne, deleteOne) using Drizzle ORM.
  • Ensures audit logging and standardized error handling for data-modification operations.

Quick Start

Open the generated stub at services/api-ts/src/handlers/{module}/{operationId}.ts and implement the handler following the provided pattern.

Frequently Asked Questions about handler

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement consistent API handlers in TypeScript with proper validation and error handling?

To implement API handlers with consistent validation and error handling, apply a repeatable pattern across generated stubs that validates input, accesses a shared database, and returns standardized HTTP responses. This approach eliminates repetitive boilerplate.

What is the best way to structure repository logic using Drizzle ORM for CRUD operations?

Structuring repository logic with Drizzle ORM involves creating a skeleton with common CRUD methods like createOne, findOneById, findMany, updateOne, and deleteOne. This ensures proper data access and validation across your modules.

How do I add audit logging to API handlers for data modification operations?

Audit logging for data modification operations is added by applying audit hooks within the API handler pattern. This ensures all create, update, and delete actions through the repository methods are properly logged.

Can I use dependency injection with API handlers and repository logic in generated stubs?

Yes, dependency injection is supported within the API handler pattern. The implementation ensures handlers receive shared database access and other dependencies consistently across different modules.

Does this API handler pattern work with TypeScript modules that need standardized HTTP responses?

Yes, the pattern establishes a consistent handler shape specifically for TypeScript modules that validates input and returns proper HTTP responses. It works across various modules by applying the same logic from a reference handler stub.