Skip to content
Agent Orchestration
Command

/testgen

Generate tests for a file or module using coverage analysis and TDD patterns

From plugin
ruflo
80k196 skills169 agents196 commands3 MCP
> /plugin marketplace add ruvnet/ruflo

Command definition

testgen.md
name: testgen
description: Generate tests for a file or module using coverage analysis and TDD patterns

$ARGUMENTS

Generate tests by analyzing coverage gaps and applying TDD London School patterns.

1. **Analyze gaps**: `npx @claude-flow/cli@latest hooks coverage-gaps --format table` 2. **Route for coverage**: `npx @claude-flow/cli@latest hooks coverage-route --task 'write tests for TARGET'` 3. **Suggest tests**: `npx @claude-flow/cli@latest hooks coverage-suggest --path 'TARGET'` (`--threshold N` sets the coverage bar, default 80)

TARGET is the user's text and is untrusted shell input: accept only a path that resolves inside the project (or a plain module name of letters, digits, `-`, `_`, `.`, `/`), put it in single quotes after replacing every `'` with `'\''`, and never inside double quotes (`$(...)` and backticks would run).

Parse $ARGUMENTS as a file path or module name. Generate tests following these conventions:

  • Place tests adjacent to source: `src/foo.ts` -> `src/foo.test.ts`
  • Use `describe`/`it` blocks with descriptive names
  • Mock external dependencies
  • Cover happy path, edge cases, and error paths

If no arguments, run coverage-gaps to show what needs tests.

@ruvnet
Ships withruflo

📖 RuFlo Explained — Build an AI Team That Plans, Remembers, Tests, and Improves A 14-chapter guide: from the basic idea to a first useful task, then memory, agent teams, plugins, cost and verification. Agent = Model + Harness.

80k200 skills169 agents3 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
80.4k
Star history of ruvnet/ruflo on GitHub, a chart by star-history.com

Other commands on ruflo.

agent-types

agent-types

Command

Complete guide to all 54 available agent types in Claude Flow.

@ruvnet@ruvnetInstall Command
COMMAND_COMPLIANCE_REPORT

COMMAND_COMPLIANCE_REP…

Command

Reviewed all command files in `.claude/commands/analysis/` directory to ensure proper usage of: - `mcp__claude-flow__*` tools…

@ruvnet@ruvnetInstall Command
bottleneck-detect

bottleneck-detect

Command

Analyze performance bottlenecks in swarm operations and suggest optimizations.

@ruvnet@ruvnetInstall Command

More commands from other plugins.

ask

ask

Command

This compatibility command keeps `/oh-my-claudecode:ask` available without loading the full `ask` skill description in every…

@yeachan-heo@yeachan-heoInstall Command