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-repository

v0.1.0

Published

Repository ports + adapters — Firestore/InMemory pair, toFirestore/fromFirestore, DI token, contract tests.

Readme

@llodev/ts-ddd-repository

Repository ports + adapters — Firestore/InMemory pair, toFirestore/fromFirestore, DI token, and contract tests.

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

Part of the @llodev/ts-ddd family.

What you get:

  • A Repository vs Query decision table — load-to-mutate goes through a Repository returning a domain entity; read-for-display goes through a separate Query interface returning a DTO. Never mixed on the same interface.
  • The side-by-side adapter pattern — a Firestore adapter and an InMemory adapter behind the same port + DI token symbol, so use-case tests substitute the in-memory one without jest.fn() stubs.
  • Mapping disciplinetoFirestore/fromFirestore live in dedicated mapper files, never inlined in an operation method; firebase-admin/firestore.Timestamp never leaks past the mapper into the domain (Date only).
  • Aggregate-boundary rules — a single port owns writes to the whole aggregate; save() accepts a fully constructed, already-validated entity and never patches partial fields.
  • A NEVER list covering real Firestore footguns: reading snap.data() without checking snap.exists, sharing entity references across round-trips instead of toSnapshot()/tryCreate(structuredClone(...)), and wiring an adapter via useClass without the token symbol.

Install

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

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

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 ProductRepository port with findBySlug and save" | Emits the port interface, DI token symbol, and the InMemory + Firestore adapter pair | | "why does this list method leak Firestore Timestamp?" | Points to the mapper boundary rule — convert TimestampDate inside toFirestore/fromFirestore | | "should this be a Repository or a Query?" | Applies the Repository vs Query (CQRS) decision table | | "review this adapter for aggregate-boundary violations" | Checks that save() touches only one aggregate and receives a fully validated entity |

Contents

| File | Content | | ------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------- | | SKILL.md | Trigger conditions, file layout, Repository vs Query table, core rules, and NEVER list. | | references/repository-pattern.md | Port shape, DI token, InMemory adapter, dual-adapter test strategy, enums-in-fixtures rule, checklist. | | references/firestore-adapter.md | Firebase Admin SDK basics, subcollections, Timestamp conversions, fake-DB test harness, mapper helpers, aggregate-write caveats. | | examples/product.repository.ts | A repository port interface with intent-named methods and a DI token symbol. | | examples/in-memory-product.repository.ts | The InMemory adapter counterpart, used directly in use-case tests via the same DI token. |

License

MIT — see LICENSE.