Are you the author? Sign in to claim
๐งดglooit keeps your AI agent rules, MCP, Skills & Commands configurations in perfect sync across Claude Code, Cursor, Ro
Sync AI coding assistant configurations across Claude Code, Cursor, Codex, OpenCode, and Roo Code/Cline.
Teams today use different AI coding assistants - some prefer Claude Code, others use Cursor, OpenCode, and CI/CD might run on Codex. Each tool has its own config format and location:
CLAUDE.md, commands in .claude/commands/, skills in .claude/skills/.cursor/rules/*.mdc with frontmatter, commands in .cursor/commands/AGENTS.md, commands in .opencode/command/, agents in .opencode/agent/AGENTS.md.roo/rules/glooit lets you write your rules once and sync them everywhere. Perfect for:
# Homebrew (macOS/Linux)
brew tap nikuscs/glooit https://github.com/nikuscs/glooit
brew install glooit
# npm
npm install -g glooit
# bun
bun install -g glooit
# pnpm
pnpm install -g glooit
glooit init # Create config
glooit sync # Sync rules to all agents
Create .agents/main.md with your rules, then configure glooit.config.ts:
Legacy support:
.glooitis still supported. IfconfigDiris not set, glooit will use.agentswhen present, otherwise it falls back to.glooit.
import { defineRules } from 'glooit';
export default defineRules({
rules: [
{
file: '.agents/main.md',
to: './',
targets: ['claude', 'cursor', 'codex']
}
]
});
Run glooit sync (or bunx glooit sync / npx glooit sync) and it creates:
CLAUDE.md for Claude Code.cursor/rules/main.mdc for CursorAGENTS.md for Codex| Agent | Output Path | Format |
|---|---|---|
claude | CLAUDE.md | Markdown |
cursor | .cursor/rules/{name}.mdc | Frontmatter |
codex | AGENTS.md | Markdown |
opencode | AGENTS.md | Markdown |
factory | AGENTS.md | Markdown |
roocode | .roo/rules/{name}.md | Markdown |
generic | {name}.md | Markdown |
| Feature | Claude | Cursor | OpenCode | Codex | Factory | Roo Code/Cline | Generic |
|---|---|---|---|---|---|---|---|
| Rules | โ | โ | โ | โ | โ | โ | โ |
| Commands | โ | โ | โ | โ* | - | - | - |
| Skills | โ | โ | โ** | โ | โ | - | - |
| Agents | โ | โ | โ | - | โ*** | - | - |
| MCP Servers | โ | โ | โ | โ | โ | โ | โ |
| Hooks | โ | โ | - | - | โ | - | - |
| Settings | โ | โ | โ | โ | - | - | - |
*Codex uses .codex/prompts for commands
**OpenCode uses Claude-compatible skills path (.claude/skills/)
***Factory uses "droids" (.factory/droids/) for agents
Override output locations per-agent:
{
file: '.agents/backend.md',
to: './',
targets: [
'claude',
{ name: 'cursor', to: './backend/.cursor/rules/api.mdc' }
]
}
Sync commands, skills, and agents directories at the top level:
export default defineRules({
rules: [...],
// Simple string path (defaults to claude, cursor, opencode)
commands: '.agents/commands',
// Or with explicit targets
skills: {
path: '.agents/skills',
targets: ['claude']
},
agents: {
path: '.agents/agents',
targets: ['claude', 'cursor']
}
});
Output mappings:
commands โ .claude/commands, .cursor/commands, .opencode/command, .codex/promptsskills โ .claude/skills, .cursor/skills, .codex/skills, .factory/skills (OpenCode uses .claude/skills)agents โ .claude/agents, .cursor/agents, .opencode/agent, .factory/droidsUse symlinks instead of copying. This keeps your source of truth in .agents and updates targets instantly.
export default defineRules({
mode: 'symlink', // or 'copy'
rules: [
{
file: '.agents/main.md',
to: './',
targets: ['claude', 'cursor']
},
{
file: '.agents/codex.md',
to: './',
mode: 'copy', // per-rule override
targets: ['codex']
}
]
});
Why use symlink mode?
glooit sync)Limitations: Symlinks point directly to source files, so transformations cannot be applied:
file: string[]) automatically fall back to copy mode (cannot symlink to multiple files)When limitations apply, glooit shows a warning and provides guidance. Use glooit unlink to convert symlinks back to regular files.
Combine multiple files into one output:
{
file: [
'.agents/coding-standards.md',
'.agents/testing-guidelines.md'
],
to: './',
targets: [
{ name: 'claude', to: './GUIDELINES.md' }
]
}
Limit rule scope to specific files:
{
file: '.agents/frontend.md',
to: './apps/frontend',
globs: 'src/**/*.{ts,tsx}',
targets: ['cursor']
}
Transform content during sync using placeholders in your source files.
Source file (.agents/main.md):
# Project Guidelines
Last updated: __TIMESTAMP__
## Project Structure
__STRUCTURE__
## Environment
- Node version: __NODE_VERSION__
- API URL: __API_URL__
Config (glooit.config.ts):
import { defineRules, transforms } from 'glooit';
export default defineRules({
rules: [
{
file: '.agents/main.md',
to: './',
targets: ['claude'],
hooks: ['replaceStructure', 'addTimestamp', 'replaceEnv']
}
],
transforms: {
after: [transforms.compact({ removeFillerWords: true })]
}
});
Built-in transforms:
| Transform | Placeholder | Description |
|---|---|---|
addTimestamp | __TIMESTAMP__ | Replaced with current date/time |
replaceEnv | __ENV_VAR__ | Replaced with process.env.ENV_VAR value |
replaceStructure | __STRUCTURE__ | Replaced with project directory tree |
compact | - | Cleans up markdown (removes filler words, extra newlines) |
Usage:
hooks: ['transformName'] to individual rulestransforms.after array to run on all rulesConfigure lifecycle hooks that run inside Claude Code and Cursor when the AI uses tools.
export default defineRules({
rules: [...],
hooks: [
// Run prettier after file edits
{
event: 'afterFileEdit',
command: 'npx prettier --write',
targets: ['claude', 'cursor']
},
// Run a TypeScript script before shell commands
{
event: 'beforeShellExecution',
script: '.agents/hooks/check-command.ts',
targets: ['claude']
},
// Block writes to sensitive files
{
event: 'PreToolUse',
script: '.agents/hooks/block-env-writes.ts',
matcher: 'Edit|Write', // Claude Code matcher
targets: ['claude']
}
]
});
Supported events:
| Event | Claude Code | Cursor | Description |
|---|---|---|---|
PreToolUse | โ | - | Before tool execution (can block) |
PostToolUse | โ | - | After tool completion |
beforeShellExecution | โ | โ | Before shell commands |
afterFileEdit | โ | โ | After file modifications |
Stop | โ | โ | When agent finishes |
Script types:
.ts files: Run with bun run.js files: Run with node.sh files: Run directlyMerge shared settings into provider-native settings files:
export default defineRules({
rules: [...],
settings: {
targets: ['claude', 'cursor', 'codex', 'opencode'],
env: ['GEMINI_API_KEY', 'OPENAI_API_KEY'],
envFiles: ['.env.agents', '.env.local', '.env'], // optional (default order shown)
permissions: {
allow: ['Read', 'Grep']
},
merge: true // optional; defaults to true
}
});
Resolution and precedence rules:
merge defaults to true (set merge: false to overwrite instead of merge).envFiles is optional; default lookup is ['.env.agents', '.env.local', '.env'].settings.env, the first matching file in envFiles order wins..env.agents is checked first, giving you a dedicated file for agent-specific secrets.process.env is used as a fallback (useful for CI and shell-exported vars).claude/codex), sync fails with a warning to prevent committing secrets.Default settings output files:
claude โ .claude/settings.local.jsoncursor โ .cursor/cli.jsoncodex โ .codex/config.tomlopencode โ opencode.jsonConfigure Model Context Protocol servers:
export default defineRules({
rules: [...],
mcps: [
{
name: 'postgres',
config: {
command: 'uvx',
args: ['mcp-server-postgres'],
env: { DATABASE_URL: process.env.DATABASE_URL }
},
targets: ['claude', 'cursor']
}
]
});
Automatic backups before sync:
export default defineRules({
rules: [...],
backup: {
enabled: true,
retention: 10
}
});
glooit init # Initialize configuration
glooit sync # Sync rules and MCPs
glooit link # Zero-config symlink sync (no config file needed)
glooit unlink # Replace symlinked outputs with real files
glooit validate # Validate configuration
glooit clean # Clean .gitignore entries
glooit reset --force # Remove all generated files
glooit upgrade # Upgrade glooit to latest version
glooit backup list # List available backups
glooit backup restore <timestamp> # Restore from backup
The link command provides zero-config symlink-based syncing without requiring a config file:
glooit link # Auto-detect .agents/ or .glooit/ and sync to all agents
glooit link .my-rules # Use custom source directory
glooit link -t claude,cursor # Sync to specific agents only
It automatically discovers and symlinks:
CLAUDE.md โ Claude CodeAGENTS.md โ Codex, OpenCode, Factorycommands/ โ All agents that support commandsskills/ โ All agents that support skillsagents/ โ All agents that support agents/droidsThe upgrade command auto-detects your package manager and whether glooit is installed locally or globally:
glooit upgrade # Auto-detect and upgrade
glooit upgrade -g # Force global upgrade
glooit upgrade -l # Force local upgrade
All commands work with npx, bunx, or pnpx:
npx glooit sync
bunx glooit sync
pnpx glooit sync
See examples/full.config.ts for a complete configuration with all features.
# Install dependencies
bun install
# Run tests
bun run test
# Type check and lint
bun run check
# Build
bun run build
# Build local binary
bun run install:local
bun run release
This runs checks, prompts for version bump, creates a git tag, and pushes. CI handles npm publish and GitHub release automatically.
Without these amazing projects, this project would not be possible.
MIT
Flutter AI Skills and Rules for Cursor, Copilot, Antigravity, and Other AI-Powered IDEs
A RedwoodJS optimized .cursorrules file
A practical approach to managing multiple AI agents in Cursor through strict file-tree partitioning and domain boundarie
AI ๆๅกๅๆต่งๅ่ๅ: ๅคๆบๅๅนถ | ๆ provider ็ฒพไฟฎ | ๆฏๆฅ่ชๅจๅๆญฅ. ่ฆ็ OpenAI / Anthropic / Gemini / Cursor / Copilot ็ญไธปๆต AI ๆๅก, ้้ Clash /