PHPackages                             jpcaparas/rulesync - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. jpcaparas/rulesync

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

jpcaparas/rulesync
==================

Easily sync all of your favourite AI assistant configuration files

v0.1.18(10mo ago)1391[1 PRs](https://github.com/jpcaparas/rulesync/pulls)MITPHPPHP ^8.2CI failing

Since Jul 5Pushed 9mo agoCompare

[ Source](https://github.com/jpcaparas/rulesync)[ Packagist](https://packagist.org/packages/jpcaparas/rulesync)[ Docs](https://github.com/jpcaparas/rulesync)[ RSS](/packages/jpcaparas-rulesync/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (11)Used By (0)

Rulesync
========

[](#rulesync)

 [![](https://private-user-images.githubusercontent.com/2406808/462747004-307c2333-d2a0-449d-a5a8-50919e66746d.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU1Njc0OTMsIm5iZiI6MTc3NTU2NzE5MywicGF0aCI6Ii8yNDA2ODA4LzQ2Mjc0NzAwNC0zMDdjMjMzMy1kMmEwLTQ0OWQtYTVhOC01MDkxOWU2Njc0NmQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDQwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjA0MDdUMTMwNjMzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZmIzYTM1Zjc2N2QxMTdhZmRiYWZkMmYyNDNmNzAzNWMzYmQwMzkwYjQ5NjcxZjczOTk5NWY0NDNhNmY3NzAxNCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.vLTSVyUI1qHRTjRAI9FBjkcMbJWf09AAhgR35nnhlsc)](https://private-user-images.githubusercontent.com/2406808/462747004-307c2333-d2a0-449d-a5a8-50919e66746d.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU1Njc0OTMsIm5iZiI6MTc3NTU2NzE5MywicGF0aCI6Ii8yNDA2ODA4LzQ2Mjc0NzAwNC0zMDdjMjMzMy1kMmEwLTQ0OWQtYTVhOC01MDkxOWU2Njc0NmQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDQwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjA0MDdUMTMwNjMzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZmIzYTM1Zjc2N2QxMTdhZmRiYWZkMmYyNDNmNzAzNWMzYmQwMzkwYjQ5NjcxZjczOTk5NWY0NDNhNmY3NzAxNCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.vLTSVyUI1qHRTjRAI9FBjkcMbJWf09AAhgR35nnhlsc)

 [ ![Tests](https://github.com/jpcaparas/rulesync/actions/workflows/tests.yml/badge.svg) ](https://github.com/jpcaparas/rulesync/actions/workflows/tests.yml) [ ![Coverage](https://camo.githubusercontent.com/e803b287c34601a69ddefa094fc46b79d4f5d3a767add081f672f7a813cd8ead/68747470733a2f2f636f6465636f762e696f2f67682f6a70636170617261732f72756c6573796e632f6272616e63682f6d61696e2f67726170682f62616467652e737667) ](https://codecov.io/gh/jpcaparas/rulesync)

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
------------

[](#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)

[](#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

[](#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

[](#option-3-development-dependency)

Add to your project's development dependencies:

```
composer require --dev jpcaparas/rulesync
./vendor/bin/rulesync --help
```

Quick Start
-----------

[](#quick-start)

1. Create a `rulesync.md` file with your rules
2. Run `rulesync generate` to create all AI assistant rule files
3. Your rules are now synced across Claude, Cursor, Windsurf, Gemini CLI, GitHub Copilot, OpenAI Codex, Cline, and Junie!

Commands
--------

[](#commands)

- `rulesync rules:list` - Show available AI assistants
- `rulesync generate` - Generate rule files from rulesync.md
- `rulesync gitignore:generate` - Add AI assistant rule files to .gitignore
- `rulesync config` - View current configuration
- `rulesync disable ` - Disable specific AI assistant
- `rulesync enable ` - Enable specific AI assistant
- `rulesync base ` - Set base rules (URL or file path)

Supported AI Assistants
-----------------------

[](#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
---

[](#faq)

### Rule Augmentation

[](#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 ` - Disable specific AI assistant (e.g., `rulesync disable claude`)
- `rulesync enable ` - Re-enable a disabled assistant
- `rulesync 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
------------------------------

[](#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

[](#prerequisites)

Install Box globally:

```
composer global require humbug/box
```

### Build Commands

[](#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

[](#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

[](#notes)

- The version argument updates the version in `config/app.php` before building
- Use `--verbose` flag to see detailed Box compilation output for debugging
- The build process includes all dependencies (including dev dependencies) in the final PHAR
- The `release` command runs tests, builds the PHAR, but no longer creates a tarball

License
-------

[](#license)

MIT

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance55

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

9

Last Release

317d ago

PHP version history (2 changes)v0.1PHP ^8.2

v0.1.2PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2406808?v=4)[JP Caparas](/maintainers/jpcaparas)[@jpcaparas](https://github.com/jpcaparas)

---

Top Contributors

[![jpcaparas](https://avatars.githubusercontent.com/u/2406808?v=4)](https://github.com/jpcaparas "jpcaparas (30 commits)")

---

Tags

aiclaude-codeclinecodexgemini-cliruleswindsurfaisynchronizationrulescursorGeminiclaudewindsurfgithub-copilotassistant

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/jpcaparas-rulesync/health.svg)

```
[![Health](https://phpackages.com/badges/jpcaparas-rulesync/health.svg)](https://phpackages.com/packages/jpcaparas-rulesync)
```

###  Alternatives

[cognesy/instructor-php

The complete AI toolkit for PHP: unified LLM API, structured outputs, agents, and coding agent control

310107.9k1](/packages/cognesy-instructor-php)[vizra/vizra-adk

Vizra Agent Development Kit - A comprehensive Laravel package for building intelligent AI agents.

29026.1k](/packages/vizra-vizra-adk)[sbsaga/toon

🧠 TOON for Laravel — a compact, human-readable, and token-efficient data format for AI prompts &amp; LLM contexts. Perfect for ChatGPT, Gemini, Claude, Mistral, and OpenAI integrations (JSON ⇄ TOON).

6115.6k](/packages/sbsaga-toon)[shipfastlabs/agent-detector

Detect if code is running in an AI agent or automated development environment

372.5k4](/packages/shipfastlabs-agent-detector)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
