Individual skill
cost-compact-context
Wrap getTokenOptimizer().getCompactContext() to retrieve compacted ReasoningBank context for cost-analysis queries; report bridge-reported tokensSaved
plugins/ruflo-cost-tracker/skills/cost-compact-context/SKILL.md
Source commit 722232566ad1fc4e73ba4fefc46d77d380ce61ba
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- Yes
- Repository scan complete
- No
- Skill scan complete
- No
- Observed behavior
- Network or broad shell
- Last checked
- Nov 9, 2026
These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.
Install this skill
Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.
An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.
Repository context
- Repository stars (not skill ratings)
- 81,312
- Repository last updated
- Nov 9, 2026
- License
- MIT
Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.
- agent-memory Repository topic
- agent-orchestration Repository topic
- agentic-ai Repository topic
- agentic-workflow Repository topic
- ai-agents Repository topic
- autonomous-agents Repository topic
- claude Repository topic
- claude-code Repository topic
- codex Repository topic
- hnsw Repository topic
- engineering Derived category
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Read excerpt
# 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`.