All skills
shipshitdev avatar

/context-optimization

@d322667
by Ship Shitshipshitdev/library37 stars
3

Improve context efficiency through context budgeting, observation masking, prefix or KV-cache strategy, partitioning, token-cost reduction, retrieval scoping, and extending effective context capacity without lowering answer quality. Use when token costs or context budgets constrain a task, tool outputs are verbose, cache hit rate is low, or context must be partitioned across agents.

Use this Skill: https://skilld.dev/gh/shipshitdev/library/context-optimization

This session only. Nothing lands on disk.

README.md

≈462 tokens on demand. Your agent reads this file only when SKILL.md points to it.

context-optimization

Apply optimization techniques (compaction, observation masking, KV-cache, partitioning) to extend effective context capacity.

Upstream

Derived from muratcankoylan/Agent-Skills-for-Context-Engineering (MIT).

Field Value
Source skills/context-optimization/SKILL.md
Upstream ref main
Synced at commit cbc2c978133d
Last synced 2026-06-12
License MIT

Local modifications: Ported to upstream v2.1.0 (2026-05-15 corpus, commit cbc2c978133d) on 2026-06-12 — body and references match upstream. Cross-references to upstream sibling skills not vendored here (context-compression, filesystem-context, project-development, latent-briefing) were removed so routing only names skills present in this marketplace. scripts/compaction.py carries two local hardening fixes over upstream (CodeRabbit-flagged, candidates to push back): ContextBudget now rejects total_limit<=0 and scales the reserved buffer so reservation_limit stays non-negative; calculate_cache_metrics now debits the unhit remainder of a partial cache hit from misses, where upstream counted only the hit fraction and so inflated hit_rate.

Checking for upstream changes: when upstream has moved ahead of the synced marker above, diff skills/context-optimization/SKILL.md on main since commit cbc2c978133d, port anything worth bringing home, then bump metadata.upstream_commit (or metadata.upstream_version) and metadata.last_synced in SKILL.md and this table.

Source: SKILL.md on GitHub

1 warning16d4 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill provides utilities for optimizing AI agent context through techniques like compaction, masking, and caching. It is safe for general use, though it processes external tool outputs and conversation history, which creates a surface for indirect prompt injection during summarization. No critical security risks, malicious code, or dangerous capabilities like network access were detected.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    4/4 files flagged

Signed by skilld at d322667. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 days ago.

Activeupdated 3 months ago
Other metadata
metadata
{
  "version": "2.1.0",
  "source": "https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering/blob/main/skills/context-optimization/SKILL.md",
  "upstream_repo": "muratcankoylan/Agent-Skills-for-Context-Engineering",
  "upstream_ref": "main",
  "upstream_commit": "cbc2c978133d",
  "last_synced": "2026-06-12",
  "license": "MIT",
  "tags": "context, optimization, agents"
}

README badge

README badge for shipshitdev/library/context-optimization