kg-canvas

star 2

This skill should be used when the user asks to visualize the kg wiki, create an Obsidian Canvas, knowledge map, graph view, mindmap, community map, or invokes /kg-canvas. Exports read-only .canvas JSON views — never modifies content pages.

gonos2k By gonos2k schedule Updated 6/13/2026

name: kg-canvas description: "This skill should be used when the user asks to visualize the kg wiki, create an Obsidian Canvas, knowledge map, graph view, mindmap, community map, or invokes /kg-canvas. Exports read-only .canvas JSON views — never modifies content pages." trigger: /kg-canvas

/kg-canvas — Visual Knowledge Export

Produces .canvas JSON files that Obsidian renders natively. No plugins required.

Activate When

  • User invokes /kg-canvas [mode] [arg]
  • User asks for a "knowledge map", "concept map", "Obsidian Canvas", "mindmap", "community map"
  • After ingest spree to visualize new structure
  • Before presentation or sharing of project knowledge

Do Not Activate When

  • User wants to query content → /kg-query
  • User wants to analyze structure programmatically → /kg-connect or graphify CLI
  • Wiki is empty (no pages to visualize) → suggest /kg-ingest first

Preconditions

  • Wiki must be bootstrapped (wiki/ exists with content pages)
  • For community mode: graphify-out/GRAPH_REPORT.md must exist. If absent, suggest overview or [folder] mode instead
  • If wiki doesn't exist, tell user to run /kg-init first

Modes

/kg-canvas overview

Full wiki overview. One node per page, grouped by folder/page_kind.

/kg-canvas [folder]

Single folder deep-dive. Shows pages + their wikilink connections.

/kg-canvas community [N]

Graph community N from GRAPH_REPORT.md. Nodes = community members, edges = graph edges.

/kg-canvas query "<topic>"

Focused canvas around a topic:

  1. BM25 lookup for the topic via ~/.claude/skills/kg/schema/tools/build_search_index.py
  2. Include top 10 pages
  3. Include 1-hop wikilinks
  4. Include related Decision and Heuristic pages
  5. Write wiki/canvas-<topic-slug>.canvas

Canvas JSON Structure (JSON Canvas 1.0)

{
  "nodes": [
    {
      "id": "unique-id",
      "type": "file",
      "file": "wiki/concepts/register-pressure.md",
      "x": 0, "y": 0,
      "width": 400, "height": 200,
      "color": "4"
    }
  ],
  "edges": [
    {
      "id": "edge-id",
      "fromNode": "source-id",
      "toNode": "target-id",
      "label": "implements"
    }
  ]
}

Color Scheme (page_kind -> JSON Canvas 1.0 preset)

  • entity-page: "1" (red)
  • concept-page: "4" (green)
  • procedure-page: "5" (cyan)
  • experience-page: "3" (yellow)
  • heuristic-page: "6" (purple)
  • decision-page: "2" (orange)
  • source-page: omit (Obsidian default)

Auto-Layout

  1. Group nodes by folder (or community)
  2. Grid within group: cols = ceil(sqrt(count))
  3. Node size: 400x200 default, scale up for high-degree nodes
  4. Group spacing: 600px
  5. Edges auto-routed by Obsidian

graphify integration (alternate visual exports when available)

graphify v0.8.x produces additional visualization/export formats from the same graph.json. All of these are bare-CLI export subcommands (Bash-callable, offline, read the existing graph — no LLM):

graphify export callflow-html   # Mermaid architecture / call-flow HTML
graphify export svg             # graph.svg (Notion, GitHub embed) — requires matplotlib
graphify export graphml         # graph.graphml (Gephi, yEd)
graphify export obsidian        # Obsidian vault export of the graph
graphify export wiki            # agent-crawlable markdown wiki articles
graphify export neo4j           # cypher.txt  (add --push bolt://localhost:7687 to push live)
graphify export falkordb        # cypher.txt  (add --push falkordb://localhost:6379 to push live)
graphify export html            # standalone interactive HTML
graphify tree                   # graphify-out/GRAPH_TREE.html (D3 v7 collapsible tree)

The /graphify <path> --svg|--graphml|--neo4j|--obsidian|--falkordb|--wiki flag spellings are just the orchestrator shorthand for the same exports (the slash form is the graphify SKILL; the --neo4j-push/--falkordb-push flag variants live there too). Two cautions about the bare CLI: (1) it has no --svg/--graphml/… flags — graphify --svg (non-path) returns error: unknown command; (2) graphify <path> --svg does NOT error and does NOT export — an existing path is rewritten to graphify extract <path>, so it runs an AST extraction and silently ignores the flag (no SVG produced). Use the export <format> subcommand spelling. graph.html is also generated by default on any /graphify <path> build.

export callflow-html auto-regenerates on git commit only if all three hold: the graphify hook is installed, a *-callflow.html was already generated once (opt-in by existence — never created from scratch), and the commit actually changes the code graph.

/kg-canvas produces Obsidian Canvas (wiki-aware, page-level). Use the graphify exports above for code-structure-aware views.

Output Contract

Canvas export: PASS | FAIL
Mode: overview | folder | community | query
Output file: wiki/<name>.canvas
Nodes: <N>
Edges: <M>
Groups: <K>
Color-coded by page_kind: yes
Skipped:
- archived pages: <N>
- unresolved wikilinks: <N>

Confidence: high | medium | low

Caveats:
- <large graph warning if N>200 | community mode unavailable | none>

Next command:
- <none | open in Obsidian | /kg-canvas community <N>>

Exceptions and Escalation

  • Wiki absent → stop and suggest /kg-init.
  • Community mode requested but GRAPH_REPORT.md absent → suggest /kg-update first OR fallback to folder mode.
  • Node count > 200 → warn the user; ask to narrow mode (folder or query) unless explicit "yes, full overview".
  • NEVER modify wiki content pages. This skill writes only .canvas files (which are generated views, safe to overwrite).
  • Existing .canvas file with same name → overwrite (canvases are regenerable).

Limitations

  • Static snapshot. Re-run to update.
  • Large wikis (>200 nodes) may be slow to render. Use folder or query mode.
  • Read-only export. Does not modify wiki pages.

Quality Gates

Before final answer:

  • Output file path is under wiki/ (not outside the wiki root)
  • No content page was modified
  • Every node references an existing wiki file
  • Color scheme applied per page_kind
Install via CLI
npx skills add https://github.com/gonos2k/kg-skill --skill kg-canvas
Repository Details
star Stars 2
call_split Forks 0
navigation Branch main
article Path SKILL.md
More from Creator