Capability Evolver Pro.Bak
by @sinasu
Meta-skill for AI agent self-improvement. Analyzes runtime logs to detect error patterns, regressions, and inefficiencies, then generates structured improvem...
clawhub install capability-evolver-pro-bakπ About This Skill
name: Capability Evolver description: > Meta-skill for AI agent self-improvement. Analyzes runtime logs to detect error patterns, regressions, and inefficiencies, then generates structured improvement proposals. Use when the user or agent asks to analyze logs, diagnose failures, improve agent reliability, generate evolution proposals, or assess system health. Supports analyze, evolve, and status actions.
Capability Evolver
Local skill by Claw0x β runs entirely in your OpenClaw agent.
> Runs locally. No external API calls, no API key required. Complete privacy.
Analyze agent runtime logs, detect patterns, compute health scores, and generate structured improvement proposals. Pure deterministic logic β no LLM, no external dependencies.
Quick Reference
| When This Happens | Use Action | What You Get |
|-------------------|------------|--------------|
| Agent keeps failing | analyze | Error patterns + health score |
| Same error repeats | analyze | Root cause identification |
| Need improvement plan | evolve | Prioritized recommendations |
| System health check | status | Health score + summary |
| Post-deployment review | analyze | Regression detection |
| Fleet-wide diagnostics | analyze (batch) | Cross-agent patterns |
Why deterministic? Reproducible results, no hallucination risk, sub-100ms processing, zero token costs.
Prerequisites
None. Just install and use.
5-Minute Quickstart
Step 1: Install (30 seconds)
openclaw skill add capability-evolver
Step 2: Analyze Your First Logs (1 minute)
const result = await agent.run('capability-evolver', {
action: 'analyze',
logs: [
{timestamp: '2025-01-15T10:00:00Z', level: 'error', message: 'ETIMEDOUT', context: 'payment-api.ts'},
{timestamp: '2025-01-15T10:01:00Z', level: 'error', message: 'ETIMEDOUT', context: 'payment-api.ts'},
{timestamp: '2025-01-15T10:02:00Z', level: 'error', message: 'ETIMEDOUT', context: 'payment-api.ts'}
]
});
Step 3: Get Actionable Insights (instant)
{
"patterns": [
{
"type": "repeated_error",
"severity": "high",
"description": "ETIMEDOUT appeared 3 times in payment-api.ts",
"affected_contexts": ["payment-api.ts"]
}
],
"health_score": 45,
"recommendations": [
"Add timeout configuration to payment-api.ts",
"Implement retry logic with exponential backoff",
"Monitor payment API response times"
]
}
Step 3: Generate Evolution Plan (instant)
const evolution = await agent.run('capability-evolver', {
action: 'evolve',
logs: result.logs,
strategy: 'harden'
});
Done. You now have a prioritized improvement roadmap, all processed locally.
Real-World Use Cases
Scenario 1: Production Incident Response
Problem: Your agent crashed in production and you need to understand whySolution: 1. Export last 1000 log entries 2. Run analyze action 3. Get error patterns and cascades 4. Identify root cause in minutes
Example:
const logs = await db.logs.findMany({
where: { timestamp: { gte: incidentStart } },
orderBy: { timestamp: 'asc' }
});const analysis = await agent.run('capability-evolver', {
action: 'analyze',
logs: logs.map(l => ({
timestamp: l.timestamp,
level: l.level,
message: l.message,
context: l.context
}))
});
// analysis.patterns shows: "auth-service.ts failed, then payment-api.ts failed"
// Root cause: auth service timeout cascaded to payment failures
Scenario 2: Continuous Improvement Pipeline
Problem: You want your agent to automatically improve based on production dataSolution: 1. Schedule daily log analysis 2. Generate evolution proposals 3. Review and apply recommendations 4. Track improvement over time
Example:
// Cron job: every day at 2am
async function dailyEvolution() {
const logs = await getLast24HoursLogs();
const evolution = await agent.run('capability-evolver', {
action: 'evolve',
logs,
strategy: 'balanced'
});
// Store recommendations for review
for (const rec of evolution.recommendations.filter(r => r.priority === 'critical')) {
await db.recommendations.create({
title: ${rec.category}: ${rec.description},
priority: rec.priority,
affected_files: rec.affected_files,
approach: rec.suggested_approach
});
}
// Track health score trend
await db.metrics.create({
date: new Date(),
health_score: evolution.estimated_improvement
});
}
// Result: Health score improved from 45 to 85 over 3 months
Scenario 3: Multi-Agent Fleet Management
Problem: Managing 50+ agent instances, need to identify systemic issuesSolution: 1. Aggregate logs from all agents 2. Batch analyze to find common patterns 3. Fix once, deploy to all agents 4. Reduce fleet-wide error rate
Example:
# Collect logs from all agents
all_logs = []
for agent_id in agent_fleet:
logs = fetch_agent_logs(agent_id, last_24h)
all_logs.extend(logs)Analyze fleet-wide
result = client.call("capability-evolver", {
"action": "analyze",
"logs": all_logs
})result.patterns shows: "40 of 50 agents failing on auth-service.ts"
Fix auth-service.ts once, deploy to all agents
Result: 80% reduction in fleet-wide errors
Scenario 4: Pre-Deployment Health Check
Problem: Want to ensure new deployment doesn't introduce regressionsSolution: 1. Analyze logs from staging environment 2. Compare health score to production baseline 3. Block deployment if health score drops 4. Catch regressions before production
Example:
// Pre-deployment health check script
async function preDeploymentCheck() {
const stagingLogs = await fetchStagingLogs();
const result = await agent.run('capability-evolver', {
action: 'analyze',
logs: stagingLogs
});
const BASELINE = 75;
if (result.health_score < BASELINE) {
console.error(Health score ${result.health_score} below baseline ${BASELINE});
console.error('Critical patterns:', result.patterns.filter(p => p.severity === 'critical'));
process.exit(1);
}
console.log(β Health check passed: ${result.health_score});
}
// Result: Zero regression-related incidents in 6 months
Integration Recipes
OpenClaw Agent
// Analyze logs after each run
agent.onComplete(async () => {
const logs = agent.getRecentLogs();
const analysis = await agent.run('capability-evolver', {
action: 'analyze',
logs
});
if (analysis.health_score < 70) {
console.warn('β οΈ Health score low:', analysis.health_score);
console.log('Recommendations:', analysis.recommendations);
}
});
LangChain Agent
def analyze_agent_health(logs):
result = agent.run("capability-evolver", {
"action": "analyze",
"logs": logs
})
return {
"health_score": result["health_score"],
"patterns": result["patterns"],
"recommendations": result["recommendations"]
}Use in monitoring
health = analyze_agent_health(agent.logs)
if health["health_score"] < 70:
alert_team(health)
Custom Monitoring Dashboard
// Real-time health monitoring
async function updateHealthDashboard() {
const logs = await db.logs.findMany({
where: { timestamp: { gte: Date.now() - 3600000 } } // last hour
});
const result = await agent.run('capability-evolver', {
action: 'analyze',
logs
});
// Update dashboard
dashboard.update({
healthScore: result.health_score,
errorRate: result.summary.error_count / result.summary.total_logs,
topPatterns: result.patterns.slice(0, 5)
});
}setInterval(updateHealthDashboard, 60000); // every minute
Evolution Strategy Comparison
// Compare different evolution strategies
const logs = await getProductionLogs();const strategies = ['balanced', 'innovate', 'harden', 'repair-only'];
const results = await Promise.all(
strategies.map(strategy =>
agent.run('capability-evolver', {
action: 'evolve',
logs,
strategy
})
)
);
// Compare estimated improvements
for (let i = 0; i < strategies.length; i++) {
console.log(${strategies[i]}: ${results[i].estimated_improvement});
}
// Choose best strategy for current situation
const best = results.reduce((a, b) =>
parseFloat(a.estimated_improvement) > parseFloat(b.estimated_improvement) ? a : b
);
How It Works β Under the Hood
Capability Evolver is a deterministic analysis engine that processes structured log data and produces actionable diagnostics. No LLM is involved οΏ½?the analysis is rule-based, which means results are reproducible and fast.
Analysis Engine
The core engine processes log entries through several analysis passes:
1. Pattern detection οΏ½?logs are grouped by context (file/module) and level (error/warn/info/debug). The engine looks for:
- Repeated errors οΏ½?the same error message appearing multiple times indicates a systemic issue, not a transient failure
- Error cascades οΏ½?errors in module A followed by errors in module B within a short time window suggest a dependency chain failure
- Regression signals οΏ½?errors that appear after a period of clean logs suggest a recent change broke something
- Inefficiency patterns οΏ½?excessive warn-level logs or repeated retries indicate performance issues
2. Health scoring οΏ½?a system health score (0οΏ½?00) is computed based on: - Error rate (errors / total logs) - Error diversity (unique error messages / total errors) - Warn-to-error ratio - Time distribution (clustered errors score worse than spread-out errors)
3. Recommendation generation οΏ½?based on detected patterns, the engine generates specific, actionable recommendations. These aren't generic advice οΏ½?they reference the actual files, error messages, and patterns found in your logs.
Evolution Strategies
When using the evolve action, you can choose a strategy that shapes the recommendations:
| Strategy | Focus | Best For |
|----------|-------|----------|
| auto | Balanced based on health score | Default οΏ½?let the engine decide |
| balanced | Equal weight to reliability and features | Stable systems with moderate issues |
| innovate | Prioritize new capabilities | Healthy systems ready to grow |
| harden | Prioritize reliability and error reduction | Systems with frequent failures |
| repair-only | Fix critical issues only | Systems in crisis |
Evolution Proposals
The evolve action produces structured improvement proposals with:
evolution_id for trackingWhy Deterministic (Not LLM)?
The tradeoff: the engine can't understand semantic meaning in log messages the way an LLM could. It relies on structural patterns (frequency, timing, severity) rather than understanding what the error message means in context.
About Claw0x
This skill is provided by Claw0x, the native skills layer for AI agents.
Cloud version available: For users who need centralized analytics and cross-agent insights, a cloud version is available at claw0x.com/skills/capability-evolver.
Explore more skills: claw0x.com/skills
GitHub: github.com/kennyzir/capability-evolver
When to Use
Input
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| input.action | string | yes | "analyze", "evolve", or "status" |
| input.logs | array | yes (for analyze/evolve) | Array of log entries |
| input.logs[].timestamp | string | yes | ISO timestamp |
| input.logs[].level | string | yes | "error", "warn", "info", or "debug" |
| input.logs[].message | string | yes | Log message |
| input.logs[].context | string | no | File or module name |
| input.strategy | string | no | "auto", "balanced", "innovate", "harden", "repair-only" |
| input.target_file | string | no | Focus analysis on a specific file |
Output (Analyze)
| Field | Type | Description |
|-------|------|-------------|
| patterns | array | Detected error/regression/inefficiency patterns with severity |
| health_score | number | System health 0οΏ½?00 |
| recommendations | string[] | Actionable improvement suggestions |
| summary | object | Counts: total_logs, error_count, warn_count, unique_patterns |
Output (Evolve)
| Field | Type | Description |
|-------|------|-------------|
| evolution_id | string | Unique proposal ID |
| strategy | string | Effective strategy used |
| recommendations | array | Prioritized improvements with category and approach |
| risk_assessment | object | Risk level and contributing factors |
| estimated_improvement | string | Projected health score improvement |
Error Codes
400 β Invalid action or missing logs array500 β Processing failedAbout Claw0x
Claw0x is the native skills layer for AI agents β providing unified API access, atomic billing, and quality control.
Explore more skills: claw0x.com/skills
GitHub: github.com/kennyzir/capability-evolver
Deterministic vs LLM Analysis: Which is Right for You?
| Feature | LLM-Based (GPT-4, Claude) | Capability Evolver (Local) | |---------|---------------------------|---------------------------| | Setup Time | 5-10 min (prompt engineering) | 30 seconds (install skill) | | Processing Speed | 5-30 seconds | Sub-100ms | | Reproducibility | β Varies per run | β Same logs = same results | | Hallucination Risk | β οΈ Can invent patterns | β Only reports real patterns | | Cost | $0.10-0.50 per analysis | Free (runs locally) | | Semantic Understanding | β Understands context | β Pattern-based only | | Audit Trail | β Hard to explain | β Rule-based, explainable | | Privacy | β οΈ Sends data to API | β Runs entirely locally |
When to Use LLM-Based
When to Use Capability Evolver (Local)
How It Fits Into Your Agent Lifecycle
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Agent Development Lifecycle β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
ββ Development
β β’ Write agent code
β β’ Local testing
β
ββ Staging Deployment
β agent.run('capability-evolver',
β {action: "analyze", logs: staging_logs})
β β Health check before production
β
ββ Production Monitoring
β agent.run('capability-evolver',
β {action: "analyze", logs: recent_logs})
β β Real-time health tracking (every hour)
β
ββ Incident Response
β agent.run('capability-evolver',
β {action: "analyze", logs: incident_logs})
β β Root cause analysis
β
ββ Continuous Improvement
agent.run('capability-evolver',
{action: "evolve", strategy: "balanced"})
β Auto-generate improvement tasks (daily)
Integration Points
1. Pre-Deployment β Health check before releasing 2. Real-Time Monitoring β Continuous health tracking 3. Incident Response β Fast root cause analysis 4. Daily Reviews β Automated improvement proposals 5. Fleet Management β Cross-agent pattern detection
Why Use Capability Evolver?
Zero-Cost Operations
Agent-Optimized
Production-Ready
β‘ When to Use
βοΈ Configuration
None. Just install and use.