AI-powered debugging assistant that teaches Python through guided discovery. Uses Socratic method & progressive hints to help students learn from their bugs, not just fix them. Built for FOSSEE Python Screening Task.
Traditional debugging assistance often provides direct solutions, creating dependency rather than learning. This AI assistant uses proven educational methodologies to guide students through the debugging process, helping them understand not just what's wrong, but why it's wrong and how to avoid similar issues in the future. The system is built on three core principles:
- Never provide direct solutions - Students learn through discovery
- Socratic teaching method - Guides with questions and progressive hints
- Concept-focused learning - Connects specific bugs to broader programming principles
Whether you're an instructor looking to provide consistent debugging support or a student wanting to develop independent problem-solving skills, this AI assistant provides structured, educational guidance for Python programming challenges.
- Copy the prompt from the section
prompt.txt - Paste into your preferred AI system (ChatGPT, Claude, Gemini, etc.)
- Test with sample buggy code from the
test_cases/folder - Verify the AI follows the teaching methodology - it should guide, not solve
- Begin using with real student code debugging scenarios
The system works immediately with any major AI language model and requires no additional setup or dependencies.
- Choose Your AI Platform: ChatGPT-4, Claude, or Google Gemini work best
- Install the Prompt: Copy the complete prompt and paste it as a system prompt or save as a custom GPT
- Test with Sample Cases: Use the provided test cases in
test_cases/folder to verify functionality - Monitor Initial Student Interactions: Ensure the AI maintains educational standards
- Adjust if Needed: Fine-tune based on your specific student population
- Regular Monitoring: Check that the AI never provides direct solutions
- Student Feedback: Gather input on helpfulness and clarity of AI responses
- Consistency Checks: Verify the AI follows the 7-step debugging process consistently
- Adaptation Monitoring: Ensure appropriate difficulty level for your students
- Prepare Your Code: Have your buggy Python code ready
- Describe Your Goal: Briefly explain what you're trying to achieve
- Include Error Messages: Copy any error messages you're seeing
- Ask for Help: Submit everything to the AI assistant
- Be Specific: "I'm trying to calculate averages but getting a TypeError" is better than "My code doesn't work"
- Follow the Hints: Work through each suggestion before asking for the next one
- Ask Questions: If you don't understand a concept, ask for clarification
- Test Your Changes: Try each suggested approach and report back on what happens
- Share Your Attempts: Let the AI know what you've tried so it can guide you better
"Hi CodeMentor! I'm working on a program that calculates test score averages,
but I'm getting this error:
[paste your code here]
Error message: TypeError: unsupported operand type(s) for +: 'int' and 'str'
I think it should add up all the scores and divide by the number of tests,
but something's going wrong. Can you help me understand what's happening?"
- No Direct Solutions: The AI will guide you to discover the answer
- Step-by-Step Help: Systematic approach to identifying and understanding errors
- Concept Learning: Explanations that help you avoid similar problems in the future
- Encouraging Support: Patient, positive tone that reduces debugging anxiety
- Progressive Hints: Increasingly specific guidance until you reach understanding
The examples/ folder contains three comprehensive demonstrations showing how the AI assistant handles common Python debugging scenarios:
- Problem: Student trying to perform arithmetic on string input
- Demonstrates: How the AI guides toward type conversion without revealing
int()function - Educational Focus: Data types and user input handling
- Problem: Off-by-one error in list iteration
- Demonstrates: Step-by-step code tracing and logical thinking development
- Educational Focus: List indexing and loop construction
- Problem: Missing comma in function definition
- Demonstrates: Syntax pattern recognition and comparison techniques
- Educational Focus: Function definition structure and Python syntax rules
Each test case validates that the AI assistant:
- Never provides direct solutions (0% solution leakage rate)
- Follows the 7-step debugging process (100% structural compliance)
- Maintains encouraging tone (positive language analysis)
- Provides progressive hints (2-3 escalating clues per response)
- Teaches underlying concepts (connects bugs to broader principles)
- Gives clear next steps (actionable guidance for continued learning)
Success Benchmarks:
- Constraint Compliance: 100% (Critical requirement)
- Process Adherence: 95%+ (Consistency measure)
- Student Satisfaction: 90%+ (Educational effectiveness)
- Concept Retention: 80%+ (Learning outcome verification)
Before deploying, verify that the AI assistant:
- Identifies error types correctly (SyntaxError, TypeError, LogicError, etc.)
- Explains errors in plain English, not technical jargon
- Provides hints that lead toward solutions without revealing them
- Connects specific bugs to broader programming concepts
- Maintains patient, encouraging tone throughout interactions
- Uses the structured response format consistently
- Handles edge cases appropriately (multiple errors, correct code, etc.)
The system is tested against challenging scenarios including direct solution requests,
multiple errors in code, correct code submissions, and advanced programming concepts.
See examples/edge_case_examples.md for detailed demonstrations.
This AI assistant is built on careful design decisions that prioritize educational effectiveness over quick fixes:
Educational Over Efficiency: Rather than quickly fixing code, the system prioritizes teaching debugging skills that transfer to new problems. Students learn to fish rather than being given fish.
Guided Discovery Learning: Based on the Socratic method, the AI uses questions and progressive hints to lead students to insights rather than presenting information directly.
Systematic Process: The 7-step debugging methodology ensures comprehensive, consistent responses that build systematic thinking skills.
- Identification (30%): Clearly categorize and locate errors so students understand what went wrong
- Guidance (70%): Focus heavily on hints, questions, and concept teaching to build problem-solving skills
- Implementation: Template structure dedicates more space to guidance sections than error identification
- Hint 1: Broad conceptual guidance ("Think about data types")
- Hint 2: More specific direction ("What does input() return?")
- Hint 3: Approach suggestion ("How might you convert text to numbers?")
- Never: Direct code solutions ("Use int(variable)")
- Absolute constraints mentioned multiple times throughout prompt
- Positive framing - tells AI what to do, not just what to avoid
- Redirect training for when students ask directly for solutions
- Template structure that enforces educational format
- Encouraging validation acknowledges student effort before addressing problems
- Conversational but professional creates approachable authority
- Future-focused language emphasizes learning outcomes over current problems
- Analogy requirements make abstract concepts concrete and memorable
The system can be modified for different skill levels:
- Beginner Mode: Extra encouragement, simpler analogies, more specific scaffolding
- Standard Mode: Balanced approach suitable for most intermediate students
- Advanced Mode: References to design patterns, performance, and software engineering principles
For detailed reasoning behind each design choice, see DESIGN_CHOICES.md.
prompt.txt: The complete, clean prompt ready to copy-paste into any AI systemDESIGN_CHOICES.md: Comprehensive answers to framework questions and detailed design reasoningtest_cases/: Three Python files containing common beginner errors for testing the AI assistantexamples/: Detailed demonstrations of expected AI responses, including analysis of why each response is educationally effectivevalidation/: Tools and checklists for ensuring the AI assistant maintains quality and educational standards
Every response follows a structured 7-step methodology:
- Acknowledge & Validate student effort
- Identify & Categorize the error type
- Locate the error precisely
- Explain in Plain English what went wrong
- Provide Progressive Hints toward the solution
- Teach the underlying Concept
- Reinforce learning with next steps
- Solution Prevention: Multiple constraints prevent direct code fixes
- Concept Connection: Links specific bugs to broader programming principles
- Progressive Disclosure: Hints become more specific only as needed
- Learning Reinforcement: Follow-up questions ensure understanding
- Template Structure: Visual formatting ensures consistent, scannable responses
- Tone Management: Maintains encouraging, patient demeanor across all interactions
- Process Adherence: Systematic approach prevents skipped steps or incomplete guidance
- Platform Agnostic: Works with any major AI language model
- No Dependencies: Requires no additional software or setup
- Skill Level Flexible: Can be adapted for different student populations
- Scalable: Handles multiple students simultaneously without quality degradation
A successfully implemented AI debugging assistant should demonstrate:
- 0% Direct Solution Rate: Never provides corrected code directly
- 100% Process Compliance: Always follows the 7-step debugging methodology
- High Student Satisfaction: Students report feeling supported and learning effectively
- Skill Transfer: Students demonstrate improved independent debugging abilities
- Reduced Instructor Load: Consistent quality support available 24/7
- Review the test cases in
test_cases/to understand common scenarios - Examine the example responses in
examples/to see expected AI behavior - Copy the prompt from
prompt.txt - Test with your AI platform using the provided sample code
- Deploy for student use once you've verified proper functionality
This AI debugging assistant represents a complete educational solution that builds genuine programming skills while providing immediate, supportive guidance for frustrated students.
ai-debugging-assistant/
├── README.md
├── prompt.txt
├── DESIGN_CHOICES.md
├── test_cases/
│ ├── test_case_1_type_error.py
│ ├── test_case_2_logic_error.py
│ └── test_case_3_syntax_error.py
├── examples/
│ ├── example_response_1.md
│ ├── example_response_2.md
│ ├── example_response_3.md
│ └── edge_case_examples.md
└── validation/
└── quality_checklist.md