/khive:expandfrom khive
Creates new entities and edges in a knowledge graph to fill gaps identified by the gap skill — promotes concepts to projects, bridges architectural orphans, resolves decision debt.
Ships in khive. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
gap finds what's missing. expand builds it.
This is the most aggressive skill in the plugin: it adds NEW entities and edges based on what the graph already knows it's missing. Use it when a gap-inventory item is concrete enough to act on — a researched-but-unbuilt concept with downstream waiters, a single-use paper that should connect to more, a domain rich with concepts but no implementing crate.
Self-expansion is high-leverage but easy to corrupt. The rule: never create an entity you cannot back with at least one citation — a paper, an ADR, an existing implementation, a quote from the source the gap came from. Speculative entities become noise that the next polish pass has to clean up.
The MCP server exposes one tool — request — that takes the verb call as a string:
request(ops="create(kind=\"entity\", entity_kind=\"concept\", name=\"…\")")
request(ops="[create(kind=\"entity\", entity_kind=\"project\", name=\"lora-tools\"), link(source_id=\"<project-id>\", target_id=\"<concept-id>\", relation=\"implements\"), link(source_id=\"<project-id>\", target_id=\"<dependency-id>\", relation=\"depends_on\")]") # parallel batch
The verb examples below show the inner call. Wrap each one as request(ops="…").
Namespace rule (ADR-007): KG operations always use the shared namespace (local), even when the
MCP server runs with --actor lambda:myproject. Do NOT override the namespace for entity/edge/note
operations. The knowledge graph is cross-project by design.
A single gap to expand. Either:
gap (roadmap, feature direction, research direction)properties.domain value flagged as an architectural gapcompetes_with clique flagged as decision debtIf the input isn't a structured gap from gap_inventory.md, run gap first. Working from a fresh
inventory keeps expansion grounded.
Pick the mode that matches the gap's category. One expansion = one mode. Do not chain modes inside a single skill invocation.
Gap type from gap | Mode to run |
|---|---|
| Roadmap (researched-unbuilt) | Promote |
| Architectural (domain orphan) | Bridge |
| Feature direction (enables→void) | Extend |
| Feature direction (decision debt) | Resolve |
| Research direction (single-use paper) | Extend |
| Research direction (narrow framing) | Extend |
Trigger: a concept C with status ∈ {"researched", "concept"}, ≥2 incoming depends_on, zero
implements.
Workflow:
C's description, properties, and full neighborhood:neighbors(node_id="<C-id>", direction="both")
search(kind="entity", query="<C.domain> <C.name>")
list(kind="entity", entity_kind="project", limit=50)
Determine the smallest viable project that could implements C. Anchor it to existing
infrastructure crates via depends_on. If no obvious crate name exists, propose one based on the
dominant ADR or repo in C's properties.
Create the project entity (status: "proposed"):
create(kind="entity", entity_kind="project", name="<crate-name>",
description="Proposed: implements <C.name>. Triggered by gap-inventory <date>.",
properties={"status": "proposed", "domain": "<C.domain>", "repo": "<C.repo or repo:TBD>"})
link(source_id="<new-project-id>", target_id="<C-id>", relation="implements", weight=0.8)
# For each existing depends_on of C, add depends_on from new project to that prerequisite's project
decision note recording why this project was promoted:create(kind="note", note_kind="decision",
content="Promoted <C.name> from researched → proposed implementation. <N> concepts depend_on it. Source: gap-inventory <date>.",
annotates=["<new-project-id>", "<C-id>"])
Trigger: a properties.domain value with ≥5 concept entities and zero project entities whose
implements edges land in that domain.
Workflow:
list(kind="entity", entity_kind="concept", limit=100)
# filter by properties.domain == "<target-domain>"
Pick the concept with the highest incoming_depends_on count as the architectural anchor. Apply
Promote to that anchor (above).
After Promote completes, walk the rest of the domain's concepts and add implements edges from
the new project to each whose description is architecturally compatible (read each description to
verify; do NOT bulk-link).
Trigger: a paper cited by exactly one concept, or a concept in a multi-option domain with zero
competes_with edges.
Workflow:
neighbors(node_id="<source-id>", direction="both")
Read the source's description. Identify named alternatives, variants, or parent techniques mentioned in the text.
For each identified neighbor that does not exist yet in the graph (verify with search),
create it as a concept:
search(kind="entity", query="<candidate-name>")
# If no match found:
create(kind="entity", entity_kind="concept", name="<short-canonical-name>",
description="<one-sentence definition from the source>",
properties={"domain": "<source.domain>", "status": "concept", "type": "technique"})
Link the new concept to the source with the appropriate relation: competes_with for
alternatives, extends/variant_of for derivatives, instance_of for specializations.
Hard ceiling: max 5 new entities per Extend invocation. Self-expansion that creates more than 5 entities is no longer grounded — it's hallucination. If you need more, run Extend again with a different source.
Trigger: a clique of ≥2 concepts under competes_with with zero implements edges across all
members.
Workflow:
request(ops="[get(id=\"<m1-id>\"), get(id=\"<m2-id>\")]")
Identify the comparison axes that matter (drawn from descriptions, properties, the domain's conventions). Typical axes: performance, memory, complexity, compatibility with existing infra.
Resolve does not pick winners autonomously. It writes a decision note that:
create(kind="note", note_kind="decision",
content="Comparison of <clique-members>. Axes: <axes>. Recommended: <member>. Assumptions: <list>.",
annotates=["<member-1-uuid>", "<member-2-uuid>"])
implements edge from the relevant project to the chosen member.After expansion, for every new entity created:
neighbors(node_id="<new-id>", direction="both")
Each new entity must meet the kind's minimum density (concept ≥ 4, project ≥ 3, document ≥ 2). If a
new entity is below threshold and you've exhausted the visible context, file a question note
recording what edge is missing:
create(kind="note", note_kind="question",
content="<new-entity> needs <relation> to <unknown-target>. Source for follow-up: <…>",
annotates=["<new-entity-id>"])
A question note is honest debt — it tells the next agent what's missing without fabricating an edge.
State for the record:
The input gap is closed (the entity exists with min density and a relation back to the source) OR a
question note explicitly records why the gap cannot be closed without external input. Either is an
acceptable terminal state. Leaving the gap silently unaddressed is not.
Run after each gap survey. Process gaps in frontier-rank order — highest- leverage first. Re-run
gap between expansions to track which gaps the expansion actually closed and which new gaps it
opened (every expansion opens at least one new edge of unexplored knowledge).
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
knowledge-graph, graph-expansion, gap-filling, entity-creation
npx claudepluginhub ohdearquant/khive --plugin khive11 skills in this plugin
/brainTune adaptive recall with brain profilesTune adaptive recall with brain profiles — inspect profiles and posteriors, manage lifecycle (activate/deactivate/archive/reset), emit feedback (brain.feedback / brain.auto_feedback) to shift recall weights, and wire actors to profiles via bind/unbind/resolve/bindings. Use whenever recall behavior feels off, a new tuning profile is needed, or you need to confirm which profile serves a given caller./commCoordinate over commCoordinate with other agents and lambdas over khive comm — be attributable (set KHIVE_ACTOR), address by actor (to="lambda:X") with a subject, triage your inbox by sender + subject, reply to thread, and inspect channel polling freshness. Use whenever you send a message, check your inbox, follow up in a conversation, read a thread, or diagnose channel delivery./digestOther plugins' skills for the same job