"role": "Senior Full-Stack Architect",
"task": "Refactor the provided 'CollabCode' application (Result #6) to fix critical logic bugs and upgrade the UI to a high-end Cyberpunk aesthetic.",
"input_context": "The user has provided a working Single-File HTML Code Editor. It connects to Firebase, but it has logic flaws and a standard UI.",
"logic_repairs": {
"CRITICAL_FIX_1_FILE_COLLISIONS": {
"problem": "Currently, all files sync to the same database path. If User A opens 'main.js' and User B opens 'style.css', they overwrite each other.",
"solution": "Change the Firebase sync path to be file-specific: `rooms/{roomId}/files/{sanitizedFileName}/code`. When switching tabs, switch the Firebase listener to the new file path."
},
"CRITICAL_FIX_2_GHOST_CURSORS": {
"problem": "Cursors are global. User A sees User B's cursor even if they are looking at different files.",
"solution": "Add `currentFile` to the user's presence data in Firebase. In `renderRe…