Tool-specific adapters for Universal AI Rules 🔌
This package contains adapters that convert Universal AI Rules (.ai/ai-rules.yaml) into the specific formats required by different AI coding assistants. Each adapter handles the unique requirements, file formats, and conventions of its target tool.
⚠️ Note: These adapters don't exist yet - we need contributors to help build them!
| AI Tool | Status | Output Format | Adapter |
|---|---|---|---|
| GitHub Copilot | 📋 Planned | .github/copilot-instructions.md |
CopilotAdapter |
| Claude (Anthropic) | 📋 Planned | CLAUDE.md, CLAUDE.local.md |
ClaudeAdapter |
| Cursor | 📋 Planned | .cursor/rules/*.md |
CursorAdapter |
| Windsurf | 📋 Planned | .windsurf/rules/*.md |
WindsurfAdapter |
| Cline | 📋 Planned | .clinerules/*.md |
ClineAdapter |
| OpenAI Codex | 📋 Planned | AGENTS.md |
CodexAdapter |
| Google Jules | 📋 Planned | AGENTS.md |
JulesAdapter |
| Aider | 📋 Planned | CONVENTIONS.md |
AiderAdapter |
| Sourcegraph Cody | 📋 Planned | .sourcegraph/memory.md |
CodyAdapter |
| JetBrains AI | 📋 Planned | .junie/instructions.md |
JetBrainsAdapter |
interface AIRulesAdapter {
name: string;
version: string;
outputPath: string;
// Convert unified rules to tool-specific format
convert(rules: UniversalAIRules): Promise<AdapterOutput>;
// Validate tool-specific requirements
validate(output: AdapterOutput): Promise<ValidationResult>;
// Import existing tool config to unified format
import(configPath: string): Promise<UniversalAIRules>;
}
interface AdapterOutput {
files: Array<{
path: string;
content: string;
encoding?: string;
}>;
metadata: {
generatedAt: Date;
sourceVersion: string;
warnings?: string[];
};
}import { CursorAdapter, ClaudeAdapter } from '@universal-ai-rules/adapters';
const rules = await loadUniversalRules('.ai/ai-rules.yaml');
// Generate Cursor rules
const cursorAdapter = new CursorAdapter();
const cursorOutput = await cursorAdapter.convert(rules);
await writeFiles(cursorOutput.files);
// Generate Claude rules
const claudeAdapter = new ClaudeAdapter();
const claudeOutput = await claudeAdapter.convert(rules);
await writeFiles(claudeOutput.files);Each adapter should:
- Extend BaseAdapter - Use common functionality
- Handle Tool Specifics - Respect tool's format requirements
- Support Import - Convert existing configs back to unified format
- Validate Output - Ensure generated files are valid
- Add Metadata - Include generation info and warnings
src/adapters/
├── base/
│ ├── BaseAdapter.ts
│ ├── types.ts
│ └── utils.ts
├── cursor/
│ ├── CursorAdapter.ts
│ ├── templates/
│ └── tests/
├── claude/
│ ├── ClaudeAdapter.ts
│ ├── templates/
│ └── tests/
└── index.ts
- Single markdown file format
- GitHub-specific context awareness
- Repository-level instructions
- Support for both
CLAUDE.mdandCLAUDE.local.md - Personal vs team rules separation
- Markdown with specific formatting preferences
- Multiple files in
.cursor/rules/directory - Support for rule categories (architecture, style, etc.)
- Integration with Cursor's rule system
- Similar to Cursor but with Windsurf-specific features
- Directory-based organization
- Support for Windsurf's rule priorities
We need developers to build these adapters:
- 🔧 TypeScript developers - implement adapter logic
- 🧪 Tool experts - contribute knowledge about specific AI tools
- 📝 Template creators - design output templates
- 🔍 Testers - validate adapter outputs with real tools
- 📚 Documentation writers - document adapter behaviors
- Choose a tool - pick an AI assistant you use regularly
- Study the format - understand how the tool expects rules
- Implement the adapter - follow our adapter interface
- Add tests - ensure your adapter works correctly
- Submit PR - contribute back to the community
Each adapter should include:
- Unit tests for conversion logic
- Integration tests with sample rule files
- Validation tests for output format
- Import/export round-trip tests
Adapters are crucial for Universal AI Rules success. Each tool you help support makes the ecosystem more valuable for everyone. Check out our main project for contribution guidelines.
MIT License - see LICENSE for details.