Files
ReuvenandRuFlo f457b39185 feat(ruflo-testgen): v0.2.0 — adopt plugin contract + SPARC Refinement-phase ownership (ADR-0001)
Plugin already had 1 agent + 2 skills + 1 command at v0.1.0. The
contract pieces were missing.

Notable cross-references:
- testgaps worker (consumed) → ruflo-loop-workers ADR-0001 (canonical
  definition of the 12 background workers)
- SPARC Refinement phase (owned) → ruflo-sparc ADR-0001 §"Phase-to-plugin
  alignment". This plugin is the canonical handoff for the Refinement
  phase, paired with ruflo-jujutsu for diff-aware refactor.
- 3 coverage CLI commands surfaced: hooks coverage-gaps, coverage-route,
  coverage-suggest

- ADR-0001 (Proposed) at docs/adrs/0001-testgen-contract.md
- README adds Compatibility (pin v3.6), testgaps worker + 3 coverage
  CLI command surface table, SPARC Refinement-phase ownership block,
  Namespace coordination (claims test-gaps; defers to ruflo-agentdb
  ADR-0001), Verification + Architecture Decisions
- plugin.json bumps 0.1.0 → 0.2.0; description names the testgaps
  worker + SPARC ownership; keywords add mcp, tdd-london-school,
  coverage-routing
- scripts/smoke.sh — 10 structural checks: version + keywords, both
  skills + agent + command present, hooks_worker-dispatch + testgaps
  trigger, 3 coverage CLI commands referenced, v3.6 pin, namespace
  coordination, test-gaps claimed, SPARC Refinement cross-reference,
  ADR Proposed, no wildcard tools

Verification: bash plugins/ruflo-testgen/scripts/smoke.sh → 10/10

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-04 20:45:33 -04:00

3.2 KiB

ruflo-testgen

Test gap detection, coverage analysis, and automated test generation. SPARC Refinement-phase canonical owner.

Install

/plugin marketplace add ruvnet/ruflo
/plugin install ruflo-testgen@ruflo

What's Included

  • Coverage Gap Detection: Identify untested code paths with prioritized gap analysis
  • Coverage-Aware Routing: Route tasks to agents based on test coverage needs
  • Test Generation: Automated test scaffolding for uncovered modules
  • TDD Support: London School (mock-first) test patterns with agent coordination
  • testgaps Worker: Background worker for continuous coverage analysis
  • Integration: Works with hooks system for post-edit test suggestions

Requires

  • ruflo-core plugin (provides MCP server)

Compatibility

  • CLI: pinned to @claude-flow/cli v3.6 major+minor.
  • Verification: bash plugins/ruflo-testgen/scripts/smoke.sh is the contract.

testgaps worker + coverage CLI surface

This plugin's two MCP/CLI surfaces:

Surface Invocation
MCP: dispatch the testgaps worker mcp tool call hooks_worker-dispatch --json -- '{"trigger":"testgaps"}'
CLI: coverage-gaps (table of gaps) npx @claude-flow/cli@latest hooks coverage-gaps --format table --limit 20
CLI: coverage-route (route a task by gap) npx @claude-flow/cli@latest hooks coverage-route --task "add auth tests"
CLI: coverage-suggest (suggest tests for a path) npx @claude-flow/cli@latest hooks coverage-suggest --path src/

testgaps is one of 12 background workers documented in ruflo-loop-workers ADR-0001.

SPARC Refinement-phase ownership

This plugin owns the Refinement phase per ruflo-sparc ADR-0001 §"Phase-to-plugin alignment". When SPARC's sparc-refine skill runs, it composes:

  1. This plugin — coverage gap detection + TDD test generation
  2. ruflo-jujutsu — diff-aware refactor recommendations

Together they enforce the Refinement gate: ≥80% coverage on new code + diff risk score below threshold.

Namespace coordination

This plugin owns the test-gaps AgentDB namespace (kebab-case, follows the convention from ruflo-agentdb ADR-0001 §"Namespace convention"). Reserved namespaces (pattern, claude-memories, default) MUST NOT be shadowed.

test-gaps indexes detected gaps by file + priority + last-seen timestamp. Accessed via memory_* (namespace-routed).

Verification

bash plugins/ruflo-testgen/scripts/smoke.sh
# Expected: "10 passed, 0 failed"

Architecture Decisions

  • ruflo-loop-workers — defines the testgaps background worker
  • ruflo-sparc — Refinement-phase canonical handoff
  • ruflo-jujutsu — diff-aware refactor companion in the Refinement gate
  • ruflo-agentdb — namespace convention owner