From knowledge-distillery
Queries team-verified knowledge from the Knowledge Vault. A UserPromptSubmit hook reminds you when active vault entries exist — use this skill to query and interpret them before planning code changes.
How this skill is triggered — by the user, by Claude, or both
Slash command
/knowledge-distillery:knowledge-gateThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Query the Knowledge Vault (`.knowledge/vault.db`) before planning code changes. The vault contains team-verified Facts and Anti-Patterns that constrain how code should be written.
Query the Knowledge Vault (.knowledge/vault.db) before planning code changes. The vault contains team-verified Facts and Anti-Patterns that constrain how code should be written.
A UserPromptSubmit hook fires on each user prompt. When the vault has active entries, it reminds you to query before planning. Follow the reminder when the task involves code modifications; ignore it for non-code tasks.
You MUST NOT directly read files in the .knowledge/ directory. All vault access goes through the knowledge-gate CLI.
Resolve the CLI path once at session start. If plugins/knowledge-distillery/scripts/knowledge-gate exists in the current repo root, use the local development path. Otherwise use the installed plugin path:
plugins/knowledge-distillery/scripts/knowledge-gate${CLAUDE_PLUGIN_ROOT}/scripts/knowledge-gateAll commands below use <knowledge-gate> as a placeholder for the resolved executable path. Substitute the concrete path directly in the command; do NOT create or execute a shell variable such as $GATE.
<knowledge-gate> <command> [args]
If the CLI or vault is not available, inform the user: "Knowledge vault not configured. Proceeding without vault guidance." Then continue normally -- do not block work.
# Returns a lightweight summary index by default
<knowledge-gate> query-paths "<filepath>"
Resolve domains first to avoid duplicate queries:
# 1. Resolve each file to its domain(s) -- a few representative files suffice
<knowledge-gate> domain-resolve-path "<filepath>"
# 2. Deduplicate the resolved domains, then query each one (summary index by default)
<knowledge-gate> query-domain "<domain>"
# Returns a lightweight summary index by default
<knowledge-gate> search "<keyword>"
When a query returns entry IDs and you need the complete body:
<knowledge-gate> get "<id>"
<knowledge-gate> get-many "<id-1>" "<id-2>" ...
When the relevant domain or keyword is unknown:
# Load a lightweight navigation-only domain index
<knowledge-gate> domain-list --ids-only
# Browse all active entries as a summary index
<knowledge-gate> list
# Browse full domain metadata only when needed
<knowledge-gate> domain-list
Then use query-paths, query-domain, or search for precise queries.
<knowledge-gate> domain-resolve-path "<filepath>"
<knowledge-gate> domain-info "<domain>"
When the hook reminder fires and the task involves code changes, query relevant paths or domains before you start planning. Prefer one broad summary-index query for the task, then fetch full bodies only for the specific entry IDs you need with get or get-many. You do not need to re-query before each individual file edit.
Vault entries are team-verified constraints. Treat them as authoritative rules:
alternative field to find the correct approach.If your planned changes contradict a vault entry, surface the conflict to the user before proceeding. Never silently override a vault constraint.
No vault entries for a path or domain is a normal state -- the vault does not cover every code path.
When making structural changes and the vault returns no results, ask the user before proceeding. Present the question in this format:
question_type: scope_gap | conflict | risk_check
blocking_scope: "<affected files/modules>"
needed_decision: "<what human choice is required>"
fallback: "<safe default behavior until answered>"
evidence_link:
- "<related PR/issue references, if any>"
Question types:
scope_gap -- Structural change in an area with no vault coverageconflict -- Planned change contradicts an existing vault entryrisk_check -- Change touches a domain with existing constraints and needs human confirmationAfter using a vault entry's guidance in your work, append a usage record to tmp/vault-refs.jsonl (project root). Only record entries that influenced your decisions — not every queried result. See Vault Usage Tracking below.
When vault queries return entries, present them as follows:
claim prominently -- it is the actionable rule.considerations alongside -- caveats matter.alternative -- it tells the user what to do instead.evidence links only if the user asks "why?"body by default. Show it only if the user asks for details.User asks: "Refactor the batch-refine pipeline to support parallel PR processing."
<knowledge-gate> domain-resolve-path "plugins/knowledge-distillery/skills/batch-refine/SKILL.md"
# → domain: distillation-pipeline
<knowledge-gate> query-domain "distillation-pipeline"
<knowledge-gate> get-many "pipeline-stage-order" "parallelism-boundary"
[FACT] Pipeline stages must execute sequentially per PR
claim: "Stage B steps (collect → extract → quality-gate) MUST run in sequence for each PR."
considerations: "Cross-PR parallelism is allowed; intra-PR parallelism is not."
| Failure | Response |
|---|---|
knowledge-gate CLI not found | Inform user: "Knowledge vault not configured. Proceeding without vault guidance." Continue normally. |
vault.db not found | Same as CLI not found -- degrade gracefully. |
| Query returns no results | Normal. Apply the Soft Miss Principle (see Behavioral Rules section 4). |
| Query returns an error | Log a warning, proceed without vault constraints. Do NOT block work. |
After querying the vault and using the results to guide your work, record the usage in tmp/vault-refs.jsonl (project root, gitignored):
mkdir -p tmp && echo '{"entry_id":"<entry-id>","queried_at":"<ISO-8601>","command":"<command-used>"}' >> tmp/vault-refs.jsonl
Rules:
tmp/ directory if it doesn't existmemento-commit and cleared after each commitnpx claudepluginhub ether-moon/knowledge-distillery --plugin knowledge-distilleryProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.