← スキル一覧に戻る
Use
Use

create-service
by madooei
This is a template for a backend service built with TypeScript and Hono.js. It provides a basic structure for creating RESTful APIs.
⭐ 1🍴 0📅 2026年1月5日
SKILL.md
name: create-service description: Guide for creating services in the backend. Use when asked to create a service layer component. Directs to the appropriate service skill based on the type of service needed.
Create Service
Services contain business logic and orchestrate operations between repositories, external APIs, and other services.
Service Types
There are two types of services in this architecture:
| Type | Purpose | Skill |
|---|---|---|
| Resource Service | CRUD operations on entities (notes, users, etc.) | create-resource-service |
| Utility Service | Cross-cutting concerns (auth, notifications, email) | create-utility-service |
Which Skill to Use?
Use create-resource-service when:
- Creating a service for a domain entity (Note, User, Course, etc.)
- The service will perform CRUD operations via a repository
- The service needs authorization checks per operation
- The service should emit events for real-time updates
- You've already created the schema and repository for this entity
Example: NoteService, UserService, CourseService
Use create-utility-service when:
- Creating a service for cross-cutting concerns
- The service calls external APIs (auth service, payment gateway, etc.)
- The service provides shared functionality used by other services
- The service doesn't directly map to a domain entity
Example: AuthenticationService, AuthorizationService, EmailService, NotificationService
Service Layer Principles
Regardless of type, all services follow these principles:
- Business logic lives here - Not in controllers or repositories
- Dependency injection - Inject dependencies via constructor
- Throw domain errors - Use errors from
@/errors(not HTTP errors) - User context - Accept
AuthenticatedUserContextTypewhere needed - Return domain types - Return schema types, not HTTP responses
File Naming
Location: src/services/{service-name}.service.ts
| Type | Example |
|---|---|
| Resource | note.service.ts, user.service.ts |
| Utility | authentication.service.ts, authorization.service.ts |
See Also
create-resource-service- CRUD services for entitiescreate-utility-service- Cross-cutting/specialized servicesadd-resource-events- Add real-time events to a resource service
スコア
総合スコア
70/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
✓説明文
100文字以上の説明がある
+10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です