agentleFS
ingsergiovtingsergiovt/claude-code-hexagonal-kit/.claude/skills/new-module/SKILL.md

new-module

Skill1 starsChanged 36 days agoMITView on GitHub

Scaffold a new bounded-context module (domain, application, infrastructure, public API) under src/modules. Use when the user wants a new area of the business such as "billing" or "catalog" that does not fit an existing module.

4 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions4 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 4

    1. nextflow-io/training★ 277same name
    2. luk-s12/legion★ 2same name
    3. lepresk/groundwork★ 0same name
    4. ricci-labs/twise★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository5 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 1 is distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create the folders and files from templates/:

    line 14
  2. Very specific:

    Add use cases with the new-use-case skill and adapters with the new-adapter skill.

    line 20
  3. Very specific:

    Add src/composition/<name>.ts wiring adapters into use cases (see src/composition/orders.ts).

    line 21
  4. Very specific:

    Never import another module's internals.

    line 22
  5. Very specific:

    Run pnpm check and fix everything before reporting done.

    line 23

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

New module

Creates src/modules/<name>/ with the same layout as orders. <name> is lower-case, singular or plural noun (billing, catalog).

Steps

  1. Confirm the module does not already exist (ls src/modules) and that the concept does not belong in an existing module.
  2. Create the folders and files from templates/:
    • domain/errors.ts (copy DomainError pattern from src/modules/orders/domain/errors.ts), domain/ports.ts, domain/index.ts
    • application/index.ts
    • infrastructure/index.ts
    • index.ts (public API: re-exports domain and application, never infrastructure)
  3. Model the first entity in domain/ with its invariants, test first: write domain/<entity>.test.ts (valid + invalid cases), watch it fail, then implement.
  4. Add use cases with the new-use-case skill and adapters with the new-adapter skill.
  5. Add src/composition/<name>.ts wiring adapters into use cases (see src/composition/orders.ts).
  6. Never import another module's internals; use only @/modules/<other> (its index.ts).
  7. Run pnpm check and fix everything before reporting done.

Tests expected

Domain tests for every invariant, including invalid input. Application and infrastructure tests are added by the other skills.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.