Show HN: Single source of truth for AI config files

5 hours ago 2

Generate AI provider configurations from a centralized .ai/ folder

A CLI tool that reads from a single .ai/ directory and generates configuration files for multiple AI assistants and code editors, eliminating duplicate configs across Claude Code, Cursor, Gemini, and OpenCode.

XKCD on standards

Modern development often involves multiple AI assistants and code editors, each requiring their own configuration files:

  • Claude Code needs CLAUDE.md
  • Cursor needs .cursor/rules/*.mdc files
  • Gemini needs GEMINI.md and .gemini/settings.json
  • Codex needs AGENTS.md
  • OpenCode needs opencode.json
  • MCP servers need .mcp.json

This leads to scattered configs and duplicate content across your project.

dot-ai provides a single source of truth in a .ai/ folder that generates all provider-specific configurations:

.ai/ (single source) ├── instructions.md # Main instructions ├── rules/ # Rules with YAML frontmatter │ ├── general.md │ ├── typescript.md │ └── forms.md ├── commands/ # Available commands │ ├── deploy.md │ └── test.md └── mcp.json # MCP server configuration

Generates

CLAUDE.md # Claude Code instructions GEMINI.md # Gemini instructions (identical to Claude) AGENTS.md # Agents instructions (identical to Claude) .mcp.json # MCP server config .cursor/rules/*.mdc # Cursor rules (preserves frontmatter) .gemini/settings.json # Gemini MCP settings opencode.json # OpenCode MCP config

before and after

Important Note: This is a Temporary Solution

dot-ai is intended as a stop-gap solution. The ultimate goal is for AI model providers and development tools to standardize on a single configuration format, so every provider and CLI tool reads from the same place. When that happens, this project will be deprecated.

Until that standardization happens, dot-ai helps eliminate the pain of maintaining duplicate configurations across multiple tools. We hope this project becomes obsolete as the ecosystem matures and converges on unified standards.

# If you have bun installed bunx dot-ai@latest # If you don't have bun installed npx bun x dot-ai@latest
# Initialize .ai/ folder structure or migrate existing configs (one-time setup) bun dot-ai@latest init # Generate all AI provider configs from .ai/ folder bun dot-ai@latest run
  • init - Initialize .ai/ folder structure or migrate existing configs
  • run - Generate provider-specific configs from .ai/ folder

The run command will:

  1. Read your .ai/ folder structure
  2. Generate provider-specific configuration files
  3. Preserve YAML frontmatter where needed (Cursor)
  4. Transform MCP configs to each provider's format

Main instructions that will be included in CLAUDE.md, GEMINI.md, and AGENTS.md:

# Project Instructions Follow these guidelines when working on this project...

Rule files with YAML frontmatter that define specific coding standards:

--- title: TypeScript Rules enabled: true priority: 1 --- # TypeScript Guidelines - Always use explicit types - Avoid `any` type - Use strict mode

Documentation for available commands (included in instruction files):

# Deploy Command Handles deployment to production environments. ## Usage

MCP server configuration that gets distributed to all providers:

{ "mcpServers": { "filesystem": { "type": "stdio", "command": "npx", "args": ["@modelcontextprotocol/server-filesystem", "/tmp"] } } }
File Description Content
CLAUDE.md Claude Code instructions instructions + rules (no frontmatter) + commands
GEMINI.md Gemini instructions Identical to CLAUDE.md
AGENTS.md Agents instructions Identical to CLAUDE.md
.mcp.json MCP server config Direct copy of .ai/mcp.json
.cursor/rules/*.mdc Cursor rules Individual rule files with frontmatter preserved
.gemini/settings.json Gemini MCP settings { "mcpServers": { ... } }
opencode.json OpenCode MCP config { "mcp": { "server": { "type": "local", "command": [...] } } }

If you have existing AI configs, follow this workflow to safely migrate:

1. Create a Migration Branch

git checkout -b migrate-to-dot-ai

This creates a .ai/ folder by consolidating your existing configs:

  • CLAUDE.md, GEMINI.md, AGENTS.md → .ai/instructions.md
  • .cursor/rules/*.mdc → .ai/rules/*.md
  • Various MCP configs → .ai/mcp.json

3. Review and Clean Up .ai/ Folder

Important: The migration may concatenate multiple files or create duplicate MCP configs. Edit the files as needed to remove duplicates and organize content properly.

4. Delete Original AI Config Files

Once satisfied with .ai/ folder, remove the original AI-specific files:

  • Always remove: CLAUDE.md, GEMINI.md, AGENTS.md, .cursor/rules/
  • MCP configs: Remove .mcp.json, .gemini/settings.json, opencode.json since these will be auto-generated
  • Keep other configs: Don't remove .json files that serve purposes beyond MCP server configuration (like editor settings, build configs, etc.)

Commit the current work so we have a checkpoint.

7. Add Generated Files to .gitignore

You can add the generated files to .gitignore if you prefer.

8. Re-generate when needed

You can now use bun dot-ai@latest run whenever you update .ai/ configs.

If you don't have existing AI configs, initialize a new .ai/ folder by running:

This will create the .ai/ folder structure and example files to get you started.

Contributions are welcome! This project aims to:

  1. Support more providers as they emerge
  2. Improve configuration mapping between formats
  3. Eventually become unnecessary once standards emerge

Running the Project Locally

# Install dependencies bun install # Build the project bun run build # Test the built CLI bun link bun link dot-ai # Test in another project by running the linked cli cd ~/my-project bunx dot-ai run
# Run all tests bun test # Run type checking bun typecheck

Please open issues for bugs or feature requests.

MIT License - see LICENSE for details.

Read Entire Article