agentleFS
Eleven-MEleven-M/flowmind/skills/learning-engine/SKILL.md

learning-engine

Skill1 starsChanged 3 months agoMITView on GitHub

Core learning engine that powers FlowMind's ability to learn from user corrections and preferences. This is the heart of FlowMind's intelligence.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 7 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before executing any task:

    line 205
  2. Distinctive:

    When learning is captured:

    line 258
  3. Distinctive:

    When learning is applied:

    line 273
  4. Distinctive:

    Local Only: All learning data stored locally

    line 324
  5. Distinctive:

    Confirm Patterns: Verify learned patterns are correct

    line 332
  6. Distinctive:

    Review Regularly: Check and clean old learnings

    line 333
  7. Very specific:

    Check if learning exists: flowmind learn list

    line 340
  8. Distinctive:

    Verify confidence threshold in config

    line 341

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

FlowMind Learning Engine

The core intelligence that makes FlowMind learn and adapt to your workflow.

How Learning Works

The Learning Loop

graph TD
    A[User Request] --> B[FlowMind Executes]
    B --> C{User Feedback?}
    C -->|Correction| D[Capture Learning]
    C -->|Confirmation| E[Reinforce Learning]
    C -->|No Feedback| F[Continue]
    D --> G[Store Learning]
    E --> G
    G --> H[Apply Next Time]
    H --> A

Learning Types

TypeTriggerExample
CorrectionUser corrects output"不对,用表格格式"
RefinementUser improves process"先查错误再查链路"
PreferenceUser specifies style"用中文回复"
Scene MappingUser defines workflow"这类需求走xxx流程"

Learning Storage

Directory Structure

~/.flowmind/learning/
├── records/                    # Learning records by skill
│   ├── log-audit/
│   │   ├── 2026-06-22-001.json
│   │   └── 2026-06-22-002.json
│   ├── code-review/
│   └── _global/
├── scenes.json                # Scene-skill mappings
├── skill-bindings.json        # Skill learning bindings
└── stats.json                 # Learning statistics

Learning Record Format

{
  "id": "learn-20260622-001",
  "timestamp": "2026-06-22T10:30:00Z",
  "skill": "log-audit",
  "type": "output_format",
  "severity": "major",
  "context": {
    "userRequest": "查询 traceId 日志",
    "executionContext": "Log audit skill execution"
  },
  "correction": {
    "original": "Tree format output",
    "corrected": "Sequential list format",
    "reason": "User prefers chronological view"
  },
  "application": {
    "condition": "When outputting trace results",
    "action": "Use sequential list format",
    "priority": "high"
  },
  "verification": {
    "verified": true,
    "verifiedAt": "2026-06-22T10:31:00Z"
  },
  "stats": {
    "appliedCount": 5,
    "successCount": 5
  }
}

Scene Mapping Format

{
  "version": "1.0",
  "mappings": [
    {
      "id": "scene-001",
      "name": "Trace Log Query",
      "keywords": ["traceId", "日志", "链路", "trace"],
      "patterns": [
        "查询.*traceId.*日志",
        "查看.*链路"
      ],
      "workflow": {
        "skills": ["log-audit"],
        "params": {
          "format": "sequential-list",
          "includeRequest": true,
          "includeResponse": true
        }
      },
      "preferences": {
        "outputFormat": "sequential-list",
        "language": "zh-CN"
      },
      "stats": {
        "useCount": 10,
        "lastUsed": "2026-06-22T15:00:00Z",
        "successRate": 1.0
      }
    }
  ]
}

Learning Process

Step 1: Detect Learning Opportunity

function detectLearning(input, context) {
  // Check for correction patterns
  if (isCorrectionPattern(input)) {
    return { type: 'correction', ... };
  }

  // Check for scene mapping patterns
  if (isSceneMappingPattern(input)) {
    return { type: 'scene_mapping', ... };
  }

  // Check for preference patterns
  if (isPreferencePattern(input)) {
    return { type: 'preference', ... };
  }

  return null;
}

Step 2: Capture Context

function captureContext(userRequest, executionResult) {
  return {
    userRequest: userRequest,
    executionContext: executionResult.context,
    timestamp: new Date().toISOString(),
    skill: executionResult.skill
  };
}

Step 3: Create Learning Record

function createLearningRecord(context, correction) {
  const record = {
    id: generateId(),
    timestamp: new Date().toISOString(),
    skill: context.skill,
    type: correction.type,
    context: context,
    correction: correction,
    application: generateApplicationRule(correction)
  };

  return saveLearningRecord(record);
}

Step 4: Update Bindings

function updateSkillBindings(skill, record) {
  const bindings = loadSkillBindings();

  if (!bindings[skill]) {
    bindings[skill] = { records: [], rules: [] };
  }

  bindings[skill].records.push(record.id);
  bindings[skill].rules.push(record.application);

  saveSkillBindings(bindings);
}

Knowledge Application

Pre-Execution Check

Before executing any task:

async function executeWithLearning(request, context) {
  // 1. Check scene mappings
  const sceneMatch = matchScene(request);
  if (sceneMatch && sceneMatch.confidence >= 0.7) {
    return applySceneWorkflow(sceneMatch, request);
  }

  // 2. Check skill learning bindings
  const skill = selectSkill(request);
  const learnings = getSkillLearnings(skill);

  // 3. Apply learnings
  let result = await executeSkill(skill, request, context);
  result = applyLearnings(result, learnings);

  return result;
}

Matching Algorithm

function matchScene(request) {
  const scenes = loadScenes();
  let bestMatch = null;
  let bestScore = 0;

  for (const scene of scenes) {
    const score = calculateMatchScore(request, scene);
    if (score > bestScore) {
      bestScore = score;
      bestMatch = scene;
    }
  }

  return bestScore >= 0.7 ? bestMatch : null;
}

function calculateMatchScore(request, scene) {
  const keywordScore = matchKeywords(request, scene.keywords) * 0.4;
  const patternScore = matchPatterns(request, scene.patterns) * 0.3;
  const historyScore = (scene.stats.useCount / 100) * 0.2;
  const confidenceScore = scene.stats.successRate * 0.1;

  return keywordScore + patternScore + historyScore + confidenceScore;
}

User Confirmation

When learning is captured:

┌─────────────────────────────────────────────────────┐
│ 🧠 Learning Captured                                │
├─────────────────────────────────────────────────────┤
│ ID: learn-20260622-001                              │
│ Skill: log-audit                                    │
│ Type: output_format                                 │
├─────────────────────────────────────────────────────┤
│ Your preference has been recorded.                  │
│ FlowMind will apply this automatically next time.   │
└─────────────────────────────────────────────────────┘

When learning is applied:

┌─────────────────────────────────────────────────────┐
│ ✨ Applying Learned Workflow                        │
├─────────────────────────────────────────────────────┤
│ Based on: learn-20260622-001                        │
│ Applied: 5 times                                    │
│ Success rate: 100%                                  │
├─────────────────────────────────────────────────────┤
│ Using your preferred: sequential list format        │
└─────────────────────────────────────────────────────┘

Management Commands

View Learnings

flowmind learn list [--skill <name>] [--type <type>]

View Scenes

flowmind scenes list

Delete Learning

flowmind learn delete <id>

Reset Skill

flowmind learn reset <skill>

Export/Import

flowmind learn export [--output <file>]
flowmind learn export --bundle
flowmind learn import <file>
flowmind learn --install <file>

Privacy & Security

  • Local Only: All learning data stored locally
  • No Cloud: Nothing sent to external servers
  • User Control: Full control over all data
  • Encryption: Optional encryption for sensitive data

Best Practices

  1. Be Specific: More specific corrections = better learning
  2. Confirm Patterns: Verify learned patterns are correct
  3. Review Regularly: Check and clean old learnings
  4. Share Knowledge: Export and share with team

Troubleshooting

Learning Not Applying

  1. Check if learning exists: flowmind learn list
  2. Verify confidence threshold in config
  3. Check skill bindings

Wrong Behavior

  1. Review scene mappings: flowmind scenes list
  2. Check learning records
  3. Reset if needed: flowmind learn reset <skill>

Performance Issues

  1. Limit learning records per skill
  2. Archive old learnings
  3. Clean up unused scenes

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.