Get the FREE Ultimate OpenClaw Setup Guide →
m

learning-engine

Scanned

@mupengi-bot

npx machina-cli add skill @mupengi-bot/learning-engine --openclaw
Files (1)
SKILL.md
5.2 KB

learning-engine

System records mistakes and successes, automatically learns patterns to improve skills. Automates "don't repeat same mistake" principle.

Learning Sources

1. memory/errors/

Extract failure patterns from error logs

# memory/errors/2026-02-14.md

## 10:30 - insta-post failure
- Cause: PNG file upload → "Problem occurred" error
- Fix: Retry after JPG conversion → Success
- Lesson: Always convert to JPG before Instagram upload

2. self-eval Results

Extract improvement points from weekly self-evaluation

# memory/self-eval/2026-W07.md

## This Week's Mistakes
- Too many browser snapshots (token waste)
- → Improvement: Call API directly via exec

## This Week's Successes
- 95% token savings with insta-cli v2 DM check

3. performance Data

Learn successful/unsuccessful patterns from performance tracking

{
  "insight": "Posts at 7-9 PM get +30% likes",
  "rule": "Instagram posts recommended 19:00-21:00"
}

Auto Rule Generation

Convert learned patterns to rules:

Location: memory/learned-rules/

memory/
  learned-rules/
    instagram-posting.md
    browser-automation.md
    api-usage.md
    error-recovery.md

Rule Format

# Instagram Posting Rules

## Rule #1: Always Convert to JPG
- **Situation**: Upload image to Instagram
- **Failure Pattern**: PNG file → "Problem occurred"
- **Solution**: `convert input.png -quality 92 output.jpg`
- **Evidence**: 2026-02-10, 2026-02-14 error logs
- **Applied Skills**: insta-post, cardnews, social-publisher

## Rule #2: 1:1 Ratio Required
- **Situation**: Instagram card news
- **Failure Pattern**: 16:9 horizontal → Cropped in feed
- **Solution**: Generate as 1024x1024 square
- **Evidence**: 2026-02-13 feedback
- **Applied Skills**: cardnews, nano-banana-pro

Inject Rules into Skills

Auto-add learned rules to relevant skill SKILL.md:

Location: skills/{skill-name}/SKILL.md

# insta-post

...

## Learned Lessons

### Image Processing
- ✅ Always convert to JPG (PNG causes errors)
- ✅ 1:1 ratio required (1024x1024 recommended)
- ✅ File size < 8MB

### Timing
- ✅ Posts at 19:00-21:00 get +30% engagement
- ❌ Avoid early morning posts

### Automation
- ✅ Call API via exec (0 snapshots)
- ❌ Minimize browser automation

Weekly Learning Report

Auto-generated every Monday:

Location: memory/learning/weekly-YYYY-Www.md

# 2026-W07 Learning Report

## New Learnings (5)

1. **Instagram PNG Ban**
   - 3 mistakes → Rule created
   - Applied: insta-post, cardnews

2. **Token Saving: exec > Browser**
   - v1: 5 snapshots → v2: 1 exec
   - 95% savings

3. **Optimal Posting Time**
   - 19:00-21:00 +30% likes

4. **Brand Tone Effect**
   - 무펭이 tone +40% engagement

5. **Auto Error Recovery**
   - browser-dependent failure → Browser restart

## Applied Skills
- insta-post (2 rules)
- cardnews (1 rule)
- performance-tracker (1 insight)

## Next Week Goals
- [ ] Build A/B testing system
- [ ] Add 3 auto-recovery patterns

Event Publishing

Publish event when learning complete:

Location: events/lesson-learned-YYYY-MM-DD.json

{
  "timestamp": "2026-02-14T23:00:00Z",
  "source": "learning-engine",
  "new_rules": 2,
  "updated_skills": ["insta-post", "cardnews"],
  "summary": "Learned 2 Instagram image rules"
}

hook-engine Integration

  • on-error hook: Error occurs → Record to memory/errors/ → learning-engine analysis
  • post-hook (self-eval): After weekly evaluation → Update learning rules
  • post-hook (performance): After collecting performance data → Learn patterns
  • scheduled hook: Every Monday → Generate weekly learning report

Learning Pipeline

Error occurs
  ↓
Record to memory/errors/
  ↓
learning-engine analysis
  ↓
Extract patterns + Create rules
  ↓
Save to memory/learned-rules/
  ↓
Auto-update relevant skill SKILL.md
  ↓
Publish event (lesson-learned)
  ↓
Reflect in weekly report

Trigger Keywords

  • "what did I learn"
  • "learning"
  • "lessons"
  • "mistake patterns"
  • "improvements"
  • "learning report"
  • "add rule"

Usage Examples

"What did I learn this week?"
→ Generate weekly learning report

"Organize Instagram posting mistake patterns"
→ Analyze memory/errors/ + Create rules

"Learn from performance data"
→ Extract successful patterns + Update rules

Auto-improvement Examples

Before (Pre-learning)

Instagram post fails → Manually convert to JPG → Retry
(Repeat every time)

After (Post-learning)

Execute insta-post → Auto-check/convert JPG → Success
(Rule injected into SKILL.md)

Meta Learning

learning-engine itself also learns:

  • "Which rules are used most?"
  • "Which skills improve most?"
  • "Which areas have slow learning?"

Meta Learning Report: memory/learning/meta-YYYY-MM.md

Future Improvements

  • Rule conflict detection (Rule A vs Rule B)
  • Rule confidence score (based on usage frequency)
  • Auto A/B testing (rule validation)
  • Share learning with other agents

🐧 Built by 무펭이Mupengism ecosystem skill

Source

git clone https://clawhub.ai/mupengi-bot/learning-engineView on GitHub

Overview

The learning-engine automatically analyzes mistakes and successes from error logs, self-evaluations, and performance data to identify patterns. It converts these insights into actionable rules and auto-injects them into relevant skills SKILL.md, embodying the don't-repeat principle.

How This Skill Works

It ingests memory/errors/, weekly self-eval results, and performance tracking data to identify failure patterns and success drivers. It then generates rules under memory/learned-rules/ and updates the corresponding skill SKILL.md to reflect Learned Lessons, enabling continuous improvement.

When to Use It

  • When you need to prevent repeating common mistakes across skills by turning patterns into rules.
  • When you want concrete, impact-focused rules like image processing or timing adjustments.
  • When you want automatic rule generation from error logs, self-eval, and performance data.
  • When you need SKILL.md to reflect new best practices via Learned Lessons.
  • When you want weekly learning reports and event publishing to track improvements.

Quick Start

  1. Step 1: Enable and standardize logs in memory/errors, memory/self-eval, and performance data.
  2. Step 2: Run learning-engine to analyze and generate rules under memory/learned-rules/.
  3. Step 3: Verify and inject Learned Lessons into skills/{skill-name}/SKILL.md and review in the weekly report.

Best Practices

  • Ensure consistent logging to memory/errors and memory/self-eval to feed the engine.
  • Review and validate auto-generated rules before injecting into skills.
  • Use evidence stamps (dates from errors) to support rules.
  • Keep SKILL.md organized with a Learned Lessons section.
  • Regularly check weekly reports to monitor impact and adjust rules.

Example Use Cases

  • Always convert to JPG before uploading to Instagram.
  • Maintain a 1:1 image ratio for Instagram card news to avoid cropping.
  • Post timing at 19:00-21:00 to boost engagement.
  • Call API via exec instead of browser automation to save tokens.
  • Auto-recover from browser failures by restarting the browser.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers