🎓 HM-Code: AI Code Learning Assistant
Transform code pasting into a learning experience!
HM-Code is a revolutionary VS Code extension that intercepts code paste operations and presents educational quizzes to enforce active learning and understanding. Instead of mindlessly copying code, you'll develop genuine comprehension through interactive questions powered by advanced AI.

✨ Key Features
🔍 Intelligent Code Detection
- Automatically detects when you're pasting code snippets
- Supports multiple programming languages (JavaScript, Python, Java, C++, and more)
- Recognizes AI-generated code patterns from ChatGPT, Copilot, and other tools
- Smart filtering excludes comments, documentation files, and small snippets
🎯 Educational Quiz System
- Component Analysis: Understand the main parts of code and how they interact
- Plain English Explanation: Explain code purpose without technical jargon
- Concrete Examples: Demonstrate code execution with real input/output scenarios
- Progressive Difficulty: Adapts to beginner, intermediate, or advanced skill levels
🤖 AI-Powered Intelligence
- Groq API Integration: Uses advanced language models for intelligent question generation
- Smart Evaluation: AI assesses your understanding, not just exact wording
- Contextual Hints: Get helpful guidance without spoiling the answers
- Fallback System: Works offline with built-in question banks
📊 Learning Analytics
- Progress Tracking: Monitor your learning journey over time
- Success Metrics: Track quiz completion rates and improvement trends
- Concept Mastery: Identify strengths and areas for improvement
- Daily Goals: Set and achieve learning objectives with skip limits
🎨 Beautiful Interface
- VS Code Integration: Seamlessly matches your editor's theme
- Responsive Design: Works perfectly in any panel size
- Smooth Animations: Engaging micro-interactions and transitions
- Accessibility: Full keyboard navigation and screen reader support
🚀 Getting Started
Installation
Install from VS Code Marketplace
Search for "HM-Code" in the Extensions panel
Or install from VSIX
code --install-extension hm-code-0.0.1.vsix
Quick Setup
Get a Groq API Key (optional but recommended)
- Visit console.groq.com
- Create an account and generate an API key
- Add it to your VS Code settings
Configure HM-Code
- Press
Ctrl+Shift+P
(or Cmd+Shift+P
on Mac)
- Type "Preferences: Open Settings"
- Search for "HM-Code"
- Set your API key and preferences
Start Learning!
- Copy some code from any source
- Try pasting it in VS Code
- Complete the educational quiz
- Paste your code after demonstrating understanding
⚙️ Configuration
HM-Code offers extensive customization through VS Code settings:
Core Settings
Setting |
Default |
Description |
hmCode.enabled |
true |
Enable/disable the extension |
hmCode.groqApiKey |
"" |
Your Groq API key for AI features |
hmCode.model |
llama-3.1-70b-versatile |
AI model to use |
hmCode.difficulty |
medium |
Quiz difficulty level |
Learning Behavior
Setting |
Default |
Description |
hmCode.minimumCodeLength |
50 |
Minimum characters to trigger quiz |
hmCode.requirePerfectScore |
false |
Require 3/3 score to paste |
hmCode.allowSkip |
true |
Allow users to skip quizzes |
hmCode.maxSkipsPerDay |
3 |
Daily skip limit |
Advanced Options
Setting |
Default |
Description |
hmCode.autoDetectAICode |
true |
Enhanced detection for AI-generated code |
hmCode.trackLearningProgress |
true |
Store learning analytics |
hmCode.excludedFileTypes |
[".md", ".txt", ".json"] |
File types to exclude |
🎮 How It Works
The Learning Flow
- Code Detection: When you paste code, HM-Code analyzes it for programming patterns
- Quiz Generation: AI creates three targeted questions about your code
- Interactive Learning: Complete the quiz to demonstrate understanding
- Smart Evaluation: AI assesses your responses and provides detailed feedback
- Relearning Path: If needed, get explanations and try again
- Success: Paste your code once you've shown comprehension
Example Quiz Questions
For a JavaScript sorting function:
Component Analysis: "What are the main components of this code, and how do they work together to achieve the sorting functionality?"
Plain English: "Explain what this code accomplishes for a user, without using technical programming terms."
Concrete Example: "If this function received the array [5, 2, 8, 1, 9], walk through what would happen step by step and what the final result would be."
🏆 Learning Benefits
For Students
- Active Learning: Engage with code rather than passively copying
- Concept Reinforcement: Solidify understanding through explanation
- Pattern Recognition: Develop ability to analyze code structure
- Communication Skills: Practice explaining technical concepts
For Developers
- Code Review Skills: Improve ability to understand others' code
- Documentation Writing: Practice clear technical communication
- Architecture Understanding: Learn to see big-picture code design
- Interview Preparation: Get comfortable explaining code logic
For Teams
- Knowledge Sharing: Ensure team members understand shared code
- Code Quality: Encourage thoughtful code integration
- Learning Culture: Foster continuous improvement mindset
- Onboarding: Help new team members understand codebases
📱 Commands
Access HM-Code features through the Command Palette (Ctrl+Shift+P
):
🎓 Open Code Learning Quiz
- Manually start a quiz with clipboard content
📊 Show Learning Progress
- View detailed analytics and insights
🔄 Reset Learning Progress
- Clear all stored learning data
⚡ Toggle HM-Code
- Quickly enable/disable the extension
Keyboard Shortcut: Ctrl+Shift+H
(or Cmd+Shift+H
on Mac) to toggle HM-Code
🔧 API Integration
Groq API Setup
- Create Account: Visit console.groq.com
- Generate Key: Create a new API key in your dashboard
- Add to Settings: Copy the key to
hmCode.groqApiKey
setting
- Choose Model: Select from available models:
llama-3.1-70b-versatile
(default, most capable)
llama-3.1-8b-instant
(faster, lighter)
mixtral-8x7b-32768
(alternative option)
Offline Mode
HM-Code works without an API key using built-in fallback systems:
- Pre-generated question templates
- Rule-based code analysis
- Heuristic answer evaluation
- Local hint generation
🌟 Advanced Features
Learning Analytics
Track your progress with comprehensive metrics:
- Total Quizzes: Number of quizzes completed
- Success Rate: Percentage of successful attempts
- Learning Streak: Consecutive days of quiz activity
- Concept Mastery: Areas where you excel
- Improvement Trends: How your scores change over time
- Time Investment: Learning time per session
Smart Hints
Get contextual help without spoiling answers:
- Progressive Hints: Start general, get more specific
- Code Highlighting: Visual cues about relevant sections
- Concept Links: Connect to related programming concepts
- Example Guidance: Suggest approaches without giving answers
Relearning System
When you don't pass initially:
- Detailed Explanations: Understand why answers were incorrect
- Concept Walkthrough: Step-by-step code analysis
- Practice Opportunity: Demonstrate improved understanding
- Multiple Attempts: Learn at your own pace
🎨 Customization
Theme Integration
HM-Code automatically adapts to your VS Code theme:
- Dark Mode: Optimized for dark color schemes
- Light Mode: Clean appearance in light themes
- High Contrast: Accessible design for high contrast modes
- Custom Colors: Respects your workspace color customizations
Layout Options
Customize the learning experience:
- Panel Position: Quiz opens in side panel by default
- Code Display: Collapsible code view with syntax highlighting
- Progress Indicators: Visual feedback on quiz completion
- Responsive Design: Adapts to different screen sizes
🛠️ Troubleshooting
Common Issues
Quiz not appearing when pasting code:
- Check that
hmCode.enabled
is set to true
- Verify code length meets
hmCode.minimumCodeLength
threshold
- Ensure you're not pasting in excluded file types
- Confirm you're pasting in an active editor window
API-related errors:
- Verify your Groq API key is correctly set in settings
- Check your internet connection
- Ensure your API key has sufficient credits
- Try switching to a different model in settings
Performance issues:
- Disable debug mode: set
hmCode.enableDebugMode
to false
- Reduce minimum code length to avoid unnecessary processing
- Clear learning progress data if storage becomes large
Getting Help
- GitHub Issues: Report bugs and request features
- VS Code Developer Tools: Use F12 to see console errors
- Debug Mode: Enable
hmCode.enableDebugMode
for detailed logs
- Community: Join discussions in the repository
🤝 Contributing
We welcome contributions to make HM-Code even better!
Development Setup
git clone https://github.com/your-org/hm-code.git
cd hm-code
npm install
code .
Running the Extension
- Press
F5
to open a new Extension Development Host window
- Copy some code and try pasting in the new window
- Make changes to the code and reload the window (
Ctrl+R
)
Project Structure
hm-code/
├── src/
│ ├── webview/ # Quiz interface
│ ├── services/ # Core services
│ ├── utils/ # Utility functions
│ └── config/ # Configuration
├── media/ # Icons and images
├── test/ # Test files
└── package.json # Extension manifest
📋 Requirements
- VS Code: Version 1.104.0 or higher
- Node.js: Version 14 or higher (for development)
- Internet Connection: Optional (for AI features)
- Groq API Key: Optional (for enhanced AI capabilities)
🐛 Known Issues
- Large Code Files: Very large code snippets (>2000 lines) may take longer to process
- Network Timeouts: API calls may timeout on slow connections (15-second limit)
- File Type Detection: Some less common file extensions may not be properly detected
- Memory Usage: Extensive learning history may impact performance over time
📈 Roadmap
Upcoming Features
- Team Analytics: Shared learning insights for development teams
- Custom Question Types: Create your own quiz templates
- Integration APIs: Connect with other learning platforms
- Gamification: Badges, achievements, and learning challenges
- Code Explanation Videos: AI-generated video explanations
- Multi-language Support: Interface localization
Version History
0.0.1 (Initial Release)
- ✨ Core paste interception and quiz system
- 🤖 Groq API integration for intelligent questions
- 📊 Basic learning progress tracking
- 🎨 Comprehensive UI with VS Code theme integration
- ⚙️ Extensive configuration options
- 🔧 Fallback systems for offline operation
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Groq: For providing the powerful AI API that drives our intelligent features
- VS Code Team: For the excellent extension API and development tools
- Prism.js: For beautiful code syntax highlighting
- Open Source Community: For inspiration and best practices
Made with ❤️ for developers who want to truly understand the code they use.
Transform your coding habits. Start learning actively with HM-Code today!