cost-compact-context
Wrap getTokenOptimizer().getCompactContext() to retrieve compacted ReasoningBank context for cost-analysis queries; report bridge-reported tokensSaved
npx skills add ruvnet/ruflo --skill cost-compact-context --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Cost Compact Context Wraps `getTokenOptimizer().getCompactContext()` from `@claude-flow/integration` for cost-analysis queries. The bridge dynamically imports `agentic-flow` with graceful fallback: when the package isn't installed, `tokensSaved` is `0` and the skill exits cleanly. No MCP tool wraps `getTokenOptimizer` today (ADR-0002 §"Riskiest assumption"); we shell a Node one-liner instead. ## Steps 1. **Take the query** — the single argument. 2. **Invoke** — run from anywhere under `v3/` so `@claude-flow/integration` resolves: ```bash ( cd v3 && node ../plugins/ruflo-cost-tracker/scripts/compact.mjs "<QUERY>" ) ``` The script imports `@claude-flow/integration/token-optimizer` (canonical export — **not** `dist/token-optimizer.js`, which would double the `.js` extension via Node's `./*` exports rule), calls `getCompactContext(query)`, and prints a markdown summary plus a JSON line via `COMPACT_QUIET=1`. 3. **Report** — markdown table with: memories retrieved, tokens saved (bridge-reported), agentic-flow availability, cache hit rate. The script also emits a "bridge-reported, not measured against a no-RAG baseline" disclaimer. On bridge-unavailable: prints "agentic-flow not instal
- Steps
- Caveats — claimed upstream, not yet verified
- Fallback
- Cross-references
What does the cost-compact-context skill do?
Wrap getTokenOptimizer().getCompactContext() to retrieve compacted ReasoningBank context for cost-analysis queries; report bridge-reported tokensSaved
How do I install it?
Run `npx skills add ruvnet/ruflo --skill cost-compact-context --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ruvnet/ruflo, a repository with 67,015 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.