Skip to content

find_skills/search_skills returns each matched skill's full instruction subtree, not just its description #1356

Closed

Description

@malibio

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}. The description comes from properties (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 Guidance root child with detailed prompt children).

Proposed Solution

  • find_skills fetches 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 description as the embedded/matching field (separate concern); add an instructions (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_skills returns an instructions field containing each matched skill's child subtree rendered to markdown.
  • description remains 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, the skills.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

Non-Goals

  • The routing/clarification pipeline (separate issue).
  • Skill-to-skill references.

Activity

  1. malibio commented on Jun 6, 2026

    @malibio
    CollaboratorAuthor

    Frontend: 134 passed

  2. self-assigned this
    on Jun 6, 2026
  3. added a commit that references this issue on Jun 6, 2026
    fd7c0a6
  4. added a commit that references this issue on Jun 22, 2026
    ade865e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions