nop-codegen-master

Generates initial Nop Platform project scaffolding from ORM model files using nop-cli.

693|100|Updated Aug 18, 2022
One-click install
npx skills add https://github.com/entropy-cloud/nop-entropy --skill nop-codegen-master
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nop-codegen-master
Source: https://github.com/entropy-cloud/nop-entropy/tree/main/.opencode/skills/nop-codegen-master
Command: npx skills add https://github.com/entropy-cloud/nop-entropy --skill nop-codegen-master

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Starting a new Nop Platform project requires creating multiple interdependent modules (API, DAO, service, web, deploy) by hand. This Skill automates the one-time generation of a complete project scaffold from an ORM model file, so developers can move directly to iterative development with Maven builds.

Core Features & Use Cases

  • Project Scaffolding: Runs nop-cli gen with the /nop/templates/orm template to produce a full multi-module project (api, codegen, dao, service, web, app, deploy) from an ORM model file.
  • Custom Template Support: Allows overriding default templates by placing custom templates under a _vfs directory and pointing -t to the custom path.
  • Safe Iteration Guidance: Explains the file overwrite rules—files in _gen/ or with _ prefix are always regenerated, while handwritten code is preserved—and the post-generation workflow via mvn install in the codegen module.
  • Use Case: You have an app-demo.orm.xml model and need a complete Nop Platform backend project. Run the generation command once, then iterate by editing the model and rebuilding with Maven.

Quick Start

Ask the assistant to generate a new Nop Platform project from your ORM model file, for example: "Generate a project scaffold from model/app-demo.orm.xml using nop-cli gen with the orm template."

Frequently Asked Questions about nop-codegen-master

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

FAQPage Schema
How do I generate a Nop Platform project from an ORM model?

Run `nop-cli gen <model-file> -t=/nop/templates/orm -o=<output-dir>` with your ORM model file. This produces a multi-module project including api, dao, service, web, codegen, app, and deploy directories.

How do I use custom code generation templates with nop-cli?

Create a `_vfs` directory in the execution directory and place your custom templates inside, for example `_vfs/my/templates/orm`. Then pass `-t=/my/templates/orm` to the nop-cli gen command.

Will regenerating code overwrite my handwritten code in Nop Platform?

No. Only files in the `_gen/` directory or files with an underscore prefix are always overwritten. Handwritten code in files without the underscore prefix is permanently preserved across regenerations.

How do I update generated code after changing the ORM model?

After the initial generation, nop-cli is no longer needed. Edit the model file, then run `mvn install` in the xxx-codegen module, which automatically triggers code regeneration while keeping handwritten code.

Why does nop-cli gen fail with command not found?

The nop-cli tool must be installed and available on the global PATH before generation. Install nop-cli globally, then verify the command is accessible from your terminal before running gen.