agentleFS
pfeffpfeff/claude-skills/skills/kb-core/SKILL.md

kb-core

Skill3 starsChanged 3 months agoMITView on GitHub

Shared library for the LLM Knowledge Base skills (kb-capture, kb-compile, kb-lint). Holds the SPEC v2 §1 primitives — capture predicate, idempotency key, off-limits write-guard, KB-ownership check, concept-slug dedup, orphan detection — in one place so the three skills share one implementation. Reference/infrastructure content, not user-invocable; the three KB skills load its scripts.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No zones, no fence: edit safety is git + review (SPEC v2 §1, INV-5).

    line 42
  2. Very specific:

    All primitives implemented and unit-tested (test_kb_core.py).

    line 46

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

KB Core (shared library)

Shared infrastructure for the three LLM-Knowledge-Base skills. Not user-invocable — there is no operation to run here (precedent: lN-lifecycle-doctrine). It exists so the deterministic logic from SPEC v2 §1 lives in exactly one place.

Source of truth

FilePurpose
references/spec-v2-contract.mdReconstructed KB SPEC v2 contract — the 3 design bullets (Ownership, Reuse the vault schema, Billing) and the AC-1.x/2.x/3.x/6.x acceptance-criteria checklist, with provenance to PR #123. The original SPEC.md's §N numbering was lost with the unarchived llm-kb workspace; this reconstructs the surviving AC-level contract in-repo.

What it provides

scripts/kb_core.py — pure, vault-I/O-free primitives consumed by kb-capture, kb-compile, and kb-lint:

  • Capture predicate (is_eligible, CAPTURE_TAG) — the SPEC §2.1 eligibility gate (highlight/notes + work-relevance, with the kb tag override).
  • Idempotency (source_key) — stable, filesystem-safe key from the Reader id, so re-capture / re-compile are no-ops (INV-4).
  • Content-aware re-sync (highlights_fingerprint, new_highlights) — lets kb-capture tell whether an already-captured source's highlights changed since its last sweep, and compute just the delta to fold in, instead of source_key existence alone silently skipping a source forever once it's captured once.
  • Write boundary (is_writable, OFF_LIMITS) — the INV-1 floor: never write under DevOps Documentation/ or Confluence/.
  • KB ownership (is_kb_owned, KB_PROJECT) — is a note KB-authored? Confines lint auto-fix to KB notes (AC-6.2); everything else is proposal-only.
  • Concept dedup (concept_slug) — stable slug so re-compile updates a concept note in place instead of duplicating it (AC-2.3).
  • Orphan detection (find_orphans) — notes with no inbound backlinks (AC-6.3 input).
  • type: constants (TYPE_RAW, TYPE_SUMMARY, TYPE_CONCEPT, TYPE_MOC) — the note kinds compile emits (kb-raw / reference / zettel / moc).

No zones, no fence: edit safety is git + review (SPEC v2 §1, INV-5).

Status

All primitives implemented and unit-tested (test_kb_core.py).

Tests

cd skills/kb-core/scripts && python3 -m unittest test_kb_core

Stdlib unittest (zero-dependency, matches task-workflow/scripts/test_render_deps.py).

See Also

  • skills/kb-core/references/spec-v2-contract.md — the authorship-boundary contract (Ownership design bullet) these primitives enforce.
  • skills/kb-capture, skills/kb-compile, skills/kb-lint — the three consumers.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.