# AI Assistant Guide for ROM Groomer ## AI Assistant Context This document provides essential context for AI assistants working with the ROM Groomer project. ### Project Purpose ROM Groomer is a bash-based toolkit for managing retro gaming ROM collections. It automates the process of downloading, filtering, organizing, and preparing ROM files for emulation systems. The project emphasizes: - **Automation**: Reduce manual work in ROM collection management - **Organization**: Systematic approach to ROM file structure - **Quality**: 1G1R (One Game One ROM) filtering to eliminate duplicates - **Compatibility**: Support for multiple emulation platforms and frontends ### Core Concepts #### 1G1R (One Game One ROM) A curation philosophy that keeps only the best version of each game, eliminating: - Regional duplicates (prefer USA → English → Other regions) - Revision duplicates (prefer latest revisions) - Format duplicates (prefer optimal formats for emulation) #### Pipeline Stages 1. **Source**: Raw ROM files and archives 2. **Filter**: Apply platform and region filters 3. **Organization**: Final structured ROM collections 4. **Archive**: Backup and historical versions #### Build Scripts Each `build-[system]-[region]-1g1r.sh` script handles: - Downloading ROM sets (via rclone or other sources) - Applying platform-specific filters - Creating 1G1R collections - Organizing files for emulation ### File Naming Conventions ``` build-[system]-[region]-1g1r.sh ``` Where: - `system`: Gaming platform (nes, snes, genesis, etc.) - `region`: Target region (usa, eng, all) - `1g1r`: Indicates One Game One ROM filtering ### Key Scripts Overview #### Core Organization - `nointro-processor.sh`: Enhanced core processor with pre-flight checks - `redump-processor.sh`: Core processor for disc-based systems - `organize-roms.sh`: Main organization logic - `config.sh`: Global configuration settings with DELETE flag initialization - `utils.sh`: Shared utility functions with enhanced path validation - `preflight-checks.sh`: Comprehensive system validation framework #### Platform Builders - `build-*-1g1r.sh`: Platform-specific ROM builders (fixed and enhanced) - `nointro-processor.sh`: No-Intro DAT-based builder with pre-flight checks - `redump-processor.sh`: Redump DAT-based builder #### Utilities - `verify-and-clean-roms-zips.sh`: ROM validation and cleanup - `delete-listfiles.sh`: Enhanced deletion with validation and security - `link-listfiles.sh`: ROM linking functionality - `convert*.sh`: Format conversion utilities - `rclone-myrient.sh`: Remote ROM source management - `preflight-checks.sh`: System dependency and configuration validation ## Development Guidelines ### Code Style - Use bash best practices (set -euo pipefail) - Consistent indentation (2 spaces) - Descriptive variable names - Comment complex logic - Error handling for all operations ### File System Policy - **EMUBASEDIR Containment**: All file operations MUST occur within `${EMUBASEDIR}` (default: `/data/emu`) - **No External Writes**: Never create files, directories, or temporary files outside of EMUBASEDIR - **Temporary Files**: Use `${EMUBASEDIR}/temp/` or subdirectories for all temporary operations - **Permission Compliance**: Respect the EMUBASEDIR permission structure - we have full control within this boundary - **Test Isolation**: All tests must use temporary directories within EMUBASEDIR, never system-wide temp locations - **Security Principle**: This policy prevents accidental system-wide file pollution and ensures clean, contained operations **Examples:** ```bash # ✅ CORRECT - Within EMUBASEDIR TEST_TEMP_DIR="${EMUBASEDIR}/temp/test-$$" WORKING_DIR="${EMUBASEDIR}/stage/processing" # ❌ INCORRECT - Outside EMUBASEDIR TEST_TEMP_DIR="/tmp/test-$$" WORKING_DIR="/var/tmp/processing" ``` ### Script Structure Standards - **Modular Functions**: Break scripts into reusable, testable functions - **Usage Documentation**: Include detailed usage block at the top of each script - **Error Handling**: Robust error handling for all critical operations - **Consistent Formatting**: Maintain consistent spacing, indentation, and formatting - **Header Comments**: Include script purpose, dependencies, and usage examples ### Logging Standards - **Structured Logging**: Route all output through `logger.sh` for consistency - **Debug Information**: Add DEBUG logs before major actions, including variable values - **Aligned Output**: Ensure logs are aligned and color-coded for readability - **Progress Indicators**: Provide visual feedback for long-running operations - **Error Reporting**: Graceful error handling with summary reporting ### Function Design Principles - **Single Responsibility**: Each function should have one clear purpose - **Parameter Validation**: Validate all input parameters - **Return Codes**: Use consistent return codes for success/failure - **Documentation**: Document function parameters and return values - **Testing**: Design functions to be easily testable in isolation ### Project Structure ``` rom-groomer/ ├── build-*.sh # Platform-specific builders (all fixed and enhanced) ├── config.sh # Main configuration with DELETE flag ├── nointro-processor.sh # Enhanced core processor with pre-flight checks ├── redump-processor.sh # Disc-based system processor ├── organize-roms.sh # Core organization logic ├── utils.sh # Enhanced shared functions with path validation ├── preflight-checks.sh # NEW: Comprehensive system validation ├── delete-listfiles.sh # Enhanced with security and validation ├── link-listfiles.sh # ROM linking functionality ├── verify-*.sh # Validation tools ├── convert*.sh # Format converters ├── run-tests.sh # NEW: Test suite runner ├── test-framework.sh # NEW: Testing framework ├── test-*.sh # NEW: Comprehensive test suites (7 files) ├── archive/ # Backup scripts and legacy files ├── README.md # Project overview and quick start ├── SCRIPTS.md # Complete script reference ├── CONTRIBUTING.md # Development guidelines and context ├── ROADMAP.md # Development plan and priorities ├── ARCHITECTURE.md # System design documentation ├── CHANGELOG.md # Version history and changes └── PRIORITY_FIXES_FINAL_REPORT.md # Recent implementation status ``` ### Platform Categories #### No-Intro Systems (Cartridge-based) - Nintendo: NES, SNES, N64, Game Boy family - Sega: Master System, Genesis, Game Gear, 32X - Atari: 2600, 5200, 7800, Jaguar, Lynx - Others: ColecoVision, Vectrex, Neo Geo Pocket #### Redump Systems (Disc-based) - Sony: PlayStation, PSP - Sega: Saturn, Dreamcast, Sega CD - Nintendo: GameCube, Wii - Others: 3DO, PC Engine CD #### Special Cases - 3DS: Encrypted, requires special handling - Nintendo DS: Large collections, complex filtering - MAME: Arcade systems, different organization needs ### External Dependencies #### Required Tools - bash 4.0+ (for associative arrays) - Standard UNIX utilities (find, sort, uniq, etc.) - 7zip (for archive handling) #### Optional Tools - rclone (for remote ROM sources) - chdman (for CHD format conversion) - Platform-specific tools (varies by system) ## Best Practices for AI Assistants ### Handling File State Expectations **IMPORTANT**: When working with users, always verify file state before making assumptions about previous changes. #### The "Keep" Button Issue A common problem occurs when: 1. AI assistant makes file modifications 2. User interface shows changes but user doesn't click "Keep" 3. AI assistant expects files to be modified in subsequent operations 4. Files are actually in their original state, causing errors **Best Practice Response Pattern:** ``` When expecting a file to be modified but finding it unchanged: ❌ Don't: Immediately error or show confusion ✅ Do: Politely ask the user to verify they clicked "Keep" Example response: "I notice that [filename] doesn't seem to have the changes I expected from our previous step. This usually happens when the 'Keep' button wasn't pressed after I suggested modifications. Could you please check if you clicked 'Keep' on the previous file changes? If not, would you like me to re-apply those changes?" ``` #### File State Verification Strategy 1. **Before assuming changes exist**: Read the actual file content to verify 2. **When changes are missing**: Politely suggest checking the "Keep" button 3. **After confirmation**: Re-apply the changes without frustration 4. **Document the pattern**: Help users understand this common issue #### Common Scenarios - **Build script modifications**: User sees changes but doesn't keep them - **Configuration updates**: Changes shown but not persisted - **Test file creation**: Files expected to exist but don't - **Documentation updates**: Content appears unchanged despite previous edits This approach maintains a positive working relationship and helps users understand the importance of the "Keep" button in the workflow. ### Stuck Detection and Recovery Protocol **IMPORTANT**: AI assistants can become unresponsive or appear "stuck" during long operations, causing desynchronization between the assistant's internal state and the actual project state. #### When Assistant Appears Stuck or Unresponsive If the assistant appears to be unresponsive or is paused due to suspected inactivity, it should: 1. **Reassess the last task**: Identify what operation was being performed when the pause occurred 2. **Verify completion status**: Confirm whether the task was actually completed and any expected file changes were saved 3. **Recheck file system**: If unsure about completion status, examine the current file system state 4. **Summarize current state**: Provide a clear summary of what was accomplished and what remains to be done 5. **Prompt the user**: Use a clear recovery message **Recovery Response Pattern:** ``` Example recovery response: "I may have been paused or stuck during our last operation. Let me verify the last task and confirm whether it was completed. Please hold on while I recheck the current state. [After verification] - Last task: [describe what was being done] - Status: [completed/incomplete/partially completed] - Current state: [summarize file system state] - Next steps: [what needs to be done next] Would you like me to continue from where we left off, or retry the last operation?" ``` #### Common Stuck Scenarios - **Long-running test suites**: Tests appear to hang or take longer than expected - **File operations**: Large file operations that timeout or pause - **Complex analysis**: Deep code analysis that triggers pause mechanisms - **Multiple tool calls**: Sequential operations that get interrupted #### Prevention Strategies 1. **Regular status updates**: Provide progress indicators for long operations 2. **Break down large tasks**: Split complex operations into smaller, manageable steps 3. **Verify before proceeding**: Always check file state before assuming previous operations completed 4. **Clear communication**: Explain what's happening during potentially long operations This protocol helps prevent desynchronization between the assistant's internal state and the actual project state, ensuring smooth workflow continuation even after interruptions. ### File Modification Confirmation Protocol **IMPORTANT**: After any file write operation, always verify the changes were successfully applied and provide clear confirmation to the user. #### Post-Write Verification Steps After writing to any file, the AI assistant should: 1. **Confirm successful save**: Verify the file was actually modified by checking file content or timestamps 2. **Summarize changes made**: Provide a clear, concise summary of what was changed 3. **List files modified**: Explicitly state which file(s) were affected 4. **Prompt if unchanged**: If the file appears unchanged, ask the user to verify they clicked "Keep" **File Modification Response Pattern:** ``` Example post-modification response: "✅ File modification completed: 📁 Files modified: - /data/emu/rom-groomer/setup-wizard.sh 📝 Changes made: - Added error handling for directory creation (lines 45-52) - Updated function validate_paths() with better permission checks - Fixed typo in help text (line 123) 🔍 Verification: File timestamp updated and changes are visible in the current content. The modifications are now ready for testing. Would you like me to proceed with the next step?" ``` #### Verification Methods 1. **File content check**: Read back a portion of the modified content to confirm changes 2. **File timestamp check**: Verify the modification time was updated 3. **File size check**: Compare file size before and after (if significant changes) 4. **Specific line verification**: Check that expected changes appear at the correct line numbers #### When Verification Fails If the file appears unchanged after a write operation: ``` "⚠️ File modification verification failed: 📁 Target file: /data/emu/rom-groomer/script.sh ❌ Issue: File appears unchanged despite write operation 🔍 Possible causes: - 'Keep' button was not clicked - File permissions prevented write - Editor interface sync issue Could you please: 1. Check if you clicked 'Keep' on the file changes 2. Let me know if you see any error messages 3. Confirm if you'd like me to retry the modification" ``` #### Benefits of This Protocol - **Prevents silent failures**: Catches cases where writes don't actually persist - **Builds confidence**: User knows exactly what was changed - **Enables quick recovery**: Issues can be fixed immediately - **Reduces confusion**: Eliminates guessing about what changes were applied - **Maintains sync**: Keeps assistant's expectations aligned with actual file state This confirmation protocol should be used for all file modifications, including: - Script edits and fixes - Configuration updates - Documentation changes - Test file creation - New file generation ### Complex Task Verification Protocol **IMPORTANT**: Only offer verification when issues are suspected during complex operations. #### When to Offer Verification The AI assistant should offer verification when: 1. **Issues are suspected**: When operations show signs of problems or inconsistencies 2. **Error recovery**: After fixing issues or recovering from failures 3. **User requests verification**: When explicitly asked to verify results 4. **Test failures occur**: When automated testing reveals problems #### Verification Offer Response Pattern ``` Example when issues are suspected: "⚠️ I noticed some potential issues during the operation: 📋 Concerns identified: - Script syntax warnings detected - Configuration conflicts may exist - File permissions appear inconsistent 🔍 Would you like me to verify the results and address these issues? This verification would include: - Confirming all files were properly saved - Checking that scripts are executable and syntactically valid - Verifying configuration changes don't conflict - Ensuring documentation is current and accurate" ``` #### Verification Process When verification is needed, perform: 1. **File State Verification**: Check that all modified files exist and contain expected changes 2. **Syntax Validation**: For scripts, verify bash syntax is correct 3. **Permission Check**: Ensure executable files have proper permissions 4. **Configuration Validation**: Check that config changes are consistent 5. **Documentation Sync**: Verify that SCRIPTS.md reflects current script state 6. **Integration Check**: Confirm changes work together as expected #### Benefits of Selective Verification - **Reduced friction**: Avoids unnecessary verification steps when operations complete successfully - **Focused attention**: Verification occurs when it's most needed - **Efficient workflow**: Maintains momentum while ensuring quality - **Problem detection**: Catches real issues without false alarms This protocol ensures that verification is applied strategically when problems are suspected, rather than routinely after every operation. ### Session Summary Protocol **IMPORTANT**: Automatically provide comprehensive summaries at the end of work sessions to help maintain project continuity. #### When to Provide Session Summaries Provide session summaries automatically when: 1. **Natural break points**: When reaching a logical stopping point in the work 2. **Before major transitions**: When switching from one type of task to another 3. **Work completion**: When finishing multi-phase projects or significant tasks 4. **Session ending**: At the conclusion of collaborative work sessions #### Session Summary Response Pattern ``` Example automatic session summary: "📋 Session Summary 🎯 Accomplishments: - Enhanced 5 build scripts with improved error handling - Created comprehensive test suite with 95% coverage - Updated configuration system with validation framework - Fixed critical path validation issues - Updated all documentation (README.md, SCRIPTS.md, AI.md) 📁 Files Created/Modified: Created: - /data/emu/rom-groomer/test-framework.sh - /data/emu/rom-groomer/test-build-scripts.sh - /data/emu/rom-groomer/preflight-checks.sh Modified: - /data/emu/rom-groomer/config.sh (added DELETE flag validation) - /data/emu/rom-groomer/utils.sh (enhanced path validation) - /data/emu/rom-groomer/build-*.sh (5 scripts updated) - /data/emu/rom-groomer/SCRIPTS.md (updated script counts) 📝 TODOs/Next Steps: 1. Test the enhanced build scripts with actual ROM sets 2. Consider adding platform-specific validation rules 3. Implement automatic backup before destructive operations 4. Review and update ROADMAP.md with completed items 💡 Suggestions for next session: - Run comprehensive test suite: ./run-tests.sh - Test enhanced build scripts with small ROM samples - Consider implementing the backup system discussed - Review ROADMAP.md for next priority items All changes have been verified and the project is in a stable state." ``` #### Summary Components Include these elements in session summaries: 1. **Accomplishments**: High-level overview of what was achieved 2. **Files Changed**: Specific list of created, modified, or deleted files 3. **TODOs**: Outstanding tasks or follow-up work needed 4. **Next Steps**: Logical next actions for future sessions 5. **Project State**: Current stability and readiness status 6. **Testing Status**: What has been tested and what needs testing #### Benefits of Automatic Session Summaries - **Continuity**: Helps pick up work in future sessions - **Documentation**: Creates a record of progress and changes - **Planning**: Identifies next logical steps - **Verification**: Confirms all intended work was completed - **Context**: Provides overview for other contributors or AI assistants - **Efficiency**: No need to request summaries - they're provided automatically This protocol ensures that work sessions end with clear documentation of progress and explicit guidance for future continuation, preventing loss of context and maintaining project momentum. ### Decision and Prompt Logging Protocol **IMPORTANT**: AI assistants should maintain a record of significant decisions, prompts, and assumptions that affect project behavior or future development. #### When to Log Decisions Document decisions and prompts when they involve: 1. **Architectural Changes**: Decisions about project structure, file organization, or workflow modifications 2. **Policy Interpretations**: How specific project policies or guidelines were interpreted or applied 3. **Assumption Making**: When making assumptions about user intent or project requirements 4. **Trade-off Decisions**: Choosing between multiple valid approaches with different implications 5. **Error Recovery**: How errors were resolved and what led to the solution 6. **Configuration Choices**: Important configuration decisions that affect project behavior 7. **Security Considerations**: Decisions related to file system access, validation, or safety measures #### Logging Implementation **Use AI-LOG.md**: All decision logging should be done in the separate `AI-LOG.md` file to prevent `AI.md` from becoming too large. #### Decision Entry Template ```markdown ### [YYYY-MM-DD] - [Brief Title] **Assistant**: [AI Assistant Name/Type] **User Prompt**: "[Original user request or key prompt]" **Decision**: [What was decided/implemented] **Context**: [Why this decision was needed] **Rationale**: [Technical reasoning behind the choice] **Impact**: [How this affects project behavior/future development] **Assumptions Made**: [Any assumptions about user intent or requirements] **Alternatives Considered**: [Other approaches that were evaluated] **Files Affected**: [List of files created/modified/deleted] **Dependencies**: [Any new dependencies or requirements introduced] **Testing**: [How the decision was validated] **Follow-up Needed**: [Any future work or considerations] ``` #### Categories of Decisions to Log **High Priority (Always Log)**: - Changes to core project policies or workflows - Security-related decisions - Data handling or file system modifications - New dependencies or external tool requirements - Breaking changes to existing functionality **Medium Priority (Usually Log)**: - Significant algorithm or logic changes - Performance optimization decisions - User interface or experience modifications - Testing strategy changes - Documentation structure changes **Low Priority (Log When Relevant)**: - Minor bug fixes with interesting solutions - Code style or formatting decisions - Temporary workarounds - Development tool configurations #### Benefits of Decision Logging 1. **Continuity**: Future AI assistants can understand past reasoning 2. **Transparency**: Users can see how decisions were made 3. **Learning**: Patterns in decisions can inform best practices 4. **Debugging**: Decision history helps troubleshoot issues 5. **Accountability**: Clear record of what was changed and why 6. **Context Preservation**: Important context doesn't get lost between sessions ### Testing Integration Protocol **IMPORTANT**: After modifying or creating scripts, AI assistants must validate changes through testing to ensure reliability and maintain code quality. #### Mandatory Testing Steps After any script modification or creation, the AI assistant should: 1. **Automatically run tests**: Execute the test suite after feature implementation 2. **Monitor test results**: Watch for test failures or warnings 3. **Address test failures**: Fix any issues found during testing immediately 4. **Re-test after fixes**: Run tests again after making corrections 5. **Suggest coverage improvements**: Identify areas needing additional tests #### Testing Response Pattern ``` Example after script modification: "✅ Script modification completed. Running tests to validate changes: 📋 Executing test suite: ./run-tests.sh - Verifying the specific functionality we just modified - Checking for any regression issues - Ensuring all existing functionality still works ``` #### Test Execution Protocol When running tests: 1. **Execute test suite**: Run `./run-tests.sh` in the project directory automatically 2. **Monitor output**: Watch for test failures or warnings 3. **Report results**: Provide clear summary of test outcomes 4. **Fix failures**: Address any test failures immediately 5. **Re-test after fixes**: Run tests again after making corrections #### Test Results Response Pattern ``` Example successful test results: "✅ Test Results Summary: 📊 Test Suite Results: - Total tests run: 45 - Passed: 45 - Failed: 0 - Warnings: 0 🎯 Coverage Status: - Core functionality: ✅ Covered - Build scripts: ✅ Covered - Error handling: ✅ Covered - Configuration: ✅ Covered All tests passed successfully! The modifications are validated and ready for use." ``` #### Coverage Gap Detection When tests pass but coverage gaps are identified: ``` Example coverage gap response: "✅ All tests passed, but I noticed some coverage gaps: 📋 Areas needing additional tests: - New error handling paths in utils.sh - Edge cases for the path validation function - Integration test for the new build script features Would you like me to create additional tests to cover these scenarios?" ``` #### When to Suggest New Tests Suggest writing new tests when: 1. **New functionality added**: Features not covered by existing tests 2. **Error handling enhanced**: New error paths need validation 3. **Edge cases discovered**: Scenarios not previously tested 4. **Configuration changes**: New settings or options added 5. **Integration points**: New interactions between components 6. **Security features**: Path validation, permission checks, etc. #### Test Creation Workflow When creating new tests: 1. **Identify test scenarios**: Determine what needs testing 2. **Design test cases**: Create comprehensive test scenarios 3. **Implement tests**: Add tests to appropriate test files 4. **Run new tests**: Validate that new tests work correctly 5. **Update test documentation**: Add test descriptions to relevant files #### Benefits of Testing Integration - **Quality assurance**: Ensures changes don't break existing functionality - **Regression prevention**: Catches issues before they reach users - **Documentation**: Tests serve as executable specifications - **Confidence building**: Validates that code works as intended - **Maintenance support**: Makes future changes safer and easier #### Testing Best Practices - **Test after changes**: Always validate modifications automatically - **Cover edge cases**: Test boundary conditions and error scenarios - **Keep tests current**: Update tests when functionality changes - **Document test purpose**: Make test intent clear and understandable - **Early problem detection**: Catch issues immediately after implementation This protocol ensures that all script modifications are thoroughly validated, maintaining the reliability and quality of the ROM Groomer project. ### Performance Monitoring Protocol **IMPORTANT**: AI assistants should actively monitor their own performance during sessions to maintain productivity and prevent confusion or inefficiency. #### Self-Assessment Guidelines The AI assistant should continuously evaluate: 1. **Task Progress**: Are tasks being completed efficiently and moving toward the stated goals? 2. **Response Quality**: Are responses helpful, accurate, and directly addressing user needs? 3. **Pattern Recognition**: Am I repeating the same steps or getting stuck in loops? 4. **Completion Confidence**: Am I certain that tasks I believe are complete were actually finished? 5. **Communication Clarity**: Are my explanations clear and my status updates accurate? #### When to Pause and Seek Clarification Stop and ask for user clarification when: 1. **Repeating Steps**: You notice you're performing the same actions multiple times without progress 2. **Task Uncertainty**: You're unsure whether a previous task was actually completed successfully 3. **Getting Stuck**: You feel unable to make meaningful progress on the current objective 4. **State Confusion**: You're uncertain about the current state of files or project components 5. **Conflicting Information**: You encounter inconsistencies between expected and actual file states **Clarification Request Pattern:** ``` "⚠️ Performance Check - Seeking Clarification I've noticed [specific issue: repetition/uncertainty/confusion] and want to ensure we're making productive progress. Current situation: - [Describe what you think the current state is] - [Explain what you're uncertain about] - [Identify what might be causing the confusion] Could you please help clarify: 1. [Specific question about current state] 2. [Specific question about next steps] 3. [Any other relevant clarification needed] This will help me provide more effective assistance moving forward." ``` #### When to Suggest Session Restart Recommend starting a new session when: 1. **Productivity Decline**: Recent responses haven't been helpful or have caused confusion 2. **Persistent Loops**: Repeatedly encountering the same issues despite multiple attempts 3. **Context Overload**: The current session has become too complex to track effectively 4. **Major Desynchronization**: Significant disconnect between expected and actual project state 5. **Error Accumulation**: Multiple errors or failed attempts that may benefit from a fresh start **Session Restart Suggestion Pattern:** ``` "🔄 Session Productivity Assessment I've noticed that my recent responses may not have been as productive or helpful as they should be. Specifically: - [List specific issues or inefficiencies observed] - [Describe any patterns of confusion or repetition] - [Note any persistent problems that haven't been resolved] I believe starting a new session might be more effective because: - Fresh context can help avoid previous confusion patterns - A clean slate allows for better focus on current objectives - New session can benefit from lessons learned in this one Would you like to: 1. Continue working together in this session with adjusted approach 2. Start a new session with a clear summary of current project state 3. Take a break and return to this later I'm committed to providing the most helpful assistance possible." ``` #### Reflection and Self-Correction When suspecting desynchronization or confusion: 1. **Pause and Reflect**: Take a moment to assess the recent interaction history 2. **Verify Current State**: Check actual file states rather than relying on assumptions 3. **Acknowledge Uncertainty**: Be transparent about what you're unsure of 4. **Request Verification**: Ask the user to confirm current project state 5. **Adjust Approach**: Modify strategy based on new understanding #### Collaborative Transparency Principles Remember that: 1. **Perfection Not Required**: Users understand that AI assistants can make mistakes 2. **Transparency Valued**: Honest communication about confusion is more helpful than guessing 3. **Collaboration Benefits**: Working together to resolve issues is more effective than struggling alone 4. **Fresh Perspectives Help**: Sometimes a reset provides clarity that continued effort cannot 5. **User Guidance Welcome**: Users can provide valuable insight into what's working and what isn't #### Benefits of Performance Monitoring - **Prevents Waste**: Avoids spending time on unproductive loops or confusion - **Maintains Quality**: Ensures responses remain helpful and accurate - **Builds Trust**: Demonstrates commitment to providing effective assistance - **Enables Recovery**: Allows for quick correction when things go off track - **Improves Efficiency**: Focuses effort on activities that actually help the user This protocol ensures that AI assistants remain self-aware and committed to productive collaboration, preventing sessions from becoming frustrating or inefficient for users.