npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@llodev/ts-ddd-controller

v0.1.0

Published

HTTP controllers in a TypeScript + DDD API — routes, guards, Zod validation, use-case orchestration, Result→HTTP mapping.

Readme

@llodev/ts-ddd-controller

HTTP controllers in a TypeScript + DDD API — routes, guards, Zod validation, use-case orchestration, and Result→HTTP mapping, with the NEVER list that keeps controllers thin.

npm License: MIT Node.js >= 20 Agent Skills spec

Part of the @llodev/ts-ddd family.

What you get:

  • A thin-translator contract — controllers validate at the boundary, inject use cases, and map Result → HTTP with mapResultToHttp; no business logic, no domain conditionals, no repository calls in a handler.
  • Guard placement rules — per-method @UseGuards(ApiKeyGuard) on mutations, never at the class level, so public reads and guarded writes can coexist on the same controller.
  • A NestJS 11 reference layer — DI symbol tokens, @Inject(SYMBOL), @Global() modules, Zod-validated ConfigModule.forRoot, and the @nestjs/testing + supertest test bed actually used in production code.
  • Response-mapper discipline — signed-URL enrichment, date serialization, and tagged-union variants funnel through a dedicated mapper instead of leaking entity internals.
  • A NEVER list grounded in real failure modes: class-level guards that 401 public reads, inline HttpException throws that fork the error-code catalog, new UseCase(...) that breaks DI and tests.

Install

# npm (with skillpm or Claude Code marketplace)
npm i @llodev/ts-ddd-controller

# Vercel CLI
npx skills add llodev/skills/skills/ts-ddd-controller

No MCP, no config, no init — it's a pure knowledge skill. Once installed it activates on prompts like the ones below.

Use

| Prompt example | What the agent does | | --------------------------------------------------- | ------------------------------------------------------------------------------------ | | "add a POST /celebrations/:slug/publish endpoint" | Emits a controller method with ApiKeyGuard, ZodValidationPipe, mapResultToHttp | | "why is this write endpoint returning 401?" | Checks guard placement (class-level vs per-method) against the NEVER list | | "review this controller" | Checks for business logic leakage, new UseCase(), raw HttpException throws | | "wire this controller's response for signed URLs" | Routes entity → response through a dedicated response mapper |

Contents

| File | Content | | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | | SKILL.md | Trigger conditions, folder layout, before-you-start checklist, core rules, and NEVER list for controllers. | | references/controller-pattern.md | Repo-grounded: folder layout, ZodValidationPipe, ApiKeyGuard semantics, mapResultToHttp, response mapper, test strategy. | | references/nestjs.md | NestJS 11 patterns: DI symbol tokens, @Inject(SYMBOL), @Global() modules, Zod-validated ConfigModule.forRoot, test bed. | | examples/product.controller.nestjs.ts | Runnable-style mirror of a production controller, showing guard placement and Result → HTTP mapping. |

License

MIT — see LICENSE.