Test Writer logo

Test Writer

Community
poshan0126
test-writer

Write comprehensive tests for new or changed code. Use automatically after adding a function, endpoint, or component, or changing behavior, when the change has no corresponding test changes. Not for config, docs, or test-only diffs. For judging whether existing tests adequately verify a change, use the pr-test-analyzer agent instead.

Overview

Publisherposhan0126
Repositorydotclaude
Skill nametest-writer
Stars
870
Forks
204
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by poshan0126 on GitHub. Read the source before you install it.

Installation

Install the Test Writer AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/poshan0126/dotclaude/tree/main/skills/test-writer
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/poshan0126/dotclaude.git /tmp/dotclaude
mkdir -p .claude/skills
cp -r /tmp/dotclaude/skills/test-writer .claude/skills/test-writer
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Test Writer in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Test Writer on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Test Writer is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Write comprehensive tests for the code that was just added or changed.

Step 1: Discover What Changed

Change under test (injected at load — already in front of you, no tool call needed):

git diff --stat HEAD 2>/dev/null || echo "(no diff vs HEAD — inspect git status manually)"
git diff HEAD 2>/dev/null || true
  • The diff above is the change under test. If it is empty (already committed or amended elsewhere), run git diff, git diff --cached, or git show HEAD to locate the change
  • Read each changed file to understand the behavior being added
  • Identify the project's existing test framework, patterns, and conventions by finding existing test files
  • Place new test files next to the source files or in the project's established test directory. Match whatever the project already does

Step 2: Analyze Every Code Path

For each new or modified function/method/component, map out:

  • Happy path. Normal input, expected output
  • Edge cases. Empty input, single element, boundary values (0, 1, -1, MAX_INT)
  • Null/undefined/nil. What happens with missing data
  • Type boundaries. Wrong types, type coercion traps
  • Error paths. Invalid input, network failures, timeouts, permission denied
  • Concurrency. Race conditions, parallel calls with shared state
  • State transitions. Initial state, intermediate states, final state
  • Integration points. How this code interacts with its dependencies

Step 3: Write the Tests

For EACH scenario identified above, write a test. No skipping.

Structure

  • One assertion per test. If a test name needs "and", split it into two tests
  • Descriptive names. Test names read as sentences describing the behavior:
    • should return empty array when input is empty
    • should throw ValidationError when email format is invalid
    • should retry 3 times before failing on network timeout
  • Arrange-Act-Assert. Set up, execute, verify. Clear separation.

What to Test

Pure functions / business logic:

  • Every branch (if/else, switch, ternary)
  • Every thrown error with exact error type and message
  • Return value types and shapes
  • Side effects (mutations, calls to external services)

API endpoints / handlers:

  • Success response (status code, body shape, headers)
  • Validation errors for each field (missing, wrong type, out of range)
  • Authentication/authorization failures
  • Rate limiting behavior if applicable
  • Idempotency for non-GET methods

UI components (if applicable):

  • Renders without crashing with required props
  • Renders correct content for each state (loading, error, empty, populated)
  • User interactions trigger correct callbacks (click, submit, type, select)
  • Accessibility: focusable, keyboard navigable, correct ARIA attributes
  • Conditional rendering. Each branch shows/hides correct elements

Database / data layer:

  • CRUD operations return correct data
  • Unique constraints reject duplicates
  • Cascade deletes work as expected
  • Transactions roll back on failure

Async operations:

  • Successful resolution
  • Rejection / error handling
  • Timeout behavior
  • Cancellation if supported
  • Concurrent calls don't interfere

Mocking Rules

  • Prefer real implementations over mocks
  • Only mock at system boundaries: network, filesystem, clock, random
  • Never mock the code under test
  • If you mock, verify the mock was called with expected arguments
  • Reset mocks between tests. No shared state leaking

Step 4: Verify

  • Run the new tests. Confirm they all pass
  • Temporarily break the code (change a return value or condition). Confirm at least one test fails
  • If no test fails when code is broken, the tests are useless. Rewrite them
  • Check coverage: every new function should have at least one test, every branch should be exercised

Output

  • Complete, runnable test file(s). Not snippets
  • Tests grouped by the function/component they cover
  • A brief summary: how many tests, what scenarios covered, any gaps you couldn't cover and why

Frequently asked questions

What does the Test Writer AI skill do?

Write comprehensive tests for new or changed code. Use automatically after adding a function, endpoint, or component, or changing behavior, when the change has no corresponding test changes. Not for config, docs, or test-only diffs. For judging whether existing tests adequately verify a change, use the pr-test-analyzer agent instead.

Why use Test Writer on TypingMind?

Because you install it once and use it with any model. Test Writer is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Test Writer in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/poshan0126/dotclaude/tree/main/skills/test-writer. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Test Writer?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Test Writer?

As many as you like. As long as a model supports skills, you can use Test Writer with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Test Writer AI skill free?

Yes. It is published on GitHub by poshan0126 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇