agentleFS
lbb00lbb00/ai-rules-sync/AGENTS.md

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.

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
  1. Distinctive:

    TypeScript Strict Mode: All code must pass strict type checking

    line 63
  2. Distinctive:

    Functional Programming: Prefer pure functions, avoid side effects where possible

    line 64
  3. Very specific:

    Testing Required: All new features must have tests in src/__tests__/

    line 65
  4. Very specific:

    ES Modules: Use .js extension in imports for Node.js compatibility

    line 66
  5. Distinctive:

    Error Handling: Use descriptive error messages with chalk for CLI output

    line 67
  6. Very specific:

    All adapters follow the BaseAdapter interface:

    line 71
  7. Distinctive:

    When making significant code changes, update documentation:

    line 88
  8. Distinctive:

    Document new adapters, commands, or architectural changes

    line 92
  9. Distinctive:

    Add new features, commands, or usage examples

    line 95
  10. Distinctive:

    Keep architecture section current

    line 96
  11. Distinctive:

    Before ending a productive session:

    line 109
  12. Very specific:

    Use /summarize-session to generate artifacts.

    line 123
  13. Very specific:

    Use Vitest's describe, it, expect

    line 128
  14. Distinctive:

    Test adapters independently from CLI

    line 130
  15. Very specific:

    Use conventional commits: feat:, fix:, refactor:, docs:, test:

    line 134
  16. Distinctive:

    Keep commits atomic and focused

    line 136

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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 point

Development 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

  1. TypeScript Strict Mode: All code must pass strict type checking
  2. Functional Programming: Prefer pure functions, avoid side effects where possible
  3. Testing Required: All new features must have tests in src/__tests__/
  4. ES Modules: Use .js extension in imports for Node.js compatibility
  5. 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:

  1. Update KNOWLEDGE_BASE.md (if architecture/features changed)
    • Use /update-knowledge-base skill
    • Document new adapters, commands, or architectural changes
  2. Update README.md (English)
    • Add new features, commands, or usage examples
    • Keep architecture section current
  3. Sync README_ZH.md (Chinese)
    • Use /sync-readme skill
    • Maintain parity with English README
  4. Run Tests
    npm test

Session Summary (End of Session)

Before ending a productive session:

  1. Identify Reusable Patterns → Generate Rules
    • Coding standards discovered
    • Project-specific conventions
  2. Identify Multi-step Workflows → Generate Skills
    • Complex operations that benefit from step-by-step guidance
    • Integration workflows
  3. 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 documentation
  • README_ZH.md - Chinese documentation
  • .cursor/rules/ - Cursor-specific rules (if any)
  • ai-rules-sync.json - Project configuration example

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.