borghei/Claude-Skills / engineering/self-improving-agent
self-improving-agent
VerifiedCurates agent memory and turns repeated lessons into reviewed rules: memory health checks, pattern extraction, feedback and regression analysis. Use when managing auto-memory or building agents that learn from their own sessions.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 10.0 KB |
| assets/memory_index/MEMORY.md | markdown | 316 B |
| assets/memory_index/feedback_migrations.md | markdown | 203 B |
| assets/memory_index/feedback_pnpm.md | markdown | 255 B |
| assets/sample_feedback.jsonl | other | 2.2 KB |
| assets/sample_metrics.json | config | 3.6 KB |
| references/feedback-loop-patterns.md | markdown | 9.2 KB |
| references/memory-curation-guide.md | markdown | 4.6 KB |
| references/meta-learning-architectures.md | markdown | 2.4 KB |
| references/self-improvement-methodology.md | markdown | 4.3 KB |
| scripts/feedback_analyzer.pyexecutable | script | 18.5 KB |
| scripts/memory_health_checker.py | script | 13.1 KB |
| scripts/pattern_extractor.py | script | 10.8 KB |
| scripts/regression_detector.pyexecutable | script | 17.0 KB |
| scripts/rule_manager.pyexecutable | script | 12.0 KB |
| scripts/rule_promoter.py | script | 12.0 KB |
| skills/extract.md | markdown | 2.1 KB |
| skills/promote.md | markdown | 2.8 KB |
| skills/remember.md | markdown | 2.1 KB |
| skills/review.md | markdown | 2.3 KB |
| skills/status.md | markdown | 2.5 KB |
skills/extract.md
View on GitHub# Sub-Skill: Extract
**Parent:** self-improving-agent
**Trigger:** "extract patterns", "find reusable patterns", "what did we learn"
## Purpose
Extract reusable patterns from completed work sessions. Analyzes session history to identify approaches that succeeded consistently and packages them as candidate rules or skill components.
## Workflow
### Step 1: Gather Session Data
Collect recent session outcomes:
- Tasks completed and their outcomes (success, partial, failure)
- Corrections made by the user
- Tool usage patterns
- Error resolutions applied
### Step 2: Identify Patterns
Run `pattern_extractor.py` on session logs:
```bash
python scripts/pattern_extractor.py --input session-log.jsonl --min-occurrences 2
```
Pattern categories:
- **Solution patterns:** Same approach solved similar problems multiple times
- **Error patterns:** Same error occurred and was resolved the same way
- **Workflow patterns:** A sequence of steps was effective repeatedly
- **Anti-patterns:** Approaches that consistently failed
### Step 3: Score Patterns
Each pattern gets scored on:
- **Frequency:** How often it appeared (2-3 = low, 4-6 = medium, 7+ = high)
- **Consistency:** Same solution every time vs varied approaches
- **Impact:** Prevented errors (high) vs minor convenience (low)
- **Generalizability:** Works across contexts vs project-specific
### Step 4: Package Candidates
For each high-scoring pattern, create a candidate entry:
```
Pattern: [description]
Evidence: [N occurrences across M sessions]
Score: [frequency * consistency * impact]
Recommendation: KEEP | PROMOTE | EXTRACT_TO_SKILL
```
### Step 5: Present for Review
Output the ranked pattern list for human review. Patterns are candidates, not automatically promoted -- the **promote** sub-skill handles graduation.
## Inputs
| Input | Required | Description |
|-------|----------|-------------|
| Session logs | Yes | JSONL file of session outcomes |
| Min occurrences | No | Minimum pattern frequency (default: 2) |
| Time range | No | Only analyze sessions within N days |
## Outputs
- Ranked list of extracted patterns with scores
- Candidate entries ready for promotion review
- Anti-pattern warnings
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |