Skip to content
juwonllee2024-dotcomPublic

About

The ESLint & Babel for AI Agent Rules — Compile, lint, optimize, and sync instructions across AGENTS.md, CLAUDE.md, .cursor/rules, and Copilot.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

9 Commits

Folders and files

Repository files navigation

RuleSync 활용 실험

RuleSync 활용 실험 — portfolio visual

Portfolio introduction card, not a screenshot of a running application.

포트폴리오 소개 카드입니다. 실행 화면 캡처가 아닙니다.

English

A RuleSync-related integration experiment in this account. This is not presented as an independently authored upstream project. The previously recorded rulesync/rulesync URL was unavailable during review; exact upstream lineage still needs verification.

View JUWON's portfolio · Browse the project collection

Scope: This README presents the repository's documented intent and recorded visual evidence. It does not certify that every feature is complete, deployed, or currently working. Follow the original setup, safety, and license documentation below.

한국어

이 계정의 RuleSync 활용 실험입니다. 독자 제작 원작으로 소개하지 않습니다. 이전에 기록한 rulesync/rulesync 주소는 확인 시 접근 불가였으며, 정확한 원작 계보는 추가 확인이 필요합니다.

JUWON 포트폴리오 보기 · 전체 프로젝트 보기

확인 범위: 저장소의 문서상 목적과 기록된 화면 근거를 소개합니다. 모든 기능의 완성·배포·현재 정상 작동을 보증하지 않습니다. 설치법·안전 주의사항·라이선스는 아래 기존 문서를 확인하세요.


Original documentation / 기존 문서

⚡ RuleSync

The ESLint & Babel for AI Agent Rules — Compile, lint, optimize, and sync instructions across AGENTS.md, CLAUDE.md, .cursor/rules, and Copilot.

CI Workflows npm version License: MIT Node.js Version


💡 What is RuleSync?

RuleSync is an open-source CLI engine, static analyzer, and cross-format compiler for AI agent context instruction rules. It allows developers and engineering teams to write a single canonical source of truth (AGENTS.md or .rulesync/) and automatically compile, lint, optimize, and synchronize instructions across Cursor, Anthropic Claude Code, GitHub Copilot, Cline / RooCode, Windsurf, and OpenCode.

                           ┌───────────────────────────┐
                           │    Source: AGENTS.md      │
                           │  (Canonical Rules File)   │
                           └─────────────┬─────────────┘
                                         │
                                         ▼
                           ┌───────────────────────────┐
                           │   Abstract Rule Tree      │
                           │         (ART)             │
                           └─────────────┬─────────────┘
                                         │
                   ┌─────────────────────┴─────────────────────┐
                   ▼                                           ▼
     ┌───────────────────────────┐               ┌───────────────────────────┐
     │   Static Linter Engine    │               │  Multi-Target Compiler    │
     │ ├─ Duplicate check        │               │ ├─ CLAUDE.md              │
     │ ├─ Conflict detector      │               │ ├─ .cursor/rules/*.mdc    │
     │ ├─ Token budget check     │               │ ├─ copilot-instructions   │
     │ └─ Security sanitizer     │               │ ├─ .cline/instructions    │
     └───────────────────────────┘               │ └─ .windsurfrules         │
                                                 └───────────────────────────┘

🎯 Who is it for?

  • Polyglot AI Developers: Working with 2+ AI tools (e.g. Claude Code CLI + Cursor IDE + GitHub Copilot) who want consistent rule behaviors across all assistants without manual copy-pasting.
  • Open-Source Maintainers: Defining repo-wide architectural guidelines, testing rules, and security standards for community contributors using different AI tools.
  • Engineering Teams & DevSecOps: Standardizing security guardrails, forbidden packages, and code styling rules across engineering teams, verifying rule consistency in CI/CD pipelines.

⚡ 1-Minute Quickstart

Try RuleSync immediately in any project without installation:

# Download the verified rulesync-1.2.0.tgz asset from GitHub Releases.
# The public npm name `rulesync` currently belongs to another project.
npm install --global ./rulesync-1.2.0.tgz

# 1. Bootstrap canonical AGENTS.md rule file and configuration
rulesync init

# 2. Ask why a rule applies to one file
rulesync explain src/app.ts --target cursor

# 3. Lint and cross-compile target instruction files
rulesync lint
rulesync build

Package note: npx rulesync is not safe before installing the release tarball because the npm registry name currently resolves to a different package. Each release includes a SHA-256 file beside the tarball so installation stays reviewable and offline after download.

See exactly what your agent receives

Rule files can be synchronized and still be unclear at review time. receipt creates a local fingerprint for the canonical source and every compiled target:

npx rulesync receipt --format html --output .rulesync/context-receipt.html
open .rulesync/context-receipt.html

The receipt shows a 12-character context ID, SHA-256 values, byte/token estimates, and SYNCED, MISSING, or DRIFTED status. It never prints rule contents or calls a network. Use it in CI:

npx rulesync receipt --check --format json --output .rulesync/context-receipt.json

Share the context ID in a pull request when someone asks, “Which instructions did the agent see?” A receipt fingerprints expected compiled bytes; it does not claim runtime loading.

Context Lens: answer “why did this rule apply?”

receipt proves generated bytes are synchronized. explain answers the next question: for this exact file, which rules are included, which are excluded, and which glob caused the decision? It prints rule names and source lines, never rule bodies:

rulesync explain src/payments/checkout.ts --target cursor
rulesync explain tests/checkout.spec.ts --format markdown --output .rulesync/checkout-context.md
rulesync explain src/payments/checkout.ts --format json

Context Lens is a local static prediction. It does not claim that Cursor, Claude, Copilot, or another provider loaded or obeyed the resulting instructions at runtime.


🔍 Why RuleSync?

Feature Manual Copy-Paste Caliber / Paid Tools RuleSync (OSS)
Cross-Tool Compilation ❌ Manual ⚠️ Limited ✅ 10+ Target Adapters
Static Linter Engine ❌ None ❌ None ✅ 7 AST Linter Rules
Conflict & Duplicate Detection ❌ None ❌ None ✅ AST Analysis
Token Budget Optimization ❌ Manual ❌ None ✅ Automated Token Check
Security & Secret Sanitizer ❌ None ❌ None ✅ Intercepts API Keys & Shell Bugs
100% Offline & $0 Operating Cost ✅ Yes ❌ Paid / SaaS ✅ Pure Local Open-Source
CI / Pre-commit Synchronization ❌ None ❌ None ✅ rulesync check

🛠️ Supported Target Adapters

Target Generated Output Description
claude CLAUDE.md Anthropic Claude Code terminal agent rules
cursor .cursor/rules/rulesync.mdc Cursor IDE rules with YAML frontmatter globs
copilot .github/copilot-instructions.md GitHub Copilot repository guidelines
cline .cline/instructions.json Cline / RooCode custom instructions JSON
windsurf .windsurfrules Windsurf Cascade agent rules
agents AGENTS.md OpenCode / Standard universal agent specification

🧪 Static Linter Rules Matrix

RuleSync analyzes your markdown rules using AST parsing to catch common prompt anti-patterns before they cause LLM hallucinations:

Rule Code Severity Description
no-duplicate-rules error Flags duplicate or identical rule instructions.
no-contradictory-directives error Catches conflicting guidance (e.g. prefer types vs prefer interfaces).
no-unsafe-commands error Identifies dangerous shell commands (rm -rf /, chmod 777, curl | bash).
no-secret-patterns error Intercepts hardcoded API keys (sk-ant-*, ghp_*, AKIA*) in rule files.
max-token-budget warning Warns when rule sets exceed context window budgets (> 2,000 tokens).
require-glob-scope warning Recommends scoping tech-specific rules with file glob annotations.
no-empty-rules warning Flags empty rule header sections.

💻 CLI Reference

rulesync init

Bootstraps a canonical AGENTS.md file and creates .rulesync/config.json.

npx rulesync init [--force]

rulesync lint

Lints source rule files against static analysis rules and token budgets.

npx rulesync lint [--format json] [--max-tokens 2000]

rulesync build

Compiles source rules into all enabled target AI rule files.

npx rulesync build [--targets claude,cursor,copilot] [--dry-run]

rulesync check

CI / pre-commit verification mode — exits with code 1 if target files are out of sync.

npx rulesync check [--quiet]

rulesync watch

Live file watcher mode — automatically compiles target files whenever AGENTS.md is saved.

npx rulesync watch

rulesync diff

Previews terminal colorized diffs between compiled target outputs and disk files.

npx rulesync diff [--target cursor]

rulesync receipt

Creates a machine-readable, Markdown, or standalone HTML fingerprint of every configured target. --check exits with code 1 when a target is missing or drifted.

npx rulesync receipt [--format json|markdown|html] [--output <path>] [--check]

### `rulesync explain <path>`

Predict which canonical rules apply to one workspace-relative file. Use `--target` to show the generated target path and `--format pretty|json|markdown` for terminal, CI, or pull-request output.

```bash
rulesync explain src/index.ts --target claude

---

## ⚙️ Configuration (`.rulesync/config.json`)

```json
{
  "source": "AGENTS.md",
  "targets": ["claude", "cursor", "copilot", "cline", "windsurf"],
  "maxTokens": 2000,
  "headerComment": true,
  "ignoreRules": []
}

🔒 Security & Privacy Model

  • Strict Workspace Boundary: Path resolution is strictly constrained within process.cwd() using sanitizeWorkspacePath(). Attempts to traverse outside workspace boundaries (../../) trigger an immediate security exception.
  • 100% Offline & Private: Zero remote telemetry, zero external API calls, zero server tracking.

🤝 Contributing

We welcome community contributions! Please read our Contributing Guide and Code of Conduct.


📜 License

MIT License © 2026 RuleSync Contributors

About

The ESLint & Babel for AI Agent Rules — Compile, lint, optimize, and sync instructions across AGENTS.md, CLAUDE.md, .cursor/rules, and Copilot.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages