360 Secure SkillHub
360 安全技能中心

Self-Improving Global Safe

面向 OpenClaw 的跨会话学习记忆 Skill:以 ~/.openclaw/self-improving/ 为存储根,按全局与上下文命名空间保存规则和纠正记录,仅在用户明确纠正、明确偏好或重复纠正时学习,经确认后逐级提升规则;支持查询已学内容、规则、记忆统计与遗忘操作,并明确不存储凭据、财务、医疗及第三方隐私信息。

slicenferqin
slicenferqin
热度 25.14
最近更新 2026-05-11 17:28:15
分类:知识依赖:读写文件 / 内部调用大模型应用场景:笔记整理 / 工作流

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add self-improving-global-safe
Metadata
name
self-improving
description
Global, namespaced learning memory for OpenClaw. Use when users correct output, set stable preferences, ask what was learned, ask for memory stats, or request forgetting learned patterns. Keep memory cross-session, avoid context mixing, and enforce strict privacy boundaries.
metadata
{"openclaw":{"os":["darwin","linux","win32"]}}

Self-Improving (Global + Namespaced)

Maintain global learning while preventing cross-project pollution.

Storage Root

Store only in:

~/.openclaw/self-improving/
  global/
    rules.md
    corrections.md
  contexts/
    <context-key>/
      rules.md
      corrections.md
      meta.md
  index.md

Never write outside this root unless the user explicitly asks.

Context Key

Compute a stable context-key in this order:

  1. If in a git repo, use <host>-<owner>-<repo> when available.
  2. Else use sanitized absolute workspace path.
  3. If user gives explicit project scope, append that suffix.

Use global/* only for cross-context rules. Use contexts/<context-key>/* for local rules.

Load Strategy

Default read set:

  • global/rules.md
  • active contexts/<context-key>/rules.md

When user asks cross-project/global questions, read additional context folders and cite exact source file.

Learning Triggers

Learn only from explicit signal:

  • direct correction
  • explicit preference
  • repeated correction (3 times)

Do not learn from silence, guesses, or one-off temporary requests.

Promotion Gates

Write every candidate to active corrections.md. Promote to context rules.md only after explicit confirmation. Promote to global rules.md only when:

  • user says it is global, or
  • rule is confirmed in 2+ different contexts.

Detailed procedures: operations.md.

Conflict Handling

Conflict precedence:

  1. active context rule
  2. global rule
  3. ask user if ambiguity remains

Record conflicts and resolutions in corrections logs. Detailed policy: conflict-resolution.md.

Retention and Compaction

Keep files concise, deduplicated, and auditable. Apply retention windows and archive stale entries by policy. Detailed policy: retention-policy.md.

Safety Guardrails

Never store:

  • credentials or secrets
  • financial, medical, biometric, identity-sensitive data
  • third-party private information

If uncertain, ask before writing.

User Requests

  • "What did you learn?" -> recent corrections (active context + global summary)
  • "Show my rules" -> active context rules and global rules
  • "Memory stats" -> counts by scope, file, and last update
  • "Forget X" -> remove in active context, then ask about global/all contexts
  • "Forget everything" -> ask scope first: active context, global only, or all contexts

Do not auto-backup before deletion unless user asks for export.

Response Transparency

When behavior uses learned memory, cite source file:

  • global/rules.md
  • contexts/<context-key>/rules.md