Agent skill

Test Quality Assurance

by wislertt in wislertt/leetcode-py

Test quality assurance workflow for LeetCode problems - verifies reproducibility, fixes linting issues, and ensures test structure matches JSON templates.

Apache-2.0Auto-check passedTesting & QA

Install Test Quality Assurance

skills CLI
$ npx skills add wislertt/leetcode-py --skill test-quality-assurance -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install wislertt/leetcode-py test-quality-assurance --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/wislertt/leetcode-py.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/test-quality-assurance .claude/skills/test-quality-assurance && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
test-quality-assurance
GitHub stars
142
Token cost
~2.9k tokens
SKILL.md length
1,275 words
Files
1
Skills in repo
5
Repo updated
First seen
Licence
Apache-2.0

At a glance

Test quality assurance workflow for LeetCode problems - verifies reproducibility, fixes linting issues, and ensures test structure matches JSON templates.

  • Works in 4 steps: Problem Resolution → Test Reproducibility Verification Process → What NOT to Do → …
  • Explicitly requests test quality assurance via /test-quality-assurance command
  • SKILL.md covers CRITICAL: Follow These Steps…, Test Case Standards, Quick Commands and Common Issues & Solutions, plus 2 more sections
  • Calls uv, node and ruff

What it does

Test Quality Assurance is an agent skill from wislertt/leetcode-py. Test quality assurance workflow for LeetCode problems - verifies reproducibility, fixes linting issues, and ensures test structure matches JSON templates. Use ONLY when user explicitly requests test quality assurance via /test-quality-assurance command.

Its SKILL.md is about 2.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering QA and bug reports, Linting and formatting and Reproducible research. It works with Python. The repository describes itself as: Python LeetCode practice environment with automated problem generation, data structure visualizations, and comprehensive testing. Includes all Grind 75, partial Blind, Neetcode… The licence is Apache-2.0.

When your agent uses it

  • Explicitly requests test quality assurance via /test-quality-assurance command
  • Tasks that involve QA and bug reports
  • Tasks that involve Linting and formatting

Example prompts

  • “/test-quality-assurance”

Requirements

  • Python 3

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Problem Resolution
  2. Test Reproducibility Verification Process
  3. What NOT to Do
  4. What to Do

What it can do on your machine

Read from SKILL.md and the folder at commit 9155db3. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • uv
    • node
    • ruff

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use uv, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Test Quality Assurance loads about 2.9k tokens when it runs. Until then it costs about 69 tokens; SKILL.md has 1,275 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~69
When it runs · the whole SKILL.md, loaded when a task matches
~2.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from wislertt/leetcode-py at commit 9155db3, republished under its Apache-2.0 licence (© wislertt). 1,275 words, ~2,939 tokens.

Download SKILL.mdSave it as .claude/skills/test-quality-assurance/SKILL.md (or your agent's skills folder).
name
test-quality-assurance
description
Test quality assurance workflow for LeetCode problems - verifies reproducibility, fixes linting issues, and ensures test structure matches JSON templates. Use ONLY when user explicitly requests test quality assurance via /test-quality-assurance command.

Test Quality Assurance Rules

CRITICAL: Follow These Steps EXACTLY - No Deviations

1. Problem Resolution
  • Use active file context or user-provided problem name
  • If unclear, run: uv run python -m leetcode_py.tools.check_test_cases --threshold=10 --max=1
2. Test Reproducibility Verification Process

MANDATORY 6-Step Process - Execute in Order:

bash
# Step 1: Backup original files
cp -r leetcode/{problem_name} leetcode/{problem_name}_backup

# Step 2: Regenerate from JSON template (use bake, NOT uv run)
bake p-gen -p {problem_name} -f

# Step 3: Restore original solution ONLY
cp leetcode/{problem_name}_backup/solution.py leetcode/{problem_name}/solution.py

# Step 4: Verify linting pass (CRITICAL for CI)
bake lint

# Step 5: Verify tests pass (expected to fail if solution is incomplete)
bake p-test -p {problem_name}
# NOTE: in the batch-problem-creation flow the solution is implemented BEFORE this
# step, so tests MUST pass here. A failure = real defect: wrong expected values in
# the JSON test_cases (most common — see problem-creation.md tree gotchas) or a
# wrong solution. Debug it; do not dismiss it as "incomplete solution".
# SPIN GUARD: 12-20 tiny cases finish in well under a minute. If a pytest run
# exceeds ~1 min wall, it is an INFINITE LOOP in the solution or helper, not
# slowness — kill it (check `ps aux` for a pytest process burning ~100% CPU),
# run the parametrize cases one by one to find the spinner, fix the root cause.
# Never trust a truncated/backgrounded output file as a pass: an exit code
# observed on a run that ended early after logging only the first test is NOT
# a pass (hit with 1265 — a spinning pytest burned ~34 min and an early-truncated
# "exit 0" output masqueraded as green).

# Step 6: Cleanup
rm -rf leetcode/{problem_name}_backup
3. What NOT to Do
  • NEVER edit cookiecutter templates ({{cookiecutter.problem_name}}/ files)
  • NEVER use uv run python -m leetcode_py.cli.main gen - use bake p-gen instead
  • NEVER modify helpers.py manually - let regeneration handle it
  • NEVER skip ty verification - this is the main CI issue
  • NEVER assume tests will pass - they may fail if solution is incomplete
  • NEVER use null in JSON templates - use None for Python None values
4. What to Do
  • ALWAYS use bake p-gen -p {problem_name} -f for regeneration
  • ALWAYS verify ty passes before considering task complete
  • ALWAYS restore original solution after regeneration
  • ALWAYS check JSON template if ty fails (look for assert_assert_ bugs)
  • ALWAYS use None not null in JSON templates for Python None values

Test Case Standards

Coverage Requirements
  • Minimum 12 test cases per problem
  • Edge cases: Empty inputs, single elements, boundary values
  • Corner cases: Maximum/minimum constraints, duplicates, sorted arrays
  • Normal cases: Mixed scenarios with varied complexity
JSON Format
  • CRITICAL: Use None NOT null for Python None values in test cases
    • JSON templates use None directly: "[1, None, 2]" NOT "[1, null, 2]"
    • This ensures generated Python code passes linting (ruff/ty check for undefined name null)
  • Use single quotes for Python strings: 'hello' not "hello"
  • Follow existing parametrize format
  • Ensure valid Python list syntax in test_cases field

Quick Commands

bash
# Generate enhanced problem
uv run lcpy gen -s {problem_name} -o leetcode --force

# Test specific problem
bake p-test -p {problem_name}

# Lint check
bake lint
Development Commands
bash
# Find problems needing enhancement
uv run python -m leetcode_py.tools.check_test_cases --threshold=10

# Check all problems (no limit)
uv run python -m leetcode_py.tools.check_test_cases --threshold=10 --max=none

# Check with custom threshold
uv run python -m leetcode_py.tools.check_test_cases --threshold=12

# Generate from JSON template (uses uv run lcpy internally)
bake p-gen -p {problem_name} -f

Common Issues & Solutions

Issue: `assert_assert_missing_number` Error

Cause: JSON template has `helpersassert_name: "assert_missing_number"` but template adds `assert` prefix Solution: Change JSON to `helpers_assert_name: "missing_number"` so template generates `assert_missing_number`

Issue: ty Import Errors

Cause: Regenerated helpers.py doesn't match test imports Solution: Use `bake p-gen` (not uv run) and verify JSON template is correct

Issue: Tests Fail After Regeneration

Expected: Tests may fail if solution is incomplete (returns 0 or placeholder) Action: This is normal - focus on ty passing, not test results Exception: if the solution is already implemented (batch flow), failures are real defects — fix the JSON test cases or the solution, then re-run the 6 steps

Issue: pre-commit flags solution.py (B905 / E741 / RUF012 / N806 / ty list invariance)

Cause: bake lint during QA runs a narrower ruff config than the pre-commit hook, so zip() without strict= (B905), variable names like l (E741), mutable class-attribute defaults (RUF012), uppercase locals like MOD (N806), and list-invariance type mismatches in ty pass QA and surface only at batch finalization.

  • Fix: zip(s, t) → zip(s, t, strict=True); rename l/I/O variables (left_val, etc.); class-level constant lists → tuples (BELOW_20: tuple[str, ...] = (...)) or annotate with typing.ClassVar; MOD = 1_000_000_007 → lowercase mod (N806, recurs on every modulo problem); annotate accumulators with the full return element type (result: list[TreeNode[int] | None], not list[TreeNode[int]] returned against -> list[TreeNode[int] | None] — ty rejects the narrowing under list invariance); a float('-inf') sentinel in an int-returning DP poisons derived values into float (ty invalid-return-type) — prefer a type-pure int sentinel like -1 for non-negative domains (hit with 741 Cherry Pickup); a nested dfs(node: TreeNode[int] | None, ...) whose body touches node.val/node.left/node.right passes bake lint but fails pre-commit ty with one unresolved-attribute per access — ty does not narrow through the call site when root is Optional, so add if node is None: return at the top of the DFS (hit with 988, 7 errors at once). Generated helpers add four more: RUF005 list concatenation in return expressions → unpack instead ([node.val, *left, *right], hit with 889); E731 lambda assigned to a name → rewrite as a def with return type (hit with 894); ty unresolved-attribute when calling .to_list() on a TreeNode | None element — assert all(x is not None ...) does NOT narrow a comprehension variable; filter into a new list (roots = [t for t in result if t is not None]) and assert equal length (hit with 894); ty does NOT narrow subscripts — while vals[i] is not None and even assert vals[i] is not None still yield int | None at the use site (invalid-argument-type in helpers_content); hoist to a local first (v = vals[i]; assert v is not None; ... v, hit with 428). All are fixed at the JSON level (helpers_assert_body / helpers_content) or in solution.py, never in other generated files
  • Hit with 273 Integer to English Words: lookup-table lists (BELOW_20 = [...]) at class level flagged RUF012 Mutable default value for class attribute
  • Hit with 552/576/629 (MOD → N806) and 652 (ty invalid-return-type on list invariance)
  • E501 also fires on COMMENTS: a complexity comment listing per-method costs (# Time: get O(index), add_at_index O(index), ...) overflows col 100 — compress or split it (hit with 707 Design Linked List)
  • Solution-defined doubly-linked Node classes (custom linked-list/design problems, e.g. 708 circular list, 716 MaxStack DLL) whose pointer fields are Node | None pass bake p-gen QA and bake lint but fail pre-commit ty with one unresolved-attribute/invalid-assignment error per pointer access — ty cannot narrow attribute fields, and the dead-node marker node.prev = None assignment also fails (invalid-assignment). Fix at the solution level with self-linking non-Optional fields: self.next: Node = next if next is not None else self in __init__, dead marker node.prev = node.next = node plus node.prev is not node liveness checks (hit with 708/716, 12 errors at once). Recurs on linked-list/design problems in the unscrapable queue (919, 428, 431, 510, 369)
  • Prevention: write solutions ruff-clean from the start (see problem-creation.md, Batch Flow Notes section)
  • Prevention (batch flow, where bake lint is orchestrator-owned and skipped in the QA chain): scoped lint is STILL REQUIRED before reporting PASS, and it must read the repo config — from the repo root run uv run ruff check leetcode/{problem_name}, uv run ruff format --check leetcode/{problem_name}, and uv run ty check leetcode/{problem_name} (uv resolves the pyproject ruff/ty settings, so these mirror what pre-commit's repo-wide run enforces). A bare ruff check outside uv run, or skipping the scoped lint entirely because the step was "not yours", lets SIM110/E501-class issues surface first at batch pre-commit and cost a fix + full pre-commit rerun (hit with 1849, whose agent skipped scoped lint and shipped a SIM110 for-loop-return that pre-commit caught)
Show full SKILL.md (281 more words)Show less
Issue: `null` vs `None` in JSON Templates

Cause: JSON template uses `null` which causes linting errors in generated Python code

  • Error: `F821 Undefined name 'null'` from ruff/ty
  • Generated test files contain `null` which is not valid Python

Solution: Update JSON template to use `None` instead of `null`

  • Change: `"([1, null, 2], 3, 1)"` → `"([1, None, 2], 3, 1)"`
  • This applies to `test_cases` list and `playground_setup` fields
  • After fixing JSON, regenerate with `bake p-gen -p {problem_name} -f`
  • Generated code will now pass linting without manual edits
Issue: hand-invented inputs pass value-range checks but violate STRUCTURAL constraints

Cause: verifying each entry against value ranges (`grid[i][j]` is 0 or 1, `nums[i] <= 10^4`) is not enough — shape invariants stated in the constraints must be checked too. Hit with 827 Making A Large Island: the statement guarantees an `n x n` (square) grid, but a test case like `[[1], [1]]` is 2x1; it passes all value checks and then crashes matrix-indexing solutions with `IndexError`, which reads as a solution bug rather than a test-data bug

  • Fix: include shape invariants (`grid.length == grid[i].length`, row/col counts, ordering guarantees like "graph[i] is strictly increasing") in the reference-implementation verification script — assert the STRUCTURE of every input, not just element values
  • Drop or reshape any case that violates a structural constraint, even if the expected output "looks right"

Success Criteria

  • ty passes with no errors (CRITICAL for CI)
  • Test structure matches JSON template exactly
  • Original solution preserved (user's code intact)
  • helpers.py generated correctly (no `assertassert` bugs)
  • Reproducibility verified (can regenerate consistently)

When to Use This Workflow

  • GitHub Actions CI failures due to ty errors
  • Test reproducibility verification requests
  • Need to ensure test structure matches JSON template
  • CI test failures in reproducibility checks

© wislertt, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/test-quality-assurance of wislertt/leetcode-py.

Open the folder on GitHubat commit 9155db3

Compare with similar skills

Test Quality Assurance next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Test Quality Assurance compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Test Quality Assurance this skillwislertt/leetcode-py142—~2.9kAutomated safety check: PassApache-2.0
Monitor With HaolemeHaolemeApp/Haoleme157—~1.3kAutomated safety check: PassAGPL-3.0
Wobbling Ty Constraint Orderastral-sh/ruff50k—~838Automated safety check: PassMIT
Fake Model Provider Faultsdifferent-ai/openwork24k—~642Automated safety check: PassCustom licence
Agentacct Workflowmikehasa/agentacct766—~1.6kAutomated safety check: PassMIT
Simple Modern Uvjlevy/simple-modern-uv301—~1.9kAutomated safety check: PassMIT

Similar skills

  • Monitor With Haoleme

    HaolemeApp/Haoleme

    Selectively monitor important long-running or resource-intensive commands with Haoleme by prefixing them with hao, so status, output, and completion notifications sync to the mobile app.

    157 GitHub stars~1.3k tokensUpdated 1 mo ago
    Data & AnalyticsAuto-check passed
  • Official

    A skill your agent uses when a user asks to wobble ty constraint ordering, check constraint-set or TDD ordering determinism, test reversed constraint/typevar IDs, or investigate nondeterministic ty…

    50k GitHub stars~838 tokensUpdated today
    Testing & QAAuto-check passed
  • Fake Model Provider Faults

    different-ai/openwork

    Makes the desktop app's model provider fail on demand, with refused connections, resets, stalls and HTTP 4xx and 5xx errors, so error and retry states can be reproduced.

    24k GitHub stars~642 tokensUpdated today
    Testing & QAAuto-check passed
  • Agentacct Workflow

    mikehasa/agentacct

    A skill your agent uses when working in a repo with agentacct MCP configured, or when asked to track coding-agent work, smoke-test agentacct integrations, or report objective AI-agent task evidence.

    766 GitHub stars~1.6k tokensUpdated 7 days ago
    Testing & QAAuto-check passed
  • Simple Modern Uv

    jlevy/simple-modern-uv

    Start, selectively modernize, fully migrate, or update Python projects using simple-modern-uv practices: uv, ruff, BasedPyright, pytest, GitHub Actions CI, and tag-driven PyPI publishing.

    301 GitHub stars~1.9k tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • Decodes QR-code bug report photos and screenshots from the pipensx app into a log, then triages crashes and update, download or install failures.

    221 GitHub stars~1.5k tokensUpdated 8 days ago
    Testing & QAAuto-check: notes

More from wislertt/leetcode-py

  • Leetcode Py

    wislertt/leetcode-py

    Generates Python LeetCode practice environments and manages a 307-problem catalog with the lcpy CLI.

    142 GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Batch Problem Creation

    wislertt/leetcode-py

    Batch creation workflow for multiple LeetCode problems - loops through problem creation, solution implementation, and quality assurance for a specified count.

    142 GitHub stars~10k tokensUpdated today
    Auto-check passed
  • Problem Creation

    wislertt/leetcode-py

    Guide for creating a single LeetCode problem scaffold - scrape, transform to JSON template, generate files, and verify.

    142 GitHub stars~9.9k tokensUpdated today
    Auto-check passed
  • Update Tags

    wislertt/leetcode-py

    Use ONLY when user explicitly requests "update tags" or "/update-tags", or after running .claude/.dev/updatetags.py and seeing "Missing" or "Removed" discrepancy lines.

    142 GitHub stars~2.5k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Test Quality Assurance

What does Test Quality Assurance do?

Test quality assurance workflow for LeetCode problems - verifies reproducibility, fixes linting issues, and ensures test structure matches JSON templates. Test Quality Assurance is an agent skill from wislertt/leetcode-py. Test quality assurance workflow for LeetCode problems - verifies reproducibility, fixes linting issues, and ensures test structure matches JSON templates.

When should I use Test Quality Assurance?

Test Quality Assurance fits situations like: explicitly requests test quality assurance via /test-quality-assurance command; tasks that involve QA and bug reports; tasks that involve Linting and formatting.

How do I install Test Quality Assurance in Claude Code?

Run `npx skills add wislertt/leetcode-py --skill test-quality-assurance -a claude-code`. Or copy the skill folder (.claude/skills/test-quality-assurance in wislertt/leetcode-py) into .claude/skills/test-quality-assurance in your project. Claude Code loads it when a task matches its description.

How do I install Test Quality Assurance in Codex?

Run `npx skills add wislertt/leetcode-py --skill test-quality-assurance -a codex`. Or copy the skill folder (.claude/skills/test-quality-assurance in wislertt/leetcode-py) into .agents/skills/test-quality-assurance in your project. Codex loads it when a task matches its description.

Can I use Test Quality Assurance in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add wislertt/leetcode-py --skill test-quality-assurance -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/test-quality-assurance, .gemini/skills/test-quality-assurance, .github/skills/test-quality-assurance and .opencode/skills/test-quality-assurance in your project.

What does Test Quality Assurance need to run?

Going by SKILL.md and its folder, Test Quality Assurance needs the command-line tools its instructions call (uv, node and ruff). Our summary lists: Python 3.

Does Test Quality Assurance access the network?

SKILL.md contains no URLs. Its commands use uv, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Test Quality Assurance safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Test Quality Assurance use?

Test Quality Assurance is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Test Quality Assurance use?

About 2.9k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Test Quality Assurance?

Skills that share tags, products or a category with Test Quality Assurance: Monitor With Haoleme (HaolemeApp/Haoleme, 157 stars), Wobbling Ty Constraint Order (astral-sh/ruff, 50k stars), Fake Model Provider Faults (different-ai/openwork, 24k stars) and Agentacct Workflow (mikehasa/agentacct, 766 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Test Quality Assurance?

wislertt (a GitHub user) maintains it in wislertt/leetcode-py, which has 142 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on October 10, 2026.

Source: wislertt/leetcode-py on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.