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

inject-rule

v1.0.0

Published

CLI tool to inject Cursor .mdc rule files from a private GitHub repo into your project

Downloads

15

Readme

inject-rule

A CLI tool that injects pre-configured Cursor .mdc rule files into any backend project — with an interactive questionnaire that pre-fills the rule context so the Cursor agent skips straight to implementation.

  ╔═════════════════════════════════════════════╗
  ║                                             ║
  ║  ◈  inject-rule                   v1.0.0   ║
  ║     Cursor rule injector                    ║
  ║                                             ║
  ║  ✦  George Padmore Yeboah                   ║
  ║                                             ║
  ╚═════════════════════════════════════════════╝

What it does

  1. Presents an interactive questionnaire about your project setup
  2. Fetches the matching .mdc rule file from the rules repository
  3. Pre-fills the rule's Step 0 context block with your answers so the Cursor agent has full context from the start
  4. Writes the file to .cursor/rules/<rule>.mdc in your current working directory

Installation

npm install -g inject-rule

Requires Node.js 18 or later.


Usage

Interactive rule picker (recommended)

Run without arguments to browse and select one or more rules:

inject-rule

You will be shown a multi-select list of all available rules. Select any combination and the CLI walks you through the relevant questions for each.

Inject a specific rule directly

inject-rule rbac

List all available rules

inject-rule list
# shorthand:
inject-rule l

Help

inject-rule --help
inject-rule rbac --help

Available rules

| Rule | Description | |------|-------------| | rbac | Role-Based Access Control — sets up roles, permissions, guards, and seeding |


rbac question flow

When you run inject-rule rbac (or select rbac from the picker), you will be asked:

| # | Question | Options | |---|----------|---------| | 1 | Backend framework | NestJS, Elixir/Phoenix, Ruby Sinatra, Laravel | | 2 | Database | PostgreSQL, MySQL | | 3 | ID / primary-key type | bigserial/bigint, serial/int, UUID v4 | | 4 | Users table already exists? | Yes / No | | 4a | (if Yes) PK column name and type | Free text, e.g. id bigint | | 5 | Authentication strategy | JWT, Session, Other | | 6 | Migration strategy | SQL file only, Framework migration tool | | 7 | Route protection scope | All routes, Roles and permissions routes only | | 8 | Permissions to seed | Comma-separated, optional |

After answering, a summary is displayed for review. You can confirm to proceed or restart the questionnaire.

What gets written

The file .cursor/rules/rbac.mdc is created in your project with a pre-filled context block at the top:

## Step 0 — Context already provided

> The following context was collected via `inject-rule rbac` — skip straight to implementation.

- **Framework**: NestJS
- **Database**: PostgreSQL
- **ID type**: UUID v4
- **Users table exists**: Yes
- **PK column**: `id UUID`
- **Auth type**: JWT
- **Migration strategy**: SQL file only
- **Route protection**: All routes
- **Permissions to seed**: read:posts, write:posts, admin:users

Open the file in Cursor and the agent will read this context and skip straight to writing code.


No configuration required

inject-rule works out of the box — no tokens, no environment variables, no account needed. Just install and run.


Author

George Padmore Yeboah


License

MIT