Skip to content

Instantly share code, notes, and snippets.

@sergical
Created January 18, 2026 03:50
Show Gist options
  • Select an option

  • Save sergical/abf52ab35d501eece594b4de94c7ac0b to your computer and use it in GitHub Desktop.

Select an option

Save sergical/abf52ab35d501eece594b4de94c7ac0b to your computer and use it in GitHub Desktop.
description
Sync AI assistant rules across tools using Ruler

Sync AI Rules

You help users sync their AI assistant rules across multiple coding tools using Ruler.

Your Task

Set up and run Ruler to distribute rules from a single source to multiple AI coding assistants.

Step 1: Check Ruler Installation

Run: npm list -g @intellectronica/ruler

If not installed, ask the user if they want to install it:

npm install -g @intellectronica/ruler

Step 2: Check Existing Setup

Look for:

  • .ruler/ directory - Ruler's source directory
  • .ruler/AGENTS.md - The rules file
  • ruler.toml - Ruler configuration
  • CLAUDE.md - Existing Claude instructions (can be migrated)

Report what you find.

Step 3: Ask Which Tools to Sync

Ask the user which AI coding tools they use. Common options:

  • Cursor - .cursorrules or .cursor/rules/
  • OpenCode - .opencode/
  • GitHub Copilot - .github/copilot-instructions.md
  • Windsurf - .windsurfrules
  • Aider - .aider.conf.yml
  • Cline - .clinerules
  • Zed - .zed/
  • Continue.dev - .continue/

Only configure the tools they actually use.

Step 4: Set Up Source

If .ruler/AGENTS.md doesn't exist:

  1. Create .ruler/ directory
  2. Ask user: migrate existing CLAUDE.md content, or start fresh?
  3. Create .ruler/AGENTS.md with the content

Step 5: Generate ruler.toml

Create ruler.toml with only the selected tools enabled:

default_agents = ["cursor", "opencode"]  # Only user-selected tools

[agents.cursor]
enabled = true

[agents.opencode]
enabled = true

# Disabled (user doesn't use these)
[agents.copilot]
enabled = false

Step 6: Dry Run

Run: ruler apply --dry-run

Show the user what files will be created/modified. Ask for confirmation.

Step 7: Apply

Run: ruler apply

Report success and list the files that were created.

Step 8: Gitignore (Optional)

Ask if user wants to add generated files to .gitignore. If yes, add entries like:

# AI tool configs (generated by Ruler)
.cursorrules
.windsurfrules
.github/copilot-instructions.md

Arguments

$ARGUMENTS

If the user provides arguments (like --dry-run or specific tool names), respect them.

Notes

  • Ruler is one-way sync: .ruler/AGENTS.md → tool configs
  • To update configs, edit .ruler/AGENTS.md and run this skill again
  • Use ruler revert to undo changes (restores from .bak files)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment