vaultli
Manage a file-based knowledge vault with YAML frontmatter, sidecar markdown, and JSONL indexing. Use when initializing or maintaining a knowledge base, attaching metadata to markdown or non-markdown assets, rebuilding or validating INDEX.jsonl, or searching vault records by metadata. Trigger on: "knowledge base", "vault", "frontmatter", "sidecar", "INDEX.jsonl", "document this query/template/skill", "search the vault", or "set up KB docs".
- License 许可
- MIT
- 最近更新
- 2026-11-11
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- vaultli
- description
- Manage a file-based knowledge vault with YAML frontmatter, sidecar markdown, and JSONL indexing. Use when initializing or maintaining a knowledge base, attaching metadata to markdown or non-markdown assets, rebuilding or validating INDEX.jsonl, or searching vault records by metadata. Trigger on: "knowledge base", "vault", "frontmatter", "sidecar", "INDEX.jsonl", "document this query/template/skill", "search the vault", or "set up KB docs".
02 资源文件 27
- 脚本__init__.py107 B
- 脚本__main__.py80 B
- 脚本cli.py15.7 KB
- 脚本core.py56.1 KB
- 参考文档README.md8.8 KB
- 其他rs/Cargo.lock15.9 KB
- 其他rs/Cargo.toml472 B
- 脚本rs/src/context.rs3.5 KB
- 脚本rs/src/error.rs2.8 KB
- 脚本rs/src/federation.rs2.2 KB
- 脚本rs/src/frontmatter.rs3.8 KB
- 脚本rs/src/gitinfo.rs4.1 KB
- 脚本rs/src/id.rs833 B
- 脚本rs/src/index.rs8.9 KB
- 脚本rs/src/infer.rs10.5 KB
- 脚本rs/src/lib.rs253 B
- 脚本rs/src/main.rs12.9 KB
- 脚本rs/src/metadata.rs6.9 KB
- 脚本rs/src/model.rs1.6 KB
- 脚本rs/src/paths.rs2.1 KB
- 脚本rs/src/scaffold.rs12.1 KB
- 脚本rs/src/search.rs11.4 KB
- 脚本rs/src/util.rs4.9 KB
- 脚本rs/src/validate.rs11.4 KB
- 脚本rs/tests/integration.rs16.8 KB
- 脚本rs/tests/parity.rs6.3 KB
- 参考文档vaultli-spec-v1.0.md29.2 KB
03 SKILL.md 正文
vaultli
Use vaultli when the job is to make a repository's knowledge assets agent-discoverable.
It is strongest at standardizing metadata, creating sidecars, building INDEX.jsonl,
and validating vault integrity.
What vaultli does
vaultli turns a directory of markdown files, queries, templates, runbooks, and
other assets into a structured file-based knowledge base.
- Native markdown files keep metadata inline in YAML frontmatter.
- Non-markdown assets get same-directory sidecars such as
report.sql.md. - Indexed records are written to
INDEX.jsonlfor fast lookup and filtering. - Validation checks help catch stale, broken, or internally inconsistent vault state.
The source of truth is the files on disk. INDEX.jsonl is a derived cache.
What This Skill Is Not
vaultli is not a full-text search engine or vector database.
searchandshowoperate onINDEX.jsonl.- Search quality depends on frontmatter, especially
description,tags, andcategory. - After a hit is found, use
resolve,cat, orcontextto hydrate real file content. - For sidecars, you often need both the
.mdsidecar and thesourceasset.
Default Invocation
Prefer the Rust binary — it is at behavioral parity with the Python reference (verified by cross-language parity tests) and starts an order of magnitude faster, which matters in tight agent loops:
# one-time build from the vaultli directory, outside the plugin tree
cd <vaultli>/rs && CARGO_TARGET_DIR="${CLAUDE_PLUGIN_DATA:-/tmp}/vaultli-target" cargo build --release
# then invoke the wrapper, which finds that data-directory binary
<plugin-root>/bin/vaultli --json <command> ...
<vaultli> is wherever this package lives; the binary has no other install-time
dependencies and the directory can be relocated freely.
Fall back to the Python CLI only when the Rust binary is unavailable (no Rust toolchain, or debugging a suspected Rust-specific bug):
PYTHONPATH=<plugin-root> uv run python -m vaultli ...
Both implementations accept the same subcommands and flags. Prefer --json in
agent flows so results are machine-readable. Use --root to target the vault
explicitly instead of depending on the current working directory.
| Area | Rust | Python |
|---|---|---|
| Default agent choice | Use this first | Use as fallback |
| Best for | Fast repeated CLI calls | Debugging and reference reads |
| Parity role | Checked against Python | Oracle for Rust parity tests |
| Expected behavior | Same user-visible commands and JSON envelopes | Same user-visible commands and JSON envelopes |
Stability Boundaries
Treat the flat-file lifecycle as stable: init, add, scaffold, ingest,
index, validate, search, show, resolve, cat, set, unset, and
refresh.
Treat search --semantic, context, federated-search, and git-info as
implemented but still experimental helper surfaces. They are safe to use, but a
new agent should prefer explicit JSON inspection and validation around them
instead of assuming they are a full vector store, orchestration engine, or git
history system.
Before claiming compatibility or release readiness, run:
UV_CACHE_DIR=/tmp/uv-cache uv run pytest tests/test_vaultli.py
cd <vaultli>/rs && CARGO_TARGET_DIR="${CLAUDE_PLUGIN_DATA:-/tmp}/vaultli-target" cargo test
Core model
vaultli is built around three simple ideas:
- Markdown is the universal knowledge wrapper.
- YAML frontmatter is the universal metadata format.
- JSONL is the universal index format.
A typical vault looks like this:
kb/
.kbroot
INDEX.jsonl
docs/
guide.md
queries/
retention.sql
retention.sql.md
templates/
campaign_report.j2
campaign_report.j2.md
Core Workflow
- Find or confirm the vault root.
vaultli --json root .
- Create the vault only if
.kbrootis missing.
vaultli --json init ./kb
- Choose the right write path.
| Need | Use |
|---|---|
| Add frontmatter to an existing markdown file and index it right away | add <file> |
| Create a sidecar for a non-markdown asset without indexing yet | scaffold <file> |
| Bulk scaffold missing metadata for a file or directory | ingest <path> |
| Preview a bulk ingest without writing files | ingest <path> --dry-run |
| Limit bulk ingest to safe slices | ingest <path> --include 'queries/*.sql' --exclude 'queries/tmp*' |
| Preview the generated metadata before writing anything | infer <file> |
| Edit one frontmatter field by path or id | set <target> <field> <value> |
| Remove one frontmatter field by path or id | unset <target> <field> |
| Refresh inferred metadata while preserving body content | refresh <target> |
| Rebuild cache state after edits | index |
| Audit the vault for broken links, duplicate IDs, and stale index state | validate |
| Look up candidate records by metadata | search, then resolve or cat; narrow with filters, --sort, --explain, or experimental --semantic |
| Assemble content for an answer | context [query] or context --id <id> |
| Search multiple vaults | federated-search --vault <root> --vault <other> |
| Inspect git state for a vault item | git-info [target] |
- Immediately refine generated metadata.
The inferred metadata is a draft. A new agent should treat the generated values as placeholders:
- rewrite
descriptionto be retrieval-friendly and specific - tighten
tags - correct
categoryif the inference is too generic - add
depends_onandrelatedonly when the IDs are real - flesh out the markdown body so humans and later agents have context
- Rebuild and validate.
vaultli --json index --root ./kb
vaultli --json validate --root ./kb
- Retrieve in two stages.
vaultli --json search retention --root ./kb
vaultli --json search --root ./kb --category query --tag retention --sort priority --limit 5
vaultli --json search "retention query" --root ./kb --semantic --explain
vaultli --json resolve queries/retention --root ./kb --body --source
vaultli cat queries/retention --root ./kb --source
vaultli --json context --root ./kb --id queries/retention --token-budget 2000
Use show when you only need metadata. Use resolve when you need file paths
and optional body/source content. Use cat when the next step needs raw text.
Use context when answering a question and you want dependencies packed into a
single JSON bundle.
Sidecar rules
For non-markdown files, vaultli uses same-directory sidecars:
| Source file | Sidecar |
|---|---|
report.sql |
report.sql.md |
template.j2 |
template.j2.md |
config.yaml |
config.yaml.md |
The sidecar must include a valid source field, usually:
source: ./report.sql
Rules That Prevent Bad KBs
- Never edit
INDEX.jsonldirectly. - Native markdown gets inline frontmatter.
- Non-markdown files need same-directory sidecars named
<file>.<ext>.md. - Sidecars must have a valid relative
source, typically./filename.ext. - Non-markdown assets are not searchable until a sidecar exists.
validatereports problems; it does not repair them.- Prefer
searchfilters oversearch --jqfor common metadata fields. - Treat
search --semanticas experimental token-overlap matching, not vector retrieval. search --jqrequires thejqbinary to be installed.- Sidecar hash changes come from the source asset bytes, not from sidecar prose edits.
- Use
ingest --dry-runbefore bulk writes, and add--include/--excludeglobs on large trees. - Use
set,unset, andrefreshinstead of hand-editing frontmatter when making simple metadata changes.
A Safe Default Loop
vaultli --json root .
vaultli --json add ./kb/docs/guide.md --root ./kb
vaultli --json scaffold ./kb/queries/report.sql --root ./kb
vaultli --json ingest ./kb --root ./kb --dry-run
vaultli --json ingest ./kb --root ./kb --dry-run --include 'queries/*.sql'
# edit the generated markdown files
vaultli --json index --root ./kb
vaultli --json validate --root ./kb
vaultli --json search report --root ./kb
vaultli --json resolve queries/report --root ./kb --body --source
When A New Agent Usually Gets Confused
- Expecting body text to be searchable without opening files.
- Assuming a source file is indexed just because it exists in the vault.
- Leaving the generic inferred
descriptionuntouched. - Forgetting to re-run
indexafter metadata edits. - Treating
validateoutput as if it were self-healing. - Reaching for Python by habit even when the Rust binary is already built.
- Opening source paths manually when
resolve --sourceorcat --sourcewould avoid mistakes. - Running broad
ingeston a large tree without--dry-runand include/exclude globs.
Related docs
README.mdexplains what vaultli is and how the core model works.vaultli-spec-v1.0.mddefines the storage layout and metadata schema.rs/is the primary implementation (Rust); build withCARGO_TARGET_DIR="${CLAUDE_PLUGIN_DATA:-/tmp}/vaultli-target" cargo build --releaseand invoke viabin/vaultli.core.pyis the Python reference implementation, still kept in sync and used as the parity oracle byrs/tests/parity.rs.
04 同仓库更多 Skills
metric-reconciliation
Use when two reports disagree, a KPI needs reconciliation across sources, or actuals need to be compared with a plan, forecast vintage, or prior methodology. Align population, coverage, calendar, attribution, and observation windows before computing gaps. Identify missing slices and preserve unresolved residuals.
analysis-handoff
Use to make a recurring SQL analysis reproducible, hand it to another analyst, or check whether an analysis bundle changed. Capture the exact query, metric definitions, inputs, source vintages, checks, and rerun steps in a portable folder without requiring a copy of row-level results.
conversation-ingestion
File a conversation transcript or notes from an interview, research discussion, or support exchange. Preserve the raw material, capture decisions and actions, and update participant and company timelines. Trigger on 'process this conversation', 'ingest this conversation', 'file this transcript', or 'conversation notes to KB'. For standalone media use media-ingest. For source routing use ingest.
minimal-skill
Minimal shared skill fixture for marketplace renderer and validator examples.
roadmap
Use this skill when the user wants a product roadmap, initiative sequencing, Now/Next/Later plan, quarterly roadmap, release theme map, product strategy-to-roadmap translation, or executive roadmap narrative. Trigger on phrases like "build a roadmap", "roadmap these initiatives", "what should be now next later", "sequence this backlog", "quarterly product roadmap", "theme-based roadmap", or "plan the next two quarters". Do NOT trigger for drafting or reviewing a single PRD (use prd-writer or prd-review), converting a PRD into an agentic PLAN.md (use prd-to-plan), or scoring/ranking a set of options without a time horizon (use prioritization).
prioritization
Use this skill when the user wants to rank, score, triage, or compare product opportunities, features, PRD requirements, backlog items, roadmap candidates, or initiatives using RICE, impact-effort, confidence, reach, value, effort, risk, or tradeoff analysis. Trigger on phrases like "prioritize these features", "rank this backlog", "RICE score", "impact effort matrix", "what should we build first", "compare these initiatives", or "stack rank product bets". Do NOT trigger for a time-based roadmap (use roadmap), writing or reviewing one PRD (use prd-writer or prd-review), turning a PRD into an agentic plan (use prd-to-plan), or analyzing experiment results (use ab-testing or experimentation skills).