doing-leetcode
v1.0.0
Published
Interview-style algorithm practice Skill for AI coding agents (TRAE, Claude Code, Cursor, Windsurf, etc.). Simulates real interview whiteboarding from problem analysis to complete code.
Maintainers
Readme
doing-LeetCode
Interview-style algorithm practice Skill for AI coding agents. Simulates a real interview whiteboarding experience — from the moment you receive a problem to the moment you write the final line of code.
Works with TRAE, Claude Code, Cursor, Windsurf, GitHub Copilot, Cline, and any agent that supports skill directories.
What It Does
When you enter practice mode and ask an algorithm question, this skill:
- Confirms your preferences — ACM or LeetCode mode? Chat or file output?
- Solves the problem like a real interview — raw, step-by-step thinking, not a polished answer
- Writes code segment by segment — each code block is preceded by what you're thinking
- Re-explains the approach at the end, simulating an interviewer follow-up
Quick Start
Install via npx (recommended)
# Install into your current project for TRAE (default agent)
npx doing-leetcode
# Install for a specific agent
npx doing-leetcode --agent claude
npx doing-leetcode --agent cursor
npx doing-leetcode --agent windsurf
# Specify a target directory
npx doing-leetcode /path/to/your/project
# Combine target + agent
npx doing-leetcode /path/to/your/project --agent claudeSupported Agents
| Agent | --agent value | Skill directory |
|-------|-----------------|-----------------|
| TRAE (default) | trae | .trae/skills/doing-LeetCode/ |
| Claude Code | claude | .claude/skills/doing-LeetCode/ |
| Cursor | cursor | .cursor/skills/doing-LeetCode/ |
| Windsurf | windsurf | .windsurf/skills/doing-LeetCode/ |
| GitHub Copilot | copilot | .github/copilot-skills/doing-LeetCode/ |
| Cline | cline | .cline/skills/doing-LeetCode/ |
| Custom path | custom | Use --skill-path to specify |
Custom Skill Path
If your agent uses a non-standard directory, use --agent custom with --skill-path:
npx doing-leetcode --agent custom --skill-path .myagent/skills
npx doing-leetcode --agent custom --skill-path /absolute/path/to/skillsList Supported Agents
npx doing-leetcode --listInstall via npm (global)
npm install -g doing-leetcode
doing-leetcode /path/to/your/project --agent claudeInstall via git clone
cd your-project/.trae/skills/ # or .claude/skills/, .cursor/skills/, etc.
git clone https://github.com/Xstly1014/doing-LeetCode.gitUsage
Once installed, open your project in your agent IDE and say:
practice mode, reverse linked listThe skill will respond:
Got it. Before we start, I need to confirm two things:
1. ACM mode or LeetCode mode?
2. Output to chat or write to file?After you answer, the skill walks through the entire problem-solving process:
- First reaction — raw initial thoughts
- Determining direction — analyzing problem characteristics to pick the optimal approach
- Writing code while thinking — segment by segment, with reasoning before each block
- Complete code — assembled into one copy-pasteable block
- Complexity analysis — time and space, with explanations
- Re-explaining the approach — simulating "walk me through your solution"
ACM Mode vs LeetCode Mode
| Mode | Description |
|------|-------------|
| ACM Mode | Complete runnable program with main, input handling (Scanner), and output (System.out) |
| LeetCode Mode | Only the Solution class and core method — no main, no I/O |
Output Options
| Option | Description |
|--------|-------------|
| Chat Output | Everything displayed in the conversation |
| File Output | Appended to a markdown file (default: practice-notes.md) |
Example Output Style
Alright, let me look at this problem.
Reverse a linked list... so 1->2->3->4->5 becomes 5->4->3->2->1.
My first reaction: each node's next should point to the previous node.
But a singly linked list only goes forward — how do I know the previous node?
Let me think... if I'm at node 2, I want 2 to point to 1. But once I
move past 1, it's gone — unless I save it beforehand.
Also, if I change 2's next to point to 1, I lose 2's original next (node 3).
So I must save 2's next before changing the pointer.
OK, direction is set: three pointers — prev, curr, next.
Let me start writing.
First, I need to handle I/O. ACM mode, so I need a main method...
```java
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
}
}Wait, I need to build a linked list. Let me define ListNode first...
class ListNode {
int val;
ListNode next;
ListNode(int val) { this.val = val; }
}Now the core method. What parameters? Pass head, return the new head...
public static ListNode reverseList(ListNode head) {
ListNode prev = null;
ListNode curr = head;
while (curr != null) {
ListNode next = curr.next;
curr.next = prev;
prev = curr;
curr = next;
}
return prev;
}Return prev because when curr becomes null, prev points to the last processed node — the new head.
## File Structure
doing-LeetCode/ ├── SKILL.md # Skill definition (the core file) ├── bin/ │ └── install.js # npx installer script (multi-agent support) ├── package.json # npm package config ├── README.md # This file ├── LICENSE # MIT └── .gitignore
## Language Support
Default priority:
1. Language explicitly specified by the user
2. Java (most common in interviews)
3. Python (quick to validate ideas)
4. C++ (common in competitive programming)
## License
MIT