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

tkhrn-ruler

v0.2.0

Published

Frontend common ruleset CLI for AI agents using Ruler

Downloads

404

Readme

Frontend Common Ruleset

Centralized AI agent instructions for frontend development projects using Ruler.

Quick Start

# Initialize in your project
npx tkhrn-ruler init

# Apply rules to all agents
npx tkhrn-ruler apply

That's it! Your project now has AI agent rules configured.


Installation

Using CLI (Recommended)

# Initialize ruleset in current project
npx tkhrn-ruler init

# Options
npx tkhrn-ruler init --skip-env        # Skip .env.mcp.example setup
npx tkhrn-ruler init --skip-gitignore  # Skip .gitignore modification

Manual Installation

# Copy .ruler directory
npx degit ginameee/tkhrn-ruler/.ruler .ruler

# Copy environment template
npx degit ginameee/tkhrn-ruler/.env.mcp.example .env.mcp.example

# Update .gitignore
echo -e "\n# Agent Handover Context\n.handover/\n\n# MCP tokens\n.env.mcp.local" >> .gitignore

Usage

All ruler commands are available through tkhrn-ruler:

# Apply rules to all configured agents
npx tkhrn-ruler apply

# Apply to specific agents
npx tkhrn-ruler apply --agents cursor,claude

# Apply with nested rule discovery
npx tkhrn-ruler apply --nested

# Preview changes without applying
npx tkhrn-ruler apply --dry-run

# Verbose output
npx tkhrn-ruler apply --verbose

# Revert changes
npx tkhrn-ruler revert

Configure MCP Tokens

# Create local config from template
cp .env.mcp.example .env.mcp.local

# Edit and add your tokens
vim .env.mcp.local

Project Structure

After initialization:

your-project/
├── .ruler/
│   ├── AGENTS.md          # Project overview
│   ├── code-quality.md    # Code quality principles
│   ├── atomic-design.md   # Atomic Design pattern
│   ├── handover.md        # Agent handover protocol
│   └── ruler.toml         # Ruler configuration
├── .handover/             # Handover context (gitignored)
├── .env.mcp.example       # MCP token template
├── .env.mcp.local         # Your MCP tokens (gitignored)
└── .gitignore

Rule Files

| File | Description | |------|-------------| | AGENTS.md | Project overview and configuration | | code-quality.md | 4 principles: Readability, Predictability, Cohesion, Coupling | | atomic-design.md | Atomic Design pattern & boilerplate structure | | handover.md | Cross-agent context transfer protocol |

Configured Agents

| Agent | Output File | |--------|---------------------------| | Cursor | .cursor/rules/rules.mdc | | Claude | CLAUDE.md | | Codex | codex.md |

MCP Servers

| Server | Purpose | |---------------------|----------------------------------| | figma | Design token extraction | | notion | Documentation access | | playwright | Browser automation & E2E testing | | sequential-thinking | Complex reasoning & analysis | | context7 | Library documentation lookup |


Nested Rules

Sub-projects can extend these rules by creating their own .ruler/ directory:

packages/design-system/.ruler/
├── AGENTS.md           # Design system specific rules
└── component-api.md    # Component API guidelines

packages/admin-app/.ruler/
├── AGENTS.md           # Admin app specific rules
└── security.md         # Security guidelines

Apply with nested discovery:

npx tkhrn-ruler apply --nested

Core Principles

This ruleset enforces four fundamental frontend code quality principles:

  1. Readability - Code should be easy to understand at a glance
  2. Predictability - Code should behave consistently and unsurprisingly
  3. Cohesion - Related code should stay together
  4. Low Coupling - Minimize dependencies between components

See .ruler/code-quality.md for detailed guidelines and examples.


Customization

Adding Custom Rules

Create additional .md files in .ruler/:

# Add TypeScript-specific rules
echo "# TypeScript Rules" > .ruler/typescript.md

# Add testing conventions
echo "# Testing Rules" > .ruler/testing.md

Files are concatenated alphabetically after AGENTS.md.

Modifying Agent Configuration

Edit .ruler/ruler.toml to:

  • Enable/disable specific agents
  • Change output paths
  • Add/remove MCP servers
  • Configure merge strategies

Links