contextual-neural-map

Contextual Neural Map

Produces an Obsidian Graph View–style interactive knowledge graph from any folder. Paper-white background, pencil-sketch hand-drawn feel, D3.js force-directed layout.

Design Aesthetic

The core aesthetic is “pencil doodles on a notebook page”:

Node Types

Type Visual Size Rule
Document (document) Solid dark circle #4a4540, soft shadow Scaled by importance metric (e.g. word count, links-in), 4–20 px
Note (note) Hollow dashed circle Fixed 5.5 px
Draft (draft) Semi-transparent filled circle Fixed 5.5 px
Tag / Topic (tag) Large semi-transparent circle, Caveat handwriting label Fixed 10 px

Edge Types

Type Visual Meaning
tag-link Thin solid line #cdc6bb, 0.5 px Node → Tag membership
content-link Dashed line #a09888, 1.2 px Direct reference or shared keyword between nodes
sequence-link Thick dashed line #8a8279, 1.8 px Sequential or hierarchical relationship

Workflow

Step 1 — Identify the target folder

Ask the user which folder to visualize. Accept any path. Then recursively scan the folder to inventory all files.

Step 2 — Analyze and extract data

Read the files and build three data structures:

Tags / Topics: Detect recurring themes across files. Strategies:

Nodes: Each file or meaningful content unit becomes a node.

Edges / Links:

Step 3 — Inject data into the HTML template

Read assets/template.html and replace the // __DATA_INJECT__// __DATA_END__ block with the extracted data.

Data format:

const tags = [
  { id: 't_topicname', label: 'Topic Name' },
  // ...
];

const documents = [
  { id: 'd_filename', label: 'Document Title', date: 'YYYY-MM-DD', weight: 1200, type: 'report', tags: ['t_topicA', 't_topicB'], desc: 'Brief summary' },
  // ...
];

const notes = [
  { id: 'n_001', label: 'Note Title', status: 'note', tags: ['t_topicA'], desc: 'Description', related: ['n_002', 'd_filename'] },
  // ...
];

const sequenceGroups = [
  ['d_chapter1', 'd_chapter2', 'd_chapter3'],  // ordered series
  // ...
];

Step 4 — Save and deliver

Save the completed HTML to the workspace root as contextual-neural-map.html (or a user-specified name), then provide a computer:// link.

Interactive Features

The template includes these interactions out of the box — no extra development needed:

Customization Guide

Common tweaks users may request:

Need Where to change
Background color body { background: #xxx }
Node colors nodeEls fill and stroke values
Fonts @import url(...) and font-family
Node size formula Math.sqrt(d.weight / N) — adjust N
New edge type Add a new type to links data, add matching stroke/dasharray style
Force layout params simulation.force(...) distance / strength / charge values

Applicable to Any Folder

This skill works with any folder that contains text-based files:

As long as you can extract nodes and links into the JSON structure above, the template renders it beautifully.