agentsclimarketplace

Draft tests

Skill avanrossum/claude-local-llm-skills/skills/draft-tests

Generate test boilerplate for a file or function using the local LLM — scaffolds tests without Claude tokensFrom its SKILL.md

Install
npx -y skills add avanrossum/claude-local-llm-skills --skill draft-tests

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

2.3 KB, as published. Nobody here has run it

/draft-tests — Draft Test Boilerplate via Local LLM

You are generating test scaffolding using the local/remote LLM. The local model writes the initial test structure; the user (or you) can refine it afterward.

Arguments: $ARGUMENTS


Step 1 — Read the Source

Read the target file. Identify:

  • The test framework likely in use (check for existing tests, pyproject.toml, package.json, etc.)
  • The functions/classes that need tests

Step 2 — Send to Local LLM

LLM_API_TOKEN=$(security find-generic-password -a "$USER" -s "lm-studio-token" -w 2>/dev/null)
curl -s "${LLM_BASE_URL:-https://lm.mipyip.com}/v1/chat/completions" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $LLM_API_TOKEN" \
  -d '{
    "model": "'"${LLM_MODEL:-qwen/qwen3.5-35b-a3b}"'",
    "messages": [
      {"role": "system", "content": "You are a senior developer writing tests. Given the source file below, generate a comprehensive test file:\n- Use {test_framework}\n- Test each public function/method\n- Include edge cases (empty input, None, boundary values)\n- Include error path tests where applicable\n- Use descriptive test names\n- Add minimal comments explaining non-obvious test cases\n\nReturn ONLY the test code, no explanations."},
      {"role": "user", "content": "{file_content}"}
    ],
    "stream": false,
    "temperature": 0.4
  }'

Environment variables:

  • LLM_BASE_URL — override endpoint (default: https://lm.mipyip.com)
  • LLM_MODEL — override model (default: qwen/qwen3.5-35b-a3b)
  • Bearer token from macOS Keychain (lm-studio-token) or LLM_API_TOKEN env var

Step 3 — Present and Offer to Write

Show the generated test code to the user. Ask:

Want me to write this to tests/test_{module_name}.py? I can also refine any of the test cases.

If the user says yes, write the file. If they want changes, make them yourself (using Claude's capabilities) rather than re-calling the local model.


Error Handling

  • If the LLM is unreachable, offer to draft the tests yourself
  • If the generated tests have obvious issues (wrong imports, bad framework), fix them before presenting

Keep looking

Skills are one crate of 627,801. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.