create-resource-service

Generates CRUD service skeletons with authorization hooks and event emission for domain entities.

1|Updated May 21, 2025
One-click install
npx skills add https://github.com/madooei/backend-template --skill create-resource-service
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-resource-service
Source: https://github.com/madooei/backend-template/tree/main/.claude/skills/create-resource-service
Command: npx skills add https://github.com/madooei/backend-template --skill create-resource-service

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The skill provides a standardized blueprint for building resource services that manage CRUD operations, authorization checks, and event emission, enabling consistent, testable domain logic.

Core Features & Use Cases

  • CRUD service skeletons with repository injection and event emission
  • Authorization hooks for create, read, update, delete
  • Consistent event naming and easy integration with controllers

Quick Start

Create the service file at src/services/{entity-name}.service.ts implementing a CRUD interface with repository access and authorization.

Frequently Asked Questions about create-resource-service

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

FAQPage Schema
How do I structure a TypeScript CRUD service with authorization and event emission?

To build a TypeScript CRUD service with authorization and events, inject a repository for data persistence and apply authorization hooks before operations, then emit event-based notifications after create, update, or delete actions.

What is the best way to enforce access control in a domain-layer resource service?

The best way to enforce access control in a resource service is by integrating dedicated authorization checks directly within CRUD operations, ensuring permissions are validated before any data persistence or modification occurs.

How do I decouple data persistence from business logic in a TypeScript domain service?

You decouple data persistence from business logic in a TypeScript domain service by using repository injection, allowing the service to manage domain logic while the repository handles database interactions.

When do I need event-based notifications in a CRUD service?

You need event-based notifications in a CRUD service when downstream controllers or other system components must react to data changes, ensuring consistent event naming after create, update, and delete operations.

Can I use repository injection with existing TypeScript controllers?

Yes, you can use repository injection with existing TypeScript controllers. This resource service design pattern ensures consistent domain logic and easy integration by standardizing how controllers interact with the service layer.

How to create a reusable CRUD service skeleton for domain entities?

Create a reusable CRUD service skeleton by defining a TypeScript class at src/services/{entity-name}.service.ts that implements a standardized interface for repository access, authorization hooks, and event emission.