agentleFS
googlarzgooglarz/agents-sync/skill/SKILL.md

agents-sync

Skill5 starsChanged 6 months agoMITView on GitHub

Generate and sync AI context files (AGENTS.md, CLAUDE.md, .cursorrules, copilot-instructions.md, GEMINI.md, .windsurfrules, .clinerules, .roomodes, CONVENTIONS.md, .kiro/steering/, .trae/rules/) from your codebase. One canonical source, every tool stays current.

  • Reads credentials

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. Quarktex/qcobrain★ 4same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 5 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Add to your Claude Code MCP config (.claude/settings.json or ~/.claude/claude_desktop_config.json):

    line 13
  2. Distinctive:

    When to use: After major refactors, new dependencies, architecture changes.

    line 55
  3. Very specific:

    Add --fast to skip Claude API call when drift is minor (re-derives from existing AGENTS.md, still refreshes MCP + codegraph sections for …

    line 58
  4. Very specific:

    Add --dry-run to preview changes without writing

    line 59
  5. Distinctive:

    When to use: After manually editing AGENTS.md and wanting all tool files to reflect the changes immediately.

    line 71
  6. Distinctive:

    Check what changed in your codebase since the last sync.

    line 81
  7. Distinctive:

    Check whether all managed files are in sync with AGENTS.md.

    line 104
  8. Very specific:

    Verify the codebase against mechanically-checkable Never rules in AGENTS.md.

    line 114
  9. Very specific:

    Use --no-session-hook to install only the pre-commit hook.

    line 145
  10. Very specific:

    When the user types /agents-sync <command>, call the corresponding MCP tool:

    line 154
  11. Very specific:

    Determine projectPath: Use the current working directory.

    line 170
  12. Distinctive:

    Add AGENTS.md to git

    line 187
  13. Very specific:

    Add .agents-sync/ to .gitignore

    line 188
  14. Very specific:

    Add this anywhere in AGENTS.md, CLAUDE.md, .cursorrules, etc.

    line 208

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill 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
SKILL.md

agents-sync

Generate and sync AI context files across every coding tool you use.

Prerequisites

Add to your Claude Code MCP config (.claude/settings.json or ~/.claude/claude_desktop_config.json):

{
  "mcpServers": {
    "agents-sync": {
      "command": "npx",
      "args": ["@googlarz/agents-sync"],
      "env": { "ANTHROPIC_API_KEY": "sk-ant-..." }
    }
  }
}

Then restart Claude Code to connect.

Commands

/agents-sync init

First-time setup. Reads your codebase and generates all context files.

When to use: New project, or starting from scratch.

What it does:

  1. Scans your codebase (manifests, structure, source samples, docs, TODO/FIXME comments)
  2. Extracts project metadata via Claude API
  3. Generates canonical AGENTS.md
  4. Derives CLAUDE.md, .cursorrules, .github/copilot-instructions.md, GEMINI.md, .windsurfrules, .clinerules, .roomodes, CONVENTIONS.md, .kiro/steering/agents-sync.md, .trae/rules/agents-sync.md
  5. Saves a snapshot for drift detection

Usage:

Run /agents-sync init on this project

Claude will call agents_sync_init with the current project path.


/agents-sync sync

Re-sync after your codebase has changed. Preserves any manual customizations.

When to use: After major refactors, new dependencies, architecture changes.

Options:

  • Add --fast to skip Claude API call when drift is minor (re-derives from existing AGENTS.md, still refreshes MCP + codegraph sections for free)
  • Add --dry-run to preview changes without writing

Usage:

Sync my AI context files /agents-sync sync --fast


/agents-sync derive

Re-derive all tool files from the current AGENTS.md without re-running the scanner or calling the Claude API.

When to use: After manually editing AGENTS.md and wanting all tool files to reflect the changes immediately.

Usage:

/agents-sync derive I edited AGENTS.md, update all tool files


/agents-sync drift

Check what changed in your codebase since the last sync. Read-only.

Usage:

What's drifted in my AI context files? /agents-sync drift


/agents-sync export [tool]

Re-derive a single tool file without re-running analysis.

Tools: claude, cursor, copilot, gemini, windsurf, cline, roo, aider, kiro, trae

Usage:

/agents-sync export cursor Regenerate just my .cursorrules /agents-sync export kiro


/agents-sync validate

Check whether all managed files are in sync with AGENTS.md.

Usage:

/agents-sync validate Are my AI context files in sync?


/agents-sync lint

Verify the codebase against mechanically-checkable Never rules in AGENTS.md.

Usage:

/agents-sync lint


/agents-sync status

Show sync status: last sync time, managed files, drift score.

Usage:

/agents-sync status


/agents-sync scan

Show what the scanner detected — language, framework, dependencies, MCP servers. No API key needed.

Usage:

/agents-sync scan


/agents-sync install-hook

Install two hooks:

  1. Pre-commit — blocks commits when AI context files have drifted (auto-detects husky, lefthook, or plain git)
  2. Claude Code SessionStart — writes .claude/settings.json hook that auto-loads AGENTS.md as context at session start

Use --no-session-hook to install only the pre-commit hook.

Usage:

/agents-sync install-hook


How Claude Should Handle These Commands

When the user types /agents-sync <command>, call the corresponding MCP tool:

CommandMCP ToolRequired params
initagents_sync_initprojectPath = cwd
syncagents_sync_syncprojectPath = cwd
deriveagents_sync_deriveprojectPath = cwd
driftagents_sync_driftprojectPath = cwd
export <tool>agents_sync_exportprojectPath = cwd, tool = argument
validateagents_sync_validateprojectPath = cwd
lintagents_sync_lintprojectPath = cwd
statusagents_sync_statusprojectPath = cwd
scanagents_sync_scanprojectPath = cwd
install-hookagents_sync_install_hookprojectPath = cwd
uninstall-hookagents_sync_uninstall_hookprojectPath = cwd

Determine projectPath: Use the current working directory. If ambiguous, ask the user which project to target.

If MCP not connected: Respond with:

agents-sync MCP server is not connected. Add this to your Claude Code settings and restart:

{
  "mcpServers": {
    "agents-sync": {
      "command": "npx",
      "args": ["@googlarz/agents-sync"],
      "env": { "ANTHROPIC_API_KEY": "sk-ant-..." }
    }
  }
}

After init: Remind the user to:

  1. Add AGENTS.md to git
  2. Add .agents-sync/ to .gitignore

After sync: Show the list of files updated.

Flags parsing:

  • --fast → set fast: true in agents_sync_sync
  • --dry-run → set dryRun: true
  • --strict / --ci → set strict: true in agents_sync_validate

Custom Sections

Users can add permanent customizations to any managed file that survive re-syncs:

<!-- AGENTS-SYNC:CUSTOM:START -->
When working on the payments module, always check with @alice first.
Use staging Stripe keys (in .env.staging) for all local testing.
<!-- AGENTS-SYNC:CUSTOM:END -->

Add this anywhere in AGENTS.md, CLAUDE.md, .cursorrules, etc. Re-sync preserves it.

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.