Write Once, Run Anywhere.
Manage your AI assistant rules in one place and sync them across all your tools.
RulePort handles the translation and synchronization of context, coding standards, and project rules between different AI assistants. Instead of maintaining separate .cursorrules, .github/copilot-instructions.md, and .claude/rules/ configs, you define them once and let this tool handle the rest.
- οΏ½ Automatic Sync - One-time or watch mode synchronization
- π― Type-Safe - Built with TypeScript for reliability
- π§ͺ Tested - Comprehensive test suite with 87+ tests
- ποΈ Clean Architecture - Adapter-based design for easy extensibility
- β CI-Friendly - Check command for validating sync status
- π¦ Zero Config - Works out of the box with sensible defaults
| Source \ Target | Claude Code | Cursor | GitHub Copilot | Google Antigravity | Kiro | Windsurf |
|---|---|---|---|---|---|---|
| Claude Code | - | β | β | β | β | β |
| Cursor | β | - | β | β | β | β |
| GitHub Copilot | β | β | - | β | β | β |
| Google Antigravity | β | β | β | - | β | β |
| Kiro | β | β | β | β | - | β |
| Windsurf | β | β | β | β | β | - |
β = Available Now | - = N/A
npm installnpm run buildTranslate your rules to all configured targets:
npm run syncSync rules from source to all targets:
npm run syncSync to specific targets:
npm run sync -- --target copilot
npm run sync -- --target claude --target antigravitySync a specific project directory:
npm run sync -- /path/to/projectCheck if generated files are in sync with source rules (useful for CI):
npm run checkThis command:
- Computes what files would be generated
- Compares against existing files
- Exits with code 1 if drift is detected
- Exits with code 0 if everything is in sync
Perfect for CI/CD pipelines to ensure rules are always synced!
Automatically sync when you change rule files:
npm run sync:watchPress Ctrl+C to stop watching.
Limit sync to specific assistants:
npm run sync -- --target copilotAvailable targets: copilot, claude, antigravity, cursor, kiro, windsurf
Default: All targets
Specify the source to read rules from:
npm run sync -- --source cursor
npm run sync -- --source claude
npm run sync -- --source kiroAvailable sources: cursor, claude, copilot, antigravity, kiro, windsurf
Default: cursor
Enable watch mode:
npm run sync -- --watch
# or
npm run sync -- -wDisplay help information:
node dist/cli.js --helpRulePort uses a clean adapter-based architecture:
Sources (Cursor, β¦)
β
βΌ
ββββββββββββ
β Rule IR β β canonical, typed, deterministic
ββββββββββββ
β
βΌ
Targets (Copilot, Claude, Antigravity, β¦)
β
βΌ
Planned Writes (path + content)
β
βΌ
sync / check / watch
- IR-First: All conversions go through a canonical Rule IR
- No Hidden Magic: Deterministic output only
- Adapters, Not Conditionals: Clean separation of concerns
- Local-First, CI-Friendly: Works offline, validates in CI
Run the test suite:
npm testRun tests in watch mode:
npm run test:watchRun tests with coverage:
npm run test:coverageView tests in UI:
npm run test:uiruleport/
βββ src/ # TypeScript source code
β βββ cli.ts # Main CLI entry point
β βββ core/ # Core infrastructure
β β βββ ir.ts # Rule IR data model
β β βββ frontmatter.ts # YAML parser
β β βββ fs.ts # File operations
β β βββ log.ts # Logging utilities
β β βββ planner.ts # Write planning
β βββ config/ # Configuration
β β βββ types.ts # Type definitions
β β βββ defaults.ts # Default values
β βββ sources/ # Source adapters
β β βββ cursor.ts # Cursor rules reader
β β βββ claude.ts # Claude Code reader
β β βββ copilot.ts # GitHub Copilot reader
β β βββ antigravity.ts # Google Antigravity reader
β β βββ kiro.ts # Kiro reader
β β βββ windsurf.ts # Windsurf reader
β βββ targets/ # Target adapters
β β βββ copilot.ts # GitHub Copilot
β β βββ claude.ts # Claude Code
β β βββ antigravity.ts # Google Antigravity
β β βββ cursor.ts # Cursor
β β βββ kiro.ts # Kiro
β β βββ windsurf.ts # Windsurf
β βββ commands/ # CLI commands
β βββ sync.ts # Sync command
β βββ check.ts # Check command
β βββ watch.ts # Watch command
βββ tests/ # Test suite
β βββ cli.test.ts # CLI tests
β βββ cursor.test.ts # Cursor source adapter tests
β βββ sources.test.ts # All other source adapter tests
β βββ targets.test.ts # Target adapter tests
β βββ e2e.test.ts # End-to-end tests
β βββ fixtures/ # Test fixtures
βββ dist/ # Compiled JavaScript
βββ .cursor/rules/ # Your source rules
npm run buildRun without building (uses tsx):
npm run devLinting:
npm run lint # Check code style
npm run lint:fix # Fix automatic issuesType Checking:
npm run typecheck # Verify TypeScript typesPre-commit Hooks:
This project uses husky and lint-staged. On every commit, it automatically:
- Fixes linting issues (
eslint --fix) - Runs relevant tests (
vitest related) - Blocks the commit if checks fail
Conventional Commits: We use Conventional Commits to automate versioning and changelogs. Please use one of the following types:
feat: A new feature (minor release)fix: A bug fix (patch release)chore: Maintenance, dependencies, etc. (no release)docs: Documentation changestest: Adding or correcting tests
Example:
git commit -m "feat: add support for new target adapter"- Create
src/targets/your-target.ts - Implement the
renderfunction that acceptsRuleIR[]and returnsRenderResult - Add target to
VALID_TARGETSinsrc/config/defaults.ts - Update command routing in
src/commands/sync.ts - Add tests in
tests/targets.test.ts
We welcome contributions! Please see CONTRIBUTING.md for details on how to get started, report bugs, or suggest features.
MIT
Built with TypeScript, Vitest, and β€οΈ for the AI coding community.