create-test

A command that writes unit tests for a chosen file or module. Unit tests are small checks that verify one part of a program behaves correctly.

In plain words
What is it for?
Use it to create tests for hooks, utilities, components, stores, and API hooks, or for files changed between two Git branches.
Why use it?
It reduces the effort of deciding what to test, where to put the test file, and how to cover changed code and edge cases.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/jpesewang/solo-dev-workflow/create-test
Clone the repo
git clone --depth 1 https://github.com/jpeseWang/solo-dev-workflow
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 699 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00699
Opus 5 $0.00000 $0.00349
Sonnet 5 $0.00000 $0.00140
Haiku 4.5 $0.00000 $0.00070

Measured 2d ago against content hash 1b0837e766e0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

create-test scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

variants/team-jira/commands/create-test.md · 91 lines

How it starts

The opening of the file, as written. The whole thing — 91 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are $DEV_ROLE, writing unit tests for the $PROJECT_NAME project.

Why writing tests matters

The quality scorer measures test_discipline: the % of commits that touch test files.

  • 25% of commits with tests = 100 points
  • Test files are recognized by: /tests/, /test/, /__tests__/, /spec/, test_*, *_test.*, *.test.*, *_spec.*, *.spec.*

Goal: for every 3-4 code commits, have 1 test commit

Input

$ARGUMENTS — the file or module that needs tests. Example: src/modules/chat/hooks/use-chat-page.ts

If absent, check git diff dev...HEAD --name-only and write tests for the changed files.

Actions

Step 1: Read the file to test

Read the source file to understand the logic, dependencies, and edge cases.

Step 2: Create the test file

Place the test file in the corresponding location:

  • Hook: src/modules/{module}/__tests__/{hook-name}.test.ts
  • Utility: src/core/utils/__tests__/{util-name}.test.ts
  • Component: src/modules/{module}/__tests__/{component-name}.test.tsx
  • Store: src/app/stores/__tests__/{store-name}.test.ts
  • API hook: src/core/api/__tests__/{api-hook-name}.test.ts

Step 3: Write the test from the template

import { renderHook, act } from '@testing-library/react-hooks'
// import source under test

describe('{ModuleName} - {FunctionName}', () => {
    beforeEach(() => {
        // reset mocks
        jest.clearAllMocks()
    })

    describe('happy path', () => {
        it('should {expected behavior} when {condition}', () => {
            // Arrange
            // Act
            // Assert
        })
    })

    describe('edge cases', () => {
        it('should handle empty input gracefully', () => {
            // test null/undefined/empty
        })

        it('should handle error state correctly', () => {
            // test error scenarios
        })
    })

    describe('boundary conditions', () => {
        it('should {boundary behavior}', () => {
            // test limits, max values, etc.
        })
    })
})

Read the full file on GitHub · 91 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 91 lines · 0 tokens per session scan A 1b0837e766e0

Subscribe to this mod's changes

create-test is a command published in the GitHub repository jpeseWang/solo-dev-workflow (2 stars, last pushed 12d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 699 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.