Rulesify is a command-line tool (written in Rust) that provides unified management of AI assistant rules across multiple platforms. Create rules once in Universal Rule Format (URF), then deploy them everywhere.
- Cursor (
.cursor/rules/*.mdc— Markdown with YAML frontmatter) - Cline (
.clinerules/*.md— Simple Markdown files) - Claude Code (
<rule-name>.md— Markdown files in project root) - Goose (
<rule-name>.goosehints— Plain text files in project root)
File Generation Details:
- Generated tool files are automatically Git-ignored
- Only edit URF files (
.urf.yaml) - tool files are regenerated on deployment - Each tool has specific format requirements that are handled automatically
- Round-trip integrity: URF → tool file → URF maintains all information
- Rule Management: Create, edit, list, show, and delete rules
- Multi-Tool Deployment: Deploy rules to all supported AI tools
- Import Functionality: Import existing rules from any AI tool format
- Validation System: Comprehensive quality and format validation
- Template System: Create rules from built-in templates
- Configuration Management: Flexible storage and configuration options
- Sync: Synchronize deployed rules back to URF format
- Round-Trip Integrity: Import/export cycle is lossless and auto-validated
- Unicode Support: Handles international text
- Comprehensive Testing: 75 tests, 100% pass rate
Run this command to install the latest pre-built binary:
curl -sSL https://github.com/ihelio/rulesify/releases/latest/download/install.sh | bash- This script detects your OS/architecture, downloads the correct binary, installs it to
~/.local/bin, and adds it to yourPATHif needed. - After installation, restart your shell or run:
export PATH="$HOME/.local/bin:$PATH"
- Download the latest binary for your OS/arch from GitHub Releases.
- Move it to
~/.local/bin(create the directory if it doesn't exist):mkdir -p ~/.local/bin mv rulesify-<os>-<arch> ~/.local/bin/rulesify chmod +x ~/.local/bin/rulesify
- Add
~/.local/binto yourPATHif not already present.
# Create a new rule
rulesify rule new typescript-style
# Import existing rules from different tools
rulesify import --tool cursor .cursor/rules/my-rule.mdc
rulesify import --tool cline .clinerules/coding-standards.md
# Validate rules for quality and compliance
rulesify validate --all
rulesify validate typescript-style
# Deploy to all configured tools
rulesify deploy --all
# Deploy to specific tool
rulesify deploy --tool cursor --all
rulesify deploy --tool cline --rule typescript-style
# Sync deployed rules back to URF (preview first)
rulesify sync --dry-run
rulesify syncSync reads deployed tool files and updates URF files when changes are detected.
# Synchronize all deployed rules back to URF format
rulesify sync
# Preview changes without applying them
rulesify sync --dry-run
# Sync a single rule only
rulesify sync --rule typescript-style --dry-run
# Sync from a specific tool only
rulesify sync --tool cursorImport rules from different AI tools:
# Import from Cursor (YAML frontmatter + Markdown)
rulesify import --tool cursor .cursor/rules/python-style.mdc
# Import from Cline (Simple Markdown)
rulesify import --tool cline .clinerules/react-patterns.md
# Import from Claude Code (Markdown in project root)
rulesify import --tool claude-code python-style.md
# Import from Goose (Plain text hints)
rulesify import --tool goose coding-standards.goosehints
# Import with custom rule ID
rulesify import --tool cursor .cursor/rules/my-rule.mdc --rule-id custom-nameEnsure your rules meet quality standards:
# Validate all rules
rulesify validate --all
# Validate specific rule
rulesify validate python-style
# Validation checks include:
# - Name and content requirements
# - File reference security
# - Format consistency
# - Pattern validationRulesify uses a YAML-based Universal Rule Format for internal storage. Each rule is a single .urf.yaml file. Edit only these files—generated tool files are Git-ignored. Each URF file starts with a fingerprint comment (# sha256:...) for integrity.
Sample URF YAML:
# -------------------------------------------------------------
# UNIVERSAL RULE FILE (URF) – SINGLE SOURCE OF TRUTH
# Replace <placeholders> and delete comments after editing.
# -------------------------------------------------------------
id: typescript-style # machine-safe slug, filled automatically
version: 1.0.0 # bump when you make breaking changes
metadata:
name: "TypeScript Style Guide" # appears in exported Markdown H1
description: |
Coding standards for TypeScript projects
tags: [typescript, style, linting]
priority: 5 # 1 (low) → 10 (high); used for ordering
# auto_apply is now in tool_overrides.cursor section
content:
- title: "Code Style" # Markdown H2 in exports
format: markdown # or plaintext / code
value: |-
• Use consistent formatting...
• Add more guidelines here
references: # optional list of @file references
- @tsconfig.json
conditions: # optional glob patterns that trigger auto-attach
- type: file_pattern
value: '**/*.ts'
# Tool-specific overrides (ignored by other exporters)
tool_overrides:
cursor:
# Application mode - how Cursor should apply this rule:
# • always: Apply to every chat and cmd-k session
# • intelligent: When Agent decides it's relevant (RECOMMENDED)
# • specific_files: When file matches specified patterns
# • manual: Only when @-mentioned by user
apply_mode: intelligent # Options: always | intelligent | specific_files | manual
globs: [src/**/*.ts] # File patterns (only used when apply_mode is "specific_files")
cline:
toggle_default: true
claude-code: {}
goose: {}Editing & Round-Trip Integrity:
- Edit only
*.urf.yamlfiles. Generated tool files are Git-ignored. - Each URF file starts with a fingerprint comment (
# sha256:...). - Round-trip guarantee:
urf → tool file → urfis lossless (auto-validated). - Tool-specific quirks are isolated in
tool_overrides.
Rulesify uses a unified rule ID system that ensures consistent, machine-safe identifiers across all operations:
- Lowercase with hyphens:
typescript-style,react-patterns - Alphanumeric and hyphens only: Special characters are removed
- Length limits: 2-50 characters
- No consecutive hyphens: Multiple hyphens are collapsed to single hyphens
When creating or importing rules, Rulesify determines the rule ID using this priority order:
- Embedded HTML comment (highest priority):
<!-- rulesify-id: custom-id --> - Filename-based ID: Extracted from filename and sanitized
- Rule name: Sanitized version of the rule's display name
- Timestamp fallback:
imported-rule-{timestamp}as last resort
"TypeScript Style Guide" → "typescript-style-guide"
"React_Components" → "react-components"
"My Rule!!!" → "my-rule"
"rule with spaces" → "rule-with-spaces"- HTML Comment Embedding: Deployed files include
<!-- rulesify-id: {id} -->for tracking - Filename Preservation: Sync operations preserve original rule IDs based on
.urf.yamlfilenames - Conflict Resolution: Filename-based IDs take precedence during sync to maintain consistency
This system ensures that rule IDs remain stable across import, export, and sync operations while maintaining compatibility with all supported AI tools.
rulesify rule new <name>- Create a new rule from template skeletonrulesify rule edit <name>- Edit an existing rule in your configured editorrulesify rule list- List all rules with names and descriptionsrulesify rule list -r <regex>- List rules matching regex pattern (e.g.,-r "test.*")rulesify rule show <name>- Show detailed rule information including content and metadatarulesify rule delete <name>- Delete a rule (requires confirmation)
rulesify validate [rule]- Validate specific rule for quality and format compliancerulesify validate --all- Validate all rules for issues, warnings, and best practices
rulesify deploy --all- Deploy all rules to all configured default toolsrulesify deploy --tool <tool> --all- Deploy all rules to a specific tool (cursor, cline, claude-code, goose)rulesify deploy --tool <tool> --rule <rule>- Deploy a specific rule to a specific toolrulesify deploy --tool <tool> --rule <rule1,rule2,rule3>- Deploy multiple rules (triggers merge) - prompts for merged rule ID
Sync detects changes in deployed tool files and updates the corresponding URF files to maintain consistency.
rulesify sync [--dry-run]- Synchronize all deployed rules back to URF format (use --dry-run to preview changes)rulesify sync --rule <name>- Sync changes for a specific rule onlyrulesify sync --tool <tool>- Sync changes from a specific tool only- Note: Sync reads deployed files (.mdc, .md, .goosehints) and updates URF files when differences are detected
rulesify config show- Show current configuration (storage path, editor, default tools)rulesify config edit- Edit configuration file in your default editorrulesify config set-storage <path>- Change the directory where URF files are storedrulesify config set-editor <editor>- Set default editor (cursor, nano, vim, etc.)rulesify config add-tool <tool>- Add a tool to default deployment listrulesify config remove-tool <tool>- Remove a tool from default deployment list
rulesify import --tool <tool> <file>- Import existing rule from AI tool format to URFrulesify import --tool <tool> <file> --rule-id <custom-id>- Import with custom rule ID
rulesify completion <shell>- Generate shell completion script (bash, zsh, fish, etc.)
Global Options (available on all commands):
--config <path>- Use custom configuration file--verbose- Enable detailed output for debugging
# Create a new rule and open it in your editor
rulesify rule new react-best-practices
# Validate the rule for quality and compliance
rulesify validate react-best-practices
# Deploy to a specific tool (cursor)
rulesify deploy --tool cursor --rule react-best-practices
# Deploy to multiple tools
rulesify deploy --tool cline --rule react-best-practices
rulesify deploy --tool claude-code --rule react-best-practicesWhen deploying multiple rules, rulesify automatically merges them based on priority and prompts for a new rule ID.
# Deploy multiple rules - triggers interactive merge
rulesify deploy --tool claude-code --rule "typescript-style,react-patterns,testing-standards"
# Example interaction:
# 📦 Multiple rules detected for merging:
# 1. typescript-style
# 2. react-patterns
# 3. testing-standards
#
# 📋 Merge Preview:
# Rules will be combined in priority order (highest first):
# 1. typescript-style (priority: 8)
# 2. testing-standards (priority: 6)
# 3. react-patterns (priority: 4)
# 📋 Combined tags: typescript, style, testing, react, components
#
# 🔗 Enter ID for the merged rule: full-frontend-guide
# ✅ Merged 3 rules → CLAUDE.md
# The merged rule combines:
# - Metadata from highest priority rule (typescript-style)
# - Descriptions concatenated with separators
# - Tags deduplicated across all rules
# - Content sections in priority order
# - Tool overrides from highest priority rule# Preview what changes sync would make (dry-run)
rulesify sync --dry-run
# Apply synchronization to update URF files from deployed tool files
rulesify sync
# Sync changes from a specific tool only
rulesify sync --tool cursor --dry-run
rulesify sync --tool cursor# Import a Cursor rule
author_rule=.cursor/rules/coding-standards.mdc
rulesify import --tool cursor "$author_rule"
# Deploy the imported rule to other tools
rulesify deploy --tool claude-code --rule coding-standards
rulesify deploy --tool cline --rule coding-standards
# Import with a custom rule ID
rulesify import --tool cline .clinerules/my-rule.md --rule-id custom-rule-name# Validate all rules before sharing
rulesify validate --all
# Deploy all rules to your preferred tools
rulesify deploy --all
# Commit URF files to version control and push to the repository
git add rules/*.urf.yaml
git commit -m "Add/Update team coding rules"
git push origin main
# Team members can then pull, validate, and deploy
git pull origin main
rulesify validate --all
rulesify deploy --all# List rules matching a pattern
rulesify rule list -r "typescript.*"
# Show detailed information about a specific rule
rulesify rule show typescript-style
# Deploy all rules to just one tool
rulesify deploy --tool cursor --all
# Sync and validate workflow
rulesify sync --dry-run # Preview changes
rulesify sync # Apply changes
rulesify validate --all # Ensure quality
rulesify deploy --all # Deploy updates
# Merge and deploy multiple rules for comprehensive tooling
rulesify deploy --tool claude-code --rule "typescript-style,react-patterns,testing-standards"Confirmation Prompts:
rulesify rule delete <name>- Requires confirmation before deletion- Import commands ask if you want to open the rule in editor after import
- Multi-rule deployment prompts for merged rule ID and overwrite confirmation
Editor Integration:
rulesify rule new <name>- Automatically opens new rule in configured editorrulesify rule edit <name>- Opens existing rule for editingrulesify config edit- Opens configuration file for editing
Verbose Output:
- Add
--verboseto any command for detailed debugging information - Use
--config <path>to specify a custom configuration file location
See DEVELOPMENT_PLAN_DETAILED.md for the complete development roadmap and architecture details.
rulesify/
├── Cargo.toml
├── README.md
├── src/
│ ├── main.rs
│ ├── lib.rs
│ ├── cli/
│ │ ├── mod.rs
│ │ └── commands/
│ ├── models/
│ ├── store/
│ ├── converters/
│ ├── templates/
│ ├── validation/
│ ├── sync/
│ └── utils/
├── templates/
├── tests/
└── docs/
# Run all tests
cargo test
# Run specific test suite
cargo test --test converter_tests
cargo test --test validation_tests- 75+ total tests across all modules
- 19 converter tests (import/export functionality)
- 22 validation tests (quality assurance)
- 10+ CLI integration tests (including multi-rule merge)
- 11 import tests
- 4 end-to-end tests (complete workflows)
- 5 storage tests (persistence layer)
- 6 template tests (rule generation)
- Unicode and round-trip integrity tested
This project is licensed under the MIT License.
Copyright (c) 2024 Rulesify Contributors