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 🙏

© 2025 – Pkg Stats / Ryan Hefner

rules-gen

v0.3.6

Published

An interactive CLI tool that generates cursor and windsurf rules based on user selections

Readme

image

Rules Generator CLI

An interactive CLI tool that generates cursor and windsurf rules based on user selections.

Features

  • Interactive prompts for selecting rule types and specific rules
  • Smart tech stack detection and rule matching
  • Support for multiple rule selection in a single operation
  • Generate for multiple IDE types simultaneously (Cursor/Windsurf)
  • Smart filename generation with URL-friendly slugs
  • Non-interactive mode for CI/CD or scripting
  • Modern, user-friendly terminal UI with validation
  • Proper error handling and user feedback
  • Intelligent file size management with graceful truncation
  • Streamlined file conflict resolution

Installation

Using npx

Recommended - the rulelist gets updated daily

npx rules-gen

Global Installation

npm install -g rules-gen

Usage

Interactive Mode

Simply run the CLI without arguments to use the interactive mode:

npx rules-gen

The interactive mode now supports:

  • Multiple rule selection using checkboxes
  • Multiple IDE type selection (Cursor/Windsurf/both)
  • Smart tech stack detection for better rule matching
  • Intelligent file handling:
    • Preview existing rules with rule count
    • Options to overwrite or append rules
    • Automatic size limit handling (100KB)
  • Smart validation to ensure valid selections
  • Clear breadcrumb navigation
  • Improved search functionality

Non-Interactive Mode

Use command-line arguments to generate rules without prompts:

# Generate specific cursor rules
npx rules-gen --type cursor --rules basic,hover --interactive false

# Generate all windsurf rules
npx rules-gen --type windsurf --interactive false

# Generate both cursor and windsurf rules
npx rules-gen --type all --interactive false

# Force overwrite existing files (skips conflict prompts)
npx rules-gen --type cursor --rules basic,hover --force

# Combine multiple options
npx rules-gen --type all --rules basic,react,node --force --interactive false

Options:

  • --type, -t: Rule type (cursor, windsurf, or all)
  • --rules, -r: Specific rules to generate (comma-separated)
  • --interactive, -i: Use interactive prompts (true/false, defaults to true)
  • --force, -f: Force overwrite existing files without prompting

How It Works

The CLI generates IDE-specific rule files based on your selections:

  • Cursor rules are generated as .mdc files in the .cursor/rules/ directory
  • Windsurf rules are generated as .windsurfrules files in markdown format
  • File names are automatically generated as URL-friendly slugs
  • Multiple rules can be generated simultaneously
  • Both IDE types can be generated in a single operation
  • Smart tech stack detection for better rule matching
  • Automatic size limit handling (100KB) with graceful truncation

File Handling

The CLI includes intelligent file handling features:

  • Detects existing rule files and offers options to:
    • Overwrite existing rules
    • Append to existing rules
    • Cancel operation
  • Shows condensed file previews for better decision making
  • Handles large rule sets gracefully:
    • 100KB file size limit
    • Smart truncation with informative notes
    • Preserves existing content when near size limit

Contributing

We're actively looking for additional rule sources! If you have a collection of rules or know of good sources, please:

  1. Fork the repository
  2. Add your rule source to data/sources.json
  3. Create a pull request

Special thanks to awesome-cursorrules by PatrickJS for providing the initial rule set.

Development

Prerequisites

  • Node.js 18 or higher

Setup

  1. Clone the repository:

    git clone https://github.com/blencorp/rules-gen.git
    cd rules-gen
  2. Install dependencies:

    npm install
  3. Run locally:

    node bin/index.js

License

MIT

Sponsorship

This project was sponsored by BLEN, a digital services company that provides Emerging Technology (ML/AI, RPA), Digital Modernization (moving legacy systems to Cloud) and Human-Centered Web/Mobile Design and Development. For questions, please contact [email protected].

Team