leetcode-teacher
A step-by-step practice tool for LeetCode medium-difficulty interview questions. It is triggered when users want to practice algorithm problems, brush up on LeetCode, prepare for technical interviews, or say "Give me a problem", "Next problem", "Generate scaffold", "Start practicing". It supports categorized practice by problem type (DP, Linked List, Tree, Graph, Sliding Window, Two Pointers, Hash Table, Binary Search, Stack, Heap, Backtracking, Interval, String, Union Find), generates Python scaffolds with test cases for each problem, tracks learning progress via Markdown tables, and guides users to think independently before providing solutions. It supports the goal of 3 problems per day, counts progress via `git diff README.md` and submits to Git.
NPX Install
npx skill4agent add lumincui/skills leetcode-teacherTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →LeetCode Step-by-Step Practice Skill
Interaction Modes
Normal Mode (Default)
- Assign problem + Automatically generate scaffold (generated directly without asking)
- Verify after user completes the code
Quick Mode
- No scaffold generated after problem assignment
- Guide users to think about algorithm ideas through conversational Q&A
- No code writing involved
Workflow
1. Maintain Local Progress
README.mdreferences/progress_tracking.md- Problem number, problem name, type, status, completion date
- Status marker: ✅ for independent completion, 🔄 for completion with help of answers/hints
2. Learning Plan Section
## Learning PlanREADME.md- To review: Record when users say "Do XX problem tomorrow" or "XX problem to review"
- Today's to-do: Dynamically maintain the daily goal
- Knowledge points notes: Ask whether to record when the user masters a certain concept
references/progress_tracking.md3. Daily 3 Problems Goal
scripts/count_today_problems.py- Inform the user that the goal is achieved
- Suggest Git commit () - keep progress traceable
source scripts/git_ops.sh && git_daily_commit - Optional Todoist update () - integrate with task management
source scripts/todoist_ops.sh
4. Problem Assignment Strategy
- ✅ (Independent completion) → Skip
- 🔄 (Completed with help) → Optional, depending on user's review willingness
- To review / Tomorrow's plan → Prioritize selection
- Unattempted → Random selection
- Problem number, problem name, difficulty tag
- Problem description, examples, constraints
5. Scaffold Generation
references/scaffolds.md<English type name>/dplinked_listtree- docstring: Problem number, problem name, link, description, examples, constraints
- Function to be implemented (with placeholder)
pass - /
ListNodedefinitions and construction/conversion tools are required for linked list/tree problemsTreeNode - Complete test cases
- function
run_tests() - entry
if __name__ == "__main__"
- What is the core ability the problem assesses?
- Where are common implementation errors usually?
- What execution branches does the problem have?
6. User Answering Stage
- Run for verification
python3 <file path> - If the test result logic is correct but the expected value is wrong, correct it and retest - reduce repeated efforts caused by template problems for users
- Audit core implementation: Whether the logic is correct, whether the efficiency meets the standard
- Feedback: Mark status according to the situation, do not write code for users
- Judge subsequent process:
- Have not reached the daily 3 problems goal → Assign next problem directly without asking
- Have reached the daily 3 problems goal → Automatically execute the closing sequence without asking
7. Explanation and Review
- Compare the user's solution with the optimal solution
- Analyze the difference in time/space complexity
- Focus on explaining "Why this optimization works"
8. Correct Misconceptions
9. Closing Sequence
- Git commit and push ()
source scripts/git_ops.sh && git_add_commit_push - Optional Todoist update
- Check learning plan
Problem Type Reference
references/problem_list.md- High Priority: DP, Two Pointers, Sliding Window, Hash Table, Linked List, Tree, Graph
- Medium Priority: Binary Search, Stack, Heap, Backtracking, Interval
- Low Priority: Union Find, Trie
Key Principles
- Independent thinking first: Premature hints will reduce learning effects, only what users figure out by themselves will be truly remembered
- Verification driven: Let test cases speak, let objective results guide cognition
- Understanding is better than answers: Explain why, not just what it is
- Continuous tracking: The progress document is cross-session memory, making learning coherent.