Evolution
Rules for proposing and applying framework improvements. Covers growth (new components) and maintenance (pruning, merging). Autonomous decisions use gates; interactive decisions remain human.
Overview
Evolution governs how Datarim improves itself over time through two paths: Growth (new components proposed at /dr-compliance, or the /dr-archive Step 0.5 fallback, via the reflecting skill) and Maintenance (pruning, merging, and efficiency improvements via /dr-optimize). In autonomous runs, the agent decides per proposal after required gates and records the outcome. Interactive runs keep human selection. Class B requires a PRD draft and independent blind review before application.
Growth Path
After each completed task, the reflect stage analyzes lessons learned and may propose improvements: updating an existing skill with new patterns, refining agent capabilities, adding templates for recurring patterns, or creating new skills for uncovered domains. Each proposal includes category, target file, what/why/impact, and a diff preview.
Maintenance Path
The optimizer agent performs a full audit: builds a dependency graph of commands, agents, and skills; detects unused, oversized, duplicate, and broken components; and generates optimization proposals — prune, merge, split, rewrite, or fix references.
Anti-Bloat Rule
Always prefer updating existing files over creating new ones. Before proposing a new skill, check if an existing one can absorb the content. Framework bloat degrades agent performance — every new file adds to context loading overhead.
Health Metrics
- Total skills > 20 triggers optimization suggestion
- Total agents > 18 triggers optimization suggestion
- Total commands > 25 triggers a duplicate check
- Any skill > 500 lines should be split
- Total description characters > 8000 triggers shortening
- Any single description > 155 characters should be shortened
- Orphan rate > 15% triggers pruning
Class A vs Class B Gate
Not all proposals are equivalent. Class A (content changes — add a recipe, fix a description, update a skill) may be applied after the technical gates pass. Class B (operating-model changes — source-of-truth direction, sync semantics, pipeline routing, core contract) require a PRD update and independent blind review before application. This gate was introduced after <TASK-ID>/<TASK-ID> where a research conclusion was treated as a regular proposal and caused 6 hours of wrong-direction work.
From Reflection to Backlog
The self-learning loop records each proposal and its evidence. Autonomous runs decide apply, decline, or defer behind the technical gates; interactive runs ask a person. A framework-source change goes through a branch, PR, review, and CI. A consumer change stays in the project-local overlay and is logged as a promotion candidate. A proposal alone never proves application.
Deprecation Pattern
When a concept or command is removed/renamed, use forward-pointer annotations in historical references instead of rewriting history. Delete the live artifact, sweep all spec/doc files with the new name, and preserve historical mentions with an annotation citing the version and task ID. A sweep-test guards against accidental re-introduction.
Rollback
Each evolution change is a discrete edit to a specific file. For pruned components, backups are saved to documentation/archive/optimized/. Changes are designed to be independently revertable — if two proposals modify the same file, they are applied as separate edits.