Files
APAW/.kilo/skills/evolution-sync/SKILL.md
¨NW¨ 15a7b4b7a4 feat: add Agent Evolution Dashboard
- Create agent-evolution/ directory with standalone dashboard
- Add interactive HTML dashboard with agent/model matrix
- Add heatmap view for agent-model compatibility scores
- Add recommendations tab with optimization suggestions
- Add Gitea integration preparation (history timeline)
- Add Docker configuration for deployment
- Add build scripts for standalone HTML generation
- Add sync scripts for agent data synchronization
- Add milestone and issues documentation
- Add skills and rules for evolution sync
- Update AGENTS.md with dashboard documentation
- Update package.json with evolution scripts

Features:
- 28 agents with model assignments and fit scores
- 8 models with benchmarks (SWE-bench, RULER, Terminal)
- 11 recommendations for model optimization
- History timeline with agent changes
- Interactive modal windows for model details
- Filter and search functionality
- Russian language interface
- Works offline (file://) with embedded data

Docker:
- Dockerfile for standalone deployment
- docker-compose.evolution.yml
- docker-run.sh/docker-run.bat scripts

NPM scripts:
- sync:evolution - sync and build dashboard
- evolution:open - open in browser
- evolution:dashboard - start dev server

Status: PAUSED - foundation complete, Gitea integration pending
2026-04-05 19:58:59 +01:00

6.0 KiB
Raw Blame History

Evolution Sync Skill

Synchronizes agent evolution data from multiple sources.

Purpose

Keeps the agent evolution dashboard up-to-date by:

  1. Parsing git history for agent changes
  2. Extracting current models from kilo.jsonc and capability-index.yaml
  3. Recording performance metrics from Gitea issue comments
  4. Tracking model and prompt changes over time

Usage

# Sync from all sources
bun run agent-evolution/scripts/sync-agent-history.ts

# Sync specific source
bun run agent-evolution/scripts/sync-agent-history.ts --source git
bun run agent-evolution/scripts/sync-agent-history.ts --source gitea

Integration Points

1. Git History

Parses commit messages for agent-related changes:

git log --all --oneline -- ".kilo/agents/"

Detects patterns like:

  • feat: add flutter-developer agent
  • fix: update security-auditor model
  • docs: update lead-developer prompt

2. Configuration Files

kilo.jsonc - Primary model assignments:

{
  "agent": {
    "lead-developer": {
      "model": "ollama-cloud/qwen3-coder:480b"
    }
  }
}

capability-index.yaml - Capability mappings:

agents:
  lead-developer:
    model: ollama-cloud/qwen3-coder:480b
    capabilities: [code_writing, refactoring]

3. Gitea Integration

Extracts performance data from issue comments:

// Comment format
// ## ✅ lead-developer completed
// **Score**: 8/10
// **Duration**: 1.2h
// **Files**: src/auth.ts, src/user.ts

Function Reference

syncEvolutionData()

Main sync function:

async function syncEvolutionData(): Promise<void> {
  // 1. Load agent files
  const agentFiles = loadAgentFiles();
  
  // 2. Load capability index
  const capabilityIndex = loadCapabilityIndex();
  
  // 3. Load kilo config
  const kiloConfig = loadKiloConfig();
  
  // 4. Get git history
  const gitHistory = await getGitHistory();
  
  // 5. Merge all sources
  const merged = mergeConfigs(agentFiles, capabilityIndex, kiloConfig);
  
  // 6. Update evolution data
  updateEvolutionData(merged, gitHistory);
}

recordAgentChange()

Records a model or prompt change:

interface AgentChange {
  agent: string;
  type: 'model_change' | 'prompt_change' | 'capability_change';
  from: string | null;
  to: string;
  reason: string;
  issue_number?: number;
}

function recordAgentChange(change: AgentChange): void {
  const evolution = loadEvolutionData();
  
  if (!evolution.agents[change.agent]) {
    evolution.agents[change.agent] = {
      current: { model: change.to, ... },
      history: [],
      performance_log: []
    };
  }
  
  // Add to history
  evolution.agents[change.agent].history.push({
    date: new Date().toISOString(),
    commit: 'manual',
    type: change.type,
    from: change.from,
    to: change.to,
    reason: change.reason,
    source: 'gitea'
  });
  
  saveEvolutionData(evolution);
}

recordPerformance()

Records agent performance from issue:

interface AgentPerformance {
  agent: string;
  issue: number;
  score: number;
  duration_ms: number;
  success: boolean;
}

function recordPerformance(perf: AgentPerformance): void {
  const evolution = loadEvolutionData();
  
  if (!evolution.agents[perf.agent]) return;
  
  evolution.agents[perf.agent].performance_log.push({
    date: new Date().toISOString(),
    issue: perf.issue,
    score: perf.score,
    duration_ms: perf.duration_ms,
    success: perf.success
  });
  
  saveEvolutionData(evolution);
}

Pipeline Integration

Add to .kilo/commands/pipeline.md:

post_pipeline:
  - name: sync_evolution
    description: Sync agent evolution data after pipeline run
    command: bun run agent-evolution/scripts/sync-agent-history.ts

Gitea Webhook Handler

// Parse agent completion comment
app.post('/api/evolution/webhook', async (req, res) => {
  const { issue, comment } = req.body;
  
  // Check for agent completion marker
  const agentMatch = comment.match(/## ✅ (\w+-?\w*) completed/);
  const scoreMatch = comment.match(/\*\*Score\*\*: (\d+)\/10/);
  
  if (agentMatch && scoreMatch) {
    await recordPerformance({
      agent: agentMatch[1],
      issue: issue.number,
      score: parseInt(scoreMatch[1]),
      duration_ms: 0, // Parse from duration
      success: true
    });
  }
  
  // Check for model change
  const modelMatch = comment.match(/Model changed: (\S+) → (\S+)/);
  if (modelMatch) {
    await recordAgentChange({
      agent: agentMatch[1],
      type: 'model_change',
      from: modelMatch[1],
      to: modelMatch[2],
      reason: 'Manual update',
      issue_number: issue.number
    });
  }
});

Files Structure

agent-evolution/
├── data/
│   ├── agent-versions.json      # Current state + history
│   └── agent-versions.schema.json # JSON schema
├── scripts/
│   ├── sync-agent-history.ts    # Main sync script
│   ├── parse-git-history.ts     # Git parser
│   └── gitea-webhook.ts         # Webhook handler
└── index.html                   # Dashboard UI

Dashboard Features

  1. Overview Tab

    • Total agents, with history, pending recommendations
    • Recent changes timeline
    • Critical recommendations
  2. All Agents Tab

    • Filterable by category
    • Searchable
    • Shows model, fit score, capabilities
  3. Timeline Tab

    • Full evolution history
    • Model changes
    • Prompt changes
  4. Recommendations Tab

    • Export to JSON
    • Priority-based sorting
    • One-click apply
  5. Model Matrix Tab

    • Agent × Model mapping
    • Fit scores
    • Provider distribution

Best Practices

  1. Run sync after each pipeline

    • Ensures history is up-to-date
    • Captures model changes
  2. Record performance from every issue

    • Track agent effectiveness
    • Identify improvement patterns
  3. Apply recommendations systematically

    • Use priority: critical → high → medium
    • Track before/after performance
  4. Monitor evolution trends

    • Which agents change most frequently
    • Which models perform best
    • Category-specific optimizations