Agent balanced

Optimizer

Audit and improve the Datarim framework: detect bloat, duplicates, oversized files, weak descriptions, and selective-loading opportunities.

Overview

The Optimizer keeps the Datarim framework lean and efficient. It audits all components — skills, agents, commands, and templates — to find bloat, duplicates, broken references, and unused pieces. Then it proposes targeted improvements with clear risk levels and waits for approval.

When It's Used

Invoked via /dr-optimize for explicit optimization, or suggested during the /dr-archive Step 0.5 health check when bloat is detected (a suggestion only; it never runs automatically). Run periodically as the framework grows to prevent accumulation of dead weight.

Capabilities

  • Full audit — scans all skills, agents, commands, and templates with size, overlap, and usage analysis
  • Bloat detection — flags skills over 300 lines (split above 400) and agents over 120 lines (split above 180), overlapping roles, duplicate instruction blocks, and description budget overruns (over 155 characters each, over 8000 in total)
  • Dependency graph — maps which commands load which agents, which agents load which skills
  • Prune proposals — identifies unused or obsolete components for removal
  • Merge proposals — finds skills covering 70%+ of the same domain and suggests consolidation
  • Context efficiency — analyzes total token cost, recommends restructuring for lower context usage
  • Documentation sync — verifies counts and references in AGENTS.md, README.md and dr-help.md match actual files on disk

How It Works

The Optimizer follows a 5-step workflow. First, it performs a full audit of the target scope, listing every component with its size and cross-references. Second, it builds a dependency graph. Third, it detects issues: unused components, oversized skills, duplicates, stale descriptions, broken references, count mismatches. Fourth, it generates structured proposals grouped by risk. Fifth, it presents everything and waits for approval before making any changes.

Example

/dr-optimize
→ Audit: 19 agents, 79 skills, 28 commands scanned
→ Dependency graph built: 3 orphaned skills found
→ Issues: 1 skill over 500 lines, 2 duplicate descriptions
→ Proposals: prune 3 unused skills (Low risk),
   split 1 oversized skill (Low risk),
   sync README counts (Low risk)
→ Awaiting approval...

Context Loading

Reads all files in the target scope: agents/, skills/, commands/, templates/. Also reads AGENTS.md, README.md, and datarim/history/evolution-log.md. Applies datarim-system and evolution skills.

Skills Used

datarim-system (always), evolution (always).

Reporting the result

Apply Human Outcome Reporting before a human-facing update or result. Explain the user-visible outcome, the original conditions, checks and evidence, and open limitations. A stage result does not mean the entire task is complete. Keep exact protocols and technical records intact. To explain again without continuing work, use /dr-explain.