AI-powered LeetCode daily challenge companion
Adaptive hints Β· Submission-aware coaching Β· Streak protection Β· Auto-solve
Built with Gemini AI Β· GitHub Actions Β· WhatsApp Β· Telegram
StreakForge is a fully automated system that turns your LeetCode daily challenge into a guided learning experience β delivered straight to your phone via WhatsApp and Telegram.
It doesn't just remind you. It teaches you, adapts to difficulty, analyzes your actual submissions, and protects your streak when life gets in the way.
- Morning Delivery (6:00 AM IST) β AI-decoded question breakdown with tags, key insights, and edge cases
- Hard Question Special Treatment β Progressive 5-level hint system with Socratic guidance instead of info dumps
- Submission-Aware Coaching β Detects your wrong submissions, analyzes the failing test cases, and generates contextual indirect hints
- 4 Smart Reminders β Escalating nudges at 10 AM, 2 PM, 6 PM, and 9 PM with difficulty-appropriate hints dripped over time
- Auto-Solve at 11:45 PM β Generates a solution, submits it, then sends a full learning package (solution + walkthrough + quiz). Limited to 2/week so it never becomes a crutch
- Comprehension Quiz β After every auto-solve, a multiple-choice quiz tests understanding (interactive buttons on Telegram)
- On-Demand Hints β Text
hint,tags, orstatuson Telegram anytime to get help on your schedule - Dual Channel β WhatsApp (broadcast) + Telegram (interactive with buttons and commands)
6:00 AM β Morning delivery β decoded question + tags
10:00 AM β Reminder #1 β casual nudge (+ submission analysis if applicable)
2:00 PM β Reminder #2 β approach hint for Hard questions
6:00 PM β Reminder #3 β deeper conceptual nudge
9:00 PM β Reminder #4 β final warning, strongest hint
11:45 PM β Auto-solve β solution + walkthrough + quiz (if unsolved, quota available)
ββββββββββββββββββββ βββββββββββββββββββββ ββββββββββββββββ
β GitHub Actions ββββββΆβ Python Modules ββββββΆβ Your Phone β
β (cron triggers) β β (orchestrators) β β WA + TG β
ββββββββββββββββββββ βββββββββ¬ββββββββββββ ββββββββββββββββ
β
ββββββββββββββΌβββββββββββββ
βΌ βΌ βΌ
ββββββββββββ ββββββββββββ ββββββββββββ
β LeetCode β β Gemini β β State β
β GraphQL β β AI API β β (JSON) β
ββββββββββββ ββββββββββββ ββββββββββββ
StreakForge/
βββ .github/workflows/
β βββ morning.yml # 6:00 AM IST β fetch + decode + send
β βββ reminders.yml # 10AM, 2PM, 6PM, 9PM IST β check + hint + nudge
β βββ auto_solve.yml # 11:45 PM IST β generate + submit + teach
β βββ session_health_check.yml # Weekly session cookie verification
β βββ keepalive.yml # Monthly commit to prevent Actions disable
βββ src/
β βββ config.py # Constants, env vars, schedule configuration
β βββ leetcode_api.py # LeetCode GraphQL client (fetch, submit, verify)
β βββ gemini_ai.py # Two-tier AI client (Flash low/high thinking)
β βββ notifier.py # WhatsApp (CallMeBot) + Telegram messaging
β βββ state.py # JSON state management (day/week transitions)
β βββ formatter.py # All message templates and formatting
β βββ morning_job.py # Morning orchestrator
β βββ reminder_job.py # Reminder orchestrator
β βββ autosolve_job.py # Auto-solve orchestrator
βββ prompts/
β βββ decode_easy_medium.txt # Easy/Medium question decode prompt
β βββ decode_hard.txt # Hard question decode + 5-hint generation prompt
β βββ submission_analysis.txt # Socratic submission analysis prompt
β βββ auto_solve.txt # Solution + walkthrough + quiz generation prompt
βββ state.json # Persisted state (committed by Actions)
βββ requirements.txt # Python dependencies
βββ DEEP_DIVE.md # Comprehensive design documentation
βββ README.md # You are here
- A GitHub account (free)
- A Google AI Studio API key (get one free)
- A LeetCode account (with active session cookie)
- A Telegram Bot (create via BotFather)
- CallMeBot WhatsApp API (activate here)
git clone https://github.com/ManveerAnand/StreakForge.git
cd StreakForge- Go to leetcode.com and log in
- Open DevTools β Application β Cookies β
https://leetcode.com - Copy the values of
LEETCODE_SESSIONandcsrftoken
β οΈ These cookies expire periodically. StreakForge includes a weekly health check that alerts you when they expire.
Go to your fork β Settings β Secrets and variables β Actions β New repository secret
| Secret | Description |
|---|---|
LEETCODE_SESSION |
Your LeetCode session cookie |
CSRF_TOKEN |
Your LeetCode CSRF token |
GEMINI_API_KEY |
Google AI Studio API key (primary) |
GEMINI_API_KEY_2 |
(Optional) Second Gemini API key for rotation |
GEMINI_API_KEY_3 |
(Optional) Third Gemini API key for rotation |
CALLMEBOT_PHONE |
Your phone number (with country code, e.g. 919876543210) |
CALLMEBOT_API_KEY |
CallMeBot API key (received via WhatsApp) |
TELEGRAM_BOT_TOKEN |
Telegram bot token from BotFather |
TELEGRAM_CHAT_ID |
Your Telegram chat ID (find it here) |
Go to the Actions tab in your fork and enable workflows. The cron schedules will start running automatically.
Trigger any workflow manually from the Actions tab using "Run workflow".
StreakForge uses Gemini 3 Flash Preview with dynamic thinking depth:
| Task | Thinking Level | Why |
|---|---|---|
| Easy/Medium decode | low |
Straightforward β needs speed |
| Hard decode + hint generation | high |
Needs deep reasoning for quality 5-level hints |
| Submission analysis | high |
Must understand code logic and edge cases |
| Solution generation | high |
Accuracy-critical β code must pass LeetCode judge |
| Reminders & congrats | low |
Creative text β speed over depth |
Instead of dumping all information upfront, Hard questions activate a progressive 5-level hint system:
- Pattern Recognition β "This feels like a problem where..." (just tags/vibes)
- Approach Direction β "Think about what happens when..." (strategy nudge)
- Key Mechanics β Core data structure or technique needed
- Implementation Nudge β How to structure the solution
- Near-Solution β Everything except the code
Hints are dripped over time with each reminder, and available on-demand via Telegram.
When you submit a wrong answer, StreakForge:
- Detects new failing submissions since the last check
- Pulls the failing test case, expected vs actual output, and error type
- Feeds this to Gemini with a Socratic prompt
- Sends an indirect hint β never "your code is wrong at line 5", always "people often get confused when the input has duplicates..."
- Activates at 11:45 PM IST only if the question is unsolved
- Maximum 2 per week (any days, not necessarily consecutive)
- Generates a Python solution β submits to LeetCode β verifies acceptance
- Sends a 4-part learning package: status β code β walkthrough β quiz
- If the first submission fails, retries once with failure context
$0. Everything runs on free tiers:
| Service | Free Tier |
|---|---|
| GitHub Actions | 2,000 min/month (public repo) |
| Gemini 3 Flash | 500 req/day |
| CallMeBot | Unlimited (fair use) |
| Telegram Bot API | Unlimited |
| LeetCode API | No official limits (be respectful) |
StreakForge uses ~10 min/day of Actions time and ~15-25 Gemini calls/day.
- LeetCode cookies expire β StreakForge alerts you, but you must manually refresh them
- CallMeBot is one-way β WhatsApp messages are broadcast only; interactive features (quiz buttons, on-demand hints) are Telegram-only
- GitHub Actions cron Β±5 min β Delivery times may vary slightly
- LeetCode API is undocumented β May change without notice; StreakForge handles errors gracefully
See DEEP_DIVE.md for the comprehensive design document covering:
- UX philosophy and message design
- AI model selection and prompting strategy
- LeetCode GraphQL API reference
- State management design
- Risk analysis and mitigations
- Decision log
MIT β use it, fork it, make it yours.
Built for the grind. π₯
Stop breaking streaks. Start learning.