Skip to content
Development
Command

/add-tests

Add tests for recently changed files or specified code

BOOST
From plugin
project-starter
1.4k26 skills7 agents26 commands6 hooks
Install
> /plugin marketplace add CloudAI-X/claude-workflow-v2
> /plugin install project-starter@claude-workflow

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/add-tests

Context preview

What this command does when you run it.

Add tests for recently changed files or specified code

Command definition

add-tests.md
allowed-tools: Bash(git:*), Bash(npm:*), Bash(npx:*), Bash(yarn:*), Bash(bun:*), Bash(pytest:*), Bash(go:*), Read, Write
description: Add tests for recently changed files or specified code
argument-hint: "[file path or function name]"

Context

  • Recently modified files: !`git diff --name-only HEAD~3 2>/dev/null | head -10`
  • Project root files (infer the test framework from these): !`ls -a`
  • Existing test files: !`git ls-files 2>/dev/null | grep -i -e test -e spec | head -10`
  • Test directory structure: !`ls -la tests/ test/ __tests__/ spec/ 2>/dev/null | head -20`

Task

Add tests for the specified target:

1. Identify the file/function to test 2. Find the corresponding test file (or create one following project conventions) 3. Analyze the code to understand:

  • Input/output behavior
  • Edge cases
  • Error conditions

4. Write comprehensive tests covering:

  • Happy path
  • Edge cases
  • Error handling

5. Run the tests to verify they pass

Target: $ARGUMENTS

If no target specified, focus on recently modified files that lack test coverage.

Ships withproject-starter

A universal Claude Code workflow plugin with specialized agents, skills, hooks, and mode commands for any software project. Compatible with skills.sh — works with Claude Code, Cursor, Codex, and 35+ AI agents.

Get the whole plugin

Other commands on project-starter.