Overview
WikiPrepareViewer displays planning documentation in a structured, project-based format. The “prepare” phase represents work between ideation (OnIt) and verification (Prove), focusing on detailed planning before implementation.Architecture
Dual Mode System:- Project Mode (preferred): Folder-based with README.md manifest
- Document Mode (legacy): Flat files with timestamp naming
Data Models
PrepareProject (Modern)
Structure:- Folder-based organization
- README.md as project manifest
- Multiple files per project
- Status from frontmatter
- Progress from checkbox counting
PrepareDocument (Legacy)
Structure:- Flat file structure
- Timestamp-based naming
- Single file per document
- Analysis type inference
Status System
Four Project States:| Status | Color | Meaning |
|---|---|---|
| Ready | Green | Planning complete, ready to implement |
| In Progress | Blue | Planning ongoing |
| Blocked | Red | Cannot proceed, needs resolution |
| Completed | Gray | Implementation done, for reference |
- Priority 1: Explicit frontmatter in README.md
- Priority 2: Content keywords (blocked, completed, in progress)
- Priority 3: Default to “ready”
Progress Tracking
Automatic checkbox counting in README.md: Example:- Unchecked:
- [ ] - Checked:
- [x]or- [X](case-insensitive)
[2/4 50%] in project card header.
Rendering Modes
Project Mode (Preferred)
Card-based UI:- Expandable project cards
- File list within each project
- Status badges with progress indicators
- First project auto-expanded
Document Mode (Legacy)
Type-grouped list:- Code: Blue dot, code analysis docs
- Design: Purple dot, design/architecture docs
- Dependency: Orange dot, integration docs
- General: Gray dot, other planning docs
Navigation
Three Click Targets:- WIP/Wiki Toggle: Switch data source (wip ↔ wiki)
- Project Card Headers: Expand/collapse file list
- File Accordion Headers: Load document content inline
- File accordion clicks use
stopPropagation()to prevent card toggle - Critical for nested click handlers (files inside cards)
- Project headers stick during content scroll
- Calculated position accounts for viewer header height
State Management
State Properties:- If
projects.length > 0→ Project mode - Else if
documents.length > 0→ Document mode - Else → Empty state
Comparison with OnIt
| Feature | OnIt | Prepare |
|---|---|---|
| Lines of code | 350 | 789 |
| Data arrays | 1 (sessions) | 2 (projects, documents) |
| File structure | Flat only | Folders + flat |
| Status states | 3 | 4 (projects) + 2 (docs) |
| Progress tracking | No | Yes (checkboxes) |
| Frontmatter parsing | No | Yes |
| Display modes | 1 (list) | 2 (cards + list) |
| Render methods | 7 | 12 |
| Filename patterns | 6 | 1 |
Workflow Integration
OnIt → Prepare Transition:-
OnIt Phase: Document work in session files
-
Prepare Phase: Crystallize into structured project
-
Graduate: Move to wiki when planning complete
THE CENTER
Structure emerges from planning
Technical Credibility
Uses YAML frontmatter parsing for status. Regex-based checkbox counting. Dual data model supports gradual migration. Extends WikiBaseViewer for shared infrastructure. Implements SMPC principle: complexity only where needed.