Repository navigation
Description
Overview
An external agent (Claude Code, Codex, Antigravity) should be able to pull NodeSpace's skills on demand, the way it loads skills in its own harness. That covers the core skills (for example "Schema Creation", "Relationship Management"), user-authored skills and Playbook skills. Mechanically this is a CLI fetch, not the harness's skill loader, but the agent should treat what it fetches as instructions for the operation at hand.
SKILL.md then stops carrying NodeSpace's procedures itself. It teaches the agent how to find and fetch them.
A fetch should return the schemas relevant to the same intent alongside the skills, so the agent gets both the procedure and the shape of the types it is working with.
Today this cannot work, for three reasons:
- Fetching returns nothing.
nodespace skill guidance "<task>"never matches a non-empty query. - Core skill content is written for the wrong agent. The stored bodies use the in-app agent's tool names, which an external agent does not have.
- Schemas are never embedded, so no schema can be found by meaning, in-app or out.
Problem Statement
1. skill guidance never matches
Reproduced on a fresh database with the embedding model loaded and all 15 skill nodes embedded (stale = 0, error_count = 0, every embedding.id present in vec_embeddings, unit-norm vectors):
nodespace skill guidance "delete a node" → no match
nodespace skill guidance "start the sprint" → no match (verbatim from the "Sprints and Cycles" description)
nodespace skill guidance "" → returns guidance
nodespace search "delete a node" --type skill --threshold 0.01 --json → {"count": 0, "nodes": []}
nodespace search "" --type skill --json → count 15
Root cause.
skill guidancereuses the genericSearchNodesRPC withnode_types: ["skill"](build_guidance_request,packages/cli/src/commands/skill.rs). The daemon handler (search_nodes,packages/daemon/src/services/node_service.rs) passesscope: None, which resolves to the defaultKnowledgescope.should_skip_scope_filter(packages/core/src/ops/search_ops.rs) bypasses that scope only for enumerate queries (is_enumerate && has_node_types && scope_is_default).skillis a system type, not inKNOWLEDGE_CORE_TYPES, somatches_scopedrops every result.- This has been true since the command was added.
Further problems on the same path:
build_guidance_requestsendsthreshold: 0.0meaning "no floor"; the handler treats0.0as unset andsearch_semanticapplies its default of0.7. The in-app router uses no floor (SKILL_SEARCH_THRESHOLD = 0.0,packages/core/src/ops/skill_ops.rs).- The generic path runs a global KNN, then filters by type, so in a large graph the few skill vectors can fall outside the top-k window.
skill_ops::find_skillsuses an exact scan over one type (semantic_search_nodes_of_type_with_vector) plus the exclusion re-rank.
2. Core skill bodies use in-app tool names
SkillSeed::templateresolves rule includes withRuleForm::Agent(packages/agent/src/skill_pipeline.rs). The stored body therefore saysCALL create_relationship NOW,get_related_nodes,search_semantic.- Fixing retrieval alone would hand an external agent commands it cannot run.
- The rule fragments in
packages/agent/src/skill_rules.rsalready carry both forms (RuleForm::AgentandRuleForm::SkillMd). The skill bodies around them are written for the in-app agent only.
3. Content drift found in the same skills
These bodies become what external agents read, so they are fixed here:
- A heading that repeats the skill. Every core skill body opens with
# <Name> Guidance(enforced by thestarts_with("# ")test inskill_pipeline.rs). It becomes the skill's only direct child and repeats the skill's name, which users read as a duplicate skill. The prompt already prints the name and purpose (render_candidates_for_prompt,routing.rs). The 5agent-guidancebodies have no heading, and Playbook skills use their plain title. - An orphan rule.
relationship-reverse-traversalis registered inskill_rules.rsbut no seed skill includes it, so the in-app agent never sees the canonical reverse-traversal rule.relationship-management.md's TRAVERSING line covers only part of it. No test checks that every rule's agent form reaches a skill. SKILL.mdcontradicts the CLI reference on relationships.SKILL.mdsays relationships must be defined on a schema before use, contradicting the four universal names (member_of,has_child,mentions,has_role) inreferences/cli.mdand the tool description. The direction rule ("reversing them records the opposite fact and still reports success") appears in neitherSKILL.mdnorcli.md.
4. Schemas are never embedded, so they cannot be found by meaning
Schemas are designed to be found semantically:
SchemaNodeBehavioraggregates a schema's description subtree for embedding (packages/core/src/behaviors/mod.rs);Schemais inKNOWLEDGE_CORE_TYPES;bm25_search_titlesleaves schemas out of keyword search on the grounds that "a schema is still found by meaning, through its embedding";skill_ops::find_skillsruns a semanticschemasearch next to the skill search.
Yet no schema is embedded. The fresh database above has 26 schema nodes (including the user-defined cycle and issue) and 0 schema rows in embedding.
Root cause.
create_schema(packages/core/src/schema/mod.rs) writes the schema throughcreate_node_with_parent_in_tx, which deliberately does not queue an embedding marker. Its doc comment (packages/core/src/services/node_service/crud.rs) says a caller needing one should queue after commit, and thathandle_create_schema"does not need to (schema nodes are not embedded root content)". That contradicts every consumer listed above.- Core schema seeding writes with
store.create_node(packages/core/src/services/node_service/mod.rs), which also queues nothing.
So the schema half of find_skills returns nothing in-app too, and so does any "is there a type for this?" query.
Decisions
-
External agents can fetch every NodeSpace skill: core, user-authored and Playbook, through
nodespace skill guidance, ranked the way the in-app agent ranks skills. -
A fetch returns the relevant skills and the relevant schemas together, as
find_skillsdoes in-app. The agent forms the query from the intent it has narrowed — the user's request or the task at hand — and gets back both how to do the operation (skills) and the shape of the types it touches (schemas: fields, relationships, descriptions). For a workspace domain such as Issues or Cycles, that means the domain's skill and its schemas arrive in one fetch. -
SKILL.mdteaches the fetch, not the procedures. It says when to fetch (before a nontrivial operation), how to fetch (by task, or list all), and that what comes back is the operation's instructions. Procedure moves out ofSKILL.mdinto the skill nodes. -
SKILL.mdsays outright that more instructions live in NodeSpace, beyond what it carries. Two kinds:- instructions for operating NodeSpace itself (creating schemas, managing relationships, importing, …);
- instructions specific to this workspace's own domains: the types and workflows installed in it, such as Issues and Cycles, or whatever schema structure the user has set up.
The agent should expect the workspace to have its own conventions, and fetch them before working in one of its domains rather than guessing from generic knowledge. The wording names domains, types and workflows, never "Playbook" (Keep Playbooks out of the agent's vocabulary: agents work Plays and schemas, and Playbooks install only from the app #3506): to the agent, an installed setup is just schemas, Plays and skills.
-
A skill node is the one source of a procedure for both audiences. What an external agent receives names CLI commands; what the in-app agent receives names its tools.
-
Always-on
agent-guidancestays as it is: in-app identity and policy only, never fetched as a skill.
Proposed Solution
Retrieval
- Serve
skill guidancefrom the typed skill search behindskill_ops::find_skills: exact scan overskillnodes, no score floor, exclusion re-rank, subtree markdown attached. This needs a daemon RPC, since none exists for skill search. - Return matching schemas alongside matching skills, from the same query embedding, as
find_skillsalready does in-app. Each schema result carries what an agent needs to work with the type: name, description, fields (with their descriptions and enum values) and declared relationships. In the external rendering it is a separate section from the skills. - Keep the empty query as "list every skill", with names and descriptions, so an agent can browse what exists.
Schema embeddings
- Queue a schema for embedding on every path that creates or changes one:
create_schema(after its transaction commits),update_schemawhen the description, fields or relationships change, core schema seeding, and schemas a Playbook install creates. - Correct the
create_node_with_parent_in_txdoc comment, which says schema nodes are not embedded. - What is embedded for a schema is its description subtree plus enough of its shape (name, field names and descriptions) to match an intent phrased in the user's words, for example "billing" finding "Invoice".
- Fix the related silent zero:
nodespace search "<query>" --type <system type>returns that type's matches. An explicitnode_typesfilter takes precedence over the defaultKnowledgeallowlist for real queries, as it already does for enumerate queries. An unfiltered search still excludes system types.
One body, two audiences
- Render a seeded skill for the caller. The in-app agent keeps
RuleForm::Agent; an external fetch gets the same skill with rule includes resolved asRuleForm::SkillMd, and the surrounding prose names CLI commands. - Rewrite the core skill bodies so the prose outside rule includes does not name in-app-only tools. Where a tool name is needed, put it in a rule fragment with both forms.
- User-authored and user-modified skills are served as stored.
Content
- Drop the
# <Name> Guidanceheading from the 11 core seed bodies. Change the test to forbid a leading H1. - Include
relationship-reverse-traversalinrelationship-management.mdin place of its TRAVERSING line. - Add a test that every interaction and schema rule's agent form is included by at least one seed skill, or is listed in
SCHEMA_RULES_NOT_IN_PROMPT. - Make the relationship direction rule a shared fragment, so both forms carry it.
- Rewrite
SKILL.mdaround fetching. Keep only what an agent needs before its first fetch: what NodeSpace is, the trust boundary inreferences/graph-authored-guidance.md, and when and how to fetch. Remove procedures that now live in skills, including the relationship text that contradictedcli.md.references/cli.mdstays as the command reference.
Architecture Impact
This changes ADR-064 §5 (../nodespace-docs/decisions/064-instruction-channel-doctrine.md, amendment of 2026-08-31). It currently makes SKILL.md the external mirror of the seeded skills: procedure in CLI verbs, derived from the seeded nodes and "must not trail them on substance". Under this change, SKILL.md is the entry point that teaches fetching, and the skill nodes serve both audiences directly.
Trade-off the amendment must address. ADR-064 §5 cites ADR-038 Finding 2: guidance returned as a tool result performed worse than the same text in prompt context (continuation dropped from 100% to 44%). Fetched skill content arrives as command output. The amendment should say how this is mitigated — for example, SKILL.md instructs the agent to treat fetched content as its operating instructions — and the external-agent eval should measure it.
Companion nodespace-docs changes, required in the same change:
- amend ADR-064 §5;
- update
architecture/prompt-skill-system.md: core skills serve both audiences, the H1 shape is gone, and the staleflatten_subtree_contentreference becomesrender_subtree_markdown; - correct ADR-057's description of the seeds if it is still cited as current.
Acceptance Criteria
-
nodespace skill guidance "<task>"returns the matching skills' instructions for a non-empty query, with the provenance envelope unchanged; a query from a skill's own description returns that skill first - Core, user-authored and Playbook skills are all returned; ranking matches the in-app skill search for the same query, with no fixed 0.7 floor
- Guidance still matches when the graph holds far more non-skill embeddings than the KNN window
-
nodespace skill guidance ""lists every skill with its name and description - A guidance query also returns the schemas relevant to it, with name, description, fields and relationships. For example, "add an issue to the current cycle" on the Linear-style setup returns the issue and cycle skills and the
issueandcycleschemas - Every schema is embedded, whether created by
create_schema, a Playbook install or core seeding. On a fresh database, every schema node has a non-stale embedding once the processor has run, and a test fails if a schema create path leaves none - Changing a schema's description, fields or relationships re-queues its embedding
- In-app
find_skillsreturns schema matches; a test covers the schema half with real embeddings - Guidance served to an external agent names no in-app-only tool; a test fails if a seeded skill's external rendering contains one
- The in-app agent's skill rendering is unchanged apart from the content fixes below
-
nodespace search "<query>" --type skillreturns matching skills; an unfilterednodespace searchstill excludes system types - No core skill body opens with an H1, and no skill shows a child that repeats its name
-
relationship-reverse-traversalreaches the in-app agent, and a coverage test fails if any registered rule's agent form reaches no seed skill - The relationship direction rule reaches both audiences from one fragment
-
SKILL.mdteaches when and how to fetch skills and carries no procedure that a skill now owns; nothing in it contradictsreferences/cli.md -
SKILL.mdstates that NodeSpace holds further instructions, both for operating NodeSpace and for the workspace's own domains (installed types and workflows such as Issues or Cycles), and tells the agent to fetch them before working in such a domain. The wording does not say "Playbook" - An external agent asked to work in an installed domain (for example "add an issue to the current cycle" on a workspace with the Linear-style setup) fetches that domain's skill before acting
- Prompt and routing golden snapshots regenerated with
UPDATE_GOLDEN=1and the diff reviewed - ADR-064 §5 and
prompt-skill-system.mdupdated as listed under Architecture Impact - Regression test runs a non-empty guidance query end to end against embedded skill nodes and fails without the fix
- Code passes
bun run quality:fix - Tests pass (
bun run test:changed)
Technical Specifications
Reference Files
packages/cli/src/commands/skill.rs—build_guidance_request,run_guidance,print_guidancepackages/daemon/src/services/node_service.rs—search_nodes: mapsthreshold == 0.0to unset, passesscope: Nonepackages/core/src/ops/search_ops.rs—should_skip_scope_filter,search_semanticpackages/core/src/services/embedding_service.rs—KNOWLEDGE_CORE_TYPES,matches_scope,semantic_search_nodes_of_type_with_vectorpackages/core/src/ops/skill_ops.rs—find_skills,SKILL_SEARCH_THRESHOLD,rerank_with_exclusionspackages/agent/src/skill_pipeline.rs—SkillSeed::template, the leading-H1 testpackages/core/src/schema/mod.rs—create_schema(transactional write with no embedding queue),update_schemapackages/core/src/services/node_service/crud.rs—create_node_with_parent_in_txand its doc comment;queue_created_root_for_embeddingpackages/core/src/services/node_service/mod.rs— core schema seeding (store.create_node),is_embeddable_typepackages/core/src/behaviors/mod.rs—SchemaNodeBehavior::get_aggregated_contentpackages/core/src/methodology/install.rs— Playbook schema creationpackages/agent/src/skill_rules.rs—RuleForm,resolve_includes,relationship-reverse-traversalpackages/agent/src/seeds/skills/*.md— core skill bodiespackages/agent/src/local_agent/routing.rs—render_candidates_for_promptpackages/skill/SKILL.md,packages/skill/references/cli.md,packages/cli/examples/gen_skill_md.rs— the external skill and its generatorpackages/cli/tests/it/cli_integration.rs— existingskill guidancetests
Implementation Details
- Rendering for the external audience has to work from what is stored or from the seed template. A user-modified seeded skill (ADR-072
guidance_modified) is served as stored. - A new RPC means regenerating proto stubs. Resolve types through the registry (
CoreNodeType), not a"skill"literal. should_skip_scope_filter's doc comment and unit tests argue for the old rule and change with it.- Seed content changes require a database reset, not a backfill.
- The
nodespaceCLI output changes, soSKILL.mdandreferences/cli.mdchange in the same PR.
Related Issues
- Keep Playbooks out of the agent's vocabulary: agents work Plays and schemas, and Playbooks install only from the app #3506 (Playbook terminology leaves agent-facing text; touches
SKILL.mdtoo)
Non-Goals
- Changing always-on
agent-guidancecontent or making it fetchable - Changing in-app routing scores or bars
- Changing the default
Knowledgescope for an unfiltered search
Activity
[-]Make nodespace skill guidance return the skills that match a query[/-][+]Let external agents fetch every NodeSpace skill as instructions, and make skill guidance return them[/+][-]Let external agents fetch every NodeSpace skill as instructions, and make skill guidance return them[/-][+]Let agents fetch NodeSpace's skills and schemas by intent: make skill guidance return them, and embed schemas[/+]malibio commentedon Oct 4, 2026
Baseline before starting — Frontend: 312 test files passed (5635 tests)
Serve skill guidance from the typed skill search, embed schemas, and …
Rewrite SKILL.md around fetching, render relationship rules into the …
Return a schema from a fetch only when the task is about its type, an…
Queue a schema for embedding only when an update changed it, and desc…
Let agents fetch NodeSpace's skills and schemas by task, embed schema…