create-repository

Generate Mongoose-based repository adapters and port interfaces for NestJS modules.

13|1|Updated Jun 28, 2023
One-click install
npx skills add https://github.com/jovicon/nestjs-clean-architecture-event-driven-template --skill create-repository-jovicon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-repository
Source: https://github.com/jovicon/nestjs-clean-architecture-event-driven-template/tree/main/.claude/skills/create-repository
Command: npx skills add https://github.com/jovicon/nestjs-clean-architecture-event-driven-template --skill create-repository-jovicon

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps you scaffold a complete repository infrastructure for a domain entity inside a NestJS module, aligned with Ports & Adapters architecture to enable persistence.

Core Features & Use Cases

  • Scaffold files for the adapter: $1.schema.ts, $1.adapter.ts, $1.service.ts, and $1.module.ts
  • Create the domain port interface under src/modules/$0/application/ports
  • Implement mapping between domain entities and database models
  • Configure DI for adapters within the module

Quick Start

Generate a MongoDB repository adapter skeleton for the specified module and entity.

Frequently Asked Questions about create-repository

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

FAQPage Schema
How do I scaffold a MongoDB repository adapter in a NestJS module?

Scaffolding a MongoDB repository adapter in NestJS generates schema, adapter, service, and module files for a domain entity. It creates a complete Mongoose-based persistence infrastructure following the Ports & Adapters pattern with proper DI configuration.

What is the Ports and Adapters pattern for NestJS persistence design?

The Ports and Adapters pattern in NestJS separates domain logic from infrastructure by defining port interfaces in the application layer and implementing Mongoose adapters. It keeps domain entities decoupled from database models through explicit entity-to-model mapping.

Can I generate a Mongoose schema and service for any domain entity in NestJS?

Yes, you can generate a Mongoose schema and service for any specified domain entity in a NestJS module. The scaffolding produces the database schema, adapter implementation, and service while automatically configuring dependency injection within the module.

Does this repository scaffolding approach handle dependency injection configuration automatically?

Yes, repository scaffolding handles dependency injection configuration automatically within the NestJS module. It wires the Mongoose adapter to the domain port interface, ensuring the service receives the correct adapter implementation during module initialization.

What is the best way to separate domain entities from database models in NestJS?

The best way to separate domain entities from database models in NestJS is applying the Ports & Adapters pattern with a dedicated adapter. The generated adapter handles mapping between domain entities and Mongoose models, isolating persistence concerns from domain logic.