Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .agent/guidelines.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
alwaysApply: true
---
## Project Overview

dotagent is a multi-file AI agent configuration manager that maintains a single source of truth for AI coding assistant rules across multiple IDEs and tools (including VS Code Copilot, Cursor, Claude Code, OpenCode, Windsurf, and more). It converts between a unified `.agent/` directory format and tool-specific formats, supporting import/export operations, nested folders, private rules, and both CLI and TypeScript API usage.

## Package Manager

This project uses **pnpm** for dependency management.

## Available Scripts

```bash
# Install dependencies
pnpm install

# Build the project
pnpm build

# Development mode (watch)
pnpm dev

# Run tests (recommended for AI agents - non-interactive)
pnpm test:ci

# Type checking
pnpm typecheck
```
17 changes: 16 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,19 @@ coverage/
*.tsbuildinfo
.vitest/
.cursor
.claude
.claude
# Added by dotagent: ignore exported AI rule files
.github/copilot-instructions.md
.cursor/rules/**
.clinerules
.windsurfrules
.rules
AGENTS.md
CONVENTIONS.md
CLAUDE.md
GEMINI.md
best_practices.md
.amazonq/
.junie/
.roo/
WARP.md
26 changes: 26 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## Project Overview

dotagent is a multi-file AI agent configuration manager that maintains a single source of truth for AI coding assistant rules across multiple IDEs and tools (including VS Code Copilot, Cursor, Claude Code, OpenCode, Windsurf, and more). It converts between a unified `.agent/` directory format and tool-specific formats, supporting import/export operations, nested folders, private rules, and both CLI and TypeScript API usage.

## Package Manager

This project uses **pnpm** for dependency management.

## Available Scripts

```bash
# Install dependencies
pnpm install

# Build the project
pnpm build

# Development mode (watch)
pnpm dev

# Run tests (recommended for AI agents - non-interactive)
pnpm test:ci

# Type checking
pnpm typecheck
```
107 changes: 56 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# dotagent

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.
Multi-file AI agent configuration manager with .agent directory support. Maintain a single source of truth for AI coding assistant rules across multiple IDEs and tools including VS Code Copilot, Cursor, Claude Code, OpenCode, and more.

## Features

Expand All @@ -26,13 +26,14 @@ Multi-file AI agent configuration manager with .agent directory support. Maintai
| Windsurf | `.windsurfrules` | Plain Markdown | windsurf |
| Zed | `.rules` | Plain Markdown | zed |
| OpenAI Codex | `AGENTS.md` | Plain Markdown | codex |
| OpenCode | `AGENTS.md` | Plain Markdown | opencode |
| OpenCode | `AGENTS.md` | Plain Markdown | opencode |
| Aider | `CONVENTIONS.md` | Plain Markdown | aider |
| Gemini | `GEMINI.md` | Plain Markdown | gemini |
| Qodo | `best_practices.md` | Plain Markdown | qodo |
| Amazon Q Developer | `.amazonq/rules/*.md` | Plain Markdown | amazonq |
| JetBrains Junie | `.junie/guidelines.md` | Plain Markdown | junie |
| Roo Code | `.roo/rules/*.md` | Markdown with YAML frontmatter | roo |
| Warp.dev | `WARP.md` | Plain Markdown | warp |

## Installation

Expand Down Expand Up @@ -100,18 +101,18 @@ dotagent convert my-rules.md -f cursor

### CLI Flags Reference

| Flag | Short | Description |
|------|-------|-------------|
| `--help` | `-h` | Show help message |
| `--format` | `-f` | Export to single format (copilot\|cursor\|cline\|windsurf\|zed\|codex\|aider\|claude\|gemini\|qodo\|junie\|roo\|opencode) |
| `--formats` | | Export to multiple formats (comma-separated list) |
| `--output` | `-o` | Output directory path |
| `--overwrite` | `-w` | Overwrite existing files |
| `--dry-run` | `-d` | Preview operations without making changes |
| `--include-private` | | Include private rules in export |
| `--skip-private` | | Skip private rules during import |
| `--gitignore` | | Auto-update gitignore (skip prompt) |
| `--no-gitignore` | | Skip gitignore update prompt |
| Flag | Short | Description |
| ------------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- |
| `--help` | `-h` | Show help message |
| `--format` | `-f` | Export to single format (copilot\|cursor\|cline\|windsurf\|zed\|codex\|aider\|claude\|gemini\|qodo\|junie\|roo\|opencode\|warp) |
| `--formats` | | Export to multiple formats (comma-separated list) |
| `--output` | `-o` | Output directory path |
| `--overwrite` | `-w` | Overwrite existing files |
| `--dry-run` | `-d` | Preview operations without making changes |
| `--include-private` | | Include private rules in export |
| `--skip-private` | | Skip private rules during import |
| `--gitignore` | | Auto-update gitignore (skip prompt) |
| `--no-gitignore` | | Skip gitignore update prompt |

## Unified Format

Expand Down Expand Up @@ -168,44 +169,49 @@ scope: src/components/**
## Private Rules

DotAgent 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
- Client-specific requirements
- Temporary experimental rules
- Sensitive information or internal processes

### Naming Convention

Private rules are identified by:

1. **Filename suffix**: `*.local.md` (e.g., `api-keys.local.md`)
2. **Directory**: Files in `/private/` subdirectories
3. **Frontmatter**: `private: true` in YAML frontmatter

### Examples

```markdown
<!-- .agent/team-rules.md (PUBLIC) -->
---
id: team-rules
---
## <!-- .agent/team-rules.md (PUBLIC) -->

## id: team-rules

# Team Standards

Shared team guidelines
```

```markdown
<!-- .agent/my-preferences.local.md (PRIVATE) -->
---
id: my-preferences
---
## <!-- .agent/my-preferences.local.md (PRIVATE) -->

## id: my-preferences

# My Personal Preferences

These won't be exported
```

```markdown
<!-- .agent/private/client-specific.md (PRIVATE) -->
---
id: client-rules
---
## <!-- .agent/private/client-specific.md (PRIVATE) -->

## id: client-rules

# Client-Specific Rules

Confidential requirements
```

Expand All @@ -219,10 +225,11 @@ Confidential requirements
| Windsurf | `.windsurfrules` | `.windsurfrules.local` |
| Zed | `.rules` | `.rules.local` |
| Claude | `CLAUDE.md` | `CLAUDE.local.md` |
| OpenCode | `AGENTS.md` | `AGENTS.local.md` |
| OpenCode | `AGENTS.md` | `AGENTS.local.md` |
| Gemini | `GEMINI.md` | `GEMINI.local.md` |
| Junie | `.junie/guidelines.md` | `.junie/guidelines.local.md` |
| Roo Code | `.roo/rules/*.md` | `.roo/rules/*.local.md` |
| Roo Code | `.roo/rules/*.md` | `.roo/rules/*.local.md` |
| Warp.dev | `WARP.md` | `WARP.local.md` |

### CLI Options

Expand Down Expand Up @@ -255,29 +262,25 @@ CLAUDE.local.md
GEMINI.local.md
.junie/guidelines.local.md
.roo/rules/*.local.md
WARP.local.md
```

## Programmatic Usage

```typescript
import {
importAll,
importAgent,
exportToAgent,
exportAll
} from 'dotagent'
import { importAll, importAgent, exportToAgent, exportAll } from "dotagent";

// Import all rules from a repository
const { results, errors } = await importAll('/path/to/repo')
const { results, errors } = await importAll("/path/to/repo");

// Import from .agent directory
const { rules } = await importAgent('/path/to/repo/.agent')
const { rules } = await importAgent("/path/to/repo/.agent");

// Export to .agent directory
await exportToAgent(rules, '/path/to/repo')
await exportToAgent(rules, "/path/to/repo");

// Export to all formats
exportAll(rules, '/path/to/repo')
exportAll(rules, "/path/to/repo");
```

## API Reference
Expand All @@ -286,20 +289,20 @@ exportAll(rules, '/path/to/repo')

```typescript
interface RuleBlock {
metadata: RuleMetadata
content: string
position?: Position
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
id: string;
alwaysApply?: boolean;
scope?: string | string[];
triggers?: string[];
manual?: boolean;
priority?: "high" | "medium" | "low";
description?: string;
[key: string]: unknown;
}
```

Expand All @@ -323,6 +326,7 @@ interface RuleMetadata {
- `importAmazonQ(rulesDir: string): ImportResult` - Import Amazon Q Developer rules
- `importJunie(filePath: string): ImportResult` - Import JetBrains Junie guidelines
- `importRoo(rulesDir: string): ImportResult` - Import Roo Code rules
- `importWarp(filePath: string): ImportResult` - Import Warp.dev rules

### Export Functions

Expand All @@ -340,6 +344,7 @@ interface RuleMetadata {
- `exportToQodo(rules: RuleBlock[], outputPath: string): void`
- `exportToJunie(rules: RuleBlock[], outputPath: string): void`
- `exportToRoo(rules: RuleBlock[], outputDir: string): void`
- `exportToWarp(rules: RuleBlock[], outputPath: string): void`

## Development

Expand Down Expand Up @@ -372,4 +377,4 @@ Contributions are welcome! Please feel free to submit a Pull Request.
- [ ] GitHub Action for automatic sync
- [ ] Support for team rule templates
- [ ] Validation and linting of rules
- [ ] Rule inheritance and composition
- [ ] Rule inheritance and composition
Loading
Loading