ai-rules-sync
lbb00 · lbb00/ai-rules-sync
Công cụ này giúp đồng bộ hóa, quản lý và chia sẻ các quy tắc, kỹ năng và lệnh của tác nhân AI trên nhiều dự án và công cụ bằng cách sử dụng liên kết tượng trưng.
Dễ dàng đồng bộ hóa, quản lý và chia sẻ các rule AI, skill, command, subagent của bạn (Cursor, Claude Code, Copilot, OpenCode, Trae AI, Codex, Gemini CLI, Warp) với dễ dàng.
Xem trước
Bạn có thể làm gì với nó
- Cập nhật các quy tắc Cursor phổ biến trên tất cả các kho lưu trữ dự án cục bộ của bạn.
- Chia sẻ một bộ kỹ năng Claude Code tiêu chuẩn với nhóm của bạn thông qua một kho lưu trữ Git.
- Cài đặt và quản lý các gói prompt chuyên biệt cho Copilot, đảm bảo tính nhất quán.
Kiểm tra an toàn
Không thấy dấu hiệu rủi ro trong các file đã quét.
Quét tự động các file trong repo. Luôn xem lại code trước khi chạy.
Trích từ README
AI Rules Sync
English · 中文 · Documentation
AI Rules Sync (AIS) — Install, compose, update, and publish native agent assets from multiple Git repositories across all your projects.
AIS is an asset federation toolkit, not a format converter. It keeps your files exactly as they are — skills, rules, commands, agents — and syncs them via symbolic links across every project you work on. Edit once, update everywhere.
How AIS is Different
| AIS | Other tools |
|---|---|
| Symlinks — upstream changes are instant | Copy files — must re-run to update |
| One source → many projects | One project at a time |
| Native assets — no format conversion | Rewrite / re-generate your files |
| Import → publish → review workflow | One-way consumption only |
| 370 KB, 5 dependencies | Often 10+ MB with deep dependency trees |
| Git-native — works with any Git remote | Tied to specific registries or APIs |
AIS is complementary to format-conversion tools. If you also need cross-tool format conversion, you can use AIS for asset management and another tool for generation — they solve different problems.
Supported Tools
This table is generated from docs/supported-tools.json via npm run docs:sync-tools.
| Tool | rules | skills | commands | agents | AGENTS.md | tools | prompts | instructions |
|---|---|---|---|---|---|---|---|---|
| Universal | — | — | — | — | ✅ | — | — | — |
| Aider | — | ✅ | — | — | — | — | — | — |
| Amp | — | ✅ | — | — | — | — | — | — |
| Antigravity CLI | — | ✅ | ✅ | — | — | — | — | — |
| Augment Code | ✅ | ✅ | ✅ | ✅ | — | — | — | — |
| Claude Code | ✅ | ✅ | — | ✅ | ✅ | — | — | — |
| Cline | ✅ | ✅ | ✅ | ✅ | — | — | — | — |
| CodeBuddy | ✅ | ✅ | ✅ | — | ✅ | — | — | — |
| Codex | ✅ | ✅ | — | ✅ | ✅ | — | — | — |
| Continue | ✅ | ✅ | — | — | — | — | ✅ | — |
| Cursor | ✅ | ✅ | ✅ | ✅ | — | — | — | — |
| DeepAgents | — | ✅ | — | ✅ | ✅ | — | — | — |
| DeepSeek | — | ✅ | — | — | ✅ | — | — | — |
| Factory Droid | — | ✅ | ✅ | ✅ | ✅ | — | — | — |
| Gemini CLI | — | ✅ | ✅ | ✅ | ✅ | — | — | — |
| GitHub Copilot | — | ✅ | — | ✅ | — | — | ✅ | ✅ |
| Goose | — | ✅ | — | — | — | — | — | — |
| Hermes Agent | ✅ | ✅ | — | — | — | — | — | — |
| Junie | ✅ | ✅ | ✅ | ✅ | ✅ | — | — | — |
| Kilo Code | — | ✅ | ✅ | ✅ | ✅ | — | — | — |
| Kimi Code | — | ✅ | — | ✅ | ✅ | — | — | — |
| Kiro | ✅ | ✅ | — | ✅ | — | — | — | — |
| OpenCode | ✅ | ✅ | ✅ | ✅ | — | ✅ | — | — |
| Pi | — | ✅ | — | — | ✅ | — | ✅ | — |
| Qwen Code | ✅ | ✅ | ✅ | ✅ | ✅ | — | — | — |
| Trae | ✅ | ✅ | ✅ | ✅ | — | — | — | — |
| Warp | ✅ | ✅ | — | — | — | — | — | — |
| Windsurf | ✅ | ✅ | ✅ | — | — | — | — | — |
| WorkBuddy | — | ✅ | — | — | — | — | — | — |
| Zed | — | ✅ | — | — | — | — | — | — |
📋 Full directory reference — source paths, modes, suffixes, and documentation links.
Also supports User Mode for personal AI config files.
Installation
Via npm (Recommended)
npm install -g ai-rules-sync
Via Homebrew (macOS only)
brew tap lbb00/ai-rules-sync https://github.com/lbb00/ai-rules-sync
brew install ais
Verify:
ais --version
Optional: Enable tab completion
ais completion install
Quick Start
Use assets from a repository
cd your-project
# Add a rule (specify repository URL the first time)
ais cursor add react -t https://github.com/your-org/rules-repo.git
# After first use, omit -t
ais cursor add vue
ais copilot instructions add coding-standards
ais claude skills add code-review
Share your existing assets
# Import a rule from your project into the repository
ais cursor rules import my-custom-rule
# Optionally push to remote
ais cursor rules import my-rule --push
Restore assets (team onboarding / CI)
# Restore all assets from ai-rules-sync.json
ais install
User-level sync (personal AI configs)
# Sync personal configs to $HOME
ais claude md add CLAUDE --user
ais gemini md add GEMINI --user
# Restore on a new machine
ais user install
Core Concepts
How It Works
Git Repository Global Cache Your Projects
┌─────────────────┐ clone ┌──────────────────┐ symlink ┌──────────┐
│ .claude/skills/ │ ───────────→ │ ~/.config/ │ ────────→ │ projectA │
│ .cursor/rules/ │ │ ai-rules-sync/ │ ────────→ │ projectB │
│ .github/inst... │ │ repos/ │ ────────→ │ projectC │
└─────────────────┘ └──────────────────┘ └──────────┘
- Clone — AIS clones your asset repositories to a global cache (
~/.config/ai-rules-sync/repos/) - Symlink — Each project gets symbolic links pointing into the cache
- Update — When you pull changes in the repo, every project sees them instantly
Three Configuration Layers
| File | Scope | Committed to Git |
|---|---|---|
ai-rules-sync.local.json | Private, per-project | No |
ai-rules-sync.json | Shared, per-project | Yes |
user.json (~/.config/ai-rules-sync/) | Global, per-user | Optional (dotfiles) |
Three Core Operations
| Command | What it does |
|---|---|
ais add | Link an asset from a repository to your project |
ais import | Copy an asset from your project into the repository, then replace with symlink |
ais install | Restore all symlinks from ai-rules-sync.json (team onboarding, CI) |
Basic Usage
Setup a Repository
# Use an existing remote repository
ais use https://github.com/your-org/rules-repo.git
# Use a local path (for development / testing)
ais use ~/my-rules-repo
# List all configured repositories
ais ls
# Switch between repositories
ais use company-rules
ais use personal-rules
Add Assets to Your Project
cd your-project
# First time: specify reposit