A fast CLI tool for synchronizing AI documentation rules across GitHub Copilot, Cline, Cursor, and other AI tools. Define rules once in Markdown files and sync them to different output formats.
Fast CLI built with Bun, compatible with Node.js and available via npx.
Note: This project was formerly known as
ai-rule-forge
. The repository has been renamed toai-doc-sync
to better reflect its purpose of synchronizing AI documentation across multiple tools.
AI Docs Sync is a fast CLI tool built with Bun for synchronizing rules and knowledge across AI tools (GitHub Copilot, Cline, Cursor, etc.). It allows you to generate configuration files for various AI tools from a single source with a modular generator architecture.
npx @him0/ai-docs-sync@latest init
# Clone and install
bun install
# Development commands
bun run init # Initialize project
bun run sync # Sync rules to output files
# Build for distribution
bun run build
npx @him0/ai-docs-sync@latest init
This command will:
- Create the
ai-docs/
directory - Create the
ai-docs/rules/
directory with template files - Create the
ai-docs/ignore
file for defining ignore patterns
Edit Markdown files in the ai-docs/rules/
directory to define rules for AI tools.
You can use numeric prefixes (e.g., 01_security.md
) to control the order.
npx @him0/ai-docs-sync@latest
This command reads rule files from the ai-docs/rules/
directory and generates:
.github/copilot-instructions.md
(for GitHub Copilot - merged single file).clinerules/
directory with individual .md files (for Cline).cursor/rules/
directory with .mdc format files with frontmatter (for Cursor)
It also reads the ai-docs/ignore
file and generates:
.copilotignore
(for GitHub Copilot).clineignore
(for Cline).cursor/ignore
(for Cursor)
npx @him0/ai-docs-sync@latest plan
This command previews the content of the files that will be generated without writing them to disk.
Rules are written in standard Markdown format. Each AI tool generator processes the rule files according to its own requirements:
ai-docs/
├── rules/
│ ├── 00_ai-docs-base.md # Base configuration
│ ├── 01_security.md # Security guidelines
│ └── 02_communication.md # Communication rules
└── ignore # Ignore patterns
Each rule file contains standard Markdown content:
# Security Guidelines
Always follow security best practices:
- Never expose API keys or secrets
- Validate all user inputs
- Use secure coding practices
## Code Review
- Review all code changes
- Test security implications
- Document security decisions
- GitHub Copilot: Merges all rule files into a single
.github/copilot-instructions.md
- Cline: Creates individual
.md
files in.clinerules/
directory - Cursor: Converts each file to
.mdc
format with frontmatter in.cursor/rules/
Edit the ai-docs/ignore
file to define patterns that should be ignored by AI tools:
# Ignore patterns for AI assistants
node_modules/
dist/
.env
*.log
When you run npx @him0/ai-docs-sync@latest
, these patterns will be copied to:
.copilotignore
(for GitHub Copilot).clineignore
(for Cline).cursor/ignore
(for Cursor)
Contributions are welcome! Please feel free to submit a Pull Request.