This document provides guidelines for AI-assisted development on the Grok Zephyr project.
Grok Zephyr is a WebGPU-based orbital simulation for visualizing 1M+ satellites in real-time. The project is well-architected with:
- Modular TypeScript codebase with strict type checking
- GPU-accelerated compute shaders for orbital mechanics
- A 6-pass rendering pipeline with bloom and post-processing
- Multiple camera modes and interactive controls
- Always read files first before proposing modifications
- Keep changes focused - fix the reported issue without refactoring surrounding code
- Maintain the existing style - follow the established patterns in each module
- Test locally with
npm run devbefore committing - Type-check with
npm run type-checkto ensure correctness
- TypeScript: Use strict mode, prefer explicit types over
any - No premature optimization: Only optimize bottlenecks you've measured
- Simple solutions: Avoid over-engineering; prefer straightforward code
- Comments: Add comments only when logic isn't self-evident
- No feature creep: Don't add features beyond what's requested
npm run dev # Starts Vite dev server at http://localhost:5173npm run type-check # Verify TypeScript correctness before committingnpm run build # Creates optimized dist/ for deploymentLook for the PerformanceProfiler class in src/utils/ - it tracks FPS and GPU metrics.
- Entry Point:
src/main.ts - Core GPU Management:
src/core/WebGPUContext.ts,src/core/SatelliteGPUBuffer.ts - Rendering Pipeline:
src/render/RenderPipeline.ts - Camera System:
src/camera/CameraController.ts - Shaders:
src/shaders/*.wgsl(compute and fragment shaders) - Configuration:
src/types/constants.ts - UI Management:
src/ui/UIManager.ts
- Check existing modules - reuse code that's already there
- Follow the module structure - place code in appropriate directories (physics, render, ui, etc.)
- Add TypeScript interfaces to
src/types/index.tsif needed - Update ARCHITECTURE.md if the structure changes significantly
- Test with multiple view modes - ensure features work in all camera modes
- Satellite data is GPU-resident; minimize CPU-GPU transfers
- Compute shaders handle orbital propagation (fast)
- Rendering uses a 6-pass pipeline with LOD and culling
- The UI is optimized for real-time updates
- GPU Issues: Check browser console for WebGPU errors
- Performance: Use the built-in FPS counter in the UI
- Type Errors: Run
npm run type-checkbefore debugging runtime issues - Shader Problems: WebGPU shader compiler errors appear in the browser console
- Browser Support: Test in Chrome/Edge first, Firefox Nightly for experimental features
- Develop on assigned branches (typically
claude/*) - Commit messages should be clear and descriptive
- Push to the assigned branch with
git push -u origin <branch> - Keep commits focused on specific changes
- WGSL Shaders: See
src/shaders/for compute and rendering shader examples - WebGPU API: https://www.w3.org/TR/webgpu/
- Orbital Mechanics: satellite.js documentation in node_modules
- TypeScript: Strict mode by default; check
tsconfig.json
✅ Read the existing code before making changes ✅ Keep changes minimal and focused ✅ Run type-check and tests locally first ✅ Write clear commit messages ✅ Reference architecture documents when unsure ✅ Test in multiple browsers (Chrome/Edge preferred)
❌ Don't refactor unrelated code
❌ Don't add "nice-to-have" features not in the spec
❌ Don't commit without type-checking
❌ Don't assume GPU availability (fallback gracefully)
❌ Don't modify tsconfig.json without discussion
❌ Don't ignore TypeScript errors or use any types
- ARCHITECTURE.md - System design and module structure
- AGENTS.md - AI agent specifications
- SWARM_PROMPT.md - Multi-agent coordination
- package.json - Dependencies and build scripts
If you're unsure about something:
- Check the existing code for patterns
- Review ARCHITECTURE.md for high-level guidance
- Look at similar implementations in the codebase
- Check browser console for error messages
Happy coding! This is an exciting project with lots of room for interesting improvements. 🚀