Back to Ruflo

ruflo-loop-workers

plugins/ruflo-loop-workers/README.md

3.6.304.3 KB
Original Source

ruflo-loop-workers

Cache-aware /loop workers and CronCreate background automation. Substrate plugin for every recurring task in the ruflo family.

Install

/plugin marketplace add ruvnet/ruflo
/plugin install ruflo-loop-workers@ruflo

What's Included

  • Loop Workers: Recurring tasks via /loop with ScheduleWakeup (delay <270s for prompt cache hits)
  • CronCreate: Background cron jobs for audit, optimization, and monitoring
  • 12 Background Workers: ultralearn, optimize, consolidate, predict, audit, map, preload, deepdive, document, refactor, benchmark, testgaps
  • Daemon Management: Start, stop, status, trigger, and enable workers
  • ADR-091 Integration: Native Claude Code capabilities preferred over daemon polling

Requires

  • ruflo-core plugin (provides MCP server)

Compatibility

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

MCP surface (5 tools)

All defined at v3/@claude-flow/cli/src/mcp-tools/hooks-tools.ts:

ToolPurpose
hooks_worker-listList available workers and their triggers
hooks_worker-dispatchDispatch a worker run with --trigger <worker-name> and optional --scope
hooks_worker-statusInspect a running worker
hooks_worker-detectDetect which workers should fire based on context
hooks_worker-cancelCancel a running worker

12 worker triggers → consumer plugins

TriggerConsumer pluginPurpose
ultralearnruflo-intelligenceBootstrap learning corpus from a deep codebase scan
optimizeruflo-cost-tracker, ruflo-intelligencePerformance + cost optimization recommendations
consolidateruflo-intelligence, ruflo-agentdbEWC++ memory consolidation
predictruflo-intelligencePredictive routing for upcoming tasks
auditruflo-security-audit, ruflo-aidefenceSecurity + compliance audit pass
mapruflo-knowledge-graphBuild/refresh entity-relation knowledge graph
preloadruflo-core, ruflo-rag-memoryWarm caches before high-frequency operations
deepdiveruflo-goals (deep-research)Multi-source investigation pass
documentruflo-docsGenerate API docs + drift detection
refactorruflo-jujutsuDiff-aware refactor recommendations
benchmarkruflo-cost-tracker, ruflo-iot-cognitumPerf benchmarks
testgapsruflo-testgenCoverage gap detection + test generation

Invocation pattern (CLI + MCP):

bash
# CLI
npx @claude-flow/cli@latest hooks worker dispatch --trigger document --scope api

# MCP
mcp tool call hooks_worker-dispatch --json -- '{"trigger": "document", "scope": "api"}'

Cache-aware /loop integration

This plugin pairs with ruflo-autopilot ADR-0001 which owns the 270s cache-aware ScheduleWakeup heartbeat contract. Recommended fallback heartbeat is 270 seconds — under the 5-minute prompt-cache TTL so the next wake-up reads conversation context cached. Going past 300s pays a cache-miss; rounding to 5 minutes is the worst-of-both case.

For event-driven loops, arm a Monitor and let the 270s wake be the safety net.

Namespace coordination

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

worker-history records dispatch events, durations, success/failure verdicts. Accessed via memory_* tools (namespace-routed).

Verification

bash
bash plugins/ruflo-loop-workers/scripts/smoke.sh
# Expected: "12 passed, 0 failed"

Architecture Decisions

  • ruflo-autopilot — owns the 270s cache-aware /loop heartbeat contract
  • ruflo-docs, ruflo-security-audit, ruflo-testgen, ruflo-knowledge-graph, etc. — worker-trigger consumers per the table above
  • ruflo-agentdb — namespace convention owner; backing store for worker-history