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

docs-to-ai-rules

v0.2.4

Published

A tool for generating rules files for AI agents from Markdown documents

Readme

docs-to-ai-rules

A tool for generating rule files for AI agents from Markdown documents.

Installation

npm install docs-to-ai-rules

Or

npm install -g docs-to-ai-rules

Usage

Command Line

docs-to-ai-rules [options]

Options

| Option | Short | Description | Default | |------------|-------|-------------|---------| | --source | -s | Source directory | docs/rules | | --services | | Output services (comma-separated) | cursor | | --exclude | -x | Files to exclude (comma-separated) | README.md | | --dry-run | -d | Check for updates without modifying files | false | | --sync | | Format output directories and sync files completely | false |

Supported Services

  • cursor - Rule files for Cursor (output to .cursor/rules with .mdc extension)
  • cline - Rule files for Cline (output to .cline/rules with .md extension)

Examples

# Run with default settings (output to Cursor only)
docs-to-ai-rules

# Specify a custom source directory
docs-to-ai-rules --source my-docs/rules

# Output to multiple services
docs-to-ai-rules --services cursor,cline

# Exclude multiple files
docs-to-ai-rules --exclude "README.md,CHANGELOG.md"

# Check which files need updates without modifying them
docs-to-ai-rules --dry-run

# Format and completely sync source with target directories
docs-to-ai-rules --sync

How It Works

This tool processes Markdown files in the doc/rules directory (or the specified source directory) and generates rule files for AI agents. The generated files are saved in the directories of the specified services.

  • For Cursor: ./.cursor/rules with .mdc extension
  • For Cline: ./.cline/rules with .md extension

If multiple services are specified, files will be generated in each service's directory with the appropriate file extension for that service.

Dry Run Mode

When the --dry-run option is used, the tool will check for files that need updates but won't make any changes. This is useful to see which files would be updated before actually modifying them.

In dry run mode:

  • No directories will be created
  • No files will be copied or modified
  • The tool will display which files need updates

Sync Mode

When the --sync option is used, the tool will:

  1. Clear the output directories (format) before copying files
  2. Delete files in the output directories that don't exist in the source directory
  3. Ensure complete synchronization between source and destination

This is useful when you want to make sure your output directories exactly match the source directory, without any stale or outdated files.

In sync mode:

  • Output directories are formatted (all contents removed)
  • Files are copied from source to destination
  • Files in the destination that don't exist in the source are deleted
  • The tool will display a summary of added, updated, and deleted files

Sync mode can be combined with dry run mode to see what changes would be made without actually performing them:

docs-to-ai-rules --sync --dry-run

Adding Custom Services

To add a new service, create a new service class in the src/services directory and register it with the ServiceManager.

Development

Testing

The project includes unit and integration tests. To run them:

# Run all tests
npm test

# Run only unit tests
npm run test:unit

# Run only integration tests
npm run test:int

# Run tests in watch mode
npm run test:watch

CI/CD

This project uses GitHub Actions for continuous integration. The workflow automatically runs tests on push to the main branch and on pull requests.

You can see the current CI status in the GitHub repository.