knowledge-gardener

Detect drift in OKF knowledge bundles and refresh explainers against pinned source fingerprints.

1|Updated May 28, 2026
One-click install
npx skills add https://github.com/dhanesh/agent-skills --skill knowledge-gardener-dhanesh
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: knowledge-gardener
Source: https://github.com/dhanesh/agent-skills/tree/main/knowledge-gardener
Command: npx skills add https://github.com/dhanesh/agent-skills --skill knowledge-gardener-dhanesh

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve? Knowledge explainers pinned to a moving source quietly rot: the repo gains commits, files get revised, and documentation written months ago starts misleading readers. This Skill sweeps Open Knowledge Format (OKF v0.1) bundles, compares each subject's pinned fingerprints (git HEAD, sha256 of files and directories) against current reality, and reports exactly which subjects have drifted so you can refresh only what changed. ## Core Features & Use Cases - Drift Detection Sweep: Scan one or more knowledge roots and get a per-subject FRESH/STALE/UNKNOWN/ERROR report, with pinned vs current git SHA, diffstat, and changed file names for stale sources. - Diff-Aware Refresh: Follow the bundled refresh playbook to rewrite only the explainer segments the diff touched, re-pin fingerprints, and log the update in the bundle's log.md. - CI-Style Gate: The sweep exits non-zero on any STALE or ERROR subject, so it works as an automated knowledge health check; a JSON subcommand emits the same facts for scripting. - Use Case: After a week of commits to your repo, ask the agent to sweep docs/knowledge — it reports the ingest-pipeline explainer is STALE because retry.py changed, rewrites just that segment, re-pins the fingerprint, and regenerates the published site. ## Quick Start Ask the agent to sweep docs/knowledge for stale subjects and refresh any explainers whose sources have drifted.

Frequently Asked Questions about knowledge-gardener

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check if my documentation is out of date with my code?▼

Run the garden.py sweep over your knowledge roots: python3 assets/garden.py sweep docs/knowledge. It compares each explainer's pinned fingerprints (git HEAD or sha256) against current sources and reports FRESH, STALE, UNKNOWN, or ERROR per subject, with a diff summary for stale git sources.

How to update documentation after a git repo changes?▼

The sweep shows pinned vs current SHA, a diffstat, and changed file names for each stale subject. The refresh playbook then maps changed files to explainer segments, rewrites only the drifted segments, re-pins the fingerprints, and appends a dated entry to the bundle's log.md.

Can I use the drift sweep as a CI gate?▼

Yes, the sweep exits non-zero whenever any subject is STALE or ERROR, so it works directly as a CI-style gate. UNKNOWN alone exits 0 because external URL sources are permanently uncheckable, and a json subcommand emits the same results machine-readably.

Does knowledge-gardener require network access or external packages?▼

No, garden.py is stdlib-only Python 3 and runs fully offline with no pip installs. Git is needed only to check git-pinned sources; file and directory sources use sha256 hashing, and external URL sources simply report UNKNOWN.

What happens when an explainer's frontmatter is corrupted?▼

Malformed frontmatter becomes an ERROR entry in the report, never a crash. The refresh playbook describes repairing the YAML block (often recoverable via git log on the bundle), re-pinning the suspect fingerprints, and logging the repair before re-judging freshness.

When should I use feynman-walkthrough instead of knowledge-gardener?▼

Use feynman-walkthrough to create new OKF bundles and explainers from scratch; knowledge-gardener only maintains existing ones. For publishing a browsable static site over a bundle, use okf-site-kit — the gardener regenerates sites but does not build them.