Architecture Overview
Drevon follows a simple but powerful pattern: single source of truth → compile → native agent configs.The Compilation Pipeline
When you rundrevon sync, the following happens:
Load Config
Reads
drevon.config.json and validates it against the Zod schema. If the config is invalid, you get clear error messages.Resolve Skills
Reads
skills-lock.json to find all installed skills and their descriptions. Skills are injected as a formatted table into each agent’s instructions.Iterate Enabled Agents
For each agent with
enabled: true, the compiler instantiates the appropriate adapter.Generate Content
Each adapter builds the agent-specific config by combining:
- Identity — role, description, posture
- Memory protocol — instructions for reading/writing memory files
- Custom instructions — your project-specific rules
- Skills — installed skill descriptions and usage instructions
- Workspace rules — workspace organization (hub mode)
- Prompts — available workflow templates
The Adapter Pattern
Each supported agent has a dedicated adapter that knows its native config format:| Agent | Adapter | Format |
|---|---|---|
| GitHub Copilot | CopilotAdapter | Single markdown file |
| Claude Code | ClaudeCodeAdapter | Single markdown with allowedCommands |
| Cursor | CursorAdapter | Multiple .mdc files with YAML frontmatter |
| OpenAI Codex | CodexAdapter | Single markdown file |
| Windsurf | WindsurfAdapter | Single markdown file |
| Cline | ClineAdapter | Single markdown file |
| Aider | AiderAdapter | Markdown + optional YAML config |
| Continue.dev | ContinueAdapter | Single markdown file |
BaseAdapter class that provides common content generation methods. This means every agent receives the same instructions, just formatted differently.
Write-Only-If-Changed
The compiler intelligently diffs each generated file against the existing one on disk. This means:- Running
drevon syncrepeatedly is safe — it won’t create noisy Git diffs - The output tells you exactly what was
created,updated, orunchanged - You can commit agent config files to Git without churn
The Self-Evolution Loop
Drevon doesn’t just generate static config files — it creates a feedback loop where agents improve over time:- Session start — agents read all memory files to restore context
- During work — agents make decisions informed by past context
- Session end — agents write back what they learned (decisions, patterns, discoveries)
- Over time — repeated workflows get extracted into reusable prompts