Skip to content

ManveerAnand/StreakForge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

171 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”₯ StreakForge

AI-powered LeetCode daily challenge companion

Adaptive hints Β· Submission-aware coaching Β· Streak protection Β· Auto-solve

Built with Gemini AI Β· GitHub Actions Β· WhatsApp Β· Telegram

Python 3.12 Powered by Gemini GitHub Actions Zero Cost


What is StreakForge?

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.

Key Features

  • 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, or status on Telegram anytime to get help on your schedule
  • Dual Channel β€” WhatsApp (broadcast) + Telegram (interactive with buttons and commands)

Daily Timeline

 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)

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  GitHub Actions   │────▢│  Python Modules    │────▢│  Your Phone  β”‚
β”‚  (cron triggers)  β”‚     β”‚  (orchestrators)   β”‚     β”‚  WA + TG     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β–Ό            β–Ό            β–Ό
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚ LeetCode β”‚ β”‚ Gemini   β”‚ β”‚ State    β”‚
              β”‚ GraphQL  β”‚ β”‚ AI API   β”‚ β”‚ (JSON)   β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Project Structure

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

Setup Guide

Prerequisites

Step 1: Fork & Clone

git clone https://github.com/ManveerAnand/StreakForge.git
cd StreakForge

Step 2: Get Your LeetCode Cookies

  1. Go to leetcode.com and log in
  2. Open DevTools β†’ Application β†’ Cookies β†’ https://leetcode.com
  3. Copy the values of LEETCODE_SESSION and csrftoken

⚠️ These cookies expire periodically. StreakForge includes a weekly health check that alerts you when they expire.

Step 3: Configure GitHub Secrets

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)

Step 4: Enable GitHub Actions

Go to the Actions tab in your fork and enable workflows. The cron schedules will start running automatically.

Step 5: Test (Optional)

Trigger any workflow manually from the Actions tab using "Run workflow".


How It Works

AI Strategy β€” Two Tiers, One Model

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

Hard Questions Get Special Treatment

Instead of dumping all information upfront, Hard questions activate a progressive 5-level hint system:

  1. Pattern Recognition β€” "This feels like a problem where..." (just tags/vibes)
  2. Approach Direction β€” "Think about what happens when..." (strategy nudge)
  3. Key Mechanics β€” Core data structure or technique needed
  4. Implementation Nudge β€” How to structure the solution
  5. Near-Solution β€” Everything except the code

Hints are dripped over time with each reminder, and available on-demand via Telegram.

Submission-Aware Socratic Coaching

When you submit a wrong answer, StreakForge:

  1. Detects new failing submissions since the last check
  2. Pulls the failing test case, expected vs actual output, and error type
  3. Feeds this to Gemini with a Socratic prompt
  4. Sends an indirect hint β€” never "your code is wrong at line 5", always "people often get confused when the input has duplicates..."

Auto-Solve Safety Net

  • 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

Cost

$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.


Known Limitations

  • 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

Documentation

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

License

MIT β€” use it, fork it, make it yours.


Built for the grind. πŸ”₯

Stop breaking streaks. Start learning.

About

πŸ”₯ AI-powered LeetCode daily challenge companion β€” adaptive hints, submission-aware coaching, streak protection, and auto-solve. Built with Gemini AI, GitHub Actions, WhatsApp & Telegram.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages