conforme / rules
Cursor rule3 starsChanged 59 days agoMITView on GitHub
conforme is a Rust CLI that synchronizes AI coding agent configurations across 12 tools. It reads config from a source tool (Claude Code, Cursor, etc.) or AGENTS.md, and propagates to all other tool-specific config files.
- Reads credentials
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/adapter-consistency.mdcCursor rule
- .cursor/rules/rust-conventions.mdcCursor rule
- .cursor/rules/testing.mdcCursor rule
- verify-providersSkill
- verify-providersSkill
- verify-providersSkill
- verify-providersSkill
The file
We split this general.mdc into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 100
IMPORTANT: When adding/removing adapters, commands, or changing behavior, update ALL of:
- Very specific: line 126
If no activation comment: defaults to always.
- Very specific: line 223
Every JSON file conforme merges into (.mcp.json, .cursor/mcp.json, .kiro/settings/mcp.json, .devin/mcp_config.json, opencode.json, …
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule 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.
Files
---
alwaysApply: true
---
# CLAUDE.md
## Project overview
conforme is a Rust CLI that synchronizes AI coding agent configurations across 12 tools. It reads config from a source tool (Claude Code, Cursor, etc.) or AGENTS.md, and propagates to all other tool-specific config files.
## Build & test
```bash
cargo build --release
cargo test
cargo clippy -- -D warnings # lint — MUST pass before pushing
cargo fmt -- --check # format check
conforme check # verify AI configs are in sync (dogfooding)
```
## Architecture
```
src/
main.rs — Entry point, dispatches subcommands
cli.rs — CLI arg parsing (clap derive)
config.rs — NormalizedConfig, NormalizedRule, NormalizedSkill, NormalizedAgent, NormalizedMcpServer, ActivationMode
markdown.rs — AGENTS.md parser (sections → rules via ## Rule: headings)
frontmatter.rs — gray_matter wrapper for YAML frontmatter parsing/serialization
lib.rs — Library crate re-exports (adapters, config, etc.)
sync.rs — Core sync engine: init, sync, check, status, remove, diff, migrate commands
(target_config, renamed-id check, AGENTS.md output unless the source reads it)
detect.rs — Tool detection (which tools present in project)
hash.rs — SHA-256 content hashing for change detection
json_settings.rs — JSONC-safe merge of conforme's keys into user-owned JSON settings files
(in-place edit keeps comments; unparsable file is refused, never overwritten;
merge_server_entries keeps per-server keys conforme does not own;
server_settings_file leaves the file untouched when the source has no server)
hook.rs — Git pre-commit hook install/uninstall (like Husky)
gitignore.rs — `conforme gitignore install/uninstall`: ignores the files each non-source
adapter owns (root files anchored, rules/agents dirs by suffix);
merged settings files and the source's own locations stay tracked
project_config.rs — .conformerc.toml parser (source, only, exclude, clean options)
validate.rs — Config validation (duplicate names, empty content, invalid globs,
names that sanitize to nothing or collide, over-long skill descriptions)
watch.rs — File watcher for auto-sync (notify + debounce)
help_ai.rs — Detailed help about all supported tools and formats
mcp.rs — MCP config generation/parsing per tool:
- JSON entry shapes are data (`ServerShape`: type values, URL key, env on remote,
env-var syntax) fed to one builder; every JSON target is merged via json_settings
- EnvRefStyle: `${VAR}` normalized, written as `${env:VAR}` (Cursor, VS Code, Zoo,
Devin) or `{env:VAR}` (OpenCode), read back by canonicalize_env_refs
- Codex: project `.codex/config.toml`, atomically merged with comment/settings preservation; strict safe parser — merge_codex_mcp_toml / parse_codex_mcp_toml
- Claude, Kiro: mcpServers with type stdio/http; Cursor: no type on remote entries
- Zoo Code: mcpServers, HTTP uses type "streamable-http" (not "http"), no env on remote
- Claude .mcp.json parsing accepts http/https, sse, streamable-http, and ws transports (all mapped to the HTTP variant)
- Copilot: "servers" key (env on stdio, headers on HTTP)
- Devin: mcpServers in .devin/mcp_config.json, no type, remote `transport: http`
- OpenCode: "mcp" key merged into opencode.json, type local/remote, command as array, `environment` key (local only);
merge_opencode_agents keeps the user's own `agent` entries
- Zed: "context_servers" key
- Gemini: mcpServers, no type field, httpUrl for HTTP
- Amp: "amp.mcpServers" key merged into .amp/settings.json(c) — build_amp_mcp_object
- parse_mcp_json reads back mcpServers / servers / context_servers / amp.mcpServers
- OpenCode needs its own inverse (parse_opencode_mcp_object / parse_opencode_agent_object)
skills.rs — Skills (SKILL.md) and agents generation per tool; shared read helpers
preserve manual_invocation (and Codex policy sidecars, created only in
.agents/skills) across sync (read_skills_from_dir, read_skills_recursive,
read_agents_from_dir, parse_frontmatter_tool_list) used by adapters to
round-trip skills/agents on read(); TOOL_EQUIVALENTS translates agent tools
for Claude/Gemini/Kiro; claude_model/gemini_model/opencode_model filter models
adapters/
mod.rs — AiToolAdapter trait + registry + shared write_if_changed +
collect_rule_files (recursive rules-dir scan, sorted by base name) +
ManagedDir / clean_orphans
claude.rs — Claude Code: CLAUDE.md (or .claude/CLAUDE.md when only that exists)
+ .claude/rules/**/*.md, read recursively (paths: frontmatter)
cursor.rs — Cursor: .cursor/rules/**/*.mdc, read recursively (alwaysApply/globs/description); subagents at .cursor/agents/*.md
devin.rs — Devin Desktop (formerly Windsurf): writes .devin/{rules,skills,mcp_config.json}; reads
.devin/ and the legacy .windsurf/ (both loaded upstream) and cleans conforme's legacy copies
copilot.rs — GitHub Copilot: .github/copilot-instructions.md (applyTo); skills at .github/skills/<name>/SKILL.md; MCP merged into .vscode/mcp.json
codex.rs — OpenAI Codex CLI: reads AGENTS.md natively
opencode.rs — OpenCode: reads AGENTS.md natively
zoocode.rs — Zoo Code (community fork of Roo Code): .roo/rules/**/*.md, read recursively (plain Markdown)
gemini.rs — Gemini CLI: GEMINI.md
zed.rs — Zed AI: .rules file
kiro.rs — Kiro (AWS): .kiro/steering/*.md (inclusion/fileMatchPattern)
amp.rs — Amp: reads AGENTS.md natively; MCP in .amp/settings.json (or .jsonc)
deepseek.rs — DeepSeek Harness (dsh): reads AGENTS.md natively; skills at .dsh/skills/<name>/SKILL.md
tests/
integration.rs — CLI integration tests (assert_cmd + tempfile)
roundtrip.rs — Write→read round-trip tests for every adapter (rules, skills, agents, MCP)
error_cases.rs — Edge cases, MCP sync, agents sync, activation modes
docs/
providers/ — One doc per supported tool with official URLs, config format, adapter notes
```
## Keeping docs in sync
**IMPORTANT**: When adding/removing adapters, commands, or changing behavior, update ALL of:
1. `README.md` — supported tools table, CLI commands, activation mapping table
2. `src/help_ai.rs` — the `conforme help-ai` output must list all tools with correct formats
3. `src/cli.rs` — the `after_help` examples and `long_about` tool count
4. `src/project_config.rs` — if adding new config options
5. `src/validate.rs` — if adding new validation rules
6. `src/watch.rs` — if changing watched file patterns
7. `docs/providers/<tool>.md` — provider-specific documentation
8. This `CLAUDE.md` — architecture section and test count
## Key concepts
### AGENTS.md convention
conforme uses `## Rule: <name>` headings and HTML comments for activation metadata:
```markdown
# Instructions
General instructions.
## Rule: TypeScript
<!-- activation: glob **/*.ts,**/*.tsx -->
Content.
```
Activation modes: `always`, `glob <patterns>`, `agent-decision`, `manual`.
If no activation comment: defaults to `always`.
Also supports `## Skill:`, `## Agent:`, and `## MCP:` sections:
```markdown
## Skill: deploy
<!-- description: Deploy the app -->
<!-- invocation: manual -->
<!-- tools: Bash -->
Run npm run deploy.
## Agent: reviewer
<!-- description: Code review -->
<!-- model: gpt-4o -->
<!-- tools: codebase -->
<!-- color: cyan -->
<!-- permission-mode: plan -->
Review for bugs.
## MCP: filesystem
<!-- command: npx -->
<!-- args: -y, @mcp/server-filesystem -->
<!-- env: ROOT=${HOME} -->
## MCP: github
<!-- url: https://api.githubcopilot.com/mcp/ -->
<!-- headers: Authorization=Bearer ${GITHUB_TOKEN} -->
```
### Adapter categories
**Per-rule adapters** (have frontmatter or per-file rules):
- Claude, Cursor, Devin, Copilot, Kiro, Zoo Code
**Single-file adapters** (merge all content into one file):
- Codex, OpenCode, Gemini, Zed, Amp, DeepSeek Harness
### Adapter mapping
| Activation | Claude | Cursor | Devin | Copilot | Kiro |
|---|---|---|---|---|---|
| Always | in CLAUDE.md | `alwaysApply: true` | `trigger: always_on` | in main file | `inclusion: always` |
| GlobMatch | `paths: [globs]` | `globs:` | `trigger: glob` | `applyTo:` | `inclusion: fileMatch` |
| AgentDecision | no frontmatter | `description:` | `trigger: model_decision` | in main file | `inclusion: auto` |
| Manual | no frontmatter | `alwaysApply: false` | `trigger: manual` | in main file | `inclusion: manual` |
### MCP key mapping per tool
| Tool | JSON key | Notes |
|---|---|---|
| Claude, Kiro | `mcpServers` (`.mcp.json`, `.kiro/settings/mcp.json`) | `type: stdio/http`; merged (keeps `oauth`, Kiro `autoApprove`/`disabledTools`) |
| Cursor | `mcpServers` (`.cursor/mcp.json`) | `type: stdio` locally, no `type` on remote entries; `${env:VAR}`; merged |
| Zoo Code | `mcpServers` (inside `.roo/mcp.json`) | HTTP uses `type: streamable-http` (not `http`), no `env` on remote servers; merged (keeps Zoo's `alwaysAllow`/`disabledTools`) |
| Copilot | `servers` (inside `.vscode/mcp.json`) | VS Code format; `env` on stdio, `headers` on HTTP; merged (keeps `inputs`/`sandbox`) |
| Devin | `mcpServers` (inside `.devin/mcp_config.json`) | No type field; remote `url` + `transport: http`; `${env:VAR}`; merged |
| OpenCode | `mcp` (inside `opencode.json`) | `type: local/remote`; `command` is a single array; env key is `environment` (local only); `{env:VAR}`; merged (preserves user keys) |
| Zed | `context_servers` (inside `.zed/settings.json`) | No type field; merged into existing settings (preserves theme/keybindings/etc.) |
| Gemini | `mcpServers` (inside `.gemini/settings.json`) | No type field, uses `httpUrl` for HTTP; merged into existing settings |
| Amp | `amp.mcpServers` (inside `.amp/settings.json` or `.jsonc`) | Dotted key; no type field; merged into existing settings |
| DeepSeek Harness | _(none)_ | MCP is a user-level `cordis.patch.yml` plugin entry under `$DSH_HOME`; nothing project-scoped is generated |
| Codex | `[mcp_servers.<name>]` (inside `.codex/config.toml`) | TOML; atomic merge preserves unrelated settings, comments, target-only servers, and Codex-specific options; shared file is never deleted wholesale |
### Rules-directory discovery
Claude Code, Cursor and Zoo Code all scan their rules directory **recursively**
(`.claude/rules/frontend/react.md`, `.cursor/rules/backend/rpc.mdc`, …).
`adapters::collect_rule_files` implements that scan for all three, sorting by
base name (case-insensitive, so Zoo's `00-`/`01-` prefixes keep their meaning)
then by full path. Nested rules are written back flat, one file per rule name.
`clean_orphans` stays non-recursive, so hand-authored files in subdirectories are
never deleted.
### Orphan cleanup and shared files
`managed_directories()` returns `ManagedDir`s: each names the file suffix conforme
writes there (`.md`, `.mdc`, `.instructions.md`, `.agent.md`), and orphan cleanup
only deletes top-level files with that suffix. Skills directories are
`ManagedDir::subdirs` (conforme only writes `<name>/SKILL.md` folders), so no
top-level file there is ever swept. Files a tool accepts but conforme never
writes (Kiro `.json` agents, dsh flat `<name>.md` skills, plain `.md` Copilot
agents) therefore survive a sync.
`ManagedDir::files_except` keeps files a tool does not load as agents (a
Claude README or an agent without `description`, a Gemini `_draft.md`).
`ManagedDir::legacy_files` / `legacy_skills` (Devin's `.windsurf/`) remove only
conforme's old copies: a legacy file or skill whose name is generated in the
current location (a skill folder that bundles other files is kept).
Directories two tools share (`.agents/skills/` for Codex, Zed and Amp):
`sync::target_config` leaves the source's skills root to the source, `remove`
never deletes a file the source or another kept tool also generates, and
`migrate` never deletes anything in a directory the output tool manages.
A tool that reads `AGENTS.md` natively (`reads_agents_md()`: Codex, OpenCode,
Amp, DeepSeek) reads it with the AGENTS.md convention, and when it is the
source `AGENTS.md` is never regenerated nor gitignored. Renamed tool ids
(`windsurf` → `devin`) are an error wherever an id is accepted.
Every JSON file conforme merges into (`.mcp.json`, `.cursor/mcp.json`,
`.kiro/settings/mcp.json`, `.devin/mcp_config.json`, `opencode.json`,
`.zed/settings.json`, `.gemini/settings.json`, `.amp/settings.json(c)`,
`.vscode/mcp.json`, `.roo/mcp.json`) goes through `json_settings`, and together
with `.codex/config.toml` is declared by `is_shared_file()` so `remove`/`migrate`
never delete it wholesale and `gitignore install` never ignores it.
### Sync algorithm
1. Parse AGENTS.md → NormalizedConfig
2. For each detected adapter: generate expected files, write if changed
3. Change detection uses SHA-256 content hashing
### Source-based flow
conforme can read config from any tool, not just AGENTS.md:
1. `--from` CLI flag (highest priority)
2. `source` in `.conformerc.toml`
3. AGENTS.md fallback (backward compatible)
Configure via `.conformerc.toml`:
```toml
source = "claude"
only = ["cursor", "copilot"]
exclude = ["zed"]
generate_agents_md = true
clean = true
```
### Pre-commit hook
`conforme hook install` installs a git pre-commit hook that runs `conforme check`.
Works alongside existing hooks (appends/removes its own block).
## CLI commands
```
conforme init [--force] # Create AGENTS.md + sync to tools
conforme sync [--dry-run] [--only tools] # AGENTS.md → all tool configs
conforme check # Exit 0 if in sync, 1 if not
conforme status # Show detected tools + sync state
conforme remove <tools> # Remove generated config files for tools
conforme hook install # Install git pre-commit hook
conforme hook uninstall # Remove git pre-commit hook
conforme help-ai # Show all supported tools + formats
conforme diff # Show diff between expected and actual
conforme add rule|skill|agent|mcp # Add section to AGENTS.md
conforme watch # Watch source and auto-sync
conforme sync --from <tool> # Use specific tool as source
conforme sync --no-clean # Don't clean orphan files
conforme migrate --source X --output Y # Migrate config between tools
```
## Skills
This project uses Claude Code skills in `.claude/skills/`:
- **verify-providers** — Audit all 12 provider adapters: upstream product alive, renamed, forked or retired; official docs vs adapter code; required fields and value vocabularies (tool names, models, names, env-var syntax); safety invariants (orphan suffixes, JSONC-safe shared settings, gitignore, round-trip, blank output); link check; then fix with regression tests
## MCP servers (.mcp.json)
This project has a `.mcp.json` with **Context7** configured. Use it to get up-to-date documentation for any library or framework when working on adapter logic.
**When verifying or updating adapter formats**, use Context7 to check the latest docs for any AI coding tool.
## Dogfooding
This project uses conforme on itself (`source = "claude"` in `.conformerc.toml`).
CI runs `conforme check` to ensure all tool configs stay in sync.
The pre-commit hook enforces sync locally.
## Versioning
Managed by semantic-release. The `.version-hook.sh` script updates `Cargo.toml` during release.
## CI/CD
- **ci.yml**: build, unit tests, integration tests, clippy, fmt, audit, macOS smoke test, `conforme check`
- **release.yml**: matrix build (linux-x64, linux-arm64, macos-x64, macos-arm64, windows-x64, windows-arm64), semantic-release, upload binaries
- Homebrew formula in `maxgfr/homebrew-tap`
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
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.

