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

onlyrules

v0.0.36

Published

A CLI tool to easily sync all of your favorite AI assistant instruction files from a single source. Inspired by [rulesync](https://github.com/jpcaparas/rulesync).

Readme

OnlyRules

A CLI tool to easily sync all of your favorite AI assistant instruction files from a single source. Inspired by rulesync.

Features

  • Generate rule files for multiple AI assistants from a single source
  • Support for both URL and local file sources
  • Built-in templates to help you get started
  • Multi-step rule generation process
  • Written in TypeScript with Bun for optimal performance

Supported AI Assistants

  • Claude → CLAUDE.md
  • Cursor → .cursorrules
  • GitHub Copilot → .github/copilot-instructions.md
  • Gemini → GEMINI.md
  • OpenAI Codex → AGENTS.md
  • Cline → .clinerules/project.md
  • Junie → .junie/guidelines.md
  • Windsurf → .windsurfrules
  • Trae → .trae/rules.md
  • Lingma → .lingma/rules
  • Kiro → .kiro/steering
  • Tencent Cloud CodeBuddy → .codebuddy/rules/{name}.md

Installation

Prerequisites

  • Bun 1.0.0 or higher
  • Node.js 18.0.0 or higher

Global Installation

bun install -g onlyrules

Local Installation

bun install onlyrules

Getting Started

The quickest way to get started with OnlyRules is to initialize a new project:

npx rulesync init

This will create a basic configuration and template files in your current directory. After initialization, you can:

  1. Edit the generated rule template files in the .augment/rules directory
  2. Generate AI assistant-specific rule files using the generate command
  3. Customize your setup using the available templates

For more advanced usage, see the sections below.

Usage

Generate Rule Files

From a local file:

onlyrules generate -f ./rules.md

From a URL:

onlyrules generate -f "https://onlyrules.codes/api/rules/raw?id=cmd9nww9z0007l5040oegtmb1"

Specify an output directory:

onlyrules generate -f ./rules.md -o ./output

Force overwrite existing files:

onlyrules generate -f ./rules.md --force

Generate rules for specific AI assistants only:

onlyrules generate -f ./rules.md --target cursor,windsurf
onlyrules generate -f ./rules.md --target kiro,cursor,codebuddy

Available targets include: cursor, copilot, cline, claude, gemini, roo, kiro, codebuddy, windsurf, agents, junie, trae, augment, lingma

Add rules to the rulesync.mdc

onlyrules add -f ./rules-new.mdc

The add command appends new rules to the rulesync.mdc file. When appending:

  • New rules are automatically separated from existing content with a section divider (---)
  • Supports both local files and remote URLs as source
  • Creates rulesync.mdc if it doesn't exist
  • Preserves existing content while adding new rules

Options:

  • -f, --file <path>: Source file or URL containing rules to append (required)
  • -o, --output <path>: Target file to append to (default: ./rulesync.mdc)

Examples:

# Append from local file
onlyrules add -f ./new-rules.mdc

# Append from remote URL
onlyrules add -f https://example.com/rules.mdc

# Append to custom target file
onlyrules add -f ./rules.mdc -o ./custom-rules.mdc

Working with Templates

List available templates:

onlyrules templates

View a specific template:

onlyrules template basic

Create a new rules file from a template:

onlyrules init development -o ./my-rules.md

Templates

OnlyRules comes with several built-in templates to help you get started:

  • basic: Simple rules for general AI assistant behavior
  • development: Rules focused on software development practices
  • multi-step: A structured approach to creating comprehensive rules

Kiro AI Support

OnlyRules now supports Kiro AI's steering file system. Kiro uses markdown files in .kiro/steering/ to provide persistent project knowledge.

Kiro Steering Features

  • Automatic Inclusion Modes: Files can be configured to load always, conditionally based on file patterns, or manually
  • Default Steering Files: Automatically maps common rules to Kiro's default files (product.md, tech.md, structure.md)
  • Smart File Pattern Detection: Automatically configures file patterns for component, API, and test-specific rules

Kiro Example

Use the Kiro example template to get started:

onlyrules init kiro-example

This creates a comprehensive set of steering files demonstrating:

  • Always-included core project documentation
  • File-pattern-based rules for components and APIs
  • Manual inclusion for specialized guidelines

Kiro Inclusion Modes

When generating rules for Kiro, OnlyRules automatically configures appropriate inclusion modes:

  1. Always (default for root rules): Loaded in every Kiro interaction
  2. FileMatch: Automatically included when working with matching files
  3. Manual: Available on-demand by referencing with #steering-file-name

Development

Setup

# Clone the repository
git clone https://github.com/yourusername/onlyrules.git
cd onlyrules

# Install dependencies
bun install

# Build the project
bun run build

# Run tests
bun run test

Testing

This project uses Vitest for testing and follows Test-Driven Development (TDD) principles:

# Run tests once
bun run test

# Run tests in watch mode
bun run test:watch

# Run tests with coverage
bun run test:coverage

Linting and Formatting

This project uses Biome for linting and formatting:

# Format code
bun run format

# Lint code
bun run lint

# Fix linting issues
bun run lint:fix

License

MIT