Files
ruflo/plugins/ruflo-testgen
rUvandr a12e204de3 fix(plugins): Codex hook manifests for every function-hook plugin (#3688) (#5206)
* fix(plugins): give every function-hook plugin a Codex hook manifest

Codex 0.172 rejects a hooks/hooks.json that carries Claude Code's
function-hook `modules` key ("unknown field `modules`, expected
`description` or `hooks`") and drops that plugin's hooks, printing the
warning on every start (#3688). Only ruflo-adr, ruflo-ddd, ruflo-sparc
and ruflo-swarm had the fix.

Apply the ruflo-swarm pattern to the other 39 plugins whose installed
root declares `modules`: a .codex-plugin/plugin.json (name, description,
version, author, homepage, license, as in the existing four) pointing at
hooks/codex-hooks.json. That file keeps the classic command hooks and
drops only `modules`; ruflo-metaharness keeps its SessionStart secret
bridge, all others get an explicit no-op whose description says the mod
part does not run on this host. ruflo-ai-team and ruflo-x-gateway are
untouched: their marketplace roots (directory/) ship no hooks.

Codex caches plugins by <name>/<version>/, and
audit-plugin-version-bump requires it, so each of the 39 gets a patch
bump, with the smoke.sh pins, ruflo-console's CONSOLE_VERSION, the
protector README and the console/mods/protector changelogs updated.

The swarm-only test is generalized into
tests/plugins/codex-plugin-hook-manifests.test.mjs, which covers every
plugin whose installed root has a `modules` key and now runs in
all-plugins-smoke.yml.

Co-Authored-By: RuFlo <ruv@ruv.net>

* fix(ruflo-metaharness): no SessionStart hook on Codex

The hook writes OPENROUTER_API_KEY through CLAUDE_ENV_FILE, which Codex
does not provide, so on Codex it does nothing. Shipping it would add a
new hook Codex asks the user to review, which stops a phone-started
Codex tab at a review screen.

Co-Authored-By: RuFlo <ruv@ruv.net>

---------

Co-authored-by: r <r@x>
2026-11-30 16:48:51 -05:00
..

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

As a mod

This plugin also loads as a function-hook mod (ADR-445 pattern, hooks/hooks.json → register.ts). No network, no process spawn, no model call.

  • Guard (default on, tighten-only). It counts the hooks_worker-dispatch and coverage calls made this session. It is observe-only: testgen has no harmful input to guard, so it never denies and has nothing to configure.
  • Status file. .claude-flow/testgen-mod/status.json ({version: 1, updatedMs, guard, checked, blocked, seen}), written at session start and when a counter changes.
  • /testgen-mod answers locally: status, workers. (The plugin's own commands are prompt commands, which a hook cannot answer, so the mod has its own name.)
  • Options. None.

Test it: claude plugin validate plugins/ruflo-testgen, claude plugin test plugins/ruflo-testgen, bash plugins/ruflo-testgen/scripts/smoke.sh.