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 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.
npx @beforemerge/cli install avoid-raw-sql --type rulesnpx @beforemerge/cli install nextjs-security --type skillsnpx @beforemerge/cli install owasp-top-10 --type collectionsAuto-detection
The CLI checks your project for .cursor/, .claude/, .windsurfrules, etc. and picks the right format automatically. Override with --platform cursor.
Other commands
# 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 --forceMethod 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.
/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
curl "https://beforemerge.com/api/v1/public/install/rules/avoid-raw-sql?platform=cursor&format=text"{
"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."
}
}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.
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-rulesSupported 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}.mdCursor
AI-first code editor. Rules use MDC format (YAML frontmatter + markdown) in .cursor/rules/.
.cursor/rules/{name}.mdcGitHub Copilot
GitHub's AI pair programmer. Custom instructions go in .github/instructions/.
.github/instructions/{name}.instructions.mdWindsurf
Codeium's AI IDE. All rules concatenated in a single .windsurfrules file in project root.
.windsurfrulesCline / Roo Code
VS Code AI agent. Rules go in .clinerules in project root.
.clinerulesCodex (OpenAI)
OpenAI's coding agent. Reads AGENTS.md files in any directory.
AGENTS.mdAider
Terminal AI pair programmer. Put rules in CONVENTIONS.md and add 'read: CONVENTIONS.md' to .aider.conf.yml.
CONVENTIONS.mdContinue
Open-source AI assistant. Rules go in .continue/rules/ as individual .md files.
.continue/rules/{name}.mdReady to install?
Browse the knowledge base, find the rules you need, and install them in your AI tool in seconds. No account required.