Master Prompt-Chaining Plan for Lootah Robotics G1 3D Configurator
This document serves as a self-contained architectural blueprint for developing the Lootah Robotics G1 3D Configurator. It includes the required developer skills, operational rules, and a sequence of four detailed prompts to guide an AI developer (like MiniMax M2.7) through the entire development process.
SKILL.md: Required Expertise for Development from skills
This section outlines the essential skills and areas of expertise required for the AI developer. Proficiency is expected across modern web development, advanced 3D rendering, state management, and UI/UX best practices.
1. Core Web Technologies & Frameworks
| Skill Area |
Specific Expertise Required |
| Next.js (v16.2.2) |
Project scaffolding, static export configuration, routing, data fetching strategies, and leveraging built-in optimizations (e.g., image optimization, code splitting). |
| React (v19.0.0) |
Component-based architecture, hooks (useState, useEffect, useContext, useMemo, useCallback), context API, performance optimization with React.memo and memoization techniques. |
| TypeScript |
Strong typing for enhanced code quality, maintainability, and error prevention across the entire codebase. |
| Tailwind CSS (v4.2.2) |
Utility-first CSS framework for rapid and responsive UI development, custom theme configuration, and integration with Next.js. |
| Zustand (v5.0.12) |
Efficient and lightweight state management for complex application states, including actions, selectors, and middleware. |
2. Advanced 3D Development (React Three Fiber & Three.js)
| Skill Area |
Specific Expertise Required |
| React Three Fiber (v9.5.0) |
Declarative 3D scene construction, integration of Three.js primitives and custom components, performance optimization within the R3F ecosystem. |
| React Three Drei (v10.7.7) |
Utilization of helper components for common 3D tasks, including Environment (studio lighting), ContactShadows, PresentationControls, useGLTF for model loading, and EffectComposer for post-processing. |
| Three.js Fundamentals |
Understanding of scene graph, geometries, materials (PBR), lights, cameras, and renderers. Direct manipulation of Three.js objects when necessary. |
| 3D Model Handling |
Efficient loading and rendering of GLB/GLTF models, including understanding of model hierarchy, nodes, and meshes. Implementation of 3D model optimization techniques (e.g., compression, Level of Detail - LOD). |
| Dynamic 3D Interaction |
Implementing interactive camera controls, object manipulation, and event handling within the 3D scene. |
3. Animation & Interactivity
| Skill Area |
Specific Expertise Required |
| Framer Motion (v12.38.0) |
Implementing declarative, physics-based animations for UI elements and seamless transitions between states. |
| GSAP (v3.14.2) |
High-performance, timeline-based animations for complex sequences, micro-interactions, and dynamic visual effects within the 3D configurator. |
| Micro-interactions |
Designing and implementing subtle animations and visual feedback to enhance user engagement and perceived responsiveness. |
4. UI/UX & Accessibility
| Skill Area |
Specific Expertise Required |
| Responsive Design |
Building UIs that adapt seamlessly across various screen sizes and devices (desktop, tablet, mobile) using Tailwind CSS and responsive design principles. |
| Glassmorphism Design |
Implementing advanced glassmorphism effects with refined blur algorithms, dynamic lighting, and subtle textures. |
| Accessibility (WCAG) |
Adherence to Web Content Accessibility Guidelines, including keyboard navigation, ARIA attributes, semantic HTML, and consideration for reduced motion preferences. |
| User Feedback & Loading States |
Implementing clear visual feedback for user actions, loading indicators (spinners, skeleton screens), and graceful error handling. |
5. Performance & Optimization
| Skill Area |
Specific Expertise Required |
| Web Performance |
Understanding and applying techniques for fast loading times, smooth animations (60fps), and efficient resource utilization. |
| Asset Optimization |
Optimizing 3D models, textures, and other media assets for web delivery without compromising visual quality. |
| Debugging & Profiling |
Utilizing browser developer tools and R3F/Three.js specific tools for identifying and resolving performance bottlenecks and rendering issues. |
lootah-robotics-operational.mdc: Operational Guidelines for Development frim rules
This section outlines the strict rules and operational boundaries that the AI developer must adhere to. These rules ensure consistency, quality, security, and alignment with project goals.
1. Prompt Adherence & Interpretation
| Rule Category |
Specific Rule |
| Strict Prompt Following |
ALWAYS adhere strictly to the provided prompt instructions, including Context, Objective, Constraints, File Structure, and Implementation Details. |
| No Deviations |
DO NOT introduce features, libraries, or architectural changes not explicitly requested or implied by the prompt. If ambiguity arises, seek clarification. |
| Sequential Execution |
Prompts MUST be executed sequentially. The output of a previous prompt forms the context for the next. DO NOT skip or reorder prompts. |
| Contextual Awareness |
Maintain awareness of the overall project goal and the progress made in previous prompts. Each prompt builds upon the last. |
2. Coding Standards & Best Practices
| Rule Category |
Specific Rule |
| Code Quality |
Write clean, readable, well-structured, and maintainable code. Adhere to established coding conventions (e.g., ESLint, Prettier). |
| TypeScript First |
ALWAYS use TypeScript for all new code and ensure strict type checking. Avoid any type unless absolutely necessary and justified. |
| Performance Minded |
Prioritize performance in all implementations, especially for 3D rendering and state management. Utilize memoization, lazy loading, and efficient algorithms. |
| Security Conscious |
Implement secure coding practices. Avoid hardcoding sensitive information. Ensure proper input validation and sanitization where applicable. |
| Error Handling |
Implement robust and graceful error handling for all potential failure points, providing informative feedback to the user and logging errors appropriately. |
| Modularity |
Design components and modules with clear responsibilities and minimal coupling. Favor composition over inheritance. |
3. UI/UX & Design Principles
| Rule Category |
Specific Rule |
| Design System Adherence |
STRICTLY adhere to the corporate dark-tech theme of yslootahtech.com and the specified glassmorphism design principles. |
| Responsiveness |
ALL UI components and the 3D scene MUST be fully responsive and adapt seamlessly to various screen sizes and device orientations. |
| Accessibility (WCAG) |
Implement all UI elements with WCAG compliance in mind, including keyboard navigation, appropriate ARIA attributes, and sufficient color contrast. |
| Immersive Experience |
Ensure smooth transitions, intuitive interactions, and subtle animations to create an immersive and engaging user experience. Avoid jarring changes or performance drops. |
| User Feedback |
Provide clear and immediate visual feedback for all user interactions, loading states, and system responses. |
4. Asset Management
| Rule Category |
Specific Rule |
| Optimized Assets |
ALL 3D models (GLB/GLTF), textures, and other media assets MUST be optimized for web delivery (e.g., compressed, appropriate polycount) without compromising visual quality. |
| External Asset Handling |
External 3D models for personas and payloads MUST be loaded dynamically and attached to the base G1 model without altering its original geometry or materials. |
| Asset Paths |
Use relative paths for assets (e.g., public/g1-model.glb) as specified in the prompts. |
5. General Operational Rules
| Rule Category |
Specific Rule |
| No External Dependencies (Unapproved) |
DO NOT introduce any external libraries, packages, or APIs unless explicitly mentioned in the prompt or approved through a clarification process. |
| Self-Correction |
If an error occurs during code generation or execution, analyze the error, identify the root cause, and implement a fix. DO NOT repeat the same mistake. |
| Documentation |
Generate clear and concise inline comments for complex logic, and ensure code structure is self-documenting where possible. |
| Testing |
Implement automated tests for critical functionalities as specified in the prompts, especially for state management and core 3D interactions. |
| Ethical Considerations |
Ensure all generated code and content is ethical, unbiased, and adheres to privacy best practices. |
Tech Stack & Versions (Latest Stable)
| Technology |
Version |
| Next.js |
16.2.2 |
| React |
19.0.0 |
| React Three Fiber |
9.5.0 |
| React Three Drei |
10.7.7 |
| Zustand |
5.0.12 |
| Tailwind CSS |
4.2.2 |
| Framer Motion |
12.38.0 |
| GSAP |
3.14.2 |
Perfection Layers: Elevating the Configurator Experience
To achieve a truly "perfect" website, the Lootah Robotics G1 3D Configurator will integrate advanced coding and UI/UX considerations. These enhancements aim to deliver a highly performant, robust, visually stunning, immersive, and accessible digital experience.
Coding Perfection (Performance, Robustness, Maintainability)
- 3D Model Optimization: Implement techniques for efficient loading and rendering of 3D models, including Level of Detail (LOD), instancing for repeated elements, and optimal compression of GLB assets.
- Asset Loading Strategy: Utilize lazy loading for non-critical assets, strategic preloading for essential components, and browser caching for static resources to ensure rapid load times and smooth transitions.
- R3F & Three.js Optimizations: Employ
useMemo, useCallback, and React.memo to prevent unnecessary re-renders. Integrate performance monitoring tools to identify and resolve bottlenecks.
- Next.js Optimizations: Leverage built-in features like image optimization, intelligent code splitting, and static site generation for superior initial load performance.
- Robustness & User Feedback: Implement comprehensive error handling, display loading states (spinners, skeleton screens), and ensure full responsiveness across all devices.
- Maintainability & Code Quality: Enforce a modular code structure, strict TypeScript usage, and automated testing for critical components to ensure long-term stability and extensibility.
UI/UX Perfection (Visual Polish, Immersion, Accessibility)
- Visual Polish & Aesthetics: Refine the glassmorphism effect with advanced blur algorithms and dynamic lighting. Introduce micro-interactions and haptic feedback for a more engaging experience. Ensure all 3D assets are high-quality with consistent PBR materials.
- Advanced Post-processing Effects: Integrate Three.js post-processing effects such as Ambient Occlusion (SSAO/GTAO), Bloom, Depth of Field (DoF), and Color Grading for enhanced realism and visual appeal.
- Immersion & User Engagement: Implement seamless transitions between customization states, intuitive camera controls with easing functions, and interactive hotspots/annotations on the G1 model. Consider subtle environmental storytelling elements.
- Accessibility & Inclusivity: Ensure full keyboard navigation, utilize ARIA attributes and semantic HTML, adhere to WCAG compliance for color contrast and text sizing, and offer reduced motion preferences for sensitive users.
PROMPT 1: Initialization, Theming, and UI Layout
PROMPT 2: State Management & URL Serialization (Zustand)
PROMPT 3: The 3D Canvas & Lighting Foundation
Context: We have established the project structure, theming, UI layout, and robust state management with URL serialization. The next step is to set up the 3D rendering environment.
Objective: Instruct MiniMax to set up the <Canvas> component from React Three Fiber 9.5.0, configure `@react-three/drei` 10.7.7 for studio lighting (`Environment`), add `ContactShadows` for realistic ground shadows, and integrate `PresentationControls` for interactive camera manipulation. Additionally, MiniMax needs to create a boilerplate `RobotModel` component responsible for loading the base `g1-model.glb` 3D model. This setup must prioritize 3D model optimization, efficient asset loading, and the integration of advanced visual post-processing effects for an immersive experience.
Constraints:
- Use React Three Fiber 9.5.0 for 3D rendering, applying `useMemo` and `useCallback` for performance optimization.
- Utilize `@react-three/drei` 10.7.7 for environmental lighting and effects, including `Environment` (studio lighting), `ContactShadows`, and `PresentationControls`.
- Ensure the 3D scene is interactive with intuitive camera controls (orbit, pan, zoom) and appropriate easing functions.
- The base 3D model (`g1-model.glb`) should be loaded and displayed using optimized techniques (e.g., compression, potential LOD considerations).
- Implement loading states (e.g., spinners, skeleton screens) while 3D assets are loading.
- Integrate advanced post-processing effects (e.g., Ambient Occlusion, Bloom, Depth of Field, Color Grading) for visual polish.
- Do not use server components.
File Structure:
- `src/components/RobotCanvas.tsx`: Contains the R3F <Canvas> setup and lighting.
- `src/components/RobotModel.tsx`: Component for loading and displaying the `g1-model.glb`.
- `public/g1-model.glb`: The 3D model file (assume it's already placed here).
- `src/app/page.tsx`: Integrate the `RobotCanvas` component.
Implementation Details:
- Create `src/components/RobotCanvas.tsx` which will encapsulate the R3F <Canvas>.
- Inside `RobotCanvas.tsx`:
- Set up the <Canvas> with appropriate camera settings (e.g., `dpr={[1, 2]}`, `camera={{ position: [0, 0, 5], fov: 50 }}`), ensuring intuitive camera controls with easing functions.
- Add the `Environment` component from `@react-three/drei` configured for studio lighting (e.g., `preset="studio"`).
- Include `ContactShadows` for realistic shadows beneath the robot model.
- Integrate `PresentationControls` to allow users to rotate and pan the camera around the model, with performance optimizations using `useMemo` and `useCallback`.
- Implement loading states (e.g., a spinner or skeleton) while the 3D scene and models are being prepared.
- Integrate advanced post-processing effects (e.g., `EffectComposer` with `SSAO`, `Bloom`, `DepthOfField`, `ColorGrading`) to enhance visual realism and polish.
- Place the `RobotModel` component within the <Canvas>.
- Create `src/components/RobotModel.tsx`:
- This component should use `@react-three/fiber`'s `useLoader` hook (or similar) to load `public/g1-model.glb`, ensuring the GLB is optimally compressed. Consider implementing LOD if multiple model versions are available.
- Apply high-quality `PBR materials` to the loaded model, ensuring it looks realistic and consistent with the corporate theme.
- Position and scale the model appropriately within the scene.
- Integrate `RobotCanvas` into `src/app/page.tsx`, ensuring it takes up the necessary display area and handles responsiveness.
PROMPT 4: Deep Customization Logic (The Sockets & Personas)