Skip to content

Agent guidance for writing markdown into nodes: import it, or create the right node type without typed syntax #4201

Closed

Description

@malibio

Overview

An external agent (Claude, connected to a Google Drive) copied a leave-policy document into NodeSpace by creating nodes directly. The result shows markdown syntax as literal text: ## Leave Entitlements, - 11 Public Holidays, 1. **Log in to Zoho People** — ..., all in plain text nodes. The guidance an agent receives does not cover creating nodes one at a time from a markdown source, and one rule teaches the habit of typing ## .

Problem Statement

What the screenshot shows (from a user report): headings render as bullets with ## visible, list items carry a typed - , numbered steps carry a typed 1. . Headings that were real header nodes would render as headings, so these were created as text nodes with the syntax typed into the content.

What the node model says (node-types.md): the markup types keep their prefix inside content, and the level or number is derived from it.

  • header - the #-###### prefix is part of the content
  • quote-block - the > prefix
  • ordered-list - the 1. prefix
  • checkbox - its prefix
    A bullet list is not a type: it is a node with child text nodes, and the outline supplies the bullets.

What the guidance says today:

  • Bulk Import (both variants) says to import markdown with create_nodes_from_markdown (local agent) or nodespace import file <path> / nodespace import dir <dir> (external agents), "for any document with sections". Importing maps the syntax to node types and builds the hierarchy.
  • Its trigger is "importing a document or creating multiple nodes from markdown". "Take this Google Doc and put it in NodeSpace" may not retrieve it.
  • Nothing says what to do when creating nodes individually. section-create.md tells the agent to create a header node with content "## " plus the name, which is correct for a header but is the only syntax example an agent sees.

Proposed Solution

State one rule in the guidance both kinds of agent read: a markdown source goes through import; individual nodes use the node type that matches the syntax, keeping that type's own prefix; plain list items are child text nodes with no marker; syntax is never typed into a text node.

Documentation

  • Node Types - the markup types and which prefix each keeps in content (the table at header, quote-block, ordered-list).
  • Prompt & Skill System - how skills and rules are retrieved and assembled.
  • ADR-064 - where instructions to agents belong.
  • No prior doc covers hand-creating nodes from a markdown source.

Acceptance Criteria

  • The local-agent and external-agent (skill-md) variants state the rule above, for the CLI and the in-app tools alike.
  • The guidance is retrieved for requests such as "put this document into NodeSpace" and "copy this Google Doc here", not only for "import".
  • section-create.md and the new text agree (a header keeps its prefix; a text item under it has none).
  • A test or eval creates a document through the guidance and asserts: headings are header nodes, numbered steps are ordered-list nodes, list items are child text nodes whose content has no leading marker.
  • Prompt snapshots are regenerated (UPDATE_GOLDEN=1) and the diff reviewed. Code passes bun run quality:fix; bun run test:changed passes.

Technical Specifications

Reference Files

  • packages/agent/src/seeds/rules/agent/bulk-import-steps.md, packages/agent/src/seeds/rules/skill-md/bulk-import-steps.md
  • packages/agent/src/seeds/skills/bulk-import.md
  • packages/agent/src/seeds/rules/agent/section-create.md
  • packages/agent/src/skill_pipeline.rs - the skill's use_for text that retrieval matches
  • packages/agent/src/skill_rules.rs - rule registration

Implementation Details

This is a change to the CLI's agent guidance, so the acceptance criteria above cover the skill text as well as the code.

Related Issues

  • None

Activity

  1. added
    bug
    documentation
    on Oct 31, 2026
  2. malibio commented on Oct 31, 2026

    @malibio
    CollaboratorAuthor

    The guidance this issue changes is fetched with nodespace skill guidance, which exists only in CLI v0.3.4 and later. In the trial the issue came from, the user's CLI was 0.2.8, so the agent never received any of it and worked from basic commands. That case is #4203; this issue's guidance only helps agents whose CLI can fetch it.

  3. self-assigned this
    on Nov 3, 2026
  4. mstomar125 commented on Nov 3, 2026

    @mstomar125
    Contributor

    Picking this up (sweep drain).

  5. mstomar125 commented on Nov 3, 2026

    @mstomar125
    Contributor

    Merged: both bulk-import-steps variants and both section-create variants now state one rule (a markdown source goes through import; individual nodes use the matching type with its own prefix; plain list items are child text nodes with no marker; syntax is never typed into a text node). Still open: the retrieval trigger for requests like 'put this document into NodeSpace' (changing the skill's use_for text moves a digest that a gate test pins and needs a re-record on the embedding model; proposed text: '...or to put a document, a page or a Google Doc into NodeSpace, copy it here, or save it as nodes.') and a node-creation test through the real service that asserts header, ordered-list and child text structure.

    🤖 Generated with Claude Code

  6. mstomar125 commented on Nov 6, 2026

    @mstomar125
    Contributor

    Done: the service-level structure test is merged. The retrieval trigger and the agent-run check are split into #4257 (both need a model).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

aibugdocumentation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions