Multi-file AI agent configuration manager with .agent directory support. Maintain a single source of truth for AI coding assistant rules across Claude Code, VS Code Copilot, Cursor, Cline, Windsurf, Zed, Amazon Q Developer, and more.
- π Import rules from any supported IDE/tool format
- π Convert to a unified
.agent/directory structure - π Export back to all supported formats
- π Nested folders support for better organization
- π οΈ CLI tool for easy automation
- π¦ TypeScript API for programmatic use
- π¨ Color-coded output for better readability
- ποΈ Dry-run mode to preview operations without changes
- π‘ Smart error messages with actionable hints
| Tool/IDE | Rule File | Format |
|---|---|---|
| Agent (dotagent) | .agent/**/*.md |
Markdown with YAML frontmatter |
| Claude Code | CLAUDE.md |
Plain Markdown |
| VS Code (Copilot) | .github/copilot-instructions.md |
Plain Markdown |
| Cursor | .cursor/**/*.mdc, .cursor/**/*.md |
Markdown with YAML frontmatter |
| Cline | .clinerules or .clinerules/*.md |
Plain Markdown |
| Windsurf | .windsurfrules |
Plain Markdown |
| Zed | .rules |
Plain Markdown |
| OpenAI Codex | AGENTS.md |
Plain Markdown |
| Aider | CONVENTIONS.md |
Plain Markdown |
| Gemini | GEMINI.md |
Plain Markdown |
| Qodo | best_practices.md |
Plain Markdown |
| Amazon Q Developer | .amazonq/rules/*.md |
Plain Markdown |
npm install -g dotagent
# or
pnpm add -g dotagent# Import from current directory (creates .agent/ directory)
agentconfig import .
# Import from specific path
agentconfig import /path/to/repo
# Preview without making changes
agentconfig import . --dry-run# Export from current directory's .agent/
agentconfig export .
# Export to specific directory
agentconfig export . -o /path/to/repo
# Include private rules in export
agentconfig export --include-private# Auto-detect format
agentconfig convert .github/copilot-instructions.md
# Specify format explicitly
agentconfig convert my-rules.md -f cursorThe .agent/ directory contains .md files (Markdown with YAML frontmatter) to organize rules, supporting nested folders:
---
id: core-style
title: Core Style Guidelines
alwaysApply: true
priority: high
---
## Core Style Guidelines
1. Use **Bazel** for Java builds
2. JavaScript: double quotes, tabs for indentation
3. All async functions must handle errorsAnd another file .agent/api-safety.md:
---
id: api-safety
title: API Safety Rules
scope: src/api/**
manual: true
---
## API Safety Rules
- Never log PII
- Validate all inputs with zod
- Rate limit all endpointsNested folders are supported - for example .agent/frontend/components.md:
---
id: frontend/components
title: Component Guidelines
scope: src/components/**
---
## Component Guidelines
- Use functional components with hooks
- Follow atomic design principles
- Include unit tests for all componentsDotAgent supports private/local rules that are automatically excluded from exports and version control. This is useful for:
- Personal preferences that shouldn't be shared with the team
- Client-specific requirements
- Temporary experimental rules
- Sensitive information or internal processes
Private rules are identified by:
- Filename suffix:
*.local.md(e.g.,api-keys.local.md) - Directory: Files in
/private/subdirectories - Frontmatter:
private: truein YAML frontmatter
<!-- .agent/team-rules.md (PUBLIC) -->
---
id: team-rules
---
# Team Standards
Shared team guidelines<!-- .agent/my-preferences.local.md (PRIVATE) -->
---
id: my-preferences
---
# My Personal Preferences
These won't be exported<!-- .agent/private/client-specific.md (PRIVATE) -->
---
id: client-rules
---
# Client-Specific Rules
Confidential requirements| Format | Public File | Private File |
|---|---|---|
| Copilot | .github/copilot-instructions.md |
.github/copilot-instructions.local.md |
| Cursor | .cursor/rules/*.mdc |
.cursor/rules/*.local.mdc |
| Cline | .clinerules |
.clinerules.local |
| Windsurf | .windsurfrules |
.windsurfrules.local |
| Zed | .rules |
.rules.local |
| Claude | CLAUDE.md |
CLAUDE.local.md |
| Gemini | GEMINI.md |
GEMINI.local.md |
# Export including private rules
dotagent export --include-private
# Import but skip private rules
dotagent import . --skip-privateWhen you run dotagent export, it automatically updates your .gitignore with patterns for private files:
# Added by dotagent: ignore private AI rule files
.agent/**/*.local.md
.agent/private/**
.github/copilot-instructions.local.md
.cursor/rules/**/*.local.mdc
.cursor/rules-private/**
.clinerules.local
.clinerules/private/**
.windsurfrules.local
.rules.local
AGENTS.local.md
CONVENTIONS.local.md
CLAUDE.local.md
GEMINI.local.mdimport {
importAll,
importAgent,
exportToAgent,
exportAll
} from 'dotagent'
// Import all rules from a repository
const { results, errors } = await importAll('/path/to/repo')
// Import from .agent directory
const { rules } = await importAgent('/path/to/repo/.agent')
// Export to .agent directory
await exportToAgent(rules, '/path/to/repo')
// Export to all formats
exportAll(rules, '/path/to/repo')interface RuleBlock {
metadata: RuleMetadata
content: string
position?: Position
}
interface RuleMetadata {
id: string
alwaysApply?: boolean
scope?: string | string[]
triggers?: string[]
manual?: boolean
priority?: 'high' | 'medium' | 'low'
description?: string
[key: string]: unknown
}parseAgentMarkdown(markdown: string): RuleBlock[]- Parse HTML-directive formatparseFenceEncodedMarkdown(markdown: string): RuleBlock[]- Parse fence-encoded format
importAll(repoPath: string): Promise<ImportResults>- Auto-detect and import all formatsimportCopilot(filePath: string): ImportResult- Import VS Code Copilot formatimportCursor(rulesDir: string): ImportResult- Import Cursor MDC filesimportCline(rulesPath: string): ImportResult- Import Cline rulesimportWindsurf(filePath: string): ImportResult- Import Windsurf rulesimportZed(filePath: string): ImportResult- Import Zed rulesimportCodex(filePath: string): ImportResult- Import OpenAI Codex formatimportGemini(filePath: string): ImportResult- Import Gemini CLI formatimportQodo(filePath: string): ImportResult- Import Qodo best practicesimportAmazonQ(rulesDir: string): ImportResult- Import Amazon Q Developer rules
toAgentMarkdown(rules: RuleBlock[]): string- Convert to unified formatexportAll(rules: RuleBlock[], repoPath: string): void- Export to all formatsexportToCopilot(rules: RuleBlock[], outputPath: string): voidexportToCursor(rules: RuleBlock[], outputDir: string): voidexportToCline(rules: RuleBlock[], outputPath: string): voidexportToWindsurf(rules: RuleBlock[], outputPath: string): voidexportToZed(rules: RuleBlock[], outputPath: string): voidexportToCodex(rules: RuleBlock[], outputPath: string): voidexportToAmazonQ(rules: RuleBlock[], outputDir: string): voidexportToGemini(rules: RuleBlock[], outputPath: string): voidexportToQodo(rules: RuleBlock[], outputPath: string): void
# Install dependencies
pnpm install
# Build
pnpm build
# Run tests
pnpm test
# Development mode
pnpm devMIT
Contributions are welcome! Please feel free to submit a Pull Request.
- Support for more IDE formats
- Web-based converter UI
- GitHub Action for automatic sync
- Support for team rule templates
- Validation and linting of rules
- Rule inheritance and composition