knowledge-base
Scannednpx machina-cli add skill srobinson/helioy-plugins/knowledge-base --openclawKnowledge Base Management (~/.mdx)
You manage a persistent knowledge base at ~/.mdx/. Every document is a markdown file with YAML frontmatter. Follow these instructions exactly.
Directory Structure
~/.mdx/
├── research/ # Research findings, literature reviews
├── decisions/ # Architecture Decision Records (ADRs)
├── design/ # Design documents, RFCs, architecture docs
├── sessions/ # Session summaries, meeting notes
├── projects/ # Per-project status, context
├── retrospectives/ # Post-mortems, lessons learned
├── reference/ # Stable reference material, guides
└── _schema.md # Frontmatter contract
Each category directory contains a _versions/ subdirectory for historical versions.
Category Selection Guide
| Category | Use when the document... |
|---|---|
research | Captures findings, analysis, literature reviews, explorations |
decisions | Records a decision and its rationale (ADR-style) |
design | Describes architecture, RFCs, system design, technical plans |
sessions | Summarizes a work session, meeting, or pairing session |
projects | Tracks per-project status, context, or overview |
retrospectives | Reflects on what happened — post-mortems, lessons learned |
reference | Contains stable guides, cheatsheets, how-tos, conventions |
When in doubt, prefer research for exploratory content and reference for settled content.
Frontmatter Contract
Every document MUST have this frontmatter block:
---
title: "Human-readable document title"
type: research | decisions | design | sessions | projects | retrospectives | reference
tags: [tag1, tag2]
summary: "One-line summary of the document"
status: draft | active | superseded | archived
created: YYYY-MM-DD # set to current date on creation
updated: YYYY-MM-DD # set to current date on every write
---
Required fields (author provides):
title(string) — Human-readable document titletype(string) — Must match the category directory name. One of: research, decisions, design, sessions, projects, retrospectives, referencetags(string[]) — Freeform tags for cross-cutting concernssummary(string) — One-line summarystatus(string) — Must be one of: draft, active, superseded, archived
Auto-managed fields (you set these):
created(ISO date, YYYY-MM-DD) — Set on first write. Never change after creation.updated(ISO date, YYYY-MM-DD) — Set to current date on every write.
Optional fields:
project(string) — Associated Helioy project: am, fmm, nancyr, mdcontext, helioyrelated(string[]) — Slugs of related documentsconfidence(string) — One of: high, medium, low, speculativesupersedes(string) — Slug of the document this replaces
Filename Conventions
- Kebab-case slugs only:
helioy-architecture.md,cli-wrapping-default.md - No dates in filenames (dates live in frontmatter)
- No spaces or special characters
- No numeric prefixes
- The slug is the filename without
.md
Operations
1. Create
- Determine the correct category from the category selection guide.
- Choose a kebab-case slug for the filename.
- Ensure the directory exists:
mkdir -p ~/.mdx/<category>/_versions/ - Confirm the file does NOT already exist at
~/.mdx/<category>/<slug>.md. If it does, this is an Update, not a Create. - Write the file at
~/.mdx/<category>/<slug>.mdwith valid frontmatter and markdown body. - The
typefield MUST match the category directory name.
2. Read
- If given a slug: search across all category directories for
<slug>.mdusing glob~/.mdx/*/<slug>.md. If multiple matches exist across categories, present all matches and ask the user to specify the category. - If given a category and slug: read directly from
~/.mdx/<category>/<slug>.md - If given a full path: read directly
3. Update
Determine whether the change is minor or substantive:
Minor edit (typo, formatting, small correction):
- Edit the file in place.
- Update the
updatedfield to the current date. - Do NOT create a version.
Substantive revision (new sections, changed conclusions, rewritten content, or changes altering >20% of content):
- Determine the next version number by listing
~/.mdx/<category>/_versions/<slug>.v*.md - MOVE (not copy) the current file:
mv ~/.mdx/<category>/<slug>.md ~/.mdx/<category>/_versions/<slug>.v<N>.md - Write the NEW version at
~/.mdx/<category>/<slug>.mdwith updated content. - Set
updatedto the current date. Do NOT changecreated.
CRITICAL: Step 2 MUST happen BEFORE step 3. Move first, then write new.
4. Search
- By category: List files in
~/.mdx/<category>/(exclude_versions/) - By tag: Grep for the tag within frontmatter
tags:lines across all~/.mdx/*/*.mdfiles - By content: Grep for the search term across all
~/.mdx/*/*.mdfiles - By status: Grep for
status: <value>across all documents - By project: Grep for
project: <value>across all documents
5. List
- Single category: Glob
~/.mdx/<category>/*.md, read frontmatter, present as table. - All categories: Glob
~/.mdx/*/*.md(exclude_versions/and_schema.md), group by category.
6. Version History
- Find the current document at
~/.mdx/<category>/<slug>.md - List all files matching
~/.mdx/<category>/_versions/<slug>.v*.md - Sort by version number ascending and present chronologically
Initialization
If ~/.mdx/ does not exist when you need it, create the full structure:
mkdir -p ~/.mdx/{research,decisions,design,sessions,projects,retrospectives,reference}/_versions
Then create ~/.mdx/.mdcontextignore with _versions/ if it does not exist.
Rules
- Always validate that
typematches the directory the file lives in. - Never write a document without all required frontmatter fields.
- Always set
updatedto the current date on any write. - Never modify
createdafter initial creation. - When the user says "save this", "remember this", or "store this" — create a new knowledge base document.
- When the user asks "what do we know about X" — search the knowledge base.
- Use the knowledge base for structured, titled documents. Use AM memory (the memory skill) for conversational recall and session continuity. They serve different purposes.
Source
git clone https://github.com/srobinson/helioy-plugins/blob/main/plugins/helioy-tools/skills/knowledge-base/SKILL.mdView on GitHub Overview
Knowledge-base manages a centralized markdown store at ~/.mdx organized into seven categories: research, decisions, design, sessions, projects, retrospectives, and reference. Each document uses a structured YAML frontmatter and lives in its category folder, with per-document version history stored under _versions. It enables create, read, update, search, list, and versioning workflows with a consistent frontmatter contract.
How This Skill Works
Documents live as .mdx files under one of seven category folders. Every file must include a YAML frontmatter block with required fields (title, type, tags, summary, status) and auto-managed created and updated dates; optional fields like project, related, confidence, and supersedes may be included. Version history is kept in a per-category _versions subdirectory to track changes over time.
When to Use It
- Document exploratory research findings or literature reviews in research
- Capture architecture decisions and their rationale (ADR-style) in decisions
- Draft design documents, RFCs, or system architecture plans in design
- Summarize a work session, meeting, or pairing session in sessions
- Store stable reference material or per-project context in reference or projects, including post-mortems in retrospectives
Quick Start
- Step 1: Choose the category and a kebab-case slug for your document
- Step 2: Create ~/.mdx/<category>/<slug>.md with valid frontmatter and your markdown body
- Step 3: After each write, save a version under ~/.mdx/<category>/_versions/ and let the system update the created/updated fields
Best Practices
- Put documents in the correct category per the Category Selection Guide
- Fill out the frontmatter fully: title, type, tags, summary, status; ensure created/updated dates are accurate
- Use kebab-case slugs for filenames; no spaces, no dates in filenames; slug matches the filename
- Version every update by saving a copy to the corresponding _versions directory
- Use related and tags to link documents across categories and keep status current (draft, active, superseded, archived)
Example Use Cases
- Document exploratory research findings or literature reviews in research (e.g., a literature review on data synchronization techniques)
- Capture architecture decisions and rationale (ADR-style) in decisions (e.g., choosing a cache strategy)
- Draft design documents or RFCs describing system architecture in design (e.g., microservice data flow)
- Summarize a work session or meeting in sessions (e.g., design review notes)
- Post-mortem retrospectives detailing lessons learned in retrospectives (e.g., incident response review)