Xpersona
B

brain-map-visualizer

CLAWHUB · Unverified

Visualize how attention moves across your agent's projects. 13 named attention categories. Momentum-ready edges (recentCount/lifetimeCount). Directional flow encoding. Sorted by co-access score. Skill: brain-map-visualizer Owner: highnoonoffice Summary: Visualize how attention moves across your agent's projects. 13 named attention categories. Momentum-ready edges (recentCount/lifetimeCount). Directional flow encoding. Sorted by co-access score. Tags: latest:3.3.6 Version history: v3.3.6 | 2026-08-25T03:26:15.559Z | user Add contact footer v3.3.5 | 2026-04-19T21:46:52.925Z | user Added What You're Looking At

62
Rank
84
Safety
1.5k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.5K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s17788hys8dcemdm7pfhe61p9d83hbhs:brain-map-visualizer
  1. Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-highnoonoffice-brain-map-visualizer/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

149,095 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: brain-map-visualizer
version: 3.4.0
description: "Visualize how attention moves across your agent's projects. 13 named attention categories. Momentum-ready edges (recentCount/lifetimeCount). Directional flow encoding. Sorted by co-access score."
homepage: https://github.com/highnoonoffice/hno-skills
source: https://github.com/highnoonoffice/hno-skills/tree/main/oc-brain-map
license: MIT
metadata: ~
---

# Brain Map Visualizer

## Execution Gates

```xml
<skill_gates version="1.0" mode="mandatory_pre_execution" evaluation="sequential" on_violation="stop_and_report">

  <gate id="journal_format_check" priority="1" severity="hard" scope="pre_parse">
    <condition>About to run the journal parser or rebuild the graph</condition>
    <question>Do session journals exist at `memory/journal/YYYY-MM-DD.md` and contain markdown file references in the body text?</question>
    <pass_action>Proceed with parser run.</pass_action>
    <fail_action>Stop. Without structured journals referencing vault files, the parser produces an empty or meaningless graph. Bootstrap journal history first using the prompt in the Bootstrapping section.</fail_action>
  </gate>

  <gate id="workspace_scope" priority="2" severity="hard" scope="pre_parse">
    <condition>About to run the parser script against a vault directory</condition>
    <question>Is WORKSPACE_DIR set to the correct vault path and not a broader system directory?</question>
    <pass_action>Proceed.</pass_action>
    <fail_action>Stop. Confirm the WORKSPACE_DIR environment variable is scoped to your agent vault only. Running against a broader path reads unintended files and degrades graph quality.</fail_action>
  </gate>

  <gate id="network_deployment_secret" priority="3" severity="hard" scope="pre_deploy">
    <condition>About to deploy the graph API route on a networked (non-localhost) host</condition>
    <question>Is BRAIN_MAP_SECRET set and wired into both the API route and the component fetch headers?</question>
    <pass_action>Proceed.</pass_action>
    <fail_action>Stop. Without the secret, the graph API route is open to anyone on the network. Set BRAIN_MAP_SECRET before any non-localhost deployment. Localhost-only use is exempt.</fail_action>
  </gate>

  <gate id="rebuild_before_read" priority="4" severity="soft" scope="pre_interpret">
    <condition>About to interpret graph data or answer questions about attention patterns</condition>
    <question>Has the graph been rebuilt since the last significant batch of session journals were written?</question>
    <pass_action>Proceed.</pass_action>
    <fail_action>Flag that the graph may be stale. Trigger a rebuild via the Rebuild button or `node scripts/build-brain-map-projects.js` before drawing conclusions about current attention patterns.</fail_action>
  </gate>

  <gate id="promotion_intent" priority="5" severity="soft" scope="pre_promote">
    <condition>About to promote an Emerging Project to a named Attention Pocket</condition>
    <questi

_meta.json

{
  "ownerId": "kn7826mqweky3s8ys5qd8fzqyh832g8w",
  "slug": "brain-map-visualizer",
  "version": "3.3.6",
  "publishedAt": 1787628375559
}

references/component.md

---
title: "OC Brain Map — BrainMapProjects Component"
created: 2026-03-17
modified: 2026-04-17
tags: [brain-map, react, d3, component, tsx]
status: active
---

# BrainMapProjects.tsx

Project-centric Brain Map component. Left panel shows attention projects ranked by recency-weighted density. Right panel renders a D3 force-directed graph for the selected project.

**Dependencies:** `d3`, `@types/d3`

```bash
npm install d3 @types/d3
```

---

## Recency-Weighted Ranking

The left panel sorts projects by a recency-weighted score rather than raw co-access density. This surfaces recently-active projects over historically-dense-but-stale ones.

**Equation:**

```
rank_score = coAccessScore / (daysSinceLastSession + 1)
```

- `coAccessScore` — total edge weight across all sessions (aggregate attention density)
- `daysSinceLastSession` — days since `dateLast` (ISO date from parser output)
- `+1` — prevents division by zero for projects touched today

A project touched yesterday with moderate density outranks a project with high lifetime density last touched 60 days ago. The `+1` floor keeps today's sessions from producing infinite scores.

**Implementation:**

```tsx
const rankedProjects = data?.projects
  ? [...data.projects].sort((a, b) => {
      const now = Date.now();
      const daysA = (now - new Date(a.dateLast).getTime()) / 86_400_000;
      const daysB = (now - new Date(b.dateLast).getTime()) / 86_400_000;
      const scoreA = a.coAccessScore / (daysA + 1);
      const scoreB = b.coAccessScore / (daysB + 1);
      return scoreB - scoreA;
    })
  : [];
```

Then render `rankedProjects.map(proj => ...)` instead of `data.projects.map`.

---

## Project Interface

```tsx
interface Project {
  id: string;           // machine id, e.g. "ghost-publishing"
  label: string;        // display name
  color: string;        // hex color for this project
  sessionCount: number; // journal sessions attributed to this project
  fileCount: number;    // unique files accessed
  coAccessScore: number;// total edge weight — aggregate attention proxy
  dateFirst: string;    // YYYY-MM-DD of earliest session
  dateLast: string;     // YYYY-MM-DD of most recent session
  sessions: ProjectSession[];
  nodes: ProjectNode[];
  edges: ProjectEdge[];
}

interface ProjectData {
  projects: Project[];
  generated: string;    // ISO timestamp of last parser run
  journalCount: number; // number of journal files parsed
}
```

---

## Node Color Groups

```tsx
const NODE_COLORS: Record<string, string> = {
  core: '#c8a84b',
  memory: '#a78bfa',
  publishing: '#22c55e',
  infrastructure: '#60a5fa',
  skills: '#f97316',
  journal: '#6b7280',
  general: '#6b7280',
};
```

---

## Component

```tsx
'use client';

import { useEffect, useRef, useState } from 'react';
import * as d3 from 'd3';

// --- Types ---
interface Node extends d3.SimulationNodeDatum {
  id: string;
  group: string;
  accessCount: number;
  path: string;
}

interface Edge {
  source: string | Node;
  target:

references/graph-schema.md

---
title: "OC Brain Map — Graph Schema & API Route"
created: 2026-03-17
modified: 2026-04-17
tags: [brain-map, schema, api, nextjs]
status: active
---

# Graph Schema & API Route

The Brain Map uses a **project-centric** data model. The parser output (`brain-map-projects.json`) groups nodes and edges by project rather than outputting a single flat graph. Each project is an independent subgraph with its own nodes, edges, session history, and metadata.

## `brain-map-projects.json` — Full Schema

```typescript
interface ProjectData {
  projects: Project[];
  generated: string;    // ISO timestamp of last parser run
  journalCount: number; // number of journal files parsed
}

interface Project {
  id: string;           // machine id, e.g. "ghost-publishing"
  label: string;        // display name, e.g. "Ghost Publishing"
  color: string;        // hex color for this project's nodes and edges
  sessionCount: number; // number of journal sessions attributed to this project
  fileCount: number;    // number of unique files accessed in this project
  coAccessScore: number;// total edge weight — proxy for how much attention this project absorbed
  dateFirst: string;    // YYYY-MM-DD of earliest session
  dateLast: string;     // YYYY-MM-DD of most recent session
  sessions: ProjectSession[];
  nodes: ProjectNode[];
  edges: ProjectEdge[];
}

interface ProjectSession {
  date: string;         // YYYY-MM-DD
  summary: string;      // first 200 chars of journal summary
}

interface ProjectNode {
  id: string;           // relative path from vault root, e.g. "MEMORY.md"
  group: NodeGroup;     // color group for rendering
  accessCount: number;  // sessions this file appeared in within this project
}

type NodeGroup =
  | 'core'              // MEMORY.md, SOUL.md, USER.md, IDENTITY.md, AGENTS.md, TOOLS.md, HEARTBEAT.md
  | 'memory'            // memory/*.md
  | 'publishing'        // PublishingPipeline/*, drafts/*, articles/*
  | 'infrastructure'    // tools/*, workflows/*, prompts/*, scripts/*, mission-control/*, .learnings/*
  | 'skills'            // skills/*
  | 'general';          // everything else

interface ProjectEdge {
  source: string;       // file id (alphabetically first of the pair)
  target: string;       // file id (alphabetically second of the pair)
  fromId: string;       // canonical upstream node — the file accessed first in sessions (majority vote)
  toId: string;         // canonical downstream node — the file accessed later in sessions
  weight: number;       // co-access count (sessions where both files appeared)
  recentCount: number;  // co-access sessions in the last 30 days
  lifetimeCount: number;// same as weight (sessions array length) — alias for momentum math
  spanDays: number;     // days between first and last session in this project
}
```

## Edge Directionality

Each edge carries two direction fields in addition to `source`/`target`:

- **`fromId`** — the file accessed *earlier* in the session on average across all ses

references/journal-parser.md

---
title: "OC Brain Map — Journal Parser Script"
created: 2026-03-17
modified: 2026-04-17
tags: [brain-map, journal, parser, node-script]
status: active
---

# Journal Parser — `scripts/build-brain-map-projects.js`

Parses `memory/journal/*.md` session files, maps sessions to 13 named attention projects via keyword matching, builds per-project co-access graphs with momentum fields and edge directionality, and writes `data/brain-map-projects.json`.

Copy this script to `scripts/build-brain-map-projects.js` in your Mission Control or host app. Adjust `WORKSPACE_DIR` and `OUTPUT_PATH` via environment variables.

---

## Configuration

```bash
# Override defaults via environment variables before running
WORKSPACE_DIR=/path/to/your/vault node scripts/build-brain-map-projects.js
OUTPUT_PATH=/path/to/output/brain-map-projects.json node scripts/build-brain-map-projects.js
```

Defaults:
- `WORKSPACE_DIR` → `~/.openclaw/vault`
- `OUTPUT_PATH` → `data/brain-map-projects.json` relative to the script's directory

---

## Project Definitions

The parser maps sessions to 13 named attention categories. Each category has a label, color, and keyword list. Sessions matching keywords are attributed to that project; file co-access within those sessions builds the edges.

| ID | Label | Color |
|---|---|---|
| `memory-system` | Memory System | Gold `#c8a84b` |
| `ghost-publishing` | Ghost Publishing | Green `#22c55e` |
| `ghost-publishing-pro` | Ghost Publishing Pro Skill | Emerald `#34d399` |
| `youtube` | YouTube | Red `#ef4444` |
| `mission-control` | Mission Control | Blue `#60a5fa` |
| `brain-map-skill` | Brain Map Skill | Purple `#a78bfa` |
| `github` | GitHub | White `#f0f6ff` |
| `cron-automation` | Cron + Automation | Orange `#fb923c` |
| `model-stack` | Model Stack | Fuchsia `#e879f9` |
| `hno-business` | HNO Business | Pink `#ec4899` |
| `finances` | Finances + Bitcoin | Amber `#fbbf24` |
| `the-desk` | The Desk | Tan `#d4a373` |
| `second-brain` | Second Brain | Cyan `#67e8f9` |

Sessions not matching any category fall back to `mission-control`.

### Customizing for your agent

The `PROJECT_DEFS` array at the top of the script is the only thing you need to change to adapt the Brain Map to your vault. Replace the keyword lists with terms that reflect your actual work. The category names and colors are arbitrary — use whatever groupings make sense for your attention patterns.

If a journal entry has a `## Project` block, that label takes priority over keyword inference:

```markdown
## Project
Ghost Publishing
```

This lets you manually attribute sessions that keyword matching would misclassify.

---

## File Extraction

The parser uses a two-pass strategy to find which markdown files were accessed in each session:

**Pass 1 — `## Files Accessed` block (preferred)**

If the journal has an explicit files list under `## Files Accessed`, the parser reads it directly. This is accurate and fast.

```markdown
## Files Accessed
- MEMORY.md
- memory/recent.md
- s

Sponsored

Ads related to brain-map-visualizer and adjacent AI workflows.