Repository navigation
Description
Overview
The skill node type's guidance body currently routes through a vestigial prompt-typed child node, a leftover from an earlier design that was never fully implemented. This issue implements the corrected node shape: skill guidance children become ordinary markdown nodes (the same shape every other document uses), the now-purposeless prompt node type is retired, and duplicate subtree-rendering logic is consolidated. A small, separable nav change (exposing skill in the left nav's Schemas section) is included since it depends on nothing else here.
Architecture Impact
This issue implements ADR-057 (nodespace-docs/decisions/057-skill-node-markdown-children.md), which formally supersedes ADR-030 (nodespace-docs/decisions/030-prompt-skill-node-architecture.md, now marked Status: Superseded). This is not a reversal of shipped behavior — ADR-030 was still Status: Proposed and was never fully implemented as originally specified (its skill→prompt-children shape and its prompt-as-agent-config-override role were never both built). ADR-057 closes out ADR-030's one remaining undecided half: the skill node's guidance-body shape and the prompt type's fate.
ADR-038 (nodespace-docs/decisions/038-skill-mediated-tool-routing.md, Status: Accepted) already superseded ADR-030's discovery mechanism (replaced the push-based pre-turn pipeline with the model-driven search_skills tool + LLM-judged routing) before this issue existed. This issue does not touch discovery — search_skills, find_skills, and the routing/gating logic in ADR-038 are unchanged and out of scope.
No companion nodespace-docs change is required as part of this implementation — ADR-057 and the ADR-030 status update are already written and pushed to nodespace-docs main as of this issue's creation.
Background
skillschema:packages/core/src/models/core_schemas.rs:880-941. Fieldsdescription(required, drives semantic-search discovery viafind_skills),tool_whitelist(array),max_iterations(int). This schema is correct as-is and does not change.promptschema:packages/core/src/models/core_schemas.rs:866-879. Zero fields — schema-only, no behavior. Its only live use today is typing skill-guidance children (see below); ADR-030's other intended use (agent-config -[includes]-> prompt-node) was never implemented — noagent-configschema exists anywhere incore_schemas.rs, and no code creates or reads anincludesedge.seed_skill_nodes()(packages/agent/src/skill_pipeline.rs:227): builds each of the 8 seeded skills from a flatmarkdown_content: Stringfield on theNodeTemplate, expanded viaprepare_nodes_from_template(packages/core/src/markdown/mod.rs:1335) withchild_node_type: Some("prompt".to_string())— every seeded skill's guidance children are literally typedprompt, purely a vestige of ADR-030's original two-role design. Nothing about these children uses prompt-specific fields (there are none) or prompt-specific behavior.PromptAssembler::assemble_with_skill()(packages/agent/src/prompt_assembler.rs:259-284): injects onlyskill.content(name) +descriptionproperty into the system prompt as a short header. Confirmed dead code — zero callers anywhere in the repo (verified via full-repo grep; the only match is its own definition). This is a leftover from the push-based discovery design ADR-038 already replaced.- Skill guidance actually reaches the model via a separate, already-working path:
search_skillstool (packages/agent/src/local_agent/tools.rs:573) →skill_ops::find_skills(packages/core/src/ops/skill_ops.rs:117) →render_skill_instructions/render_subtree_dfs(packages/core/src/ops/skill_ops.rs:54-101), which already walks the matched skill's full child subtree depth-first and returns it as aninstructionsfield (skill_ops.rs:243,252) alongsidename/description/tools/schema_metadata. This works correctly today, independent ofchild_node_type. PromptAssembler::fetch_prompt_body()(packages/agent/src/prompt_assembler.rs:182-230) performs the same operation asrender_skill_instructionsabove — subtree walk viaget_subtree_data, depth-first, concatenate.content— but is a separate, independently-written implementation used for standaloneprompt-root override nodes in the base-prompt-assembly path (PromptAssembler::assemble()). Its doc comment records a real bug this full-subtree-walk shape already fixed once (a direct-children-only flatten previously dropped bullets nested under a header line).
Scope of this issue
1. Skill guidance children become real markdown types
Change seed_skill_nodes() in packages/agent/src/skill_pipeline.rs so each of the 8 NodeTemplates uses child_node_type: None (or an explicit content type if markdown type-inference proves insufficient) instead of Some("prompt".to_string()), so guidance children come out as ordinary text/header nodes. markdown_content (the actual guidance prose) does not need to change. Verify prepare_nodes_from_markdown's type inference produces sensible header/text children for each of the 8 seeds' markdown structure.
2. Consolidate duplicate subtree-render logic
render_skill_instructions/render_subtree_dfs (packages/core/src/ops/skill_ops.rs:54-101) and PromptAssembler::fetch_prompt_body (packages/agent/src/prompt_assembler.rs:182-230) do the same thing independently. Extract one shared subtree-flattening utility in packages/core (e.g. near get_subtree_data, or a new small module) and have both find_skills and PromptAssembler::assemble() call it.
3. Retire the prompt node type
Delete the prompt core schema entirely (packages/core/src/models/core_schemas.rs:866-879) — it has zero remaining consumers once (1) lands. Do NOT delete PromptAssembler's graph-override mechanism itself (the hardcoded-base + graph-override assembly path in assemble()) — that mechanism is legitimate and currently working; it simply no longer has a dedicated node type backing it. If a future need for a queryable prompt-override node type resurfaces, it should be designed together with a real agent-config schema at that time, not kept as speculative unused schema now.
4. Delete dead code
Remove PromptAssembler::assemble_with_skill() (packages/agent/src/prompt_assembler.rs:259-284) — zero callers, confirmed via repo-wide grep. Skill guidance flows exclusively through search_skills → find_skills → the shared subtree utility from (2).
5. Update/verify tests
packages/agent/src/skill_pipeline.rs test module (seed_skills_have_valid_properties, seed_skill_template_produces_skill_node, all_skill_whitelist_tools_are_registered, and others in that module) assert on root_properties and root-node shape, not child node_type — expected to pass unchanged, but verify. Grep the codebase for any test asserting child_node_type == "prompt" or similar and update to the new content type. Grep for any other reference to the prompt schema/node type before deleting it (UI, MCP handlers, other seed paths) to confirm full removal is safe.
6. Nav exposure (small, separable)
Add 'skill' to SIDENAV_CORE_TYPES in packages/desktop-app/src/lib/stores/schemas.svelte.ts:24 (currently new Set(['task'])) so skill nodes appear as a browsable entry in the left nav's "Schemas" section. skill is already a registered core schema and the generic QueryNodeViewer/table-view browse mechanism already works for any schema id — this should require no new UI code, just the allowlist entry. Do NOT add prompt to this allowlist — prompt fragments out of context of their parent skill aren't useful to browse flatly, and the prompt type is being retired per item 3 anyway.
Explicitly out of scope
- Skill discovery mechanism (
search_skillstool, LLM-judged routing, retrieval gating) — settled by ADR-038, unchanged by this issue. skillschema fields (description/tool_whitelist/max_iterations) — unchanged, already correct.- Any change to the 8 seeded skills' actual guidance text/content.
Acceptance Criteria
-
seed_skill_nodes()templates no longer route children throughchild_node_type: Some("prompt"); children are real markdown types - Shared subtree-flattening utility extracted and used by both
find_skills(skill_ops.rs) andPromptAssembler::assemble()(prompt_assembler.rs) -
promptcore schema deleted fromcore_schemas.rs -
PromptAssembler::assemble_with_skill()deleted - All existing skill_pipeline.rs tests pass (or are updated if they assert on removed shape)
-
bun run test:allshows no new failures vs baseline -
'skill'added toSIDENAV_CORE_TYPES; skill nodes browsable in left nav Schemas section -
promptNOT added to nav (confirm it's fully retired, not just hidden)
Technical Specifications
Reference Files
packages/agent/src/skill_pipeline.rs:227—seed_skill_nodes(), the 8NodeTemplates to retypepackages/core/src/markdown/mod.rs:1335—prepare_nodes_from_template, the expansion mechanismpackages/core/src/ops/skill_ops.rs:54-101—render_skill_instructions/render_subtree_dfs, one half of the duplication to consolidatepackages/agent/src/prompt_assembler.rs:182-230—fetch_prompt_body, the other halfpackages/agent/src/prompt_assembler.rs:259-284—assemble_with_skill, dead code to deletepackages/core/src/models/core_schemas.rs:866-879—promptschema to deletepackages/core/src/models/core_schemas.rs:880-941—skillschema, unchanged, for referencepackages/desktop-app/src/lib/stores/schemas.svelte.ts:24—SIDENAV_CORE_TYPESallowlist
Required Reading Before Implementation
nodespace-docs/decisions/057-skill-node-markdown-children.md(authoritative spec for this issue)nodespace-docs/decisions/030-prompt-skill-node-architecture.md(Status: Superseded — historical context only)nodespace-docs/decisions/038-skill-mediated-tool-routing.md(current discovery mechanism — do not touch, but understand it so as not to accidentally reintroduce push-based discovery)
Activity
mstomar125 commentedon Jul 27, 2026
While implementing, I found the
promptnode type still has a live production consumer, so retiring it as specified would ship a regression:packages/daemon/src/services/assembly.rs:229callsPromptAssembler::seed_prompt_nodes()(alongside skills/tools) and persists them.PromptAssembler::fetch_prompt_overrides()(prompt_assembler.rs:120) queriesnode_type == "prompt"and injects those override bodies into the system prompt — and it runs every agent turn viaassemble()(local_agent/agent_loop.rs:298, a live path, unlike the deadassemble_with_skill).So the graph-override mechanism the issue says to keep is backed by the
prompttype. If the schema +PromptNodeBehaviorare deleted (item 3), those seeded override nodes fall back toCustomNodeBehavior, whose defaultget_embeddable_contentreturnsSome(content), andpromptis dropped fromNON_EMBEDDABLE_CONTAINER_TYPES— so the internal system-prompt override nodes become embeddable/indexed → user semantic-search pollution. Item 2 (retyping skill guidance children fromprompt→markdown) has the same implication: guidance children go from non-embeddable to embeddable.Retiring the prompt type needs a design decision this issue doesn't cover: how does
PromptAssembleridentify its override nodes without theprompttype (a different type? a property marker? a dedicated collection?), and should skill-guidance children be embeddable? That's theagent-configschema the issue itself gestures at ("if a future need for a queryable prompt-override node type resurfaces, it should be designed together with a realagent-configschema") — which turns out to be needed now, not later.What I'm shipping (a clean, non-conflicting subset)
Items 1, 4, 6 are independent of the prompt-type question and have no embedding implications, so they go in now:
render_subtree_dfsinskill_ops.rs+ the manual walk inPromptAssembler::fetch_prompt_body) is consolidated into one sharedflatten_subtree_contentutil inpackages/core.PromptAssembler::assemble_with_skill()deleted (zero callers).'skill'added toSIDENAV_CORE_TYPES(browsable in the left nav).Items 2 & 3 remain open here pending the re-spec above (migrate the PromptAssembler override mechanism off the
prompttype + decide guidance-children embeddability). Keeping this issue open for that; happy to implement once the override-node replacement is decided.Consolidate subtree-render, drop dead assemble_with_skill, expose ski…
malibio commentedon Jul 30, 2026
Scope addition: rewrite skill descriptions for semantic retrieval
Folding in a finding from the prompting spike (#1802), because it edits the same function this issue rewrites —
seed_skill_nodes()inpackages/agent/src/skill_pipeline.rs. Two issues touching that function would conflict.The finding
Skill
descriptionproperties are the index keys for semantic retrieval — they are embedded and matched against an embedding of the user's message. They are currently written as keyword/trigger-phrase lists ("Use when user says 'new type', 'node type', 'create schema'"), which are artifacts of ADR-030's pattern-match routing that ADR-038 replaced. Users never say those words, so the descriptions index against nothing real.Measured, 20 indirect intents against the 8 seeded skills with the production embedding model:
One specific pathology:
bulk_importwon 6 of 13 mis-routes, including "mark the Camden invoice as paid". Its generic verbs (create/add/import) make it a semantic attractor that swallows unrelated intents. Rewriting must narrow attractor skills specifically, not just polish prose across the board.This is now doctrine — see ADR-064 rule 3 (skill descriptions own retrieval matching, a distinct writing target from tool descriptions, which own tool selection).
Correction to this issue's Background section
This issue currently states that skill guidance reaching the model via
search_skills→render_skill_instructions"works correctly today". That claim is now under question. Delivering instructions as a tool result is exactly the mechanism suspected of suppressing tool-calling — see #1814, and ADR-038's full-subtree provision is marked Provisional pending that result. The path works in the sense that the text arrives; whether arriving that way is correct is unresolved.No change to this issue's scope follows from that — it does not touch discovery — but the Background should not assert correctness that measurement is currently disputing.
Added acceptance criteria
bulk_import, and any other built from generic verbs) narrowed so they stop capturing unrelated intentsSequencing
Blocked on #1812 for delivery:
seed_nodes_from_templatesskips by node type, so a rewritten description reaches no existing install. Without #1812 the acceptance measurement would only be verifiable on a purged database, which is not the shipping configuration.malibio commentedon Jul 30, 2026
Status check on items 2 & 3
Re-verified current
main(as of dde8b9d) against this issue's remaining scope.Confirmed already shipped (previous comment's "clean subset"):
PromptAssembler::assemble_with_skill()is gone; zero matches forassemble_with_skillanywhere inpackages/agent/src/.SIDENAV_CORE_TYPESinschemas.svelte.ts:24is nownew Set(['task', 'project', 'skill']).promptcorrectly absent.skill_pipeline.rsstill setschild_node_type: Some("prompt".to_string())for all 8 seeded skills.Items 2 & 3 remain blocked, same reason as before. ADR-057 (Accepted, in nodespace-docs) reaffirms the what (skill children become markdown,
promptschema gets deleted) but doesn't resolve the how the previous comment flagged:PromptAssembler::fetch_prompt_overrides()(prompt_assembler.rs:120) still queriesnode_type == "prompt"and still runs every agent turn viaassemble()(prompt_assembler.rs:84, called from the livelocal_agent/agent_loop.rspath).PromptAssembler::seed_prompt_nodes()(prompt_assembler.rs:260) is still called frompackages/daemon/src/services/assembly.rs:229at daemon startup, persistingprompt-typed override nodes.promptis still inNON_EMBEDDABLE_CONTAINER_TYPES(packages/core/src/behaviors/mod.rs:167), which is the only thing currently keeping these override nodes (and, if item 1 ships as originally spec'd, skill-guidance children) out of semantic search.Deleting the
promptschema today, as item 3 asks, would fall back these nodes toCustomNodeBehavior's default embeddable behavior — the exact regression the prior comment described. ADR-057 explicitly punts this ("if a future need... resurfaces, it should be designed against its actual use case... rather than kept as unused schema surface now") without naming whatPromptAssemblershould key off of instead, or resolving whether skill-guidance children should be embeddable post-retype.Item 1 is separable and unblocked — it only touches
seed_skill_nodes()'schild_node_type, doesn't touch thepromptschema, and doesn't change embeddability of anything that isn't already going to be markdown-typed. It could ship now if desired, ahead of the item 2/3 design work, sincerender_skill_instructionsalready walks children generically by edge, not by type.Holding items 2 & 3 open pending a design decision on the replacement identifier for
PromptAssembler's override nodes (a dedicated marker/property vs. a minimal realagent-configschema) and the embeddability question for both override nodes and (if item 1 ships as spec'd) skill-guidance children. Let me know how you'd like to sequence this — happy to ship item 1 alone now, or hold everything for a combined design pass.malibio commentedon Jul 30, 2026
Ship item 1 now — agreed it's separable and safe on the argument you gave (children walked by edge, not type; nothing about the retype touches
promptorNON_EMBEDDABLE_CONTAINER_TYPES).On items 2/3's blocker
The real issue isn't "how do we key
PromptAssembler's override nodes" in isolation — it's that non-embeddability is currently an implicit side effect of type membership rather than an explicit property.prompthappens to sit inNON_EMBEDDABLE_CONTAINER_TYPES, so anything typedpromptgets the exemption for free, and anything that stops being typedpromptsilently loses it. That's the same shape as thecoreValues/core_valuesandTOOL_STRATEGY_RULESfindings from the prompting spike (#1802) — a property riding on the wrong channel, discovered only when something downstream changes and the implicit link breaks.So I'd rather not solve this by finding a new type tag to carry the same implicit behavior (a minimal
agent-configschema would just relocate the trap). Make non-embeddability an explicit property on the node, not a type-membership lookup:is_embeddable: bool(defaulttrue) to the node model, or aNodeBehavior::default_embeddable()override per behavior, however fits the existing behavior trait shape bestPromptAssembler::fetch_prompt_overrides()keys off a stable identifier that isn'tnode_type == "prompt"— a dedicated marker property (e.g.is_prompt_override: true) or a fixed collection/root marker, whichever is less invasive given howseed_prompt_nodes()currently creates theseNON_EMBEDDABLE_CONTAINER_TYPESeither goes away in favor of the per-node property, or stays as a type-level default that the per-node property can override — but not as the sole mechanismThis also directly answers the "skill-guidance children post-retype" half of the question: once they're real markdown types, their embeddability is whatever markdown nodes default to, checked against whether that's actually what you want (probably yes — skill instructions arguably should be discoverable by the same retrieval that struggles with skill descriptions per #1802/#1699's other half, but that's worth a deliberate yes rather than an inherited default).
Sequencing
PromptAssemblerat the new marker instead ofnode_type == "prompt"promptschema (item 3) — now safe, nothing depends on the type tag anymoreSteps 2-3 are a small standalone change if you want to split them out rather than doing the whole design pass at once — happy to file that as its own issue if it's cleaner to track separately from this one's remaining scope.
malibio commentedon Jul 30, 2026
Correction to my last comment — no new property needed
Checked before assuming:
NodeBehavioralready has the right hook —get_embeddable_content(&self, node: &Node) -> Option<String>(behaviors/mod.rs:296, default: embed if content non-empty, per-behavior override).SkillBehavioralready overrides it correctly.The actual bug is that two independent mechanisms gate embeddability, and only one of them goes through the trait:
get_embeddable_content— per-behavior, extensible, principledNON_EMBEDDABLE_CONTAINER_TYPES(behaviors/mod.rs:167) — a flat&[&str]checked directly againstnode_typeindb/sqlite_store/embeddings.rsandservices/node_service/mod.rs, bypassing the trait entirelypromptsits in the second list, not expressed through the first. That's the actual trap, and it's narrower than what I proposed before: not "add a persisted property," but delete the parallel gate and route everything through the trait method that already exists.Revised plan:
prompt-typed nodes overridesget_embeddable_contentto returnNone— same pattern asSkillBehaviorNON_EMBEDDABLE_CONTAINER_TYPES; its two call sites go through the behavior registry'sget_embeddable_contentinstead of anode_typestring checkpromptschema (item 3) doesn't touch embeddability at all — it was only ever gated there through the second, bypassable mechanismThat leaves exactly one open question, smaller than before:
PromptAssembler::fetch_prompt_overrides()'snode_type == "prompt"lookup is a genuine identity question (which nodes are prompt-override nodes), not an embeddability one, and does need a replacement marker once the schema is gone. But it's now a single, well-scoped problem rather than two entangled ones.Sequencing unchanged: ship item 1 now; do the
NON_EMBEDDABLE_CONTAINER_TYPESconsolidation as its own small change (steps 1-2 above); then item 3 is safe; then decide thePromptAssemblermarker and skill-guidance-children embeddability deliberately.malibio commentedon Jul 30, 2026
Frontend baseline: 171 test files passed, 4112 tests passed.
Rename seed_prompt_nodes to seed_agent_guidance_nodes; fix eval's sta…
Make the agent eval diagnostic before recording a baseline; revisit A…