GuideInstallation

Install BeforeMerge rules in your AI tool

Three ways to get BeforeMerge rules into any AI coding assistant: click the Install button on any rule, use the CLI, or call the API. No account required.

Method 1: Install button (no account needed)

Every rule, skill, collection, knowledge article, and prompt on BeforeMerge has an Install button. Click it, pick your platform, and copy or download the formatted file.

1

Browse to any rule or skill

Go to /explore and find the content you want. No login required.

2

Click Install, choose your platform

The install dialog shows all 9 supported platforms. Pick yours and see a live preview of the formatted output. Your choice is remembered for next time.

Claude CodeCursorGitHub CopilotWindsurfCline / Roo CodeCodex (OpenAI)AiderContinueRaw Markdown
3

Copy to clipboard or download

Click Copy to Clipboard and paste into your project, or click Download to save the file directly. The file path is shown so you know exactly where to put it.

Bundle installs

On skill and collection pages, the Install button includes all items in the bundle. For multi-file platforms (Claude Code, Cursor, GitHub Copilot, Continue), you get one file per rule. For single-file platforms (Windsurf, Cline, Codex, Aider), everything is concatenated into one file.

Method 2: CLI (one command)

Install rules directly into your project from the terminal. No account or API key needed. The CLI auto-detects your AI tool from project files.

Install a single rule
npx @beforemerge/cli install avoid-raw-sql --type rules
Install all rules from a skill
npx @beforemerge/cli install nextjs-security --type skills
Install a collection
npx @beforemerge/cli install owasp-top-10 --type collections

Auto-detection

The CLI checks your project for .cursor/, .claude/, .windsurfrules, etc. and picks the right format automatically. Override with --platform cursor.

Other commands

bash
# Search for content
npx @beforemerge/cli search "nextjs security"

# List all supported platforms
npx @beforemerge/cli platforms

# Specify platform explicitly
npx @beforemerge/cli install nextjs-security --type skills --platform cursor

# Force overwrite existing files
npx @beforemerge/cli install nextjs-security --type skills --force

Method 3: Install API (programmatic)

Fetch formatted content from the install API. No API key required (rate limited to 30 requests/minute per IP). Great for CI/CD pipelines, scripts, and custom integrations.

GET/api/v1/public/install/{type}/{slug}

Returns formatted content ready to write to your project.

type — rules, skills, collections, knowledge, prompts

?platform= — claude-code, cursor, github-copilot, windsurf, cline, codex, aider, continue, raw

?format= — json (default) or text

Get a rule formatted for Cursor
curl "https://beforemerge.com/api/v1/public/install/rules/avoid-raw-sql?platform=cursor&format=text"
JSON response (format=json)
{
  "data": {
    "platform": "cursor",
    "files": [
      {
        "path": ".cursor/rules/avoid-raw-sql.mdc",
        "content": "---\ndescription: ...\nglobs:\nalwaysApply: true\n---\n\n# Avoid Raw SQL..."
      }
    ],
    "instructions": "Place the .mdc file(s) in your project's .cursor/rules/ directory."
  }
}
Fetch a skill bundle for Claude Code
curl "https://beforemerge.com/api/v1/public/install/skills/nextjs-security?platform=claude-code" \
  | jq -r '.data.files[] | .path, .content' 

CI/CD example: GitHub Actions

Auto-sync rules on every push or on a weekly schedule.

.github/workflows/sync-rules.yml
name: Sync BeforeMerge Rules
on:
  schedule:
    - cron: '0 9 * * 1'  # Every Monday at 9am
  workflow_dispatch:

jobs:
  sync:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Install BeforeMerge rules
        run: npx @beforemerge/cli install nextjs-security --type skills --force
      - name: Open PR if changed
        uses: peter-evans/create-pull-request@v6
        with:
          title: "chore: update BeforeMerge rules"
          branch: chore/sync-beforemerge-rules

Supported platforms

BeforeMerge auto-formats content for each platform. Here is where each tool expects its config files.

Claude Code

Anthropic's CLI coding agent. Rules go in .claude/rules/ and are loaded automatically on every conversation.

.claude/rules/{name}.md

Cursor

AI-first code editor. Rules use MDC format (YAML frontmatter + markdown) in .cursor/rules/.

.cursor/rules/{name}.mdc

GitHub Copilot

GitHub's AI pair programmer. Custom instructions go in .github/instructions/.

.github/instructions/{name}.instructions.md

Windsurf

Codeium's AI IDE. All rules concatenated in a single .windsurfrules file in project root.

.windsurfrules

Cline / Roo Code

VS Code AI agent. Rules go in .clinerules in project root.

.clinerules

Codex (OpenAI)

OpenAI's coding agent. Reads AGENTS.md files in any directory.

AGENTS.md

Aider

Terminal AI pair programmer. Put rules in CONVENTIONS.md and add 'read: CONVENTIONS.md' to .aider.conf.yml.

CONVENTIONS.md

Continue

Open-source AI assistant. Rules go in .continue/rules/ as individual .md files.

.continue/rules/{name}.md

Ready to install?

Browse the knowledge base, find the rules you need, and install them in your AI tool in seconds. No account required.