repository-generator

Generates Repository layer design documents with Prisma implementation guidance from database schemas.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Designing a consistent data access layer is repetitive and error-prone: teams must decide CRUD methods, pagination, filtering, sorting, transaction boundaries, and query optimization for every entity. This Skill automates that work by generating a complete REPOSITORY_SPECS.md design document from your database schema and service specifications. ## Core Features & Use Cases - Repository Design Generation: Produces Repository lists, responsibilities, and standard CRUD methods (findById, findMany, create, update, delete, count) for each database entity. - Data Access Standards: Defines unified pagination, filtering, sorting, soft-delete, and transaction boundary rules, with Prisma implementation suggestions and index recommendations. - Risk & Performance Analysis: Detects N+1 query risks, missing pagination, and missing indexes, then outputs graded risk items with concrete fixes. - Use Case: Given DATABASE_SCHEMA.md and SERVICE_SPECS.md for a novel-to-script application, generate ScriptRepository, VersionRepository, and TaskRepository designs including findWithVersions, findLatestVersion, and findPendingTasks methods. ## Quick Start Ask the AI to generate the Repository layer design document from your DATABASE_SCHEMA.md and SERVICE_SPECS.md files.

Frequently Asked Questions about repository-generator

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

FAQPage Schema
How do I generate a Repository layer design from a database schema?▼

Provide your DATABASE_SCHEMA.md and optionally SERVICE_SPECS.md as input. The Skill identifies entities, generates one Repository per model with standard CRUD methods, and outputs a complete REPOSITORY_SPECS.md covering pagination, filtering, and Prisma implementation advice.

What should a Prisma Repository layer include?▼

A Prisma Repository should include findById, findMany, create, update, delete, and count methods, plus unified pagination using skip/take, where-based filtering, and orderBy sorting. It should avoid business logic, transactions, and direct Redis access.

Should transactions be handled in the Repository or Service layer?▼

Transactions belong in the Service layer. The Repository only performs database access and must not start complex transactions internally; the Service coordinates multi-step operations that require atomicity.

How do I avoid N+1 queries in Prisma repositories?▼

Use Prisma's include option to eagerly load relations such as versions or scenes in a single query instead of querying per record. The Skill flags N+1 risks in its risk analysis section and recommends include-based queries.

What are the limitations of generated Repository designs?▼

The generated design covers data access only and deliberately excludes business logic, permission checks, caching, AI calls, and queue handling. Unknown or ambiguous requirements are marked as pending confirmation and need manual review.