service-generator

Generates Service layer design documents from API specs, database schemas, and business rules.

Updated Jun 5, 2026
One-click install
npx skills add https://github.com/fen-zx/NovelToScript --skill service-generator-fen-zx
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: service-generator
Source: https://github.com/fen-zx/NovelToScript/tree/main/.agents/skills/service-generator
Command: npx skills add https://github.com/fen-zx/NovelToScript --skill service-generator-fen-zx

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Designing a backend Service layer requires translating API specs, database models, and business rules into consistent method definitions, transactions, permissions, caching, and queue designs, which is slow and error-prone when done manually. ## Core Features & Use Cases - Service Identification and Method Design: Derives Service classes (e.g., ScriptService, NovelService) from entities and defines methods, DTOs, and return models without exposing raw database models. - Cross-Cutting Design: Produces transaction boundaries (Prisma $transaction), permission rules, state machine transitions, Redis cache TTLs, BullMQ queue jobs, and AI pipeline flows. - Risk and Performance Analysis: Flags risks like AI generation timeouts and recommends mitigations such as async BullMQ execution and retry mechanisms. - Use Case: Given API_SPECS.md and DATABASE_SCHEMA.md for a novel-to-script tool, generate a complete SERVICE_SPECS.md covering ScriptService, AIService, and TaskService with all design sections. ## Quick Start Ask the agent to generate a Service layer design document from your API_SPECS.md, DATABASE_SCHEMA.md, and business logic description.

Frequently Asked Questions about service-generator

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

FAQPage Schema
How do I generate a Service layer design document from API specs?▼

Provide your API_SPECS.md, DATABASE_SCHEMA.md, and business logic description as input. The skill identifies entities, derives Service classes, and outputs a SERVICE_SPECS.md covering methods, DTOs, transactions, permissions, caching, queues, and risks.

What should a backend Service layer design document include?▼

It should include the service list, business responsibilities, method definitions with input DTOs and return models, transaction design, permission requirements, state transitions, cache TTLs, queue jobs, exception handling, repository dependencies, and risk analysis.

Does the service-generator produce actual Prisma or Express code?▼

No. It explicitly forbids generating Controller code, Prisma implementation code, or HTTP handling. It outputs design specifications only, including suggestions like prisma.$transaction() and BullMQ job structures, leaving implementation to downstream code generators.

How are transactions and permissions designed for backend services?▼

The skill detects create, delete, status-change, and batch operations that need transactions, recommending prisma.$transaction(). It also maps roles like Admin, Author, and Viewer to permission strings such as script:create for each method.

When should AI generation tasks use a queue like BullMQ?▼

Long-running operations such as AI script generation should run asynchronously via BullMQ workers instead of blocking HTTP requests. The skill identifies these耗时 tasks, defines job payloads and workers, and flags timeout risks with retry recommendations.