Skip to content
Skillv1.0.0

token-saver-adaptive-ratio

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

by oimiragieo(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from oimiragieo/agent-studio (.claude/skills/token-saver-adaptive-ratio/SKILL.md). Install upstream with npx skills add oimiragieo/agent-studio --skill token-saver-adaptive-ratio. Copyright stays with the author.

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

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.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/oimiragieo-agent-studio-token-saver-adaptive-ratio/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

oimiragieo-agent-studio-token-saver-adaptive-ratio.ocm.jsonjson
{
  "ocm": "1",
  "id": "oimiragieo-agent-studio-token-saver-adaptive-ratio",
  "kind": "skill",
  "name": "token-saver-adaptive-ratio",
  "description": "Helper skill that exposes adaptive token-saver compression ratios for large context corpora.",
  "publisher": "oimiragieo",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "token-saver",
      "compression",
      "helper",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Helper skill that exposes adaptive token-saver compression ratios for large context corpora."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/oimiragieo/agent-studio",
      "path": ".claude/skills/token-saver-adaptive-ratio/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/oimiragieo/agent-studio/blob/HEAD/.claude/skills/token-saver-adaptive-ratio/SKILL.md",
      "key": "oimiragieo/agent-studio/.claude/skills/token-saver-adaptive-ratio/SKILL.md"
    }
  },
  "instructions": "# Token Saver Adaptive Ratio\n\nComputes adaptive skeleton ratio based on corpus token count for context compression.\n\n## Purpose\n\nThis skill provides the `computeAdaptiveRatio` function that determines the optimal compression ratio based on the size of the context corpus:\n\n- **<8K tokens**: Returns 0.8 (keep 80% of content)\n- **8-32K tokens**: Returns 0.5 (keep 50% of content)\n- **32-100K tokens**: Returns 0.2 (keep 20% of content)\n- **>100K tokens**: Returns 0.1 (keep 10% of content)\n\n## Usage\n\n```javascript\nconst { computeAdaptiveRatio } = require('./scripts/main.cjs');\n\nconst ratio = compute",
  "cost": {
    "context_tokens": 249
  }
}

Fetch it by URL: GET /api/v1/registry/oimiragieo-agent-studio-token-saver-adaptive-ratio/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.