Repository navigation
Description
Overview
When the agent discovers a skill via search_skills/find_skills, it currently receives only the skill's description property — never the skill's instruction subtree (the child nodes that hold the actual procedure: steps, branching, worked examples). The instructions exist in the graph but are never delivered to the model, so skills are effectively inert.
This is the single confirmed defect behind the half-built skill system: the model can match a skill but cannot follow it, because the procedure never reaches it. Delivering the instruction subtree is small, well-bounded, independently testable, and useful even under today's flow. It is a prerequisite for the routing redesign (ADR-036) but does not depend on it.
Evidence
Rendering the real Schema Creation skill's instruction subtree (its 14 child nodes) into the prompt let both Gemma 4 12B and Ministral 8B produce flawless deeply-nested create_schema calls — correct enum coreValues, title_template matching the skill's worked example, valid types. Without the subtree, the model gets an (often empty) one-line description and improvises.
Problem Statement
find_skills(packages/core/src/ops/skill_ops.rs:71) returns{id, name, description, confidence, tools, schema_metadata}. Thedescriptioncomes fromproperties(line ~96-100); the child instruction subtree is never fetched (line ~178-185).- Skills hold their procedure as a child node subtree (e.g. Schema Creation has a
# Schema Creation Guidanceroot child with detailedpromptchildren).
Proposed Solution
find_skillsfetches each matched skill's instruction subtree and returns it rendered to markdown, reusing the existing root+children rendering (get_subtree_data/ the PromptAssembler child-concatenation pattern).- Keep
descriptionas the embedded/matching field (separate concern); add aninstructions(rendered markdown) field to each returned skill. - The agent injects the matched skill's instructions into the prompt when the skill is active.
Acceptance Criteria
-
find_skills/search_skillsreturns aninstructionsfield containing each matched skill's child subtree rendered to markdown. -
descriptionremains the field used for embedding/matching (unchanged). - A real turn (captured via
NODESPACE_PROMPT_DUMP) shows the matched skill's instructions reaching the model. - Empty/childless skills return empty instructions without error.
- Code passes
bun run quality:fix; tests pass.
Technical Specifications
Reference Files
packages/core/src/ops/skill_ops.rs—find_skills, theskills.push(json!{...})return (line ~178).packages/core/src/services/node_service/mod.rs—get_subtree_data.packages/agent/src/prompt_assembler.rs— root+children→markdown rendering pattern to reuse.packages/agent/src/local_agent/tools.rs—exec_search_skills(passes result to the model).
Related Issues
- ADR-036 (skill-mediated routing — this is the data-layer prerequisite, split out to land independently)
- Skill-mediated tool routing: LLM-judged two-stage retrieval pipeline with clarification fallback #1352 (routing pipeline — consumes this)
Non-Goals
- The routing/clarification pipeline (separate issue).
- Skill-to-skill references.
Activity
malibio commentedon Jun 6, 2026
Frontend: 134 passed
find_skills/search_skills returns each matched skill's full instructi…
find_skills/search_skills returns each matched skill's full instructi…