From 9591800815efd7f5f81a69b3cafc6f8894b43df5 Mon Sep 17 00:00:00 2001 From: ZaneChen Date: Thu, 5 Mar 2026 15:46:46 +0800 Subject: [PATCH] feat: add global visibility scope workflow for OpenClaw --- SKILL.md | 21 +++++++++++++++++++++ references/global-learnings.md | 30 ++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 references/global-learnings.md diff --git a/SKILL.md b/SKILL.md index 97b5717..5b05188 100644 --- a/SKILL.md +++ b/SKILL.md @@ -24,6 +24,7 @@ Log learnings and errors to markdown files for continuous improvement. Coding ag | Workflow improvements | Promote to `AGENTS.md` (OpenClaw workspace) | | Tool gotchas | Promote to `TOOLS.md` (OpenClaw workspace) | | Behavioral patterns | Promote to `SOUL.md` (OpenClaw workspace) | +| User asks for cross-agent persistence | Use `scope: global` workflow below and write to shared path + broadcast summary | ## OpenClaw Setup (Recommended) @@ -82,6 +83,20 @@ When learnings prove broadly applicable, promote them to workspace files: | Workflow improvements | `AGENTS.md` | "Spawn sub-agents for long tasks" | | Tool gotchas | `TOOLS.md` | "Git push needs auth configured first" | +### Visibility Scope (OpenClaw) + +Use explicit scope when logging a learning: + +- `scope: session` — applies to the current thread/session only. +- `scope: agent` (default) — write to current workspace (`.learnings/*`, `AGENTS.md`, `TOOLS.md`, `SOUL.md`). +- `scope: global` — make it visible across agents by writing to a shared path and syncing references. + +When user says phrases like **"all agents"**, **"global"**, **"全局"**, **"所有会话可见"**: + +1. Write canonical entry to a shared file (example: `~/.openclaw/skills/self-improving-agent/references/global-learnings.md`). +2. Add/refresh a short pointer block in each agent's `AGENTS.md` (or equivalent workspace prompt file) that references the canonical global entry. +3. Announce completion and affected agents. + ### Inter-Session Communication OpenClaw provides tools to share learnings across sessions: @@ -398,6 +413,12 @@ Automatically log when you notice: - "You're wrong about..." - "That's outdated..." +**Global persistence requests** (→ use `scope: global` workflow): +- "Make this global" +- "Apply to all agents/sessions" +- "全局记住这条规则" +- "所有agent都要生效" + **Feature Requests** (→ feature request): - "Can you also..." - "I wish you could..." diff --git a/references/global-learnings.md b/references/global-learnings.md new file mode 100644 index 0000000..1d9e3c3 --- /dev/null +++ b/references/global-learnings.md @@ -0,0 +1,30 @@ +# Global Learnings (Cross-Agent) + +Use this file as the canonical registry for learnings that must apply across agents/sessions. + +## Entry Template + +```markdown +## [GLRN-YYYYMMDD-XXX] title + +**Logged**: ISO-8601 timestamp +**Scope**: global +**Priority**: low | medium | high | critical +**Status**: active | superseded + +### Rule +Concise, imperative rule that all agents should follow. + +### Why +One paragraph with context and risk of not following. + +### Applies To +- agents: main, codingMaster, gretutor, ... +- sessions: all new sessions (and existing sessions after refresh) + +### Source +- Origin: user_feedback | incident | postmortem +- Related: LRN-..., ERR-... +``` + +---