Ai Debugging
Documentation for Developers
🤖 AI Assistant - Development & Debugging Guidelines
Important guidelines for AI assistant when working with the development environment
🚫 DO NOT Run Serve Processes
Rule: Never Start New Dev Servers
❌ DO NOT run:
nx serve [app-name]ng servenpm startnpm run serveyarn start- Any command that starts a development server
✅ DO instead:
- Attach to existing terminals that are already running processes
- If restart needed: Kill the process and inform the user
pkill -f "nx serve gograb-space" # Kill existing # Then tell user: "Please restart: nx serve gograb-space" - Use existing dev servers running on known ports:
gograb-space→ Port 5200editor-web→ Port 5200docs-angular→ Port 5010
Why This Rule Exists
- ❌ AI gets stuck when running serve processes
- ❌ Multiple servers cause port conflicts
- ❌ User loses control of the development environment
- ✅ User manages servers more efficiently
- ✅ Prevents blocking and hanging
- ✅ Better resource management
🔧 Development Workflow
When Library Changes
Build the library:
yarn nx build [library-name]If dev server needs restart:
pkill -f "nx serve [app-name]" # Tell user: "Please restart the dev server"User restarts:
yarn nx serve [app-name] # User runs this
When Testing Changes
- Use browser tools to test
- Attach to existing terminals to see logs
- Use build commands only
- Let user manage serve processes
📊 Port Management
Known Development Ports
| App | Port | Command |
|---|---|---|
gograb-space |
5200 | nx serve gograb-space |
editor-web |
5200 | nx serve editor-web |
docs-angular |
5010 | nx serve docs-angular |
ux-test |
5300 | nx serve ux-test |
Process Management
To check running processes:
ps aux | grep "nx serve" | grep -v grep
To kill specific process:
pkill -f "nx serve [app-name]"
🎯 AI Assistant Guidelines
When Building Libraries
✅ DO:
yarn nx build flash-animations
yarn nx build core
yarn nx build shared-ui
When Changes Need Server Restart
✅ DO:
# Kill existing
pkill -f "nx serve gograb-space"
# Inform user
echo "Dev server killed. Please restart: yarn nx serve gograb-space"
❌ DON'T:
yarn nx serve gograb-space # Don't start new server!
When Testing
✅ DO:
- Use browser refresh
- Check console logs
- Build libraries
- Use linting tools
- Read terminal output
❌ DON'T:
- Start new dev servers
- Run background serve processes
- Take control of development environment
💡 Why This Approach Works
Benefits
- ✅ User Control - User maintains control of development environment
- ✅ No Blocking - AI doesn't get stuck on long-running processes
- ✅ Resource Efficient - No duplicate servers
- ✅ Faster Development - Focus on code changes, not process management
- ✅ Better Collaboration - Clear division of responsibilities
Division of Responsibilities
| Task | Who Handles |
|---|---|
| Code Changes | AI Assistant |
| Library Builds | AI Assistant |
| Documentation | AI Assistant |
| Serve Processes | User |
| Process Management | User |
| Environment Control | User |
🔍 Debugging Workflow
When Code Issues Arise
- AI: Make code changes
- AI: Build libraries if needed
- AI: Kill process if restart required
- User: Restart dev server
- AI: Help debug via browser/logs
When Libraries Need Updates
- AI: Update library code
- AI: Build library
- AI: Inform user if restart needed
- User: Restart affected apps
- AI: Verify changes work
📚 Quick Reference
AI Commands - Allowed
✅ yarn nx build [library]
✅ yarn nx lint [project]
✅ yarn nx test [project]
✅ pkill -f "process-name"
✅ ps aux | grep [process]
AI Commands - Forbidden
❌ nx serve [app]
❌ ng serve
❌ npm start
❌ yarn start
❌ any long-running server command
Status: ✅ Guidelines documented and memory updated!
Note: This ensures smooth, efficient development without AI getting stuck on process management.