Solve competitive programming and LeetCode-style problems with educational explanations. Use when asked to "solve this problem", "help with this leetcode", "competitive programming solution", "solve this algorithm problem", "coding challenge solution", "how to solve this coding problem", or any algorithmic problem-solving request.
Solves competitive programming problems with step-by-step explanations and verified Python solutions.
/plugin marketplace add sequenzia/agent-alchemy/plugin install agent-alchemy-cs-tools@agent-alchemyThis skill is limited to using the following tools:
Solve competitive programming and LeetCode-style problems with clear educational explanations, step-by-step walkthroughs, and verified Python solutions.
CRITICAL: Complete ALL 4 phases. Do not stop after classification or skip the agent.
Goal: Extract and understand the problem statement.
If $ARGUMENTS is provided, parse the problem statement from it. Extract:
If $ARGUMENTS is empty or unclear, use AskUserQuestion to request the problem:
AskUserQuestion:
question: "Please provide the problem statement. You can paste the full text, describe it in your own words, or provide a link."
options:
- label: "Paste problem text"
description: "Paste the full problem statement including constraints and examples"
- label: "Describe the problem"
description: "Describe what the problem asks in your own words"
If the problem statement is ambiguous or missing key information (constraints, examples), ask for clarification before proceeding.
Goal: Determine the algorithmic category, technique, and difficulty.
Analyze the problem to determine:
Match to one of:
Identify the specific technique within the category (e.g., "0/1 Knapsack", "Dijkstra", "Sliding Window").
Map input size to required time complexity:
| Input Size | Viable Complexity | Typical Approach |
|---|---|---|
| N ≤ 15 | O(2^N), O(N!) | Bitmask DP, backtracking |
| N ≤ 20 | O(2^N × N) | Bitmask DP |
| N ≤ 100 | O(N^3) | Floyd-Warshall, interval DP |
| N ≤ 500 | O(N^3) | Matrix DP, dense graph algorithms |
| N ≤ 3,000 | O(N^2) | Standard DP (LCS, edit distance) |
| N ≤ 10,000 | O(N^2) or O(N√N) | Careful O(N^2), sqrt decomposition |
| N ≤ 100,000 | O(N log N) | Sorting, binary search, segment tree |
| N ≤ 1,000,000 | O(N) or O(N log N) | Linear scan, prefix sums, two pointers |
| N ≤ 10^8 | O(N) | Simple linear pass |
| N ≤ 10^9+ | O(log N) or O(√N) | Binary search, math formula |
Note if the problem combines techniques (e.g., "Binary Search + DP", "Graph + Greedy").
Present the classification summary to the user before proceeding.
Goal: Provide the solver agent with domain-specific algorithmic knowledge.
Based on the primary category, load the corresponding reference skill:
Read ${CLAUDE_PLUGIN_ROOT}/skills/dp-patterns/SKILL.mdRead ${CLAUDE_PLUGIN_ROOT}/skills/graph-algorithms/SKILL.mdRead ${CLAUDE_PLUGIN_ROOT}/skills/search-and-optimization/SKILL.mdRead ${CLAUDE_PLUGIN_ROOT}/skills/data-structures/SKILL.mdRead ${CLAUDE_PLUGIN_ROOT}/skills/math-and-combinatorics/SKILL.mdRead ${CLAUDE_PLUGIN_ROOT}/skills/string-algorithms/SKILL.mdIf a secondary category was identified, load that reference skill as well (maximum 2 reference skills).
Use the Task tool to spawn the problem-solver agent:
Task:
subagent_type: "agent-alchemy-cs-tools:problem-solver"
prompt: |
## Problem Statement
[full problem text with all constraints, I/O format, and examples]
## Classification
- **Category:** [primary category]
- **Sub-pattern:** [specific technique]
- **Difficulty:** [level]
- **Complexity Target:** [required time complexity based on constraints]
- **Secondary Category:** [if applicable]
## Reference Material
[paste the content from the loaded reference skill(s)]
Produce a complete solution following your structured output format.
Goal: Format and present the solution with follow-up options.
Take the agent's structured output and present it to the user. The output includes:
After presenting the solution, offer follow-up actions:
AskUserQuestion:
question: "What would you like to do next?"
options:
- label: "Verify with test cases"
description: "Run the solution through comprehensive test cases including edge cases and stress tests"
- label: "Explain in more detail"
description: "Get a deeper explanation of the approach, technique, or a specific part of the solution"
- label: "Show alternative approach"
description: "See a different way to solve this problem with trade-off analysis"
- label: "Done"
description: "Solution is satisfactory, no further action needed"
If the user selects "Verify with test cases", suggest they use /verify with the problem and solution.
If "Explain in more detail", provide additional explanation of the requested aspect.
If "Show alternative approach", re-spawn the agent with instructions to use a different technique.
Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.
Search, retrieve, and install Agent Skills from the prompts.chat registry using MCP tools. Use when the user asks to find skills, browse skill catalogs, install a skill for Claude, or extend Claude's capabilities with reusable AI agent components.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.