Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Multi-context memory management system for OpenClaw agents with group-isolated storage, global shared memory, workspace organization, and group-specific skills isolation. Use when initializing or managing memory systems for multi-channel deployments, creating group-specific memory directories, setting up MEMORY.md for long-term cross-group memories, organizing workspace directories (projects/repos), cloning repositories to group-isolated locations, managing group-isolated skills, or handling any
.claude/skills/leoyeai-files-memory-system/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-06 | ✗→✓ | ▲ Improved | 234% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 375% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 138% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 352% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 408% | 0% |
❌ 禁止:直接使用 git clone 命令 ✅ 必须:使用 auto-clone.sh 脚本并传入 --group 参数
当用户在群聊中要求"克隆仓库"时:
git clone <url> → 这会克隆到 /workspace/repos/./skills/files-memory-system/scripts/auto-clone.sh --group feishu <group_id> <url> → 这会克隆到群组目录Group ID 获取方式:从 metadata 中的 conversation_label 字段获取(如 oc_a2b821...)
OpenClaw Bug: 群聊不会自动加载群记忆文件
每次在群聊中收到消息时,必须执行以下检查:
检查 metadata.is_group_chat:
├── IF true (群聊):
│ ├── 读取 memory/group_<channel>_<conversation_label>/GLOBAL.md
│ ├── 读取 memory/group_<channel>_<conversation_label>/YYYY-MM-DD.md (today)
│ └── 读取 memory/global/GLOBAL.md
│
└── IF false (私聊):
├── 读取 memory/private/YYYY-MM-DD.md (today)
└── 读取 memory/global/GLOBAL.md禁止在群聊中执行任何操作前跳过此检查!
> 📖 新用户? 请先阅读 用户使用指南 了解如何快速上手!
bashcd ~/.openclaw/skills/files-memory-system ./scripts/install.sh
This will:
/workspace/skills/files-memory-system/ (standard location)AGENTS.md so the agent knows this skill existsbash# 1. Copy to standard location mkdir -p /workspace/skills cp -r ~/.openclaw/skills/files-memory-system /workspace/skills/ # 2. Run self-registration cd /workspace/skills/files-memory-system ./scripts/post-install.sh
bashcd /workspace clawhub install files-memory-system # Then manually run: ./skills/files-memory-system/scripts/post-install.sh
This skill implements auto-declaration - it automatically adds a section to AGENTS.md upon installation. This ensures:
files-memory-system exists without being toldTo verify registration:
bashgrep -A 20 "files-memory-system" /workspace/AGENTS.md
To unregister (remove from AGENTS.md):
bashsed -i '/<!-- files-memory-system: installed -->/,/<!-- files-memory-system: end -->/d' /workspace/AGENTS.md
This skill provides a complete memory management system that enables OpenClaw agents to maintain context across multiple chat groups while keeping group-specific memories and skills isolated. It includes:
memory/global/MEMORY.md for curated, permanent memoriesprojects/ and repos/ directories⚠️ 重要: 每次进入会话时,必须自动加载对应的记忆!
当收到群聊消息时,按以下顺序加载记忆:
memory/group_<channel>_<id>/GLOBAL.md
memory/group_<channel>_<id>/YYYY-MM-DD.md (today) memory/group_<channel>_<id>/YYYY-MM-DD.md (yesterday)
memory/global/GLOBAL.md
memory/private/YYYY-MM-DD.md (today) memory/private/YYYY-MM-DD.md (yesterday)
memory/global/GLOBAL.md
MEMORY.md
群聊中必须加载:
私聊中必须加载:
Context: User in group "oc_a2b821..." says: "Clone https://github.com/user/project"
Automatic Actions:
group_feishu_oc_a2b821...memory/group_feishu_oc_a2b821.../repos/project/Manual Commands:
bash# Option 1: Use auto-clone script with --group parameter (推荐) ./scripts/auto-clone.sh --group feishu oc_a2b821... https://github.com/user/project # Option 2: Direct git clone cd memory/group_feishu_xxx/repos git clone https://github.com/user/project # Option 3: Using environment variables (向后兼容) GROUP_ID="oc_xxx" CHANNEL="feishu" ./scripts/auto-clone.sh https://github.com/user/project
Agent Implementation (直接执行,无需用户交互):
当用户要求克隆仓库时,先判断当前是否在群聊中(查看 inbound metadata 中的 is_group_chat 字段),然后:
如果是群聊 (is_group_chat: true):
conversation_label 作为 group_id--group 参数执行克隆:bash./skills/files-memory-system/scripts/auto-clone.sh \ --group feishu "<conversation_label>" \ "https://github.com/user/project"
如果是私聊 (is_group_chat: false):
bash./skills/files-memory-system/scripts/auto-clone.sh \ --private \ "https://github.com/user/project"
关键要点:
--group 参数,否则仓库会克隆到全局目录--group <channel> <group_id> 必须在 URL 之前conversation_label 获取 (如 oc_a2b821...)After Cloning - Update GLOBAL.md:
markdown## 群组项目 (repos/) | 项目名称 | 类型 | 描述 | 位置 | |---------|------|------|------| | project | cloned | 克隆的示例项目 | repos/project/ |
Context: User says: "Create a new tool for our group"
Automatic Actions:
memory/group_xxx/repos/my-tool/Manual Commands:
bash# Create new project in group context mkdir -p memory/group_feishu_xxx/repos/my-tool cd memory/group_feishu_xxx/repos/my-tool # ... create files ...
Context: User says: "Install inkos skill for this group only"
Automatic Actions:
memory/group_xxx/skills/inkos/Manual Commands:
bash# Method 1: Using clawhub with --dir clawhub install inkos --dir memory/group_feishu_xxx/skills # Method 2: Manual copy mkdir -p memory/group_feishu_xxx/skills/inkos cp -r inkos/* memory/group_feishu_xxx/skills/inkos/
Update GLOBAL.md:
markdown## 已安装的群组专属 Skills | Skill | 版本 | 来源 | 描述 | |-------|------|------|------| | inkos | 1.0.0 | clawhub | 小说写作工具 |
Context: User in group chat says: "记录到群记忆里: 项目信息" / "记录到全局记忆里: API密钥" / "记住这个"
Automatic Actions (Agent Must Do):
memory/group_<channel>_<id>/GLOBAL.mdmemory/global/GLOBAL.mdmemory/private/GLOBAL.mdmemory/group_<channel>_<id>/GLOBAL.mdExample 1: Record Project Info
User: "记录到群记忆里: 项目信息"
项目名称: MyApp
技术栈: React + Node.js
负责人: 张三
Agent Action:
1. Detect "记录到群记忆里" → Target: memory/group_xxx/GLOBAL.md
2. Format as table and append:
## 活跃项目
| 项目名称 | 技术栈 | 负责人 | 更新时间 |
|---------|--------|--------|----------|
| MyApp | React + Node.js | 张三 | 2026-03-23 |
3. Confirm: "✅ 已记录到群记忆"Example 2: Record API Key (⚠️ Not Recommended)
User: "记录到全局记忆里:API密钥 sk-abc123"
⚠️ **SECURITY WARNING**:
Storing API keys in plain text in memory files is NOT recommended.
**Recommended approach: Use environment variables**
export API_KEY="sk-xxx"
Alternative (if environment variables not possible):
- Use a secrets manager
- Use encrypted storage
If user insists on storing in memory:
1. Warn: "⚠️ 存储 API 密钥到记忆文件存在安全风险,建议仅用于测试环境"
2. Detect target location based on user command
3. Format as table and append
4. Confirm: "✅ 已记录 (⚠️ 安全风险)"Recommended User Commands:
Critical Rules:
Context: User in group chat says: "帮我写一篇文章" / "创建一个文档" / "生成xxx文件"
Automatic Actions (Agent Must Do):
memory/group_<channel>_<id>/articles/ (for articles/docs)memory/group_<channel>_<id>/repos/ (for code projects)Context: Same user in different groups
Group A (小说创作):
memory/group_A/skills/inkos/memory/group_A/repos/novel-tools/Group B (编程学习):
memory/group_B/skills/code-helper/memory/group_B/repos/exercises/Behavior:
inkos, not code-helpercode-helper, not inkosContext: Information becomes relevant to multiple groups
Migration Process:
memory/group_A/GLOBAL.mdmemory/global/GLOBAL.mdExample:
bash# Original in group_A/GLOBAL.md ## Project Configuration Config: xxx # After migration - in global/GLOBAL.md ## Shared Project Configuration Config: xxx # In group_A/GLOBAL.md - add reference ## 跨群组资源 See: memory/global/GLOBAL.md
⚠️ Security Note: Do NOT migrate API keys, passwords, or other sensitive credentials to global memory. Keep secrets in environment variables or private memory only.
/workspace/
├── memory/
│ ├── global/
│ │ ├── GLOBAL.md # Shared key information
│ │ └── YYYY-MM-DD.md # Daily logs
│ ├── group_feishu_<id>/ # Feishu group memories
│ │ ├── GLOBAL.md # Group key information
│ │ ├── YYYY-MM-DD.md # Daily logs
│ │ ├── skills/ # ⭐ Group-specific skills
│ │ └── repos/ # ⭐ Group-specific projects
│ └── private/
│ ├── GLOBAL.md
│ └── YYYY-MM-DD.md
├── MEMORY.md
├── skills/ # Global shared skills
├── projects/
└── repos/scripts/init-group-memory.sh - Initialize group memory structure:
bash./scripts/init-group-memory.sh feishu oc_xxx "小说创作群组"
scripts/ensure-group-memory.sh - Ensure group memory directory exists (on-demand):
bash# Auto-initializes group memory with all subdirectories ./scripts/ensure-group-memory.sh feishu oc_xxx "小说创作群组"
scripts/ensure-private-memory.sh - Ensure private memory directory exists:
bash# Auto-initializes private memory when in private chat context ./scripts/ensure-private-memory.sh
scripts/ensure-global-memory.sh - Ensure global memory directory exists:
bash# Auto-initializes global memory for cross-group information ./scripts/ensure-global-memory.sh
scripts/auto-clone.sh - Clone repo to correct location:
bash# Auto-detects context and clones to appropriate location ./scripts/auto-clone.sh https://github.com/user/repo
| Scope | Location | Access | Priority | |-------|----------|--------|--------| | Group-specific | memory/group_<id>/skills/ | Only current group | High | | Global | /workspace/skills/ | All groups | Low |
Every group's GLOBAL.md should include:
markdown## Cross-Group Resources 📚 **Cross-Group Global Memory**: `memory/global/GLOBAL.md` Contains information shared across all groups.
⚠️ Security Note: Do NOT store API keys, passwords, or other sensitive credentials in global memory. Use environment variables or private memory for secrets.
When information becomes relevant to multiple groups:
memory/global/GLOBAL.mdAll memory directories are automatically initialized using a dual approach (A + B):
When installing files-memory-system, the following directories are automatically created:
memory/private/ with GLOBAL.mdmemory/global/ with GLOBAL.mdWhen using auto-clone.sh or other scripts, the system automatically detects and initializes missing directories:
ensure-group-memory.shensure-private-memory.shensure-global-memory.shThis ensures all memory locations are always available when needed, even if:
| Feature | Private Memory | Group Memory | Global Memory | |---------|----------------|--------------|---------------| | Location | memory/private/ | memory/group_<id>/ | memory/global/ | | Auto-init A | ✅ Install-time | ❌ No | ✅ Install-time | | Auto-init B | ✅ On-demand | ✅ On-demand | ✅ On-demand | | Skills | Uses global | Can isolate | N/A | | Projects | Uses global | Can isolate | N/A | | Scope | 1-on-1 chats | Specific group | All groups | | Ensure Script | ensure-private-memory.sh | ensure-group-memory.sh | ensure-global-memory.sh | | Scope | 1-on-1 chats only | Specific to one group | | Auto-init | ✅ Yes (A+B) | ✅ Yes (B only) |
MEMORY.md only loaded in private chats| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 2,810 | 6,724 | +139% | 1 | 1 | 0% | 548 | 5,022 | +816% | 0 | 0 | — |
case-02 | fail→fail | 2,996 | 4,691 | +57% | 1 | 1 | 0% | 610 | 4,921 | +707% | 0 | 0 | — |
case-03 | fail→fail | 4,337 | 6,168 | +42% | 1 | 1 | 0% | 653 | 5,162 | +691% | 0 | 0 | — |
case-04 | fail→fail | 3,199 | 7,223 | +126% | 1 | 1 | 0% | 634 | 5,331 | +741% | 0 | 0 | — |
case-05 | fail→fail | 4,709 | 6,819 | +45% | 1 | 1 | 0% | 988 | 5,502 | +457% | 0 | 0 | — |
case-06 | fail→pass | 7,538 | 2,505 | -67% | 1 | 1 | 0% | 1,539 | 5,142 | +234% | 0 | 0 | — |
case-07 | fail→pass | 4,674 | 4,262 | -9% | 1 | 1 | 0% | 1,170 | 5,562 | +375% | 0 | 0 | — |
case-08 | fail→fail | 6,110 | 5,092 | -17% | 1 | 1 | 0% | 956 | 5,034 | +427% | 0 | 0 | — |
case-09 | fail→fail | 9,947 | 5,026 | -49% | 1 | 1 | 0% | 1,919 | 5,022 | +162% | 0 | 0 | — |
case-10 | pass→pass | 4,646 | 5,027 | +8% | 1 | 1 | 0% | 848 | 5,762 | +579% | 0 | 0 | — |
case-11 | fail→fail | 2,724 | 1,783 | -35% | 1 | 1 | 0% | 558 | 5,021 | +800% | 0 | 0 | — |
case-12 | fail→fail | 5,591 | 2,373 | -58% | 1 | 1 | 0% | 1,224 | 5,261 | +330% | 0 | 0 | — |
case-13 | pass→pass | 2,372 | 1,059 | -55% | 1 | 1 | 0% | 454 | 4,854 | +969% | 0 | 0 | — |
case-14 | fail→pass | 9,763 | 2,027 | -79% | 1 | 1 | 0% | 2,145 | 5,102 | +138% | 0 | 0 | — |
case-15 | fail→fail | 7,088 | 2,578 | -64% | 1 | 1 | 0% | 1,369 | 5,319 | +289% | 0 | 0 | — |
case-16 | fail→pass | 5,233 | 2,373 | -55% | 1 | 1 | 0% | 1,151 | 5,203 | +352% | 0 | 0 | — |
case-17 | fail→pass | 5,881 | 4,002 | -32% | 1 | 1 | 0% | 1,081 | 5,496 | +408% | 0 | 0 | — |
case-18 | fail→pass | 6,138 | 2,690 | -56% | 1 | 1 | 0% | 1,222 | 5,202 | +326% | 0 | 0 | — |
case-19 | fail→fail | 7,167 | 3,733 | -48% | 1 | 1 | 0% | 1,376 | 5,449 | +296% | 0 | 0 | — |
case-20 | pass→pass | 2,637 | 13,702 | +420% | 1 | 1 | 0% | 485 | 7,409 | +1428% | 0 | 0 | — |
case-21 | pass→pass | 2,033 | 1,289 | -37% | 1 | 1 | 0% | 386 | 4,892 | +1167% | 0 | 0 | — |
case-22 | pass→fail | 2,991 | 5,331 | +78% | 1 | 1 | 0% | 686 | 4,991 | +628% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 14 counted toward the lift figure. The other 8 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +23 percentage points is the difference between those two pass rates over the 14 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.