Local Usage Guide

Get Started with vibe-rules

Learn how to use vibe-rules to manage AI prompts and rules in your local development environment.

Installation

Install vibe-rules globally using your preferred package manager:

# Using Bun (recommended)
bun i -g vibe-rules
# Using npm
npm install -g vibe-rules
# Using yarn
yarn global add vibe-rules

Basic Commands

Save a Rule

Store a rule for later use in the common vibe-rules store.

# Save from a file
vibe-rules save my-rule-name -f ./path/to/rule-content.md
# Save directly from content string
vibe-rules save another-rule -c "This is the rule content."
# Add a description
vibe-rules save my-rule-name -d "A concise description of what this rule does."

Options:
-f, --file <file>: Path to the file containing the rule content
-c, --content <content>: Rule content provided as a string
-d, --description <desc>: Optional description for the rule

List Saved Rules

See all the rules you've saved to the common local store.

vibe-rules list

Load (Apply) a Rule

Apply a rule from your local store to a specific editor's configuration.

# Load for Cursor
vibe-rules load my-rule-name cursor
# Load for Claude Code globally
vibe-rules load my-rule-name claude-code --global
# Load for Windsurf
vibe-rules load my-rule-name windsurf
# Load to custom target path
vibe-rules load my-rule-name cursor -t ./my-project/.cursor-rules/

Options:
-g, --global: Apply to the editor's global configuration path
-t, --target <path>: Specify a custom target file path or directory

Install Rules from NPM Packages

Install rules directly from NPM packages into an editor's configuration. This automatically scans your project's dependencies for compatible rule exports.

# Install rules from ALL dependencies for Cursor
vibe-rules install cursor
# Install rules from a specific package
vibe-rules install cursor my-rule-package
# Install with debug logging
vibe-rules install cursor --debug
# Install to custom target directory
vibe-rules install roo my-rule-package -t ./custom-ruleset/

How it works:
1. Looks for NPM packages with llms exports
2. Imports the llms module from each package
3. Applies the rules to your editor's configuration with proper formatting

Supported Editors & Formats

Cursor

Creates/updates individual .mdc files in ./.cursor/rules/

cursor

Windsurf

Appends rules to ./.windsurfrules with tagged blocks

windsurf

Claude Code

Updates ./CLAUDE.md (local) or ~/.claude/CLAUDE.md (global)

claude-code

VS Code

Creates .instructions.md files in ./.github/instructions/

vscode

Zed

Manages rules within ./.rules file

zed

Cline/Roo

Creates .md files in ./.clinerules/ directory

clinerulesorroo

Example Workflow

Complete Example: React Development Rules

# 1. Save a React-specific rule
vibe-rules save react-best-practices -f ./prompts/react-rules.md -d "React development best practices"
# 2. Apply it to multiple editors
vibe-rules load react-best-practices cursor
vibe-rules load react-best-practices windsurf
vibe-rules load react-best-practices claude-code
# 3. List all your saved rules
vibe-rules list
# 4. Install additional rules from NPM packages
vibe-rules install cursor my-react-library
# 5. Apply to global configuration
vibe-rules load react-best-practices claude-code --global

This workflow creates a reusable React rule that can be applied across different editors and projects, while also pulling in additional rules from NPM packages.

Tips & Best Practices

Organize Your Rules

Use descriptive names and descriptions for your rules to make them easy to find and understand later.

Use Debug Mode

Add --debug to any command to see detailed logging and troubleshoot issues.

Metadata Support

When saving from .mdc files, vibe-rules automatically extracts metadata like alwaysApply and globs.