Agent KB for Openclaw

Openclaw Skills for Agent KB helps you create, maintain, validate, and optimize a repository-local knowledge base for coding agents.

lesliebiubiubiu
v0.1.0
Aug 2, 2026
0
360
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install agent-context-kb

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install agent-context-kb using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Agent KB?

Openclaw Skills for Agent KB is a repository-scoped maintenance skill for managing a .agent-kb/ knowledge base designed specifically for coding agents. It focuses on durable, agent-facing project memory: scaffolding the KB, refreshing runtime protocol files, validating structure and routes, compiling inbox notes into stable topics, and trimming stale or redundant content.

Unlike general documentation tooling, this skill is built around a strict separation of concerns between protocol, canon, and maintenance. Openclaw Skills ensures the KB stays compact, reachable, and operational so agents can reliably find the right project knowledge without duplicating human documentation.

Agent KB Use Cases

  • Setting up a new .agent-kb/ repository for agent memory and project continuity
  • Refreshing the KB runtime protocol or scaffold after skill updates
  • Validating KB edits, route definitions, and link reachability before finishing work
  • Capturing durable facts when the best permanent file target is unclear
  • Compiling inbox notes into valid topic files once the destination becomes clear
  • Trimming stale, redundant, or overly large KB content to keep the knowledge base lean
  • Recording current focus, milestones, and open questions in .agent-kb/plans/current.md
  • Managing different versioning modes: nested, shared, or local
  • Backfilling usage stats and transcript reads when available

How Agent KB Works

  1. Initialize or upgrade the repository KB using the bundled Python script from the skill directory.
  2. Choose the correct versioning mode for the repository: nested by default, or shared/local when requested.
  3. Add durable knowledge through notes when the stable destination is unclear, or write directly to the appropriate topic file when it is known.
  4. Compile inbox notes into topic files to merge temporary captures into lasting knowledge.
  5. Validate the KB after every meaningful edit to catch broken routes, links, or protocol issues.
  6. Trim stale or repetitive information when the KB grows too large, using dry-run output first and --write only for deterministic cleanup.
  7. Use stats to inspect KB health and transcript-backed usage patterns, then paste the full ASCII output verbatim when required.

Agent KB Setup

  1. Open the skill directory that contains the bundled KB management script.
  2. Run initialization against the target repository root.
  3. Validate the scaffold and any generated runtime protocol files.
  4. If the scaffold is empty after init, present the one-time distillation pass to the user and proceed only if accepted.
  5. Configure versioning mode as needed: nested default, shared, or local.
  6. Keep .agent-kb/.gitignore and .agent-kb/.kb-meta.yaml aligned with the chosen mode.
  7. Regenerate the route map after route changes.
python3 scripts/agent_kb.py init --root /path/to/repo
python3 scripts/agent_kb.py upgrade --root /path/to/repo
python3 scripts/agent_kb.py validate --root /path/to/repo
python3 scripts/agent_kb.py note --root /path/to/repo --title "Auth session note" --target decisions/active/auth-storage.md --body "Durable fact."
python3 scripts/agent_kb.py compile --root /path/to/repo
python3 scripts/agent_kb.py trim --root /path/to/repo
python3 scripts/agent_kb.py trim --root /path/to/repo --write
python3 scripts/agent_kb.py stats --root /path/to/repo

Agent KB Data Schema & Taxonomy

Openclaw Skills for Agent KB organizes repository knowledge under a .agent-kb/ directory with a strict topical structure and metadata-driven routing.

Path / File Purpose Notes
.agent-kb/start.md Canonical durable-knowledge rules Defines what counts as durable knowledge and the do/don't canon
.agent-kb/plans/current.md Lightweight continuity plan Stores current focus, milestones, next moves, and open questions
.agent-kb/routes.yaml Canonical route source Maps tasks to the files agents should read first
.agent-kb/map.md Generated route map Regenerated when routes change
.agent-kb/.kb-meta.yaml Versioning metadata Records nested/shared/local mode
.agent-kb/.gitignore Privacy and VCS control Always excludes .log/ from version control
Topic files under decisions/, workflows/, etc. Durable project knowledge Must remain reachable from routes or Markdown links

Route taxonomy

  • id: stable route identifier
  • task: human-readable purpose for the route
  • read_first: exactly one primary file
  • also_consider: up to two additional files

Maintenance taxonomy

  • init: scaffold and protocol generation
  • upgrade: conservative refresh of generated files
  • validate: integrity and link checks
  • note: durable fact capture when destination is uncertain
  • compile: merge inbox notes into stable topics
  • trim: reduce redundancy and staleness
  • stats: report KB health and transcript-derived metrics

Agent KB Advanced Features

  • Support for nested, shared, and local versioning modes to fit personal, team, or repo-local workflows
  • Conservative upgrade behavior to refresh generated scaffold files without unnecessary churn
  • Route validation that enforces reachability and link integrity across the KB
  • Inbox-to-topic compilation for turning temporary notes into durable project memory
  • Controlled trimming workflow that favors non-redundant, genuinely compact knowledge over aggressive deletion
  • stats output designed for verbatim reporting, including ASCII charts as the deliverable
  • Explicit separation of trigger, canon, and skill layers to prevent protocol duplication
  • Route map regeneration to keep navigation aligned with evolving project knowledge

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*