ai-rules-sync
AGENTS.md37 starsChanged 9 months agoUnlicenseView on GitHub
AI Rules Sync (AIS) is a CLI tool for synchronizing, managing, and sharing AI agent rules across projects using symbolic links. All adapters follow the BaseAdapter interface: When making significant code changes, update documentation: Before ending a productive session: Use /summarize-session to generate artifacts.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,700 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository8 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- .cursor/rules/knowledge-base/RULE.mdCursor rule
- .cursor/rules/project/RULE.mdCursor rule
- new-adapterSkill
- summarize-sessionSkill
- sync-readmeSkill
- update-docsSkill
- update-knowledge-baseSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
16 rules. About 0 are common, 10 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 63
TypeScript Strict Mode: All code must pass strict type checking
- Distinctive: line 64
Functional Programming: Prefer pure functions, avoid side effects where possible
- Very specific: line 65
Testing Required: All new features must have tests in src/__tests__/
- Very specific: line 66
ES Modules: Use .js extension in imports for Node.js compatibility
- Distinctive: line 67
Error Handling: Use descriptive error messages with chalk for CLI output
- Very specific: line 71
All adapters follow the BaseAdapter interface:
- Distinctive: line 88
When making significant code changes, update documentation:
- Distinctive: line 92
Document new adapters, commands, or architectural changes
- Distinctive: line 95
Add new features, commands, or usage examples
- Distinctive: line 96
Keep architecture section current
- Distinctive: line 109
Before ending a productive session:
- Very specific: line 123
Use /summarize-session to generate artifacts.
- Very specific: line 128
Use Vitest's describe, it, expect
- Distinctive: line 130
Test adapters independently from CLI
- Very specific: line 134
Use conventional commits: feat:, fix:, refactor:, docs:, test:
- Distinctive: line 136
Keep commits atomic and focused
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS instructions
Project Overview
AI Rules Sync (AIS) is a CLI tool for synchronizing, managing, and sharing AI agent rules across projects using symbolic links.
Tech Stack
- Language: TypeScript (strict mode)
- Build:
tsc(ES modules) - Test: Vitest
- CLI Framework: Commander.js
- Package Manager: pnpm
Key Features
- Multi-repository rule management (Cursor, Copilot, Claude, Trae)
- Symbolic link-based synchronization
- Shell tab completion (bash, zsh, fish)
- Plugin-based adapter architecture
Directory Structure
src/
├── adapters/ # Tool-specific adapters (cursor, copilot, claude, trae)
│ ├── base.ts # Base adapter factory
│ ├── types.ts # Adapter interfaces
│ └── index.ts # Adapter registry
├── commands/ # CLI command handlers
│ ├── handlers.ts # Core command logic (add, remove, link, unlink)
│ ├── install.ts # Install command
│ └── helpers.ts # Shared utilities
├── cli/
│ └── register.ts # CLI registration
├── completion/
│ └── scripts.ts # Shell completion scripts
├── config.ts # Global config (~/.config/ai-rules-sync/)
├── project-config.ts # Project config (ai-rules-sync.json)
├── sync-engine.ts # Symlink creation/removal
├── link.ts # Link utilities
├── git.ts # Git operations
├── utils.ts # Shared utilities
└── index.ts # Entry pointDevelopment Commands
# Build TypeScript
npm run build
# Run tests (watch mode)
npm test
# Run tests once
npx vitest run
# Test CLI locally
node dist/index.js <command>Code Style Guidelines
- TypeScript Strict Mode: All code must pass strict type checking
- Functional Programming: Prefer pure functions, avoid side effects where possible
- Testing Required: All new features must have tests in
src/__tests__/ - ES Modules: Use
.jsextension in imports for Node.js compatibility - Error Handling: Use descriptive error messages with chalk for CLI output
Adapter Pattern
All adapters follow the BaseAdapter interface:
interface BaseAdapter {
name: string; // Unique adapter name
tool: string; // Tool identifier (cursor, copilot, etc.)
subtype: string; // Type within tool (rules, commands, skills)
configPath: string[]; // Path in ai-rules-sync.json
defaultSourceDir: string;
targetDir: string;
mode: 'file' | 'directory';
}Workflows
After Code Changes (Auto-trigger)
When making significant code changes, update documentation:
- Update KNOWLEDGE_BASE.md (if architecture/features changed)
- Use
/update-knowledge-baseskill - Document new adapters, commands, or architectural changes
- Use
- Update README.md (English)
- Add new features, commands, or usage examples
- Keep architecture section current
- Sync README_ZH.md (Chinese)
- Use
/sync-readmeskill - Maintain parity with English README
- Use
- Run Tests
npm test
Session Summary (End of Session)
Before ending a productive session:
- Identify Reusable Patterns → Generate Rules
- Coding standards discovered
- Project-specific conventions
- Identify Multi-step Workflows → Generate Skills
- Complex operations that benefit from step-by-step guidance
- Integration workflows
- Identify Frequent Commands → Generate Commands
- One-click operations
- Common development tasks
Use /summarize-session to generate artifacts.
Testing Conventions
- Test files:
src/__tests__/*.test.ts - Use Vitest's
describe,it,expect - Mock file system operations with
vi.mock('fs-extra') - Test adapters independently from CLI
Git Commit Guidelines
- Use conventional commits:
feat:,fix:,refactor:,docs:,test: - Include scope when relevant:
feat(adapter): add windsurf support - Keep commits atomic and focused
Related Files
README.md- English documentationREADME_ZH.md- Chinese documentation.cursor/rules/- Cursor-specific rules (if any)ai-rules-sync.json- Project configuration example
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

