ProDG Mainframe Framework: Context7 Documentation

Version: 1.0.0
Last Updated: 2026-10-04
Format: Context7-compatible documentation with interactive navigation

Overview

Comprehensive documentation system for the ProDG mainframe infrastructure, designed for Context7 MCP integration, interactive learning, and visual understanding through infographics and 3D visualizations.

Documentation Architecture

1. Core Components Documentation

Infrastructure Layer

# /prodg-mainframe/infrastructure

## Compute Platform
- **Host OS**: Ubuntu 22.04 LTS on Hetzner VPS (65.109.89.215)
- **Orchestration**: 2-node Talos Kubernetes cluster (Track C)
  - Control Plane: 192.168.100.207 (trackc-node)
  - Worker: 192.168.100.56 (convert-test)
- **Networking**: Headscale-managed Tailscale mesh (100.64.0.8 gateway)
- **Container Runtime**: Docker Compose + Kubernetes dual stack

## Container Platform
- **Primary**: Docker Compose at /opt/prodg/compose/
- **Secondary**: Kubernetes Track C cluster
- **Registry**: Local registry (192.168.100.1:5000)
- **Security**: Digest pinning, supply chain protection via SOC framework

Security Stack

# /prodg-mainframe/security

## Core Security Services
1. **OpenBao v2.7.1** (Secrets Management)
   - Endpoint: https://bao.mainframe.prodg.studio
   - Storage: Raft backend with KV v2 engine
   - Authentication: AppRole for services, root tokens secured
   - Policies: Least-privilege access with TTL rotation

2. **Wazuh v4.14.8** (SIEM Platform)
   - Endpoint: https://wazuh.mainframe.prodg.studio
   - Components: Manager, indexer, dashboard (all-in-one)
   - Agents: Host agent 001 active with Docker monitoring
   - Security: Loopback-only ports, API authentication

3. **SOC Framework** (Supply Chain Security)
   - Registry: /opt/prodg/soc/vetted-software.yaml
   - Assessment: Automated security scanning pipeline
   - Forks: Local mirrors of critical dependencies
   - Intelligence: Multi-focus threat research

AI Gateway Stack

# /prodg-mainframe/ai-gateway

## LiteLLM Proxy v1.104.0
- **Endpoint**: https://litellm.mainframe.prodg.studio
- **Models**: z-ai/glm-5.3, GPT-4o, Claude Sonnet via OpenRouter
- **Authentication**: Virtual keys with budget controls
- **Database**: PostgreSQL for spend tracking and user management
- **Security**: Master key API auth, separate UI credentials

## Integration Points
- **Hermes Agent**: Full routing through gateway (main + auxiliary models)
- **Spend Tracking**: Real-time cost monitoring with budget enforcement
- **Admin Interface**: Web UI with role-based access control
- **Provider Abstraction**: Single gateway for multiple AI providers

2. Interactive Navigation System

ELI5 Navigator Components

Based on the DreambigOu ELI5 skill pattern:

// /prodg-mainframe/navigator/eli5-system.js
class MainframeExplainer {
  constructor() {
    this.audienceTypes = {
      'age-5': 'Super simple with toy analogies',
      'age-10': 'Elementary school with basic cause-effect',
      'teenager': 'Social media and gaming references',
      'manager': 'Business outcomes and decisions',
      'engineer': 'Technical details and architecture',
      'security-analyst': 'Threat models and controls'
    };
  }

  explainComponent(component, audience = 'age-5') {
    switch(component) {
      case 'mainframe':
        return this.explainMainframe(audience);
      case 'security':
        return this.explainSecurity(audience);
      case 'ai-gateway':
        return this.explainAIGateway(audience);
      // ... more components
    }
  }

  explainMainframe(audience) {
    const explanations = {
      'age-5': `
        Imagine you have a super special computer house! 🏠
        This house has different rooms:
        - A room where all the toys (containers) live
        - A guard room that keeps bad people away (security)
        - A smart robot room that answers questions (AI)
        All the rooms talk to each other through magic tunnels!
      `,
      'manager': `
        The mainframe is our self-hosted infrastructure platform providing:
        - 99.9%+ uptime for critical services
        - $X/month operational cost vs $Y cloud alternative
        - Complete data sovereignty and compliance control
        - Automated security monitoring and threat response
        ROI achieved through reduced cloud costs and enhanced security posture.
      `,
      'engineer': `
        Production-grade infrastructure stack:
        - Ubuntu 22.04 LTS host with Talos K8s cluster
        - Docker Compose primary orchestration + K8s for specialized workloads
        - Tailscale mesh networking with Headscale control plane
        - Comprehensive observability: Wazuh SIEM + custom monitoring
        - GitOps deployment patterns with IaC security scanning
      `
    };
    return explanations[audience] || explanations['age-5'];
  }
}

3. Interactive Infographics Framework

Using FerroxLabs infographic design principles:

# /prodg-mainframe/infographics/architecture-overview

## Visual Hierarchy Structure
Level 1: "ProDG Mainframe" (Main title)
Level 2: "Security • AI • Infrastructure" (Core pillars)
Level 3: Key metrics (99.9% uptime, 6 vetted components, $50/mo AI budget)
Level 4: Service descriptions
Level 5: Technical details and sources

## Infographic Types Implemented

### 1. System Architecture Diagram
**Type**: Hierarchical/Organizational
**Purpose**: Show component relationships and data flows
**Layout**: Three-tier architecture with connection arrows
**Color Palette**: 
- Primary: #2563eb (Blue - Infrastructure)
- Secondary: #dc2626 (Red - Security) 
- Accent: #16a34a (Green - AI/Automation)
- Neutral: #64748b (Gray - Supporting elements)

### 2. Security Posture Dashboard
**Type**: Data-driven with process elements
**Purpose**: Visualize security metrics and compliance status
**Contains**: 
- Compliance percentage (100% Checkov, 6/6 vetted software)
- Threat timeline (discovery to mitigation)
- Security stack coverage matrix

4. Three.js 3D Visualization System

Based on nimoqup046-collab Three.js fundamentals:

// /prodg-mainframe/visualization/3d-architecture.js
import * as THREE from 'three';

class MainframeViz {
  constructor(container) {
    this.scene = new THREE.Scene();
    this.camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
    this.renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });
    
    this.setupScene();
    this.createMainframeComponents();
    this.setupInteractivity();
  }

  setupScene() {
    // Environment setup
    this.scene.background = new THREE.Color(0x0f1419); // Dark theme
    this.scene.fog = new THREE.Fog(0x0f1419, 10, 100);
    
    // Lighting
    const ambientLight = new THREE.AmbientLight(0x404040, 0.4);
    this.scene.add(ambientLight);
    
    const directionalLight = new THREE.DirectionalLight(0xffffff, 0.8);
    directionalLight.position.set(10, 10, 5);
    directionalLight.castShadow = true;
    this.scene.add(directionalLight);
  }

  createMainframeComponents() {
    // Infrastructure layer (bottom tier)
    this.infraLayer = new THREE.Group();
    this.createInfrastructureNodes();
    this.scene.add(this.infraLayer);
    
    // Security layer (middle tier) 
    this.securityLayer = new THREE.Group();
    this.createSecurityComponents();
    this.securityLayer.position.y = 5;
    this.scene.add(this.securityLayer);
    
    // AI/Application layer (top tier)
    this.aiLayer = new THREE.Group();
    this.createAIComponents();
    this.aiLayer.position.y = 10;
    this.scene.add(this.aiLayer);
    
    // Connection visualization
    this.createDataFlows();
  }

  createInfrastructureNodes() {
    // Physical host
    const hostGeometry = new THREE.BoxGeometry(4, 1, 2);
    const hostMaterial = new THREE.MeshStandardMaterial({ 
      color: 0x2563eb,
      metalness: 0.3,
      roughness: 0.4
    });
    const hostMesh = new THREE.Mesh(hostGeometry, hostMaterial);
    hostMesh.userData = { 
      type: 'infrastructure',
      name: 'Ubuntu Host (65.109.89.215)',
      details: 'Hetzner VPS running Ubuntu 22.04 LTS'
    };
    this.infraLayer.add(hostMesh);
    
    // Kubernetes nodes
    const k8sGeometry = new THREE.CylinderGeometry(0.8, 0.8, 1.5, 8);
    const k8sMaterial = new THREE.MeshStandardMaterial({ color: 0x326ce5 });
    
    // Control plane
    const controlPlane = new THREE.Mesh(k8sGeometry, k8sMaterial);
    controlPlane.position.set(-3, 1.5, 0);
    controlPlane.userData = {
      type: 'kubernetes',
      name: 'Control Plane',
      details: '192.168.100.207 (trackc-node)'
    };
    this.infraLayer.add(controlPlane);
    
    // Worker node
    const worker = new THREE.Mesh(k8sGeometry, k8sMaterial);
    worker.position.set(3, 1.5, 0);
    worker.userData = {
      type: 'kubernetes', 
      name: 'Worker Node',
      details: '192.168.100.56 (convert-test)'
    };
    this.infraLayer.add(worker);
  }

  createSecurityComponents() {
    // OpenBao vault
    const vaultGeometry = new THREE.BoxGeometry(2, 2, 1);
    const vaultMaterial = new THREE.MeshStandardMaterial({ 
      color: 0xffd700,
      metalness: 0.8,
      roughness: 0.2
    });
    const vault = new THREE.Mesh(vaultGeometry, vaultMaterial);
    vault.position.set(-4, 0, 0);
    vault.userData = {
      type: 'security',
      name: 'OpenBao Vault',
      details: 'Secrets management with AppRole auth'
    };
    this.securityLayer.add(vault);
    
    // Wazuh SIEM
    const siemGeometry = new THREE.OctahedronGeometry(1.2);
    const siemMaterial = new THREE.MeshStandardMaterial({ 
      color: 0xdc2626,
      emissive: 0x330000
    });
    const siem = new THREE.Mesh(siemGeometry, siemMaterial);
    siem.position.set(0, 0, 0);
    siem.userData = {
      type: 'security',
      name: 'Wazuh SIEM', 
      details: 'Real-time security monitoring'
    };
    this.securityLayer.add(siem);
    
    // SOC Framework
    const socGeometry = new THREE.IcosahedronGeometry(1);
    const socMaterial = new THREE.MeshStandardMaterial({ 
      color: 0x16a34a,
      wireframe: true
    });
    const soc = new THREE.Mesh(socGeometry, socMaterial);
    soc.position.set(4, 0, 0);
    soc.userData = {
      type: 'security',
      name: 'SOC Framework',
      details: 'Supply chain security and threat intelligence'
    };
    this.securityLayer.add(soc);
  }

  createAIComponents() {
    // LiteLLM Gateway
    const gatewayGeometry = new THREE.SphereGeometry(1.5, 16, 8);
    const gatewayMaterial = new THREE.MeshStandardMaterial({ 
      color: 0x8b5cf6,
      emissive: 0x1a0033,
      emissiveIntensity: 0.2
    });
    const gateway = new THREE.Mesh(gatewayGeometry, gatewayMaterial);
    gateway.userData = {
      type: 'ai',
      name: 'LiteLLM Gateway',
      details: 'AI model routing with spend tracking'
    };
    this.aiLayer.add(gateway);
    
    // Hermes Agent
    const hermesGeometry = new THREE.TetrahedronGeometry(1.2);
    const hermesMaterial = new THREE.MeshStandardMaterial({ 
      color: 0x06b6d4,
      metalness: 0.6,
      roughness: 0.3
    });
    const hermes = new THREE.Mesh(hermesGeometry, hermesMaterial);
    hermes.position.set(3, 0, 0);
    hermes.userData = {
      type: 'ai',
      name: 'Hermes Agent',
      details: 'Autonomous infrastructure management'
    };
    this.aiLayer.add(hermes);
  }

  setupInteractivity() {
    // Raycasting for hover and click detection
    this.raycaster = new THREE.Raycaster();
    this.mouse = new THREE.Vector2();
    
    this.renderer.domElement.addEventListener('mousemove', (event) => {
      this.mouse.x = (event.clientX / window.innerWidth) * 2 - 1;
      this.mouse.y = -(event.clientY / window.innerHeight) * 2 + 1;
      this.handleMouseMove();
    });
    
    this.renderer.domElement.addEventListener('click', (event) => {
      this.handleClick();
    });
  }

  animate() {
    requestAnimationFrame(() => this.animate());
    
    // Gentle rotation animation
    this.scene.rotation.y += 0.005;
    
    // Pulsing effects for active components
    const time = Date.now() * 0.001;
    this.securityLayer.children.forEach(child => {
      if (child.material.emissive) {
        child.material.emissiveIntensity = 0.1 + Math.sin(time * 2) * 0.05;
      }
    });
    
    this.renderer.render(this.scene, this.camera);
  }
}

5. Self-Hosted Skills Library Framework

# /prodg-mainframe/skills-library

## Local Skills Registry Structure

/opt/prodg/skills-library/ ├── registry/ │ ├── skills.json # Master skill index │ ├── categories.json # Skill categorization │ └── metadata.json # Library metadata ├── skills/ │ ├── mainframe-ops/ # Infrastructure management skills │ ├── security-analysis/ # Security assessment skills
│ ├── ai-orchestration/ # AI workflow skills │ └── visualization/ # Interactive docs skills ├── templates/ │ ├── skill-template.md # Standard skill format │ ├── eli5-template.js # ELI5 explanation pattern │ └── infographic.svg # Visual template └── tools/ ├── skill-validator.py # Skill format validation ├── security-scanner.py # Security assessment └── registry-builder.py # Generate skill index

## Skills Library API
```python
# /opt/prodg/skills-library/api/skills_api.py
from flask import Flask, jsonify
from pathlib import Path
import json

app = Flask(__name__)
SKILLS_DIR = Path('/opt/prodg/skills-library')

@app.route('/api/skills')
def list_skills():
    """List all available skills with metadata"""
    registry = json.loads((SKILLS_DIR / 'registry/skills.json').read_text())
    return jsonify(registry)

@app.route('/api/skills/<skill_name>')
def get_skill(skill_name):
    """Get detailed skill information"""
    skill_path = SKILLS_DIR / 'skills' / skill_name / 'SKILL.md'
    if not skill_path.exists():
        return jsonify({'error': 'Skill not found'}), 404
    
    content = skill_path.read_text()
    return jsonify({
        'name': skill_name,
        'content': content,
        'type': 'mainframe-skill'
    })

@app.route('/api/explain/<component>')
def explain_component(component):
    """ELI5 explanation endpoint"""
    audience = request.args.get('audience', 'age-5')
    explainer = MainframeExplainer()
    explanation = explainer.explainComponent(component, audience)
    return jsonify({
        'component': component,
        'audience': audience,
        'explanation': explanation
    })

if __name__ == '__main__':
    app.run(host='127.0.0.1', port=5001)
### 6. Integration with Context7

```yaml
# Context7 Integration Configuration
mcp_servers:
  prodg_docs:
    url: "http://127.0.0.1:5001"
    description: "ProDG Mainframe documentation and skills library"
    tools:
      include: ["list_skills", "get_skill", "explain_component"]

Implementation Roadmap

Phase 1: Documentation Foundation (Completed ✅)

  • [x] Core architecture documentation structure
  • [x] Context7-compatible format design
  • [x] Interactive navigation framework design

Phase 2: Visual Components (Next)

  • [ ] ELI5 explanation system implementation
  • [ ] Interactive infographic generation
  • [ ] Three.js 3D architecture visualization
  • [ ] Skills library API deployment

Phase 3: Self-Hosted Deployment

  • [ ] Local skills registry setup
  • [ ] Security assessment integration
  • [ ] Context7 MCP server deployment
  • [ ] Interactive documentation portal

Phase 4: Advanced Features

  • [ ] Real-time system status integration
  • [ ] Interactive troubleshooting guides
  • [ ] Multi-level learning paths
  • [ ] Community skill contributions

Benefits

For Users

  • Progressive Learning: ELI5 system adapts explanations to user's level
  • Visual Understanding: 3D architecture helps grasp complex relationships
  • Interactive Exploration: Click through components for detailed information
  • Self-Service Documentation: Find answers without asking experts

For Operations

  • Knowledge Preservation: Systematic documentation of all components
  • Onboarding Acceleration: New team members understand system faster
  • Troubleshooting Efficiency: Visual debugging and guided problem-solving
  • Compliance Documentation: Structured evidence for audits

For Development

  • Skills Reusability: Modular knowledge components
  • Context7 Integration: AI agents can query documentation programmatically
  • Security-First: All skills vetted through SOC framework
  • Version Control: Git-based documentation with change tracking

This Context7 documentation framework transforms the ProDG mainframe from a complex technical system into an accessible, learnable, and maintainable platform through interactive visualization and adaptive explanation systems.