# Evolve

> Aggregate high-confidence instincts into reusable skills. Use when the user says /evolve or periodically to consolidate learnings.

- Skill: `eroslifestyle/evolve` (Agent Skill)
- Install (CLI): `npx skillmds@latest add eroslifestyle/evolve`
- Raw SKILL.md: https://api.skillmd.com/api/skills/eroslifestyle/evolve/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: eroslifestyle (https://skillmd.com/u/eroslifestyle)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/eroslifestyle/evolve

---


# Evolve Skill - Instinct-to-Skill Promotion

## Purpose

Transform proven instincts (confidence >= 0.7) into permanent, reusable skill files.
This is the second stage of the Continuous Learning System.

## Trigger

- User types `/evolve`
- Can also be suggested automatically when 3+ instincts reach confidence >= 0.7 in a tag group

## Algorithm

1. **Read instincts**: Load `~/.claude/learnings/instincts.json`
2. **Filter candidates**: Select instincts where confidence >= 0.7 AND evolved_to is null/missing
3. **Check threshold**: If fewer than 3 candidates total, show message and suggest using `/learn` more
4. **Group by tags**: Group candidates by ALL their tags (see Multi-Tag Grouping)
   - An instinct contributes to every tag group it belongs to
5. **For each group with 3+ instincts**:
   a. Generate skill name: `{tag}-learned` (e.g., `parallelism-learned`)
   b. Check if skill already exists at `~/.claude/skills/{tag}-learned/SKILL.md`
      - If exists: merge new patterns into existing skill (see Skill File Merging below)
      - If not: create new skill directory and SKILL.md (Write tool)
   c. Generate skill file with YAML frontmatter and consolidated patterns
   d. Mark each source instinct: append `"{tag}-learned"` to `"evolved_to"` array
   e. Update metadata: increment total_evolved, set last_evolution date
6. **Save**: Write updated instincts.json
7. **Display summary**: Show evolution results

## Generated Skill Format

```markdown
---
name: {tag}-learned
description: Auto-evolved best practices for {tag}, learned from {N} confirmed patterns.
user-invocable: false
allowed-tools: Read
---

# {Tag} Best Practices (Learned)

Auto-generated by the Continuous Learning System on YYYY-MM-DD.
Source: {N} instincts with average confidence {avg}.

## Patterns

### 1. {instinct.pattern}
- **Confidence:** {instinct.confidence}
- **Evidence:** {instinct.evidence count} confirmations
- **First seen:** {instinct.created}

### 2. {instinct.pattern}
...

## Application

These patterns should be applied automatically when the orchestrator
detects relevant context matching the tags: {tags}.
```

## Grouping Rules

- An instinct contributes to ALL tag groups it belongs to (not just primary)
- Minimum 3 instincts per group to trigger evolution
- Groups with fewer than 3 are skipped (instincts remain for future evolution)
- An instinct is excluded from a tag group only if that specific tag appears in its evolved_to array

### Multi-Tag Grouping
An instinct contributes to ALL its tag groups (not just primary).
Example: instinct with tags ["testing", "parallelism"] contributes to both groups.
Mark evolved_to as array: `"evolved_to": ["testing-learned", "parallelism-learned"]`

When an instinct evolves via one tag group, it remains eligible for other tag groups
until all its tags have been evolved or it is explicitly excluded.

## Output Format - Success

```
EVOLUTION COMPLETE

Instincts processed: N (of M total candidates)
Skills created: K
Skills updated: J

Created Skills:
  - skills/parallelism-learned/SKILL.md (from 4 instincts)
  - skills/testing-learned/SKILL.md (from 3 instincts)

Remaining candidates: X instincts (need more confirmations or group members)

Tip: Continue using /learn to build more instincts. Next evolution check at 3+ per tag.
```

## Output Format - Not Ready

```
EVOLUTION CHECK

High-confidence instincts (>= 0.7): N
Groups meeting threshold (3+): 0

Breakdown by tag:
  - parallelism: 2 instincts (need 1 more)
  - testing: 1 instinct (need 2 more)

Tip: Use /learn to capture more patterns. Instincts grow with repeated confirmation.
```

## Skill File Merging

When appending to an existing evolved skill:
1. Read existing skill file
2. Find last numbered pattern (e.g., `### 5.`)
3. Assign next number to new patterns (e.g., `### 6.`)
4. Append before "## Application" section
5. Update "auto-generated" and "Last updated" timestamps
6. Increment "Sources" count

## Edge Cases

- If instincts.json does not exist or is empty, report "No instincts found. Use /learn first."
- If a skill directory already exists but SKILL.md is missing, create it fresh
- If all high-confidence instincts are already evolved, report "All patterns already evolved."
- Maximum 10 patterns per evolved skill file; if more, split into Part 1, Part 2

