Skip to content

Skill seed guidance text should use proper markdown (fenced code blocks) for JSON examples #1965

Closed

Description

@malibio

Summary

Skill guidance text should be authored as real markdown, since it's already imported as markdown at seed time — the pipeline is correct, the source text just doesn't give it real markdown syntax to work with.

Verified persistence path (confirmed correct — this is not a bypass bug)

  • packages/daemon/src/services/assembly.rs:230-239 — seed_skill_nodes()'s output is passed through prepare_nodes_from_template at seed time.
  • packages/core/src/markdown/mod.rs:1361-1384 (prepare_nodes_from_template) — the root node is built directly from title/content, but children are genuinely parsed via prepare_nodes_from_markdown(&tmpl.markdown_content, ...) (line 1383) — the same parser used for real document imports (headers → nodes, sub-headers → children, ``` fences → code-block nodes per lines 556/669/789/1475).
  • So the seeding pipeline already is a markdown import, end to end, exactly as it should be.

The actual, narrower gap

The markdown_content string literals in packages/agent/src/skill_pipeline.rs's six *_guidance() functions (schema_creation, graph_editing, relationship_management, node_deletion, bulk_import, organization) and in seed_skill_nodes()'s Research & Search / Node Creation blocks are written as loose prose with bare, unfenced inline JSON — e.g.:

{
  "node_type": "widget",
  "content": "Shipment 24",
  ...
}

with no ```json fence around it (skill_pipeline.rs ~lines 326-335), and similarly unfenced JSON in schema_creation_guidance()'s Invoice/Project examples.

Since the import pipeline already looks for ``` fences to produce code-block nodes, these examples currently get parsed as plain paragraph/list text instead of the structured code-block type they should become — not because parsing is broken, but because the source text was never written with real markdown syntax.

Fix

Wrap JSON/code examples across all six guidance functions in proper ```json fences, so the already-correct prepare_nodes_from_markdown pipeline produces real code-block child nodes for them instead of flattening them into prose. Likely also worth using inline code spans (`) for short inline call-shape examples like search_nodes(...).

Also worth checking whether any guidance text currently relies on markdown headers (#/##) purely for visual grouping in the prompt rather than intending real hierarchical children — if so, be careful not to introduce spurious child-node splits when converting.

Verification

Re-run seed_skill_children_are_real_markdown_types_not_prompt (skill_pipeline.rs ~line 677) after the fix and confirm code-block node types actually appear among seeded children where JSON examples exist.

Why this matters

Proper fencing makes skill content round-trip cleanly as real markdown — directly useful for #1958's work extending gen_skill_md to cover all six skills, and for any future "export skill as markdown" capability, since the existing node-export function (export_node_hierarchy/export_node_with_context) already round-trips code-block/header content losslessly (fence markers and # prefixes are preserved verbatim in content) — it just has nothing structured to export today for these examples.

Related

#1958 (skill guidance / SKILL.md structural sync) — companion issue, same skill-guidance-as-markdown system, but distinct scope (structural sync tooling vs. this issue's formatting fix to the source text). Can be done independently.

Acceptance criteria

  • All JSON worked examples across the six guidance functions use proper ```json fences.
  • seed_skill_children_are_real_markdown_types_not_prompt (or an extended version) confirms code-block nodes are produced where expected.
  • No regression in how the guidance renders as LLM prompt text (fencing shouldn't change the model-facing meaning).

Activity

  1. malibio commented on Aug 4, 2026

    @malibio
    CollaboratorAuthor

    Baseline (worktree issue-1965-skill-guidance-fences): Frontend 180 test files passed, 4301 tests passed.

  2. self-assigned this
    on Aug 4, 2026
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