oimiragieo/agent-studio

token-saver-adaptive-ratio

Helper skill that exposes adaptive token-saver compression ratios for large context corpora.

View source

How to use

  1. Copy the installation command and review the source package before installing it in your own agent environment.
  2. Check the source document for required tools, credentials and supported hosts.
  3. Describe your input and desired deliverable; review the output against the source material.
npx skills add https://github.com/oimiragieo/agent-studio --skill token-saver-adaptive-ratio

Before you start

  • Installation does not include a model subscription, API allowance or permission to access your files.
  • Repository stars and installation counts describe activity, not an independent quality or security test.
Original skill document

Rendered from the source repository. Headings, examples, code, tables, links, and referenced images are preserved.

Token Saver Adaptive Ratio

Computes adaptive skeleton ratio based on corpus token count for context compression.

Purpose

This skill provides the computeAdaptiveRatio function that determines the optimal compression ratio based on the size of the context corpus:

  • <8K tokens: Returns 0.8 (keep 80% of content)
  • 8-32K tokens: Returns 0.5 (keep 50% of content)
  • 32-100K tokens: Returns 0.2 (keep 20% of content)
  • >100K tokens: Returns 0.1 (keep 10% of content)

Usage

javascript
const { computeAdaptiveRatio } = require('./scripts/main.cjs');

const ratio = computeAdaptiveRatio(50000); // Returns 0.2

When to Use

  • Before running context compression to determine the target compression ratio
  • When estimating token budget for large file reads
  • As part of the token-saver-context-compression workflow

Implementation

Re-exports the computeAdaptiveRatio function from token-saver-context-compression for module resolution and testing purposes.