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

@keel_flow/pack-backend-design

v0.4.1

Published

Backend design principles for Keel projects — the API reuse ladder, contract-first routes, migration safety, timeouts and authz, checked against Python and SQL

Downloads

232

Readme

@keel_flow/pack-backend-design

Backend design principles for Keel projects: the API reuse ladder (reuse, then extend, then new), contract-first routes, migration safety, timeouts, authorization and configuration — checked against Python and SQL by keel verify.

Part of the Keel framework.

What was built

Nineteen principles, composed in src/index.ts as backendDesignPack (also the default export). Python is read through @keel_flow/py-ast; SQL migrations are read as regex over text whose comments, strings and dollar-quoted bodies have been blanked length-preservingly, so a reported line number still names the line you open.

The ladder and the contract

| id | severity | | --- | --- | | api-reuse-before-new | critical | | contract-before-handler | critical | | no-breaking-contract-change | critical |

API shape

| id | severity | | --- | --- | | api-models-not-orm | critical | | input-models-forbid-extra | critical | | collections-paginated | critical | | problem-details-errors | warning |

Failure behaviour

| id | severity | | --- | --- | | no-blind-except | critical | | outbound-calls-have-timeouts | critical | | bounded-retries-at-one-layer | warning | | no-blocking-in-async | warning | | long-work-async | critical | | mutations-idempotent | warning |

Data

| id | severity | | --- | --- | | migrations-expand-contract | critical | | migrations-lock-safe | critical | | no-query-in-loop | warning |

Security and configuration

| id | severity | | --- | --- | | routes-auth-by-default | critical | | authz-per-object | critical | | config-typed-fail-fast | warning |

Paths under a __fixtures__ or fixtures directory are out of scope for every check: deliberately wrong sample code is a test's input, not a defect to block on.

Every check reads the optional .keel/backend.json through loadBackendConfig, and a check whose configuration is absent returns no violations — an unconfigured project, or one with no Python at all, is never blocked by this pack. Checks honour # keel-ignore-file: <id> and # keel-ignore-next-line: <id>, skip removed files, and return no violations rather than throwing on a missing file, unparsable Python or malformed JSON.

The package also exports the api-stub reader (parseApiStubs, stubMatchesRoute) and the config loader that keel api inventory and keel api match are built on, so the block a design document carries and the block the gate reads are parsed by one implementation.

The design record is docs/design/backend-design-pack.md, which lists the checks' known limits.

License

MIT

.keel/backend.json may also carry "root" — a path, or a list of candidate paths, to a project checked out somewhere other than the directory holding the config. keel api reads the OpenAPI document and the front-end clients from there (resolveSourceRoot), which is how a coordination repository inventories a product it may not write into. The checks above ignore it: they judge the diff of the repository keel verify runs in.