Index of every page on this site: llms.txt
All skills
amirtaherkhani avatar

/nestjs-architecture-principles

@8272374
Run it yourself

Designs and reviews NestJS application architecture using cohesive feature modules, modular monoliths, layered or hexagonal boundaries, dependency inversion, and pragmatic engineering principles. Use when planning a NestJS project, changing module boundaries, evaluating Clean Architecture or DDD, resolving circular dependencies, defining ports and adapters, reviewing coupling, or deciding whether CQRS or microservices are justified. Do not use for pure frontend work or non-NestJS backends. When other skills also apply, reconcile ownership before mutation.

Use this Skill: https://skilld.dev/gh/amirtaherkhani/nestjs-skills/nestjs-architecture-principles

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesmodule-contracts.md

≈758 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Module Contracts and Consumer Proof

Record the capability before choosing folders or tokens:

Question Library and school example
Owner and writes Auth validates sessions; Library owns loans; School owns enrollment and capacity
Consumers LibraryModule and SchoolModule explicitly import AuthModule
Public promise Verify a credential or fail; return only an immutable id/school principal
Hidden state Session records and credential details remain inside Auth
Consumer policy A valid identity still needs library or school access; school capacity belongs to School
Duplicate/failure effects Duplicate enrollment is idempotent; denied/full enrollment leaves state unchanged
Composition One exported Symbol aliases VerifySession; private SessionStore is not a module export

The four-axis fixture proves this record with two actual consuming feature modules. Its fixed session map is a teaching adapter, not production authentication. The existing wallet example remains a healthy smaller design; neither requires a repository wrapper for every model.

Prove the right boundary

  • Unit checks prove policy with controlled collaborators.
  • A real Nest container proves constructor injection and imports/exports. A global lookup alone does not prove that a consuming module can inject a provider.
  • A shared behavioral suite proves each adapter's stated inputs, outputs, absence/error categories and effects. The inventory suite rejects a type-compatible adapter that returns mutable storage aliases.
  • HTTP checks prove the chosen transport's parsing, status and response projection. They do not prove another transport.
  • Network consumer/provider contracts become useful when independently deployed consumers evolve at different times; they are optional for ordinary local modules.

Keep a healthy case beside the deliberate failure. Here, the shared token resolves; a newly created same-description Symbol does not. A public verification operation resolves; injection of the private session store from another module fails.

Business interactions and dependency graphs

Separate business interactions, TypeScript imports, Nest module imports and provider dependencies. A port changes source coupling only when its ownership and binding change the actual edges. It does not automatically remove A → B → A module imports.

If identity disabling must revoke sessions, a real account-lifecycle workflow can depend on both owners instead of adding a reverse identity-to-auth import. Specify atomicity or durable reconciliation before replacing a synchronous operation with events. A successful boot with forward references is not proof of an acyclic graph.

See module-boundaries.md, dependency-injection.md and architecture-review.md. Preserve simple cohesive CRUD and the project's supported conventions.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts3d3 checks · Risk SAFE
  • Gen Agent Trust Hub4d

    This skill provides architectural principles, design patterns, and review guidelines for NestJS applications. It focuses on modularity, dependency inversion, and pragmatic engineering. No security issues or malicious patterns were detected.

  • Socket3d

    No alerts

  • Snyk4d

    Risk: LOW · No issues

Signed by skilld at 8272374. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 4 days ago.

Activeupdated 5 days ago
metadata
{
  "author": "amirtaherkhani",
  "version": "1.2.1"
}

README badge

README badge for amirtaherkhani/nestjs-skills/nestjs-architecture-principles