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

@kensio/part-factory-test-data

v1.15.0

Published

How to build typed test data with @kensio/part-factory factories.

Readme

@kensio/part-factory-test-data

An agent skill for building test data with Part Factory (@kensio/part-factory), a small typed object factory library.

The package README is the authority on the API. This skill covers which factory to reach for, when a mapped factory earns its place, and where factories should live.

Install

Into any agent that reads SKILL.md:

npx @kensio/skills add part-factory-test-data

That copies the skill directory into .agents/skills/, where Codex, Cursor, Copilot, Gemini CLI and the other implementations of the specification look for one. Pass --agent claude for .claude/skills/, --agent copilot for .github/skills/, and --user to install it for every project at once.

Claude Code also takes it as a plugin:

claude plugin marketplace add KensioSoftware/kensio.ai
claude plugin install part-factory-test-data@kensio

Or pin it in a repository as a dependency:

npm install @kensio/part-factory-test-data

Every skill is also published as a zip on each release, for a machine with no npm reach. Unzip it into .agents/skills/ and it is installed.

What it covers

Which factory to reach for. StaticFactory for fixed defaults. DynamicFactory when the defaults have to be generated fresh, paired with faker, which is what gives tests their isolation. VariantFactory for a named variation of a base factory, when the variation is worth a name in the test. MappedFactory when the output shape differs from the parts you want to override.

When a mapped factory earns its place. The map should be a real transformation, such as parts to an encoded form body, or front matter parts to a file as written on disk. If the map is copying fields across into an object of the same shape, you wanted a DynamicFactory.

Call the factory directly. make(overrides) already is that function, and it does the job better, since its overrides are partial all the way down the nested structure where a spread replaces a nested object whole. A wrapper doing more than passing overrides through is a signal that the factory is the wrong shape, or that the output type is fighting you.

Factories belong beside the type they construct. A library defining an event or message shape should export a factory for it, so consumers never hand-roll the literal. The example the skill works through is an AWS Lambda function URL invocation event in payload format 2.0: around thirty lines of which two matter to any test. Hand-writing it in three files gives three copies that drift, and it carries a trap, because the path is in the event twice, as rawPath and as requestContext.http.path. A test that sets one and not the other passes against a handler reading the field the test set, and fails in production against the same handler reading the other one. A MappedFactory sets it once.

Related skills

Part of kensio.ai. Licensed under the Apache License 2.0. See the LICENSE in the repository root.