Agent skill

Test Writer

by hamzafarooq in hamzafarooq/claude-code-starter

Write unit tests for any function — happy path, edge cases, and error cases.

MITAuto-check passedTesting & QA

Install Test Writer

skills CLI
$ npx skills add hamzafarooq/claude-code-starter --skill test-writer -a claude-code

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

GitHub CLI
$ gh skill install hamzafarooq/claude-code-starter test-writer --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/hamzafarooq/claude-code-starter.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/test-writer .claude/skills/test-writer && 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-writer
GitHub stars
145
Token cost
~345 tokens
SKILL.md length
155 words
Files
1
Skills in repo
29
Repo updated
First seen
Licence
MIT

At a glance

Write unit tests for any function — happy path, edge cases, and error cases.

  • The user asks for tests
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Wants to add test coverage
  • Is practicing TDD

What it does

Test Writer is an agent skill from hamzafarooq/claude-code-starter. Write unit tests for any function — happy path, edge cases, and error cases. Use when the user asks for tests, wants to add test coverage, or is practicing TDD.

Its SKILL.md is about 350 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 Unit testing, Test coverage and Test-driven development. The licence is MIT.

When your agent uses it

  • The user asks for tests
  • Wants to add test coverage
  • Is practicing TDD

Example prompts

  • “/test-writer”

What it can do on your machine

Read from SKILL.md and the folder at commit 172c531. 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

    No scripts in the folder and no shell commands in SKILL.md (its code samples are language).

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

  • Network

    No URLs in SKILL.md.

    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 Writer loads about 345 tokens when it runs. Until then it costs about 43 tokens; SKILL.md has 155 words of instructions outside code blocks.

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

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 hamzafarooq/claude-code-starter at commit 172c531, republished under its MIT licence (© hamzafarooq). 155 words, ~345 tokens.

Download SKILL.mdSave it as .claude/skills/test-writer/SKILL.md (or your agent's skills folder).
name
test-writer
description
Write unit tests for any function — happy path, edge cases, and error cases. Use when the user asks for tests, wants to add test coverage, or is practicing TDD.

Ask the user to share the function or code they want tests for.

Then write tests covering:

Tests for [functionName]

Testing framework: [detect from package.json — Jest, Vitest, pytest, etc. Ask if unclear]


Happy path

Test the expected behavior with valid inputs. One test per meaningful variation.

language
test('returns [expected] when given [input]', () => {
  // arrange
  // act
  // assert
})
Edge cases

Tests for boundary conditions and unusual but valid inputs:

  • Empty input (empty string, empty array, 0)
  • Single item
  • Maximum size or value
  • Special characters (if string input)
Error cases

Tests that verify the function fails correctly:

  • Invalid input types
  • Null/undefined inputs
  • Inputs that should trigger error handling
Mock requirements

List any external dependencies (API calls, database queries, file system) that need mocking, with example mock setup.


Coverage target: Aim for all branches, not just lines. Flag any branch that is difficult to test and explain why.

Write tests that read like documentation — the test name should be a sentence explaining what the function does in that scenario.

© hamzafarooq, MIT. 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-writer of hamzafarooq/claude-code-starter.

Open the folder on GitHubat commit 172c531

Compare with similar skills

Test Writer 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 Writer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Test Writer this skillhamzafarooq/claude-code-starter145—~345Automated safety check: PassMIT
Test Experteinverne/dotfiles121—~2.3kAutomated safety check: PassGPL-3.0
Test Coveragescott-fryxell/brayness124—~1.6kAutomated safety check: PassMIT
TDD Guidealirezarezvani/claude-skills28k—~3.4kAutomated safety check: PassMIT
TDD GuideLeoYeAI/openclaw-master-skills2.2k—~1.4kAutomated safety check: PassMIT
Discover Testingrand/cc-polymath181—~513Automated safety check: PassMIT

Similar skills

  • Test Expert

    einverne/dotfiles

    Testing methodologies, test-driven development (TDD), unit and integration testing, and testing best practices across multiple frameworks.

    121 GitHub stars~2.3k tokensUpdated 29 days ago
    Testing & QAAuto-check passed
  • Test Coverage

    scott-fryxell/brayness

    Write Vitest specs for Vue 3 JavaScript (Vite Plus, happy-dom, @vue/test-utils) and analyze V8 coverage + Fallow health to prioritize test-first refactors.

    124 GitHub stars~1.6k tokensUpdated 10 days ago
    Testing & QAAuto-check passed
  • TDD Guide

    alirezarezvani/claude-skills

    Test-driven development skill for writing unit tests, generating test fixtures and mocks, analyzing coverage gaps, and guiding red-green-refactor workflows across Jest, Pytest, JUnit, Vitest, and…

    28k GitHub stars~3.4k tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • TDD Guide

    LeoYeAI/openclaw-master-skills

    Test-driven development skill for writing unit tests, generating test fixtures and mocks, analyzing coverage gaps, and guiding red-green-refactor workflows across Jest, Pytest, JUnit, Vitest, and…

    2.2k GitHub stars~1.4k tokensUpdated 2 mo ago
    Testing & QAAuto-check passed
  • Discover Testing

    rand/cc-polymath

    Automatically discover testing skills when working with unit testing, integration testing, e2e testing, TDD, test coverage, mocking, pytest, Jest, or test automation.

    181 GitHub stars~513 tokensUpdated 7 mo ago
    Testing & QAAuto-check passed
  • Testing

    TheBeardedBearSAS/claude-craft

    TDD/BDD testing principles. An agent skill from TheBeardedBearSAS/claude-craft.

    107 GitHub stars~887 tokensUpdated 24 days ago
    Testing & QAAuto-check passed

More from hamzafarooq/claude-code-starter

All 29 skills in this repo
  • Beautiful HTML

    hamzafarooq/claude-code-starter

    Turn any document, proposal, report, or outline into a stunning single-file HTML presentation using 34 pre-built professional templates.

    145 GitHub stars~1.6k tokensUpdated 25 days ago
    Auto-check passed
  • Claude Code Deck

    hamzafarooq/claude-code-starter

    Generate a complete, ready-to-share HTML presentation explaining Claude Code, Skills, Sub Agents, Hooks, and Multi-Agent Systems — designed for product managers.

    145 GitHub stars~972 tokensUpdated 25 days ago
    Auto-check passed
  • Competitor Research

    hamzafarooq/claude-code-starter

    Research 3–5 competitors for any product or feature. An agent skill from hamzafarooq/claude-code-starter.

    145 GitHub stars~1.6k tokensUpdated 25 days ago
    Auto-check passed
  • Frontend Slides

    hamzafarooq/claude-code-starter

    Create stunning, animation-rich single-file HTML presentations from scratch or by converting a PowerPoint (.pptx) file.

    145 GitHub stars~1.4k tokensUpdated 25 days ago
    Auto-check passed
  • Md To PDF

    hamzafarooq/claude-code-starter

    Convert any markdown file to a clean PDF. An agent skill from hamzafarooq/claude-code-starter.

    145 GitHub stars~598 tokensUpdated 25 days ago
    Auto-check passed
  • User Story Writer

    hamzafarooq/claude-code-starter

    Converts feature ideas or rough bullets into user stories with acceptance criteria.

    145 GitHub stars~531 tokensUpdated 25 days ago
    Auto-check passed

Categories

Questions about Test Writer

What does Test Writer do?

Write unit tests for any function — happy path, edge cases, and error cases. Test Writer is an agent skill from hamzafarooq/claude-code-starter. Write unit tests for any function — happy path, edge cases, and error cases.

When should I use Test Writer?

Test Writer fits situations like: the user asks for tests; wants to add test coverage; is practicing TDD.

How do I install Test Writer in Claude Code?

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

How do I install Test Writer in Codex?

Run `npx skills add hamzafarooq/claude-code-starter --skill test-writer -a codex`. Or copy the skill folder (.claude/skills/test-writer in hamzafarooq/claude-code-starter) into .agents/skills/test-writer in your project. Codex loads it when a task matches its description.

Can I use Test Writer 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 hamzafarooq/claude-code-starter --skill test-writer -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-writer, .gemini/skills/test-writer, .github/skills/test-writer and .opencode/skills/test-writer in your project.

What does Test Writer need to run?

SKILL.md names no scripts, command-line tools or credentials: Test Writer is instructions for the agent only.

Does Test Writer access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Test Writer 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 Writer use?

Test Writer is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Test Writer use?

About 345 tokens (SKILL.md is roughly 1.4k 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 Writer?

Skills that share tags, products or a category with Test Writer: Test Expert (einverne/dotfiles, 121 stars), Test Coverage (scott-fryxell/brayness, 124 stars), TDD Guide (alirezarezvani/claude-skills, 28k stars) and TDD Guide (LeoYeAI/openclaw-master-skills, 2.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Test Writer?

hamzafarooq (a GitHub user) maintains it in hamzafarooq/claude-code-starter, which has 145 GitHub stars. The repository holds 29 skills in this directory. The repository was last updated on September 13, 2026.

Source: hamzafarooq/claude-code-starter on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.