jpcaparas/rulesync
Composer 安装命令:
composer require jpcaparas/rulesync
包简介
Easily sync all of your favourite AI assistant configuration files
README 文档
README
Easily sync all of your favourite AI instruction files (e.g. .cursorrules, copilot-instructions.md, GEMINI.md, CLAUDE.md, AGENTS.md, .clinerules/project.md).
demo.mp4
Installation
Requirements: PHP 8.2+ is required for all installation options.
Choose the method that works best for your workflow:
Option 1: Standalone Executable (Recommended)
Download the pre-built executable - no Composer required!
# Download from GitHub releases curl -L -o rulesync https://github.com/jpcaparas/rulesync/releases/latest/download/rulesync chmod +x rulesync ./rulesync --help # Optional: Add to PATH for global access sudo mv rulesync /usr/local/bin/ rulesync --help
Option 2: Global Composer Binary
Install globally via Composer (adds to your $PATH automatically):
composer global require jpcaparas/rulesync rulesync --help
Option 3: Development Dependency
Add to your project's development dependencies:
composer require --dev jpcaparas/rulesync ./vendor/bin/rulesync --help
Quick Start
- Create a
rulesync.mdfile with your rules - Run
rulesync generateto create all AI assistant rule files - Your rules are now synced across Claude, Cursor, Windsurf, Gemini CLI, GitHub Copilot, OpenAI Codex, Cline, and Junie!
Commands
rulesync rules:list- Show available AI assistantsrulesync generate- Generate rule files from rulesync.mdrulesync gitignore:generate- Add AI assistant rule files to .gitignorerulesync config- View current configurationrulesync disable <name>- Disable specific AI assistantrulesync enable <name>- Enable specific AI assistantrulesync base <path>- Set base rules (URL or file path)
Supported AI Assistants
- Claude →
CLAUDE.md - Cline →
.clinerules/project.md - Cursor →
.cursorrules - Gemini CLI →
GEMINI.md - GitHub Copilot →
.github/copilot-instructions.md - Junie →
.junie/guidelines.md - OpenAI Codex →
AGENTS.md - Windsurf →
.windsurfrules
FAQ
Rule Augmentation
Q: How does local and global rule augmentation work?
A: Rulesync automatically detects whether you're in a local project (with composer.json) or global context. When both local (./rulesync.md) and global (~/.config/rulesync/rulesync.md) rule files exist, the system prompts you to:
- Combine both files: Local rules first, then global rules separated by
--- - Use local only: Ignore global rules entirely
Your preference is saved for future generate calls, but can be changed anytime.
Q: Can I disable certain AI assistants?
A: Yes! Use these commands:
rulesync disable <name>- Disable specific AI assistant (e.g.,rulesync disable claude)rulesync enable <name>- Re-enable a disabled assistantrulesync rules:list- View all assistants and their enabled/disabled status
Disabled assistants won't have their rule files generated during rulesync generate.
Q: How does overwrite protection work?
A: By default, Rulesync protects existing rule files by:
- Comparing content using MD5 hashing
- Prompting for confirmation when files exist and differ
- Skipping files that already have identical content
You can override this behaviour with:
--overwrite- Force overwrite existing files--force- Skip all prompts and force generation
Q: Can I use base rules from external sources?
A: Yes! The base rules system allows you to:
- Set base rules from URLs:
rulesync base https://example.com/rules.md - Set base rules from local files:
rulesync base ./shared-rules.md - Disable base rules:
rulesync base --disable - View current base rules:
rulesync base
Base rules are appended to your final rule files after local/global augmentation.
Building Standalone Executable
You can build Rulesync as a standalone PHAR executable that doesn't require Composer on the target system (PHP 8.2+ is still required).
Prerequisites
Install Box globally:
composer global require humbug/box
Build Commands
Basic build:
php rulesync build
Build with specific version:
php rulesync build 1.0.0
Create full release (with tests):
php rulesync release 1.0.0
Build with verbose output (for debugging):
php rulesync build 1.0.0 --verbose
Output
The standalone executable is created at builds/rulesync and includes all dependencies. You can distribute this single file without requiring users to install Composer or manage dependencies (PHP 8.2+ is still required).
Test the build:
./builds/rulesync --version ./builds/rulesync --help
Notes
- The version argument updates the version in
config/app.phpbefore building - Use
--verboseflag to see detailed Box compilation output for debugging - The build process includes all dependencies (including dev dependencies) in the final PHAR
- The
releasecommand runs tests, builds the PHAR, but no longer creates a tarball
License
MIT
jpcaparas/rulesync 适用场景与选型建议
jpcaparas/rulesync 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9 次下载、GitHub Stars 达 13, 最近一次更新时间为 2025 年 07 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「synchronization」 「rules」 「cursor」 「assistant」 「ai」 「Gemini」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 jpcaparas/rulesync 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jpcaparas/rulesync 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 jpcaparas/rulesync 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Sync files from various sources to neos assets.
AI agent skills for framework-agnostic Composer package authors. Pairs with sandermuller/boost-core for sync to nine AI agents.
Magento 2 module which adds support for Speculation Rules API for instant page loads.
The coding standard applying to all Youdot PHP projects, based on Doctrine set of PHPCS rules, with additional checks.
Business rules engine tools.
Read-only MCP (Model Context Protocol) server for Laravel. Give Claude Code, Cursor, and AI coding agents safe live access to your database, logs, queue, cache, routes, and config. No Sanctum, no user table, no write access.
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 13
- 点击次数: 24
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-05