Skip to content

Let a skill be attached to any node, read a node with what its paths reach, and return attached skills with a node and a query run #3555

Closed

Description

@malibio

Overview

Under ADR-094 a team says which instructions apply to which work by linking skills to nodes: a procedure to the queue it is for, standards to a project. This issue adds that link, a read that returns a node together with the nodes a set of relationship paths reach, and returns the skills attached to a node with it. It is the smallest slice that proves a workflow can be defined as data, and it is proved twice: on tasks, and on a workflow over user-defined types.

Problem Statement

  • A skill can be linked only to a type. applies_to points at a schema and tells the built-in agent which types a skill's operations concern. There is no way to say "hand this skill over when working on this project" or "this is the procedure for this queue".
  • No read returns a node with its related nodes. The CLI can get one node, its children, or the nodes for one relationship name. An agent that needs a task with its spec, plan and project makes several calls and has to know which.
  • A named relationship per aspect does not scale. Each new aspect (naming conventions, a test strategy) or kind of work (a review queue with its own procedure) would be a schema change.

Proposed Solution

  • attached_to: skill declares one relationship, attached_to, to a node of any type, with reverse attached_skills. It is separate from applies_to.
  • Read with paths: a node read accepts relationship paths to follow and returns the node with the nodes they reach.
  • Skills with a node: the read returns the skills attached to the node and the skills attached to each node the given paths reach, each with its full instructions.
  • Skills with a query run: running a saved query returns the skills attached to that query node.

The link delivers a skill and does not scope it: every skill stays discoverable through the skill list and match.

Documentation

  • ADR-094 §2 (read with paths) and §3 (a skill can be linked to any node); Consequences - "the first slice is proved twice"; Build order step 2
  • ADR-093 §2 and §3 - a skill can be attached to a node; what an agent receives with an item
  • ADR-064 §3 and §5 - a skill's description says when it applies; how a skill is rendered for a coding agent
  • ADR-070 and Relationship paths - relationship declarations and paths
  • Node type sequence - mandatory for the new relationship on skill
  • Updates: components/node-types.md (the skill sheet), components/seeded-nodes.md and architecture/prompt-skill-system.md (the attached_to link beside applies_to), packages/skill/references/cli.md and SKILL.md

Architecture Impact

Implements ADR-094 §2 (read with paths) and §3. applies_to and the built-in agent's routing are unchanged.

Acceptance Criteria

  • skill declares attached_to with no fixed target type and reverse attached_skills, added through the node type sequence; a link from a skill to a project, a saved query, a task and a user-defined type's node are all accepted
  • applies_to behaves as before: the built-in agent's skill search, schema_metadata and routed-turn type holding show no change, and prompt and routing goldens show no diff
  • A node read accepts one or more relationship paths (declared names, reverse names and has_child, as a RelationshipPath) and returns the node with the nodes each path reaches, grouped by path; an unknown path is refused with a message naming it
  • The read returns the skills attached to the node and the skills attached to each node the paths reached; each skill comes with its instructions, referenced schemas and tool commands, as a skill fetch returns it, inside the provenance marking
  • A skill attached to several returned nodes appears once, with the nodes it is attached to
  • A skill can be detached from a node: the CLI can delete an attached_to link (it has no relationship delete today, though the daemon has the RPC), the built-in agent can do the same, and the next read of that node no longer returns the skill
  • Running a saved query returns the skills attached to that query node, once, beside the result nodes
  • Archived skills and archived nodes are not returned
  • The read and its output contain no reference to any node type by name
  • Proof on tasks: a fixture with a project with a standards skill attached and a saved query with a procedure skill attached; running the query returns the procedure; reading a task with the path to its project returns the standards
  • Proof on a user-defined workflow: the same test with types created through create_schema (for example a request and a desk), a saved query over them and skills attached to the query and the related node, using the same commands with no code change
  • The built-in agent can read a node with paths, through a tool that is in the tool registry with its CLI command
  • references/cli.md and SKILL.md document linking a skill with attached_to, reading with paths and the skills returned, and bun run skill:check passes
  • Docs updated as listed under Documentation
  • Code passes bun run quality:fix
  • Tests pass (bun run test:changed)

Technical Specifications

Reference Files

  • packages/core/src/models/core_schemas.rs - the skill schema and its applies_to declaration
  • packages/nodespace-types/src/schema.rs - SchemaRelationship (target_type is optional), packages/nodespace-types/src/relationship_path.rs - RelationshipPath
  • packages/core/src/services/node_service/relationship.rs - relationship creation and validation
  • packages/core/src/ops/skill_ops.rs - rendering a skill with its schemas (render_skill_instructions), the external fetch
  • packages/core/src/ops/rel_ops.rs - GetNodeRelationships, which returns related nodes as previews today
  • packages/core/src/db/sqlite_store/relationship_paths.rs - resolving a path in SQL
  • packages/cli/src/commands/node.rs, packages/cli/src/commands/relationship.rs, packages/cli/src/commands/query.rs
  • packages/proto/proto/node_service.proto, packages/daemon/src/services/node_service.rs

Implementation Details

  • A related node is returned with its fields and its direct checkbox children, not its whole subtree. A skill is returned with its full instructions.
  • Render a skill for its reader the way the skill fetch does, so a coding agent gets CLI forms.
  • A path walk in SQL uses a correlated subquery, not a JOIN in a recursive CTE.
  • Whether read-with-paths is a flag on node get or its own subcommand is the implementer's choice; document it in cli.md.

Dependencies

Related Issues

Non-Goals

  • Context paths declared on a schema, and skills derived from the saved queries a node matches
  • A version on the read
  • Seeding any link, queue or skill

Activity

  1. changed the title [-]Let a skill guide any node, read a node with what its paths reach, and return guiding skills with a node and a query run[/-] [+]Let a skill be attached to any node, read a node with what its paths reach, and return attached skills with a node and a query run[/+] on Oct 4, 2026
  2. malibio commented on Oct 5, 2026

    @malibio
    CollaboratorAuthor

    Baseline — Frontend: 318 test files passed (5770 tests)

  3. self-assigned this
    on Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions