360 Secure SkillHub
360 安全技能中心

Learnings Skill

该 Skill 用自有 MeiliSearch 索引保存失败、纠正、做法、版本规则、偏好等八类经验条目,提供记录、检索、从每日笔记自动提取和蒸馏汇总四个 Bash 脚本。配置从工作区 .env 读取 MeiliSearch 地址与密钥,写入与蒸馏默认 dry-run,需 --apply 才落盘。

enjuguna
enjuguna
热度 35.36
最近更新 2026-06-14 03:53:27
分类:知识依赖:代码执行 / 读写文件 / 第三方 API应用场景:笔记整理 / 摘要总结 / 工作流 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add learnings
Metadata
name
learnings
description
Continuous learning from failures, corrections, and patterns. Logs mistakes to prevent repetition. Own MeiliSearch index. Learns version rules, approach preferences, and behavioral corrections.

Learnings Skill

Continuous learning system. Every failure, correction, and pattern gets logged so the same mistakes aren't repeated. Uses its own MeiliSearch index for fast recall.

Security Model

  • Credentials: MeiliSearch key is loaded from ~/.openclaw/workspace/.env — never hardcoded in scripts
  • Sensitive data filtering: Auto-extraction skips content containing tokens, passwords, API keys, and credentials
  • Safe defaults: Distillation and auto-extract default to --dry-run; use --apply to write
  • Secure temp files: All temp files use mktemp with chmod 600 and are cleaned up on exit

Capabilities (declared)

  • Read: memory/*.md (daily notes, for auto-extraction)
  • Write: MeiliSearch learnings index, LEARNINGS.md (distillation only with --apply)
  • Execute: curl to localhost MeiliSearch, python3 for document processing

What Gets Logged

Category Description Example
failure Script/command errors "npm install fails with permission error"
correction Fix applied after a mistake "Use --prefix flag for global installs"
approach Right way to do something "Use full-text search over vector DB for local memory"
version_rule How versions should increment "1.1.0 → 1.2.0 for new features"
preference User preferences discovered "Prefers local/no-cloud solutions"
recurring_failure Same thing failing repeatedly "Auth token expires on every deploy"
rule Explicit "don't do X" rules "Don't commit secrets to repositories"
learning General lessons learned "Always check file exists before copying"

Configuration

Requires ~/.openclaw/workspace/.env:

MEILI_HOST=http://127.0.0.1:7700
MEILI_KEY=your-master-key-here

Files

  • LEARNINGS.md — Human-readable summary (auto-generated, use --apply to write)
  • scripts/setup_index.sh — Create/configure MeiliSearch index
  • scripts/log_learning.sh — Log a new learning entry
  • scripts/search_learnings.sh — Search past learnings before acting
  • scripts/auto_extract.sh — Auto-extract learnings from daily notes
  • scripts/distill_learnings.sh — Summarize raw logs into LEARNINGS.md

Usage

# Log a learning
bash scripts/log_learning.sh \
  --category failure \
  --what "deployment fails with auth token expiry" \
  --fix "Refresh token before each deploy" \
  --importance 0.9 \
  --tags "deploy,auth,token"

# Search before acting
bash scripts/search_learnings.sh "github push" 5

# Auto-extract from daily notes (dry-run by default)
bash scripts/auto_extract.sh --days 7 --apply

# Distill into readable summary (dry-run by default)
bash scripts/distill_learnings.sh --apply

How It Integrates

Before taking any action, I search the learnings index:

  1. Search for the action/context
  2. If a past learning exists, apply the fix first
  3. If the action fails, log it immediately
  4. If you correct me, log it as a high-priority correction

Version Rules (Learned)

  • Increment minor (1.1.0 → 1.2.0) for new features
  • Increment major (1.0.0 → 2.0.0) for breaking changes
  • Avoid patch-level bumps (1.1.0 → 1.1.1) unless it's an actual bug fix