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

rulix

v0.2.0

Published

One ruleset. Every AI coding tool.

Readme


Rulix is a CLI tool and TypeScript library that gives you a single source of truth for AI coding rules across Cursor, Claude Code, AGENTS.md, and more.

Write your rules once. Rulix generates optimized configs for each tool — handling format differences, scoping semantics, and token budgets automatically.

Why Rulix?

Every AI coding tool has its own rules format:

| Tool | Format | Location | |---|---|---| | Cursor | .mdc with YAML frontmatter | .cursor/rules/ | | Claude Code | Markdown with optional frontmatter | .claude/rules/ | | AGENTS.md | Plain markdown | AGENTS.md | | Windsurf | Markdown | .windsurf/rules/ | | Copilot | Markdown | .github/copilot-instructions.md |

If you use more than one tool, you're maintaining duplicate rules that drift apart. Rulix solves this:

.rulix/rules/              .cursor/rules/*.mdc
  ├── typescript.md    →   .claude/rules/*.md
  ├── testing.md       →   AGENTS.md
  └── security.md      →   (more targets coming)

Installation

# npm
npm install -D rulix

# pnpm
pnpm add -D rulix

# yarn
yarn add -D rulix

# bun
bun add -D rulix

Or run directly with npx:

npx rulix init

Requirements: Node.js 22 or higher.

Quick Start

1. Initialize your project

npx rulix init

This creates a .rulix/ directory with a config.json and a rules/ folder.

2. Import existing rules (optional)

Already have rules in Cursor or Claude Code? Import them:

npx rulix import --from cursor
npx rulix import --from claude-code

3. Write a rule

Create .rulix/rules/typescript-strict.md:

---
id: typescript-strict
scope: always
description: "Enforce strict TypeScript conventions"
category: style
priority: 1
---

# TypeScript Conventions

- Use `strict: true` in tsconfig
- Never use `any` — prefer `unknown` with type narrowing
- Use explicit return types on public functions
- Prefer `interface` over `type` for object shapes

4. Sync to your tools

npx rulix sync

This generates tool-specific configs for every target in your config.json.

5. Validate your rules

npx rulix validate

Catches duplicates, vague descriptions, missing fields, and token budget issues.

6. Check status

npx rulix status

Shows rule count, token budget usage per tool, and configured targets.

Rule Format

Rules live in .rulix/rules/*.md as Markdown with YAML frontmatter:

| Field | Type | Required | Description | |---|---|---|---| | id | string | Yes | Unique kebab-case identifier | | scope | "always" \| "file-scoped" \| "agent-selected" | Yes | When the rule applies | | description | string | Yes | What the rule does (used by AI for selection) | | category | "style" \| "security" \| "testing" \| "architecture" \| "workflow" \| "general" | No | Rule category (defaults to "general") | | priority | 1-5 | No | 1 = critical, 5 = nice-to-have (defaults to 3) | | globs | string[] | If file-scoped | File patterns this rule applies to |

Scopes explained:

  • always — Applied to every AI request. Use for project-wide conventions.
  • file-scoped — Applied only when matching files are open. Requires globs.
  • agent-selected — The AI decides when to apply this rule based on its description.

See Writing Rules for detailed examples and best practices.

Key Features

  • Import existing rules from Cursor or Claude Code
  • Export to Cursor, Claude Code, and AGENTS.md (more targets coming)
  • Validate rules for duplicates, conflicts, and vague content
  • Token budgets — know when your rules exceed a tool's recommended limits
  • Zero LLM dependency — all validation is deterministic, works offline
  • Programmatic API — use Rulix as a library in your own tools
  • Zero config — sensible defaults, override only what you need

Supported Tools

| Tool | Import | Export | Status | |---|---|---|---| | Cursor | Yes | Yes | v0.1 | | Claude Code | Yes | Yes | v0.1 | | AGENTS.md | — | Yes | v0.1 | | Windsurf | — | — | Planned | | Copilot | — | — | Planned | | Codex | — | — | Planned |

Configuration

Rulix is configured via .rulix/config.json:

{
  "targets": ["cursor", "claude-code", "agents-md"],
  "presets": [],
  "overrides": {},
  "options": {
    "tokenEstimation": "heuristic",
    "agentsMdHeader": true,
    "syncOnSave": false
  }
}

See Configuration Reference for all options.

Programmatic API

Rulix can be used as a library in your own tools:

import { loadRuleset, exportRules, validateRuleset } from "rulix";

// Load rules from a project
const ruleset = await loadRuleset("./my-project");

// Validate
const result = validateRuleset(ruleset);
console.log(result.passed); // true if no errors

// Export to a specific tool
await exportRules("cursor", ruleset.rules, "./my-project");

See API Reference for the complete API.

Contributing

Contributions are welcome! The most impactful ways to help:

  1. New adapters — Add support for Windsurf, Copilot, Cline, etc.
  2. Validation rules — New checks for common rule issues
  3. Bug reports — Especially format edge cases

See CONTRIBUTING.md for setup and guidelines, and Writing an Adapter for the adapter guide.

Author

Daniel Chinome@danielcinome

License

MIT