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

scenarioseed

v0.1.0

Published

Generate scenario-first seed data from your Prisma schema.

Readme

ScenarioSeed

CI

Scenario-first seed data for product teams.

Most seed tools answer: "Can I generate 100 realistic rows for this schema?"

ScenarioSeed answers: "Can I open the app and immediately see the states that break real product logic?"

It reads a Prisma schema and generates named business scenarios such as:

  • trial_expiring
  • past_due_enterprise
  • usage_over_quota
  • payment_failed
  • refunded_order
  • delayed_shipment

Each scenario includes related records, stable IDs, foreign keys, enums, dates, JSON metadata, a Prisma seed file, and a scenario brief.

Why This Exists

Fake data is easy. Useful fake businesses are hard.

Faker-style tools create plausible fields. Schema seeders create rows that fit the database. ScenarioSeed creates coherent product states that a developer, designer, QA engineer, or AI coding agent can use to test actual workflows.

That makes it useful for:

  • testing billing, quota, lifecycle, checkout, fulfillment, and moderation states
  • demoing edge cases without hand-writing fixtures
  • giving AI coding agents a reproducible local world to debug against
  • replacing "seed some users" with "seed the states our product actually needs"

Quick Start

Run directly from GitHub:

npx --yes github:Oxygen56/scenarioseed generate prisma/schema.prisma \
  --scenario "SaaS billing edge cases" \
  --out ./scenarioseed

After the npm package is published, the shorter command is:

npx scenarioseed generate prisma/schema.prisma \
  --scenario "SaaS billing edge cases" \
  --out ./scenarioseed

Generated files:

scenarioseed/
  SCENARIOS.md
  scenario-pack.json
  seed.scenario.ts

Run the generated Prisma seed:

npx tsx scenarioseed/seed.scenario.ts

Inspect a schema first:

npx scenarioseed inspect prisma/schema.prisma

Try the included examples:

npm run dev -- generate examples/saas/schema.prisma \
  --scenario "SaaS billing edge cases" \
  --out examples/saas/generated

npm run dev -- generate examples/commerce/schema.prisma \
  --scenario "commerce fulfillment failures" \
  --out examples/commerce/generated

CLI

scenarioseed inspect <schema.prisma>
scenarioseed generate <schema.prisma> [options]

Options:

--scenario <text>       Business focus, for example "SaaS billing edge cases"
--domain <domain>       auto, saas, commerce, content, generic
--format <format>       both, json, prisma
--out <dir>             Output directory
--max-scenarios <n>     Number of scenario states to generate

Example

Given a SaaS billing schema with Organization, Member, Subscription, Invoice, and UsageEvent, ScenarioSeed generates states like:

| Scenario | What It Gives You | | --- | --- | | trial_expiring | trial subscription, near-term trial end date, owner member, open invoice | | past_due_enterprise | enterprise account, past-due invoice, blocked expansion state | | usage_over_quota | active account with usage above quota | | canceled_winback | canceled subscription with cancellation metadata |

The generated Prisma seed uses deterministic IDs and relation-aware inserts:

await prisma.organization.upsert({
  where: { id: "organiza_00abc123def4" },
  update: {},
  create: {
    id: "organiza_00abc123def4",
    name: "Past-Due Enterprise Organization",
    slug: "past-due-enterprise-organization",
    planName: "enterprise",
    seatLimit: 75,
    usageLimit: 1000
  }
});

Positioning

ScenarioSeed is not trying to replace broad fake-data libraries or schema seeders.

| Tool Category | Typical Output | ScenarioSeed Difference | | --- | --- | --- | | Faker libraries | fake names, emails, addresses | business-state fixtures | | schema seeders | rows that satisfy schema constraints | named scenarios that test product logic | | AI seed prompts | realistic-looking table data | deterministic, reviewable, relation-aware scenario packs | | handwritten fixtures | accurate but slow to maintain | generated from schema with stable conventions |

Current Support

  • Prisma schema parsing
  • scalar fields, enums, defaults, optional fields
  • relation-aware foreign key generation
  • SaaS, commerce, content, and generic domains
  • JSON scenario pack output
  • Prisma seed TypeScript output
  • deterministic generation for stable diffs

Library API

import {
  generateScenarioPack,
  parsePrismaSchema,
  renderPrismaSeed
} from "scenarioseed";

const schema = parsePrismaSchema(schemaSource);
const pack = generateScenarioPack(schema, {
  schemaPath: "prisma/schema.prisma",
  requestedScenario: "SaaS billing edge cases"
});

const seed = renderPrismaSeed(pack, schema);

Roadmap

  • Drizzle, SQL, and Rails schema adapters
  • custom scenario DSL
  • optional LLM enrichment for domain-specific stories and field semantics
  • Playwright fixture export
  • Supabase seed export
  • seed validation against a live database
  • VS Code and Codex/Claude Code integration

Development

npm install
npm test
npm run build
npm run dev -- generate examples/saas/schema.prisma --out tmp/saas

License

MIT