This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
localFirstTools is a collection of self-contained HTML applications following a "local-first" philosophy. Each HTML file is a complete application with inline CSS and JavaScript, requiring no build process or external dependencies. The project includes 100+ interactive tools, games, and creative applications accessible through a gallery launcher.
- Self-Contained HTML Files: Every application is a single HTML file with all CSS and JavaScript inline. Never split these into separate files.
- No External Dependencies: Applications must work offline. Do not add CDN links or npm packages.
- Gallery System: The index.html serves as a launcher that reads from vibe_gallery_config.json for application discovery.
- Auto-Discovery: Python scripts automatically scan HTML files and extract metadata for categorization.
- Flat File Structure: Currently, all HTML applications reside in the root directory (not in subdirectories).
# Primary method - extracts metadata and regenerates config
python3 vibe_gallery_updater.py
# (Symlinked from scripts/gallery/vibe_gallery_updater.py)
# Watch mode - automatically updates when HTML files change
python3 scripts/gallery/vibe_gallery_watcher.py
# Run watcher once and exit (quick update)
python3 scripts/gallery/vibe_gallery_watcher.py --once
# Quick shell wrapper (runs updater)
./update-gallery.sh
# (Symlinked from scripts/shell/update-gallery.sh)
# Legacy updater (still works with data/config/utility_apps_config.json)
python3 archive/app-store-updater.py# Move HTML files from root to category folders
python3 scripts/gallery/vibe_gallery_organizer.py
# Preview what would be moved (dry run)
python3 scripts/gallery/vibe_gallery_organizer.py --dry-runpython3 update-tools-manifest.py
# (Symlinked from scripts/gallery/update-tools-manifest.py)# Check color contrast in HTML files
python3 scripts/maintenance/color_contrast_check.py
# Apply accessibility patches to HTML files
python3 scripts/maintenance/accessibility_patch.pycd edgeAddons/xbox-mkb-extension
./create-xbox-mkb-extension.shpython3 -m http.server 8000
# Access at http://localhost:8000The gallery organizes applications into thematic categories:
- visual_art - Interactive visual experiences and design tools
- 3d_immersive - Three-dimensional and WebGL experiences
- audio_music - Sound synthesis and music creation tools
- games_puzzles - Interactive games and playful experiences
- experimental_ai - AI-powered interfaces and cutting-edge demos
- creative_tools - Productivity and creative utilities
- generative_art - Algorithmic art generation systems
- particle_physics - Physics simulations and particle systems
- educational_tools - Learning resources and tutorials
- Create self-contained HTML file in root directory
- Include proper
<title>and<meta name="description">tags - Test the application in multiple browsers
- Run
python3 vibe_gallery_updater.pyto regenerate configs - Verify the app appears correctly in index.html gallery
For active development, use the watcher to automatically update configs:
python3 vibe_gallery_watcher.pyThis watches for file changes and automatically regenerates the gallery config.
- Edit the HTML file directly
- Test changes in browser
- Run updater or watcher to update gallery configs
- Commit changes to git
- HTML Structure: Each application should be a complete, valid HTML document with proper DOCTYPE and meta tags
- Responsive Design: Applications should work on desktop and mobile devices
- Local Storage: Use browser localStorage for persistence, never external databases
- Data Import/Export: Every application should include JSON import/export functionality for data portability
- Error Handling: Applications should gracefully handle offline scenarios and missing data
- Performance: Keep file sizes reasonable since all code is inline
- Metadata Tags: Include descriptive comments in HTML for auto-categorization (e.g., )
- Accessibility: Ensure proper ARIA labels, keyboard navigation, and color contrast ratios (use accessibility_patch.py)
Testing is done manually in the browser. When modifying applications:
- Test in multiple browsers (Chrome, Firefox, Edge)
- Test offline functionality
- Test on mobile devices
- Verify local storage persistence
- Test JSON import/export functionality
localFirstTools/
├── index.html # Main gallery launcher (DO NOT MODIFY LOCATION)
├── vibe_gallery_config.json # Primary auto-generated app registry
├── tools-manifest.json # Simple tool listing with metadata
├── README.md # Project documentation
├── CLAUDE.md # AI assistant instructions
├── [152 HTML applications] # Self-contained apps in root directory
│
├── docs/ # All documentation (organized by type)
│ ├── wowmon/ # WowMon game design docs (60 files)
│ ├── agent/ # Agent strategy reports (12 files)
│ ├── accessibility/ # Accessibility guides and reports (6 files)
│ ├── architecture/ # System architecture documentation (2 files)
│ ├── implementation/ # Implementation guides (5 files)
│ ├── game-design/ # Game design documents (7 files)
│ ├── tutorials/ # Quick references and tutorials (8 files)
│ ├── reports/ # Analysis and optimization reports (3 files)
│ └── misc/ # Miscellaneous documentation (5 files)
│
├── scripts/ # All automation scripts (organized by purpose)
│ ├── gallery/ # Gallery maintenance scripts (5 files)
│ │ ├── vibe_gallery_updater.py # Main gallery config updater
│ │ ├── vibe_gallery_watcher.py # Auto-updates on file changes
│ │ ├── vibe_gallery_organizer.py # Moves HTML to category folders
│ │ ├── update_gallery.py # Alternative updater
│ │ └── update-tools-manifest.py # Updates tools manifest
│ │
│ ├── maintenance/ # Utility and maintenance scripts (4 files)
│ │ ├── accessibility_patch.py # Apply accessibility fixes
│ │ ├── color_contrast_check.py # Check color contrast
│ │ ├── compressor.py # Compress HTML files
│ │ └── flatten-to-root.py # Move files to root
│ │
│ └── shell/ # Shell scripts (2 files)
│ ├── update-gallery.sh # Quick gallery update wrapper
│ └── update-and-organize-gallery.sh
│
├── Symlinks (Backward Compatibility) # Root-level symlinks to scripts
│ ├── vibe_gallery_updater.py -> scripts/gallery/vibe_gallery_updater.py
│ ├── update-tools-manifest.py -> scripts/gallery/update-tools-manifest.py
│ └── update-gallery.sh -> scripts/shell/update-gallery.sh
│
├── archive/ # Legacy scripts and archived versions
├── edgeAddons/
│ └── xbox-mkb-extension/ # Xbox controller browser support
├── data/
│ ├── config/
│ │ └── utility_apps_config.json # Legacy app registry
│ └── games/ # Game-specific data files
└── notes/ # Development notes and experiments
- index.html: Main gallery launcher with 3D gallery mode and Xbox controller support (must remain in root)
- vibe_gallery_config.json: Primary application registry with metadata (auto-generated)
- scripts/gallery/vibe_gallery_updater.py: Main script for updating gallery configuration (symlinked to root)
- scripts/gallery/vibe_gallery_watcher.py: Auto-updates config when HTML files change
- scripts/gallery/vibe_gallery_organizer.py: Moves HTML files into category folders
- tools-manifest.json: Simple manifest of all HTML tools
- data/config/utility_apps_config.json: Legacy registry (still functional)
All documentation has been organized into docs/ subdirectories:
- docs/wowmon/: 60+ WowMon game design documents (endgame, narrative, casual player advocacy, etc.)
- docs/agent/: 12 agent strategy and design reports
- docs/accessibility/: 6 accessibility guides, reports, and code examples
- docs/architecture/: System architecture and design documentation
- docs/implementation/: Implementation guides and integration documentation
- docs/game-design/: Game redesigns (roguelike, metroidvania, action RPG, etc.)
- docs/tutorials/: Quick references, tutorials, and quickstart guides
- docs/reports/: Performance reports, optimization recommendations, and analysis
- docs/misc/: Other documentation (UIRenderer docs, build ideas, etc.)
All scripts have been organized into scripts/ subdirectories:
- scripts/gallery/: Gallery maintenance and configuration scripts
- scripts/maintenance/: Accessibility, compression, and utility scripts
- scripts/shell/: Shell wrapper scripts
Symlinks in the root directory maintain compatibility with existing workflows:
vibe_gallery_updater.py→scripts/gallery/vibe_gallery_updater.pyupdate-tools-manifest.py→scripts/gallery/update-tools-manifest.pyupdate-gallery.sh→scripts/shell/update-gallery.sh
This means existing commands continue to work exactly as before.
- Application files:
descriptive-name.html(lowercase with hyphens) - Configuration files:
*_config.json - Shell scripts:
purpose-description.sh - Python scripts:
purpose_description.py
The vibe_gallery_updater.py script automatically extracts metadata from HTML files:
- Title: From
<title>tags or filename - Description: From meta description tag or auto-generated
- Tags: Technical features detected (3D, canvas, SVG, animation, etc.)
- Complexity: simple/intermediate/advanced (based on file size and features)
- Interaction Type: game/drawing/visual/interactive/audio/interface
- Category: Auto-assigned based on content analysis
Applications are automatically categorized into one of 9 categories based on:
- Keywords in file path (e.g., "games", "ai", "media")
- Technical features detected (e.g., WebGL → 3d_immersive)
- Content analysis (e.g., "particle" keyword → particle_physics)
- Interaction patterns (e.g., click/drag/touch → interactive)
- vibe_gallery_config.json (root): Primary config with full metadata and categorization
- tools-manifest.json (root): Simple listing of all HTML files with basic metadata
- data/config/utility_apps_config.json: Legacy config (still functional)
When you modify HTML files, run the updater to regenerate these configs automatically.
The index.html includes an immersive 3D gallery experience powered by Three.js:
- Keyboard Controls: WASD for movement, mouse for looking around
- Xbox Controller Support: Left stick for movement, right stick for camera, A button to open tools
- Mobile Support: Touch gestures and virtual joystick for movement
- Interactive Artwork Display: Tools displayed as 3D "paintings" in a virtual gallery
- Main Gallery: Default view showing all active applications
- Archive: View for older/deprecated applications
- 3D Experience: Immersive walkthrough gallery with controller support
- Search: Filter tools by title, description, or filename
- Pin Tools: Pin favorite tools to the top of the gallery
- Vote System: Users can vote for feature requests (stored in localStorage)
- Download: Save individual HTML files locally