nodefony-create-module

Scaffolds Nodefony framework packages with TypeScript configs, Zod config schemas, services, and documentation.

Updated Dec 19, 2023
One-click install
npx skills add https://github.com/nodefony/nodefony-core --skill nodefony-create-module-nodefony
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: nodefony-create-module
Source: https://github.com/nodefony/nodefony-core/tree/main/.claude/skills/nodefony-create-module
Command: npx skills add https://github.com/nodefony/nodefony-core --skill nodefony-create-module-nodefony

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Creating a new Nodefony module by hand produces non-conforming packages: wrong tsconfig, missing exports, inconsistent config validation, and absent documentation that nothing flags until runtime. This Skill generates a complete, convention-compliant module skeleton for the Nodefony framework repository, or delegates to the CLI when scaffolding a module inside a user application. ## Core Features & Use Cases - Framework package scaffolding: Generates a full @nodefony/* package under src/packages/ with package.json, tsconfig, rolldown bundler config, Module class, injectable service, typed errors, and Zod-based config with a single source of truth. - Optional feature wiring: Adds CLI commands, HTTP controllers, ORM entities, or Vite frontends on demand, with peer dependencies kept in phase. - CLI delegation for apps: When the target is an application module, it delegates to nodefony create module <nom> instead of reimplementing templates, keeping one source of scaffolds. - Use Case: A developer asks to create @nodefony/metrics; the Skill asks targeted questions, generates all files from frozen templates, builds the workspace, optionally registers it in the modules manifest of nodefony.config.ts, and verifies dist/index.js is actually emitted. ## Quick Start Ask the AI to create a new Nodefony module named metrics with a service and CLI command, then let it scaffold, build, and activate the package.

Frequently Asked Questions about nodefony-create-module

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

FAQPage Schema
How do I create a new Nodefony module?▼

For an application module, run the CLI command nodefony create module <nom> with flags like --controller or --command. For a framework package under src/packages/@nodefony/, this Skill generates the full skeleton from frozen templates including config, service, and docs.

What files does a Nodefony module scaffold include?▼

Every module gets package.json, tsconfig.json, rolldown.config.ts, an index.ts Module class, a Zod config schema in nodefony/config/config.ts, a defineModuleConfig.ts builder, an injectable service, typed errors, CLAUDE.md, MEMORY.md, README.md, and a docs/ directory.

Why does my new Nodefony module crash at boot with Cannot find package?▼

The npm workspace symlink is missing. Run npm install at the repository root after creating the module so the workspace glob links node_modules/@nodefony/<mod>, then rebuild the root dist before restarting the server.

How is module configuration validated in Nodefony?▼

Each module defines a commented Zod schema in config.ts as the single source of truth, with defaults materialized via parse({}). The defineModuleConfig builder parses, formats errors per field, and freezes the config at kernel boot, so invalid config fails cleanly.

When should I not use this scaffolding Skill?▼

Do not use it to add a single controller, service, or file to an existing module; edit files directly instead. It is also unnecessary for application modules, where the nodefony create module CLI command is the correct path.