# Genesis Sitemap Upgrade PRD
*Incorporating Research Findings into Living Sitemap*

**Architect:** Claude Opus 4.5
**Executor:** Gemini Flash 2.0

---

### US-001: D2 Diagram Alternative
**Goal:** Create D2 language version of Genesis sitemap for comparison

**Acceptance Criteria:**
- Valid D2 syntax in SITEMAP.d2 file
- Same components as Mermaid version
- Uses D2 subgraphs and styling
- Includes click links to files

**Files to Create:**
- /mnt/e/genesis-system/SITEMAP.d2

**Technical Hints:**
D2 syntax: direction right. Containers with {}. Connections with arrows ->. Styles with .style. Links with .link attribute. Colors via .fill.

**Dependencies:** None

---

### US-002: Auto-Update Scanner
**Goal:** Create Python scanner that detects new files and updates sitemap automatically

**Acceptance Criteria:**
- Watches core/, AIVA/, skills/ directories
- Detects new/deleted Python files
- Auto-regenerates SITEMAP.md on change
- Logs changes to sitemap_updates.log

**Files to Create:**
- /mnt/e/genesis-system/sitemap/auto_scanner.py

**Technical Hints:**
Use watchdog library for file monitoring. Observer pattern. Debounce rapid changes with 5 second delay. Call generator on change event.

**Dependencies:** None

---

### US-003: Interactive Tour Data
**Goal:** Create JSON data for guided tours through Genesis components

**Acceptance Criteria:**
- Tour for new agent onboarding
- Tour for memory system understanding
- Tour for AIVA validation flow
- Each tour has ordered steps with descriptions

**Files to Create:**
- /mnt/e/genesis-system/sitemap/tours.json

**Technical Hints:**
JSON array of tours. Each tour has id, title, steps array. Each step has component_id, title, description, highlight_elements. Include estimated_time per tour.

**Dependencies:** None

---

### US-004: Search Index Builder
**Goal:** Create search index for instant component lookup

**Acceptance Criteria:**
- Indexes all components from components.json
- Includes file content snippets
- Supports fuzzy matching
- Outputs searchable index.json

**Files to Create:**
- /mnt/e/genesis-system/sitemap/search_index.py

**Technical Hints:**
Load components.json. Extract keywords from names and descriptions. Build inverted index. Use fuzzywuzzy for matching. Output to index.json with term frequencies.

**Dependencies:** None

---

### US-005: Embeddable Widget
**Goal:** Create embeddable mini-sitemap widget for other dashboards

**Acceptance Criteria:**
- Self-contained HTML/JS widget
- Shows core Genesis components only
- Clickable nodes link to full sitemap
- Under 50KB total size

**Files to Create:**
- /mnt/e/genesis-system/sitemap/widget.html

**Technical Hints:**
Inline CSS and JS. Simplified mermaid diagram. 6 main nodes only. Click opens SITEMAP.html in new tab. Dark theme matching Genesis.

**Dependencies:** None

---

### US-006: Knowledge Graph Connector
**Goal:** Create connector that syncs sitemap components to Genesis RLM knowledge graph

**Acceptance Criteria:**
- Reads components.json
- Creates entities in RLM for each component
- Links relationships between components
- Enables natural language queries about system structure

**Files to Create:**
- /mnt/e/genesis-system/sitemap/kg_connector.py

**Technical Hints:**
Import rlm_bridge. Create component entities with category, path, description. Create relationship edges for links_to. Enable queries like "what connects to memory cortex".

**Dependencies:** None
