# Mia Platform — Comprehensive LLM Reference > The Mia Platform is a unified creative development workspace that consumes mia-code-server (a VSCode fork with 71 rispecs), Miadi (a Next.js 16 narrative platform with 107 MCP tools, A2A messaging, three-universe agent architecture, and ceremony-grounded workflows), Tushell (Redis KV knowledge layer with cluster search), and the Medicine Wheel framework (Four Directions ontology in 7 TypeScript packages) — presenting them as a single web experience with chat, editor, and preview panes, enabling storytelling, book creation, image generation, scene development, TV series writing, and recursive platform innovation through circular development. Published at https://docs.workspace.jgwill.com. **Version:** 0.1.0 **Framework:** RISE v1.2 (Reverse-engineer → Intent-extract → Specify → Export) **Published at:** https://docs.workspace.jgwill.com --- ## PART I: PLATFORM ARCHITECTURE ### 1. Web Shell Architecture The Mia Platform wraps three mature systems into a unified web UI: ``` mia-platform (web shell) ├── consumes: mia-code-server (iframe embed) │ └── 71 rispecs at repos/miadisabelle/mia-code-server/rispecs/ ├── inherits from: Miadi (narrative APIs, A2A, MCP, medicine-wheel) │ └── /a/src/Miadi/ ├── inherits from: Tushell (Redis KV, content rendering, cluster search) │ └── repos/jgwill/tushellplatform/ ├── integrates: medicine-wheel MCP tools │ └── lib/medicine-wheel/ └── integrates: smcraft state machine engine └── repos/jgwill/smcraft/rispecs/ ``` **Key principle**: mia-code-server does NOT know about the web shell. The web shell consumes it. Same for Miadi and Tushell — they are source material, not aware of this consumer. #### 1.1 Three-Pane Layout ``` ┌─────────────────────────────────────────────────────────────────┐ │ Top Bar: Project selector + companion avatar + settings │ ├──────────────┬──────────────────────┬───────────────────────────┤ │ Left Pane │ Center Pane │ Right Pane │ │ Companion │ mia-code-server │ Preview Sandbox │ │ Chat │ (iframe embed) │ (port proxy + iframe) │ │ │ │ │ │ - AI chat │ - Full IDE │ - Hot reload │ │ - History │ - Extensions │ - Story preview │ │ - Version │ - Terminal │ - Scene render │ │ control │ - File tree │ - Image generation │ ├──────────────┴──────────────────────┴───────────────────────────┤ │ Status Bar: Session status + ceremony phase + STC indicator │ └─────────────────────────────────────────────────────────────────┘ ``` #### 1.2 Companion Chat Protocol ```typescript interface CompanionMessage { role: 'user' | 'companion' | 'system'; content: string; companion?: 'mia' | 'miette' | 'ava' | 'tushell'; universe?: 'engineer' | 'ceremony' | 'story_engine'; version?: number; timestamp: string; } ``` Messages pass through Three-Universe processing: 1. Engineer (Mia): Technical precision, implementation details 2. Ceremony (Ava): Relational accountability, Indigenous paradigm 3. Story Engine (Miette): Narrative coherence, emotional architecture #### 1.3 Code-Server Bridge ```typescript // iframe postMessage API interface CodeServerBridge { openFile(path: string): void; getActiveFile(): string; onFileChanged(callback: (path: string, content: string) => void): void; executeCommand(command: string): Promise; syncWorkspace(projectId: string): void; } ``` #### 1.4 Project Workspace Binding Each chat conversation binds to a `.code-workspace` file, tracking: - Spiral phase (germination → assimilation → completion) - Structural tension (desired outcome vs current reality) - Active story beats and ceremony phase --- ## PART II: SUB-PROJECTS ### 2. Miadi — Narrative Platform See [Miadi llms-full.txt](https://docs.miadi.jgwill.com/llms-full.txt) for comprehensive reference. **Summary**: Next.js 16, 40+ routes, 45+ API endpoints, 107 MCP tools across 17 categories, A2A messaging, Redis-backed spiral memory, GitHub webhook ETL, three-universe agent architecture, miadi-code terminal agent with PDE. ### Key Integration Points ```typescript // Workspace consumes Miadi APIs const miadiClient = { stc: '/api/stc/*', // Structural Tension Charts pde: '/api/pde/*', // Prompt Decomposition memory: '/api/memory/*', // Key-value storage github: '/api/github/*', // Webhook processing mcp: '/api/mcp/*', // MCP server endpoints sessions: '/api/sessions/*' // Session management }; ``` ### 3. PDE-MCP — Prompt Decomposition Engine See [PDE-MCP llms.txt](/a/src/mcp-pde/llms.txt) for full reference. **5 MCP Tools**: ```typescript // Step 1: Build prompt pde_decompose({ prompt: string, options?: DecompositionOptions }) → { systemPrompt: string, userMessage: string } // Step 2: Parse + store pde_parse_response({ llm_response: string, original_prompt: string }) → StoredDecomposition { id, timestamp, result, markdownPath } // Retrieval pde_get({ id: string }) → StoredDecomposition pde_list({ limit?: number }) → PdeSummary[] pde_export_markdown({ id: string }) → string ``` **DecompositionResult Schema**: ```typescript interface DecompositionResult { primary: { action: string, target: string, urgency: Urgency, confidence: number }; secondary: SecondaryIntent[]; context: { files_needed: string[], tools_required: string[], assumptions: string[] }; outputs: { artifacts: string[], updates: string[], communications: string[] }; directions: Record; actionStack: ActionItem[]; ambiguities: AmbiguityFlag[]; } ``` ### 4. Medicine Wheel — Four Directions Ontology See [Medicine Wheel llms.txt](https://docs.medicine-wheel.jgwill.com/llms.txt) for full reference. **7 TypeScript Packages**: - `ontology-core`: Types, Zod schemas, RDF vocabulary, semantic queries - `ceremony-protocol`: Ceremony state, phase transitions, governance - `narrative-engine`: Beat sequencing, cadence, arc validation, cycle management - `graph-viz`: Circular layout, SVG paths, data converters, React visualization - `relational-query`: Query builder, traversal, accountability audit, Cypher - `prompt-decomposition`: Intent extraction, Four Directions classification, relational enrichment - `ui-components`: React components (DirectionCard, BeatTimeline, NodeInspector, OcapBadge, WilsonMeter) ### 5. mia-code-server — VSCode Fork 71 rispecs across 9 modules. Product identity: nameShort "Mia Code", applicationName "mia-code", dataFolderName ".mia-code", urlProtocol "mia-code". Uses Open VSX gallery with 5 Mia-specific extensions in extensionAllowedProposedApi. **8 Built-in Extensions**: theme-mia, mia-three-universe (core), mia-stc-charts, mia-story-monitor, mia-agent-panel, mia-terminal, mia-editor-intelligence, mia-chat-participant. Core exports MiaAPI. --- ## PART III: KNOWLEDGE BASE ### 6. Creative Orientation Framework Published at https://llms.jgwill.com — 40+ guidance documents covering: ### Foundations - **Creative Orientation**: Generative creation vs reactive problem-solving (Robert Fritz) - **Structural Tension**: Desired outcome vs current reality → dynamic force seeking resolution - **Structural Tension Charts**: Visual representation — NOT a gap to bridge, but disequilibrium driving advancement - **Delayed Resolution**: Hold tension rather than premature resolution ### Methodology - **RISE Framework**: Reverse-engineer → Intent-extract → Specify → Export - **Four Directions**: East (Vision) → South (Analysis) → West (Validation) → North (Action) - **MMOT**: Managerial Moment of Truth — 4-step discrepancy → learning process - **SCCP Patterning**: Macrostructural pattern identification (Fritz's Structural Dynamics) ### Implementation - **PDE**: Prompt decomposition with implicit intent extraction and Four Directions mapping - **Narrative Beats**: Story documentation across Engineer/Ceremony/Story Engine universes - **Kinship Hub**: Software projects as beings in networks of relations - **Medicine Wheel Packages**: Indigenous relational ontology as first-class code structures --- ## PART IV: MCP TOOL ECOSYSTEM ### 7. MCP Structural Thinking 6 tools for real-time structural thinking analysis: ```typescript structural_thinking_observe(text) → StructuralObservation (patterns, questions, vague terms) ask_structural_question(text, type?) → TypedQuestion[] (information/clarification/implication/discrepancy) detect_reactive_patterns(text) → { reactive_score, patterns, reframing_suggestions } formulate_structural_tension(desired, current) → StructuralTensionFormulation identify_creative_process_phase(text) → { phase, indicators, next_phase_guidance } three_universe_analysis(text) → { engineer, ceremony, story_engine, coherence_score } ``` ### 8. PDE + Structural-Thinking Integration The PDE framework and structural-thinking MCP form a complete prompt analysis pipeline: ``` Complex Prompt → PDE: pde_decompose → LLM → pde_parse_response → DecompositionResult (primary, secondary, context, outputs, directions, actionStack, ambiguities) → Structural-Thinking: structural_thinking_observe → Vague terms, missed context, information gaps → Structural-Thinking: detect_reactive_patterns → Reactive score, problem-solving language flagged → Structural-Thinking: three_universe_analysis → Engineer/Ceremony/Story Engine cross-validation → Validated Decomposition → .pde/.md (git-diffable, human-editable) → Redis (cross-session partner access) → Partner notification (review activation) ``` **Future**: Server-level automation at Miadi — see [PDE+ST Automation rispec](https://docs.miadi.jgwill.com/rispecs/miadi-code-pde/pde-structural-thinking-automation.rispec.md) ### Skill Pair: rise-pde-session + pde-review-companion ``` Phase 0: Initial Assessment (read input, form mental model) Phase 1: Decompose (pde_decompose × 2, commit .pde/) Phase 2: SLEEP 720s (12 min — human edits .pde/*.md) Phase 3: Wake & Revise (git diff .pde/, apply human edits) Phase 4: Execute (incremental implementation, commit as you go) ``` --- ## PART V: CROSS-CUTTING CONCERNS ### 9. URL Reference Map | Project | URL | Notes | |---------|-----|-------| | Workspace Platform | https://docs.workspace.jgwill.com | This document | | Miadi | https://docs.miadi.jgwill.com | Replaces miadidocs.jgwill.com | | Medicine Wheel | https://docs.medicine-wheel.jgwill.com | Package documentation | | Knowledge Base | https://llms.jgwill.com | 40+ guidance documents | | Storytelling | https://storytelling.jgwill.com | WillWrite narrative generation | ### 10. Specification Methodology All specs follow: - **RISE Framework** v1.2 — Creative Orientation, Structural Tension, Advancing Patterns - **SpecLang Syntax** — Behavior/Styling/Layout sections, backtick cross-references - **Codebase Agnosticism** — Each spec implementable without access to source repos - **Three-Universe Lens** — Every component through Engineer/Ceremony/Story perspectives - **Circular Development** — East (vision) → South (growth) → West (reflection) → North (integration) ### 11. Development Quick Start ```bash # Workspace cd /workspace && cat CLAUDE.md # Miadi cd /a/src/Miadi && pnpm dev # Port 3335 # Medicine Wheel cd lib/medicine-wheel && npm run build # mcp-pde cd /a/src/mcp-pde && npm run build ``` --- ## Related - [Miadi llms.txt](https://docs.miadi.jgwill.com/llms.txt) - [Miadi llms-full.txt](https://docs.miadi.jgwill.com/llms-full.txt) - [PDE-MCP llms.txt](/a/src/mcp-pde/llms.txt) - [Medicine Wheel llms.txt](https://docs.medicine-wheel.jgwill.com/llms.txt) - [Medicine Wheel llms-full.txt](https://docs.medicine-wheel.jgwill.com/llms-full.txt) - [Creative Orientation Framework](https://llms.jgwill.com) - [Storytelling](https://storytelling.jgwill.com/llms.txt)