← 返回 Skills 市场
claireaicodes

Knowledge Management

作者 ClaireAICodes · GitHub ↗ · v2.1.0
cross-platform ⚠ suspicious
1147
总下载
0
收藏
6
当前安装
2
版本数
在 OpenClaw 中安装
/install knowledge-management
功能描述
Organize and classify OpenClaw knowledge entries into local folders by content type (Research, Decision, Insight, Lesson, Pattern, Project, Reference, Tutori...
使用说明 (SKILL.md)

Knowledge Management Skill (Local Storage)

Organize your OpenClaw memory files into a structured local knowledge base. Automatically parses MEMORY.md and daily memory files, classifies entries by content type, and stores each as a timestamped markdown file in the appropriate folder.

Available Tools

Core Commands

  • km sync [options] - Sync memory entries to local files
  • km classify [options] - Parse and classify without storing (JSON output)
  • km summarize [options] - Generate index files for each content type
  • km cleanup [options] - Remove orphaned files
  • km list_types - List all available content types

Setup

No API keys needed! The skill uses two locations:

  • Input Workspace: Where MEMORY.md and memory/ daily files are read from.
  • Output Directory: Where organized folders (Research/, Decision/, etc.) are written.

Both are detected automatically:

Input Workspace (source files)

  1. OPENCLAWORKSPACE environment variable
  2. --workspace \x3Cpath> CLI argument
  3. Current working directory (if it contains MEMORY.md)
  4. Default: ~/.openclaw/workspace

Output Directory (organized files)

  1. --output-dir \x3Cpath> CLI argument (relative to workspace or absolute)
  2. Default: \x3Cworkspace>/memory/KM

The skill will create the output directory and all content-type folders automatically.

If you want to pre-create:

mkdir -p ~/.openclaw/workspace/memory/KM/{Research,Decision,Insight,Lesson,Pattern,Project,Reference,Tutorial}

Usage Examples

Default locations (input at workspace root, output in memory/KM)

# From any directory (workspace auto-detected)
km sync --days_back 7 --cleanup

Custom input workspace and output directory

km sync --workspace /custom/input/workspace --output-dir /custom/output/KM --days_back 7

Using environment variables

export OPENCLAWORKSPACE=/custom/input/workspace
km sync --output-dir /custom/output/KM --days_back 7

Dry run (preview only)

km sync --dry_run --days_back 1

Classify entries and export JSON

km classify --days_back 3 > entries.json

Generate index files (default: output directory)

km summarize
# or specify different location
km summarize --output_dir ~/some/other/folder

Preview orphan cleanup

km cleanup --dry_run

List content types

km list_types

Storage Structure

Assuming default configuration:

  • Input workspace: ~/.openclaw/workspace
  • Output directory: ~/.openclaw/workspace/memory/KM
~/.openclaw/workspace/
├── MEMORY.md                (source file - you edit this)
├── memory/                  (daily memory files)
│   ├── 2025-02-11.md
│   ├── 2025-02-12.md
│   └── ...
└── memory/KM/               (organized output by the skill)
    ├── local-sync-state.json
    ├── local-sync-log.md
    ├── Research/
    │   ├── 20260215T1448_Title_Here_HASH.md
    │   └── ...
    ├── Decision/
    ├── Insight/
    ├── Lesson/
    ├── Pattern/
    ├── Project/
    ├── Reference/
    ├── Tutorial/
    ├── Research_Index.md
    ├── Decision_Index.md
    └── ... (other index files)

File Naming

Format: YYYYMMDDTHHMM_Title_With_Underscores_8CHARHASH.md

The 8-character content hash suffix prevents filename collisions when titles are identical but content differs.

File Content (YAML Frontmatter)

---
title: "Protocol Name"
content_type: "Research"
domain: "OpenClaw"
certainty: "Verified"
impact: "Medium"
confidence_score: 8
tags: ["AI", "Automation"]
source: "MEMORY.md"
source_file: "MEMORY.md"
date: "2026-02-11"
content_hash: "e4b30e75d0f5a662"
---

Entry body content starts here...

How It Works

  1. Parses MEMORY.md and recent daily memory/*.md files
  2. Classifies each entry (content type, domain, certainty, impact, tags, confidence)
  3. Computes content hash for deduplication
  4. Checks sync state (memory/local-sync-state.json) to skip already synced entries
  5. Writes to appropriate folder with timestamp + hash filename
  6. Updates state mapping (hash → filepath)
  7. Optional cleanup removes files not in state

Classification Logic

  • Content Type: Keyword matching (Research, Lesson, Decision, Pattern, Tutorial, Reference, Insight)
  • Domain: Contextual inference (AI Models, OpenClaw, Cost, Trading, etc.)
  • Certainty: Based on language (Verified, Likely, Speculative, Opinion)
  • Impact: Importance indicators (High, Medium, Low, Negligible)
  • Tags: Auto-extracted from predefined keyword map
  • Confidence Score: 1–10 heuristic (source credibility, length, data mentions)

Customize by editing the EntryClassifier class in index-local.js.

State Management

memory/local-sync-state.json maps content hashes to file paths:

{
  "e4b30e75d0f5a662": "/path/to/Research/202602151440_Title_e4b30e75.md"
}

This enables idempotent syncs and fast duplicate detection.

Do not edit manually unless recovering from corruption.

Cron Integration

Automate daily syncs:

openclaw cron add \
  --name "Daily Knowledge Sync" \
  --cron "0 5 * * *" \
  --tz "Asia/Singapore" \
  --session isolated \
  --message "km sync --days_back 7"

Note: By default, the skill reads MEMORY.md from ~/.openclaw/workspace and writes organized files to ~/.openclaw/workspace/memory/KM. Use --workspace or --output-dir to customize these locations.

Troubleshooting

"km: command not found"

  • Run npm link in the skill directory, or add ~/workspace/bin to PATH.

No entries found

  • Ensure MEMORY.md uses ## section headers and ### entry titles within recognized sections.

Files not created

  • Check write permissions; run with --verbose.

Old entries not syncing

  • They may already be in state. Clear memory/KM/local-sync-state.json to force re-sync (caution: may duplicate files).

Duplicate files

  • Run km cleanup to remove orphans, then km sync to create missing files.

Version: 2.0.0 Changed: 2026-02-15 — Switched from Notion to local storage, added hash suffixes for uniqueness. Author: Claire (OpenClaw Agent) License: MIT

安全使用建议
This skill appears to do what it says (parse local MEMORY.md and create organized markdown files), but there are a few red flags you should check before installing or running it: - Review and fix env var inconsistencies: SKILL.md/README mention OPENCLAWORKSPACE or WORKSPACE, but the code checks OPENCLAW_WORKSPACE. Decide which variable you will set and ensure the code or docs are aligned. - Check the default path: the code falls back to /home/ubuntu/.openclaw/workspace if no workspace is detected. On non-Ubuntu machines this may point to a non-existent or wrong home — set the workspace explicitly via --workspace or the correct environment variable. - Run in dry-run first: use km sync --dry_run (or km cleanup --dry_run) to preview changes before any files are written or deleted. - Back up your workspace: before running km sync --cleanup, back up memory/ and MEMORY.md so you can recover if the state file is wrong. - Inspect the bundled script: look through index-local.js (you have it) to confirm behavior (directory creation, file writes, hashing logic) meets your expectations; ensure no unexpected network calls are added later. - Install locally and trust source: the package exposes 'km' via package.json. Only npm link or add to PATH a copy you trust (don't run code from unknown servers). If these checks are satisfied and you run in dry-run mode first, the tool is usable; if you cannot confirm the workspace path or if you rely on shared/important files in the workspace, treat the cleanup step as potentially dangerous.
功能分析
Type: OpenClaw Skill Name: knowledge-management Version: 2.1.0 The skill is classified as suspicious due to a critical Remote Code Execution (RCE) vulnerability found in `index-local.js`. Specifically, the `LocalStorageManager.generateIndex()` function uses `eval()` to parse the `tags` array from YAML frontmatter within markdown files. An attacker could inject malicious JavaScript into the `tags` field of a crafted markdown file, leading to arbitrary code execution when the `km summarize` command is run. This appears to be an unintentional vulnerability rather than intentional malice, as indicated by the comment `// Safe since we control the format`.
能力评估
Purpose & Capability
The name/description align with the actual behavior: reading local MEMORY.md and daily memory/*.md files, classifying entries, and writing timestamped markdown files. Requiring a local 'km' binary is coherent because package.json exposes that CLI. However, the tool relies on a local CLI (index-local.js) rather than an external service — that matches purpose but deserves attention because installation (npm link or placing the script on PATH) is necessary. Minor concern: the code defaults to /home/ubuntu/.openclaw/workspace which may be unexpected on non-ubuntu systems.
Instruction Scope
Instructions and code describe only local filesystem operations (parsing MEMORY.md, writing files, maintaining local state), which is appropriate. However there are multiple inconsistencies between docs and code about environment variable names and default locations: SKILL.md/README reference OPENCLAWORKSPACE (no underscore) or WORKSPACE while index-local.js checks OPENCLAW_WORKSPACE (with underscore). SKILL.md and README say default is ~/.openclaw/workspace, but the code falls back to /home/ubuntu/.openclaw/workspace. The tool also supports a --cleanup operation that will delete 'orphaned' files; if the state file is incorrect or out-of-sync this could remove user files. These mismatches and the destructive cleanup option are reasons to review behavior carefully before running.
Install Mechanism
No remote install spec is provided (instruction-only skill + included JS file). The project exposes a local CLI via package.json's 'bin' field; installation is local (npm link or placing the script on PATH). There are no downloads from external URLs and no unexpected installers in the manifest, which reduces install risk.
Credentials
The skill requests no secrets and no external credentials, which is appropriate. The only required 'credential' is the local 'km' binary. But documentation and code disagree on environment variable names (OPENCLAWORKSPACE vs OPENCLAW_WORKSPACE vs WORKSPACE), which can lead to confusing behavior. Also the hardcoded fallback to /home/ubuntu/.openclaw/workspace may cause the tool to read/write in an unexpected location if environment detection fails.
Persistence & Privilege
always:false (good). The skill writes files into a workspace and maintains a local state file (memory/local-sync-state.json) — this is expected for the purpose. The notable privilege is the '--cleanup' operation which will remove files not referenced in the state mapping; that is a normal feature for sync tools but has real destructive potential if the state file is corrupted or if the workspace path detection is wrong. The skill does not request system-wide configuration changes or credentials for other skills.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install knowledge-management
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /knowledge-management 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v2.1.0
Added configurable workspace path (--workspace, OPENCLAWORKSPACE, or cwd). Separate organized output into memory/KM subfolder by default. Fixed missing warning() function. Backward compatible. Documentation updated.
v1.0.0
- Initial release of the knowledge-management skill for OpenClaw. - Organizes and classifies knowledge entries (Research, Decision, Insight, Lesson, Pattern, Project, Reference, Tutorial) into local timestamped markdown files. - Automatically parses and syncs MEMORY.md and daily memory files into structured folders. - Provides commands for syncing, classifying, summarizing, and cleaning up entries. - Uses content hashes in filenames for deduplication and reliable sync state management. - No external APIs or keys required; local-first storage and automation friendly.
元数据
Slug knowledge-management
版本 2.1.0
许可证
累计安装 7
当前安装数 6
历史版本数 2
常见问题

Knowledge Management 是什么?

Organize and classify OpenClaw knowledge entries into local folders by content type (Research, Decision, Insight, Lesson, Pattern, Project, Reference, Tutori... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1147 次。

如何安装 Knowledge Management?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install knowledge-management」即可一键安装,无需额外配置。

Knowledge Management 是免费的吗?

是的,Knowledge Management 完全免费(开源免费),可自由下载、安装和使用。

Knowledge Management 支持哪些平台?

Knowledge Management 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Knowledge Management?

由 ClaireAICodes(@claireaicodes)开发并维护,当前版本 v2.1.0。

💬 留言讨论