/evolve — Manual Evolution Trigger
CRITICAL: Run HARNESS_DIR=$(epic path) first. NEVER use .harness/ in the project directory.
You are the Evolution Engine — analyze past sessions to improve skills.
Sub-commands
/evolve (default) — Run evolution now
- Read observation logs from
$HARNESS_DIR/obs/
- Analyze failure patterns across all sessions
- Identify weak areas (error types, recurring failures)
- Generate or improve evolved skills in
$HARNESS_DIR/evolved/
- Gate: validate new skills (format, dedup, cap of 10)
- Report what changed
/evolve status — Show evolution dashboard
Read $HARNESS_DIR/metrics.json and $HARNESS_DIR/evolution.jsonl, then display:
## Evolution Dashboard
### Overview
- Sessions analyzed: {total_sessions}
- Average success rate: {avg_success_rate}%
- Best score: {best_score} (session: {best_session})
- Trend: {trend} ({score_history.length} data points)
- Stagnation count: {stagnation_count} / 3 (rollback at 3)
### Score History (last 5 sessions)
| Session | Success Rate | Avg Score | Observations | Tool Success | Output Quality |
|---------|-------------|-----------|--------------|-------------|---------------|
### Evolved Skills
(list $HARNESS_DIR/evolved/*/SKILL.md with name and description from frontmatter)
### Last Session Analysis
(read last entry from evolution.jsonl)
- Error patterns: {error_patterns}
- Failure patterns: {failure_patterns[].pattern_type}
- Skills seeded: {skills_seeded}
- Skills rolled back: {skills_rolled_back}
- Analysis: {analysis_summary}
/evolve history — Long-term analysis
Read $HARNESS_DIR/evolution.jsonl (full history), then display:
## Evolution History
### Trend Over Time
| Session # | Date | Success Rate | Avg Score | Skills | Patterns |
|-----------|------|-------------|-----------|--------|----------|
### Cumulative Pattern Frequency
| Pattern | Total Count | First Seen | Last Seen |
|---------|-------------|------------|-----------|
### Skill Effectiveness
| Skill | Sessions Active | Avg Score With | Avg Score Without | Delta |
|-------|----------------|----------------|-------------------|-------|
### Dispatch Analysis
| Skill | Times Invoked | Top Trigger Signals |
|-------|--------------|---------------------|
/evolve rollback — Undo last evolution
- If
$HARNESS_DIR/evolved_backup/ exists, restore it to $HARNESS_DIR/evolved/
- Otherwise, read
$HARNESS_DIR/evolution.jsonl for last entry, remove skills seeded in that entry
- Append a rollback record to evolution.jsonl
- Report what was rolled back
/evolve reset — Clear all evolution data
- Remove
$HARNESS_DIR/evolved/, $HARNESS_DIR/evolved_backup/
- Clear
metrics.json and evolution.jsonl
- Confirm with user first
How Evolution Works
Observe (PostToolUse — multi-dimensional scoring)
↓ $HARNESS_DIR/obs/session_YYYYMMDD.jsonl
Analyze (Stop or /evolve)
↓ SessionAnalysis: per-tool, per-ext, score distribution
↓ Pattern detection: repeated_same_error, fix_then_break, long_debug_loop, thrashing
Seed (auto-generate targeted skills)
↓ 4 seeding paths: pattern / weak tool / weak file type / high-freq error
Gate (validate: format, dedup, cap of 10)
↓ Stagnation check: 3 sessions no improvement → rollback to best checkpoint
Reload (next session resume reports metrics + loads evolved skills)
Scoring System
- Composite:
0.5 × tool_success + 0.3 × output_quality + 0.2 × execution_cost
- Failure classification: 9 categories (type_error, syntax_error, test_fail, lint_fail, build_fail, permission_denied, timeout, not_found, runtime_error)
- Pattern detection: 4 types (repeated_same_error, fix_then_break, long_debug_loop, thrashing)
Red Flags
- Evolving after only 1-2 observations (not enough data)
- Keeping evolved skills that never trigger
- Not reviewing evolved skills periodically
- Ignoring stagnation warnings
1---2name: evolve3description: Ring 3 evolution engine. Analyzes session observations, generates and improves evolved skills, shows metrics dashboard. Subcommands: status, history, rollback, reset. Use for post-session review and skill improvement.4---56# /evolve — Manual Evolution Trigger78**CRITICAL**: Run `HARNESS_DIR=$(epic path)` first. NEVER use `.harness/` in the project directory.910You are the **Evolution Engine** — analyze past sessions to improve skills.1112## Sub-commands1314### `/evolve` (default) — Run evolution now151. Read observation logs from `$HARNESS_DIR/obs/`162. Analyze failure patterns across all sessions173. Identify weak areas (error types, recurring failures)184. Generate or improve evolved skills in `$HARNESS_DIR/evolved/`195. Gate: validate new skills (format, dedup, cap of 10)206. Report what changed2122### `/evolve status` — Show evolution dashboard2324Read `$HARNESS_DIR/metrics.json` and `$HARNESS_DIR/evolution.jsonl`, then display:2526```27## Evolution Dashboard2829### Overview30- Sessions analyzed: {total_sessions}31- Average success rate: {avg_success_rate}%32- Best score: {best_score} (session: {best_session})33- Trend: {trend} ({score_history.length} data points)34- Stagnation count: {stagnation_count} / 3 (rollback at 3)3536### Score History (last 5 sessions)37| Session | Success Rate | Avg Score | Observations | Tool Success | Output Quality |38|---------|-------------|-----------|--------------|-------------|---------------|3940### Evolved Skills41(list $HARNESS_DIR/evolved/*/SKILL.md with name and description from frontmatter)4243### Last Session Analysis44(read last entry from evolution.jsonl)45- Error patterns: {error_patterns}46- Failure patterns: {failure_patterns[].pattern_type}47- Skills seeded: {skills_seeded}48- Skills rolled back: {skills_rolled_back}49- Analysis: {analysis_summary}50```5152### `/evolve history` — Long-term analysis5354Read `$HARNESS_DIR/evolution.jsonl` (full history), then display:5556```57## Evolution History5859### Trend Over Time60| Session # | Date | Success Rate | Avg Score | Skills | Patterns |61|-----------|------|-------------|-----------|--------|----------|6263### Cumulative Pattern Frequency64| Pattern | Total Count | First Seen | Last Seen |65|---------|-------------|------------|-----------|6667### Skill Effectiveness68| Skill | Sessions Active | Avg Score With | Avg Score Without | Delta |69|-------|----------------|----------------|-------------------|-------|7071### Dispatch Analysis72| Skill | Times Invoked | Top Trigger Signals |73|-------|--------------|---------------------|74```7576### `/evolve rollback` — Undo last evolution771. If `$HARNESS_DIR/evolved_backup/` exists, restore it to `$HARNESS_DIR/evolved/`782. Otherwise, read `$HARNESS_DIR/evolution.jsonl` for last entry, remove skills seeded in that entry793. Append a rollback record to evolution.jsonl804. Report what was rolled back8182### `/evolve reset` — Clear all evolution data831. Remove `$HARNESS_DIR/evolved/`, `$HARNESS_DIR/evolved_backup/`842. Clear `metrics.json` and `evolution.jsonl`853. Confirm with user first8687## How Evolution Works8889```90Observe (PostToolUse — multi-dimensional scoring)91 ↓ $HARNESS_DIR/obs/session_YYYYMMDD.jsonl92Analyze (Stop or /evolve)93 ↓ SessionAnalysis: per-tool, per-ext, score distribution94 ↓ Pattern detection: repeated_same_error, fix_then_break, long_debug_loop, thrashing95Seed (auto-generate targeted skills)96 ↓ 4 seeding paths: pattern / weak tool / weak file type / high-freq error97Gate (validate: format, dedup, cap of 10)98 ↓ Stagnation check: 3 sessions no improvement → rollback to best checkpoint99Reload (next session resume reports metrics + loads evolved skills)100```101102## Scoring System103- **Composite**: `0.5 × tool_success + 0.3 × output_quality + 0.2 × execution_cost`104- **Failure classification**: 9 categories (type_error, syntax_error, test_fail, lint_fail, build_fail, permission_denied, timeout, not_found, runtime_error)105- **Pattern detection**: 4 types (repeated_same_error, fix_then_break, long_debug_loop, thrashing)106107## Red Flags108- Evolving after only 1-2 observations (not enough data)109- Keeping evolved skills that never trigger110- Not reviewing evolved skills periodically111- Ignoring stagnation warnings