smithery/svaog

problem

Generate a LeetCode problem template file

Installation

$ npx skills add smithery/svaog --skill problem

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,521 B
  • docs SUMMARY.md 56 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

Create template for LeetCode problem $ARGUMENTS[0]

Instructions

  1. Determine the target folder. If a second argument was provided ($ARGUMENTS[1]), use problems/$ARGUMENTS[1]/. Otherwise, place the file into problems/general/ subdirectory.
  1. Look up the problem. Use your training data to find LeetCode problem number $ARGUMENTS[0]. You need: the title, full description text, all examples (Input/Output/Explanation), all constraints, and any follow-up questions.
  1. Create the file at problems/<topic>/problem_$ARGUMENTS[0].py following the exact skeleton below. Do not zero-pad the number.
  1. After creating the file, run python -m pytest problems/<topic>/problem_$ARGUMENTS[0].py to confirm the tests are collected.

File skeleton

"""
$NUMBER. $TITLE
https://leetcode.com/problems/$SLUG/

$FULL_DESCRIPTION

Example 1:
$EXAMPLE_1

...

Constraints:
$CONSTRAINTS
"""

import pytest


class Solution:
    def $METHOD_NAME(self, $PARAMETERS) -> $RETURN_TYPE: ...


@pytest.fixture
def sln():
    yield Solution()


@pytest.mark.xfail(reason="Not implemented", strict=True)
def test_001(sln):
    """Test the first example from the problem description."""
    assert sln.$METHOD_NAME($ARGS) == $EXPECTED


@pytest.mark.xfail(reason="Not implemented", strict=True)
def test_002(sln):
    """Test the second example from the problem description."""
    assert sln.$METHOD_NAME($ARGS) == $EXPECTED

# Add more test functions for remaining examples.

Rules

  • Import only import pytest. Add additional imports from typing only if the method signature requires them (e.g. Optional, Dict).
  • If the problem uses trees, also import from treenode import TreeNode and use TreeNode.createfromlist() in tests.
  • If the problem uses linked lists, also import from linkedlists import ListNode, buildlinkedlist, linkedlisttolist and use those helpers in tests.
  • The Solution method body must be ... — never include an implementation.
  • One test_NNN(sln) per example, named sequentially. Each test has a short docstring. Do not use pytest.mark.parametrize.
  • Every test must be decorated with @pytest.mark.xfail(reason="Not implemented", strict=True). Remove the decorator once the solution is implemented.
  • No if name == "main" block.
  • Match the style of problems/backtracking/problem_79.py.