Transform VERSA configurations to tool-specific formats
Version: 1.0.0
Adapters convert VERSA .ai/ configurations into formats that specific AI coding tools understand.
v1.0.0 Supported Tools:
- β
Cursor - Transforms to
.cursorrulesmarkdown format - β
Windsurf - Transforms to
.windsurf/config.jsonformat
Planned v1.1:
- π΄ Cline -
.clinerulessupport - π΄ Aider -
.aider.conf.ymlsupport - π΄ Continue -
.continue/config.yamlsupport
bun add @dotaislash/adaptersTransform VERSA config to Cursor .cursorrules:
import { cursorAdapter } from '@dotaislash/adapters/cursor';
import { loadContext } from '@dotaislash/cli';
const context = loadContext('.ai');
const cursorrules = cursorAdapter.transform(context);
// Write to .cursorrules file
import { writeFileSync } from 'fs';
writeFileSync('.cursorrules', cursorrules);Output Format:
<!-- Generated from VERSA configuration -->
# My Project
Project description here
## AI Assistant Configuration
**Model:** claude-sonnet-4
**Temperature:** 0.7
## Guidelines
[Your rules here]
## Relevant Files
- `src/**/*.ts`
- `tests/**/*.test.ts`Transform VERSA config to Windsurf JSON:
import { windsurfAdapter } from '@dotaislash/adapters/windsurf';
import { loadContext } from '@dotaislash/cli';
const context = loadContext('.ai');
const config = windsurfAdapter.transform(context, { format: true });
// Write to .windsurf/config.json
import { mkdirSync, writeFileSync } from 'fs';
mkdirSync('.windsurf', { recursive: true });
writeFileSync('.windsurf/config.json', config);Output Format:
{
"version": "1.0",
"name": "My Project",
"model": {
"name": "claude-sonnet-4",
"temperature": 0.7
},
"context": {
"files": ["src/**/*.ts"],
"rules": ["...rule content..."]
},
"permissions": {
"allowedFiles": ["src/**"],
"deniedFiles": [".env*"]
}
}Get adapter by tool name:
import { getAdapter } from '@dotaislash/adapters';
const adapter = getAdapter('cursor');
if (adapter) {
const output = adapter.transform(context);
}List all available adapters:
import { listAdapters } from '@dotaislash/adapters';
const tools = listAdapters();
// ['cursor', 'windsurf']All adapters implement:
interface Adapter<TOutput = string> {
name: string;
tool: string;
version: string;
transform(
context: Context,
options?: AdapterOptions
): TOutput;
validate?(output: TOutput): ValidationResult;
}interface AdapterOptions {
comments?: boolean; // Include comments (default: true)
format?: boolean; // Pretty print (default: true)
formatOptions?: Record<string, unknown>;
}Extend BaseAdapter to create your own:
import { BaseAdapter } from '@dotaislash/adapters';
import type { Context, AdapterOptions } from '@dotaislash/adapters';
export class MyToolAdapter extends BaseAdapter<string> {
name = 'mytool-adapter';
tool = 'mytool';
version = '1.0.0';
transform(context: Context, options?: AdapterOptions): string {
// Transform logic here
const settings = this.getModelSettings(context);
const files = this.getFilePatterns(context);
return `Config for MyTool\nModel: ${settings.model}`;
}
}import { readdirSync } from 'fs';
import { cursorAdapter, windsurfAdapter } from '@dotaislash/adapters';
import { loadContext } from '@dotaislash/cli';
const examples = readdirSync('examples');
for (const example of examples) {
const context = loadContext(`examples/${example}/.ai`);
// Generate Cursor config
const cursor = cursorAdapter.transform(context);
writeFileSync(
`examples/${example}/.cursorrules`,
cursor
);
// Generate Windsurf config
const windsurf = windsurfAdapter.transform(context);
mkdirSync(`examples/${example}/.windsurf`, { recursive: true });
writeFileSync(
`examples/${example}/.windsurf/config.json`,
windsurf
);
}bun testTests cover:
- Transformation accuracy
- Option handling
- Edge cases
- Integration with CLI
| Tool | Format | Status | Adapter |
|---|---|---|---|
| Cursor | Markdown (.cursorrules) | β v1.0 | cursorAdapter |
| Windsurf | JSON (.windsurf/config.json) | β v1.0 | windsurfAdapter |
| Cline | TBD | π Planned | - |
| Aider | TBD | π Planned | - |
| Continue | TBD | π Planned | - |
To add a new adapter:
- Create
src/adapters/mytool.ts - Extend
BaseAdapter - Implement
transform()method - Add tests in
tests/mytool.test.ts - Export from
src/index.ts
MIT Β© dotAIslash