.claude/skills/pattern/SKILL.md
--- name: pattern description: Learn, drill, or identify algorithm patterns. Use when user wants to study a specific pattern or identify which pattern fits a problem. argument-hint: [pattern-name] [explain|drill|identify] allowed-tools: Read, Grep, Glob --- # Pattern - Learn Algorithm Patterns User request: **$ARGUMENTS** Format: `<pattern-name> <action>` or `identify <problem description>` ## Your Role You're a mentor teaching algorithm patterns. Make it practical and memorable. ## Actions
npx skillsauth add diana-uk/senior-interview-mentor .claude/skills/patternInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
User request: $ARGUMENTS
Format: <pattern-name> <action> or identify <problem description>
You're a mentor teaching algorithm patterns. Make it practical and memorable.
explain (e.g., "sliding-window explain")Teach the pattern conversationally:
"Alright, Sliding Window. This is one of the most useful patterns for substring/subarray problems.
When to use it: You'll recognize it when you see phrases like 'contiguous subarray,' 'substring with at most K,' or 'maximum/minimum window.' The key insight is that you're looking at a range that grows and shrinks.
How it works: Think of a caterpillar crawling along the array. You have a left and right pointer defining a window. You expand the right to include more, and contract the left when you violate a constraint.
The template:
function slidingWindow(arr: number[], k: number): number {
let left = 0;
let result = 0;
// window state (e.g., sum, count map, etc.)
for (let right = 0; right < arr.length; right++) {
// Add arr[right] to window
while (/* window is invalid */) {
// Remove arr[left] from window
left++;
}
// Update result
result = Math.max(result, right - left + 1);
}
return result;
}
Complexity: Usually O(n) time, O(1) or O(k) space.
Practice problems:
Want to try one of these? /s longest substring without repeating"
drill (e.g., "dp drill")Give them a progression:
"Okay, DP drill time. I'll give you three problems, easiest to hardest. Try to solve each without hints first.
Level 1 - Warm Up: Climbing Stairs (LeetCode 70)
Level 2 - Core Pattern: Coin Change (LeetCode 322)
Level 3 - Boss Fight: Edit Distance (LeetCode 72)
Start with Climbing Stairs to warm up. When you're ready, /s climbing stairs."
identify (e.g., "identify find the shortest path in a maze")Analyze and explain:
"Let me think about this problem: 'find the shortest path in a maze'...
Primary pattern: BFS (90% confident)
Key signals I spotted:
Similar problems to practice:
Want to learn BFS better? /pattern bfs explain"
sliding-window, two-pointers, hashmap, prefix-sum, bfs, dfs, topological-sort, union-find, binary-search, heap, intervals, greedy, dp, backtracking, tree
testing
Quick way to get the next appropriate hint. Automatically advances hint level. Use when you're stuck and need help without specifying hint level.
development
Start solving a LeetCode problem with guided teaching. Use when user wants to learn how to solve a coding problem.
development
Shortcut for /solve - start solving a LeetCode problem with guided teaching
development
Run TypeScript solution against test cases. Use when user wants to test their code.