context-optimization

Tinjau · 63
Diindeks di Registry

>-

Verified installs0
Star33
Versi1.0.0
Kualitas57/100 · Menjanjikan
Kepercayaan63/100 · Hanya sandbox
Audit74/100 · Perlu ditinjau

Profil aset

Riset dan pekerjaan pengetahuan

Deep research, source comparison, literature review, RAG, knowledge search, and reports.

Lihat kategori

Skenario

Agent riset

I need my agent to research a topic, compare sources, and produce a concise report.

Kecocokan Agent

Claude Code + CLI + Codex

Cocok untuk Codex, Claude Code, Cursor, CLI, atau Agent khusus.

Pasang

Siap

npx skills add shipshitdev/skills --skill context-optimization

Pemeliharaan

Terkini

2 hari sejak push

Risiko

Perlu ditinjau

Lisensi tidak jelas

Kualitas GitHub

33

57/100 Kualitas · 71/100 Kepercayaan

Tag cakupan

RisetAgent risetautomationagent-skill

Catatan ulasan

Lisensi tidak jelas · Low GitHub adoption signal

Kartu adopsi Agent

Kepercayaan, audit, dan kesiapan pemasangan dalam sekali lihat

Skor ini menggabungkan metadata repositori publik, sinyal ulasan OpenAgentSkill, kebaruan pemeliharaan, dan kesiapan pemasangan. Ini adalah sinyal shortlist, bukan pengganti peninjauan manusia.

Kualitas

Menjanjikan
57

Useful candidate, but compare it with alternatives before adopting.

Kepercayaan

Hanya sandbox
63

Kandidat berguna dengan sinyal kepercayaan yang kurang atau bercampur. Gunakan di ruang kerja terisolasi hingga loop hasil membuktikan kecocokan tugas.

Audit

Perlu ditinjau
74

Tinjauan yang dapat dibaca mesin tentang kesiapan pemasangan, metadata keamanan, pemeliharaan, dan risiko adopsi.

Trust Score OpenAgentSkill v5

Tinjauan manusia sebelum pemasangan

Jalankan hanya dalam sandbox dan bandingkan alternatif terdekat sebelum digunakan untuk kerja nyata.

CodexClaude CodeCursorOpenAgentSkill CLI

Star

33 star GitHub

Aktivitas repositori

33 star dan 3 fork

Pemeliharaan

2 hari sejak push

Lisensi

Tidak diketahui

Pasang

npx skills add shipshitdev/skills --skill context-optimization

Keamanan pemasangan

Jalur pemasangan paket atau runtime standar

Cakupan izin

secrets or environment access

Hasil Agent

Belum ada data hasil Agent

Dokumentasi

Usable metadata, review docs

Ringkasan risiko

Tinjau sebelum produksi

  • Lisensi tidak jelas
  • Low GitHub adoption signal
  • Quality score needs review
  • GitHub adoption: 33 GitHub stars

Kesiapan pemasangan

Jalur pemasangan tersedia

  • Jalur pemasangan tersedia
  • Bukti repositori tersedia
  • Lisensi tidak jelas
  • Belum ada bukti hasil Agent-Proven

Metadata yang dapat dibaca Agent

Data keputusan yang dapat dibaca mesin untuk skill ini.

Gunakan blok ini atau JSON tersemat untuk memutuskan apakah Agent perlu memasang skill ini, memilih alternatif, atau meminta tinjauan manusia terlebih dahulu.

Buka JSON

Tugas yang sesuai

  • alur kerja Browser automation
  • Tim Claude Code
  • builders willing to evaluate younger projects
  • Navigate pages

Agent yang sesuai

CodexClaude CodeCursorOpenAgentSkill CLICLI

Keputusan pemasangan

Perintah
npx skills add shipshitdev/skills --skill context-optimization
Kebijakan
Tinjau
Tinjauan manusia
Ya

Kepercayaan dan risiko

Kepercayaan
63/100
Audit
74/100
Tingkat risiko
Perlu ditinjau

Lingkar hasil

Endpoint
/api/agent/outcome
ID event
resolve
Hasil
5

Perintah pemasangan

npx skills add shipshitdev/skills --skill context-optimization

Jangan gunakan ketika

  • Tim yang membutuhkan SLA dengan dukungan vendor
  • production agents without a repository review
  • Low GitHub adoption signal
  • No OpenAgentSkill engagement data yet
  • Petunjuk izin berisiko tinggi: Secrets or environment access

Keamanan Agent v2

46/100 · Hindari pemasangan otomatis

EksperimentalTinjau

Sparse or mixed signals. Useful for discovery, but not for autonomous installation.

Test manually in an isolated workspace and compare against safer alternatives.

Selesaikan via API

Sedang

Akses jaringan

Skill kemungkinan mengambil halaman jarak jauh, API, repositori, atau layanan eksternal.

Tinggi

Secrets or environment access

Skill metadata references credentials, tokens, environment variables, or secret-bearing workflows.

Sedang

Akses database

Skill dapat memeriksa skema, mengkueri database, atau bekerja dengan penyimpanan persisten.

  • Petunjuk izin berisiko tinggi: Secrets or environment access
  • Lisensi tidak jelas

Target pemasangan

Pasang skill ini di alur Agent Anda

Gunakan endpoint publik untuk mengambil perintah, checklist keamanan, prompt target, dan tautan kanonis.

skill install

OpenAgentSkill CLI

Resolve policy, run the source installer safely, and report a verified install receipt.

$ npx --yes https://github.com/Leon-Drq/openagentskill/releases/download/cli-v0.2.1/openagentskill-0.2.1.tgz install shipshitdev-context-optimization

Rencana resolusi Agent

Biarkan Agent memverifikasi kecocokan sebelum memasang.

API Resolve mengembalikan skill utama, alternatif, kebijakan keamanan, catatan audit, target pemasangan, dan prompt siap pakai.

Buka rencana teks

Agent harus memeriksa

  • Task fit and alternatives from Resolve API.
  • Audit score, trust score, and safety policy warnings.
  • Install target compatibility for Codex, Claude Code, Cursor, or CLI.

Salin prompt

Task: Use context-optimization in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20context-optimization%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/shipshitdev-context-optimization/install
Install command: npx skills add shipshitdev/skills --skill context-optimization
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.

Serah-terima Agent

Berikan jalur pemasangan kepada Agent, bukan direktori lain.

Gunakan endpoint publik untuk mengambil perintah, checklist keamanan, prompt target, dan tautan kanonis.

Buka API pemasangan

Prompt Agent

Use context-optimization for this task. Review https://www.openagentskill.com/api/skills/shipshitdev-context-optimization/install, then install with: npx skills add shipshitdev/skills --skill context-optimization

Metadata Registry

Profil yang dapat dibaca Agent untuk pemilihan skill otomatis.

API Registry menyediakan sinyal keputusan, kepercayaan, audit, use case, dan pemasangan tanpa mengikis UI.

Buka Manifest

Kecocokan Agent

56/100

Browser automation

Platform

Claude Code

Laporan audit

Perlu ditinjau · 74/100

Tinjauan yang dapat dibaca mesin tentang kesiapan pemasangan, metadata keamanan, pemeliharaan, dan risiko adopsi.

Lihat laporan auditLihat laporan evaluasi

Panel keputusan Agent

Needs validation for Browser automation

Do a manual repository review before adding this to an agent workflow.

56
Kesiapan
Tinjau
Tahap

Peran di stack

Perlu validasi

Kecocokan utama

Browser automation

Label kepercayaan

Perlu tinjauan manual

Jalur pemasangan

Perintah siap

Gunakan saat

  • alur kerja Browser automation
  • Tim Claude Code
  • builders willing to evaluate younger projects

Bukti

  • recent repository activity
  • install command or GitHub repo available
  • profil kualitas 57/100

tinjau dulu

  • Low GitHub adoption signal
  • No OpenAgentSkill engagement data yet

Jalur implementasi

  1. 1Pasang di Agent sandbox dan jalankan satu tugas Browser automation dari awal hingga akhir.
  2. 2Compare output quality, latency, and failure behavior against at least one alternative.
  3. 3Promote it into production only after reviewing repository permissions, license, and maintenance signals.

Profil kepercayaan

Hanya sandbox

Kandidat berguna dengan sinyal kepercayaan yang kurang atau bercampur. Gunakan di ruang kerja terisolasi hingga loop hasil membuktikan kecocokan tugas.

63
Trust Score OpenAgentSkill

Adopsi GitHub

Periksa

33 star GitHub

Aktivitas star/fork

Periksa

33 star dan 3 fork; aktivitas issue tidak tersedia dalam metadata saat ini

Pemeliharaan terbaru

Lulus

2 hari sejak push

Kejelasan lisensi

Periksa

Tidak diketahui

Sinyal positif

  • Tinjauan AI disetujui
  • Jalur pemasangan tersedia
  • Bukti repositori tersedia
  • Repositori yang baru dipelihara
  • Perintah pemasangan tidak memiliki pola berisiko tinggi yang jelas
  • Loop hasil siap tetapi membutuhkan eksekusi Agent nyata pertama

Tinjau sebelum memasang

  • Lisensi tidak jelas
  • Low GitHub adoption signal
  • Quality score needs review
  • GitHub adoption: 33 GitHub stars
  • Stars/forks activity: 33 stars, 3 forks; issue activity unavailable in current metadata
  • License clarity: Unknown
  • Belum ada laporan hasil Agent nyata
  • Tinjauan manusia diperlukan sebelum pemasangan tanpa pengawasan

Tindakan yang disarankan

Jalankan hanya dalam sandbox dan bandingkan alternatif terdekat sebelum digunakan untuk kerja nyata.

Profil kualitas

Menjanjikan kandidat untuk alur kerja Agent

Useful candidate, but compare it with alternatives before adopting.

57
Star GitHub
33
Keterkinian
2 hari lalu
Siap dipasang
Ya
Lisensi
Tidak diketahui
Tinjau sebelum memasang: Low GitHub adoption signal

Kecocokan alur kerja

Gunakan skill ini pada skenario berikut

Kecocokan alur kerja

Tambahkan ke alur kerja lengkap

Daftar alternatif

Bandingkan sebelum memasang

Similar skills that may fit this task.

Bandingkan semua

Ringkasan

--- name: context-optimization description: >- 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. 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" --- # Context Optimization Techniques

Context optimization extends the effective capacity of limited context windows through compression, masking, caching, and partitioning, applied with measurement discipline. The techniques below are ordered by impact and risk.

## When to Activate

- Context budgets or token costs constrain task complexity - Observation masking can replace verbose tool outputs with retrievable references - Prefix or KV-cache hit rate needs improvement - Retrieval scoping can reduce irrelevant loaded context - Context partitioning can extend effective capacity across agents - Budget triggers are needed for masking, compaction, or partitioning

Do not activate this skill for adjacent work owned by other skills:

- Explaining why attention or context windows behave this way: `context-fundamentals`. - Diagnosing active lost-in-middle, poisoning, distraction, confusion, or clash: `context-degradation`.

## Core Concepts

Apply four primary strategies in this priority order:

1. **KV-cache optimization** — Reorder and stabilize prompt structure so the inference engine reuses cached Key/Value tensors. This is the cheapest optimization when the runtime supports prefix caching: low quality risk, immediate cost and latency savings. Apply it first when stable prefixes exist.

2. **Observation masking** — Replace verbose tool outputs with compact references once their purpose has been served. Tool outputs can dominate agent trajectories (claim-context-optimization-tool-output-dominance), so masking often yields the largest capacity gains. The original content remains retrievable if needed downstream.

3. **Compaction** — Summarize accumulated context when utilization exceeds 70%, then reinitialize with the summary. This distills the window's contents while preserving task-critical state. Compaction is lossy — apply it after masking has already removed the low-value bulk.

4. **Context partitioning** — Split work across sub-agents with isolated contexts when a single window cannot hold the full problem. Each sub-agent operates in a clean context focused on its subtask. Reserve this for tasks where estimated context exceeds 60% of the window limit, because coordination overhead is real.

The governing principle: context quality matters more than quantity. Every optimization preserves signal while reducing noise. Measure before optimizing, then measure the optimization's effect.

## Detailed Topics

### Compaction Strategies

Trigger compaction when context utilization exceeds 70%: summarize the current context, then reinitialize with the summary. This distills the window's contents in a high-fidelity manner, enabling continuation with minimal performance degradation. Prioritize compressing tool outputs first (they consume 80%+ of tokens), then old conversation turns, then retrieved documents. Never compress the system prompt — it anchors model behavior and its removal causes unpredictable degradation.

Preserve different elements by message type:

- **Tool outputs**: Extract key findings, metrics, error codes, and conclusions. Strip verbose raw output, stack traces (unless debugging is ongoing), and boilerplate headers. - **Conversational turns**: Retain decisions, commitments, user preferences, and context shifts. Remove filler, pleasantries, and exploratory back-and-forth that led to a conclusion already captured. - **Retrieved documents**: Keep claims, facts, and data points relevant to the active task. Remove supporting evidence and elaboration that served a one-time reasoning purpose.

Target 50-70% token reduction with less than 5% quality degradation. If compaction exceeds 70% reduction, audit the summary for critical information loss — over-aggressive compaction is the most common failure mode.

### Observation Masking

Mask observations selectively based on recency and ongoing relevance — not uniformly. Apply these rules:

- **Never mask**: Observations critical to the current task, observations from the most recent turn, observations used in active reasoning chains, and error outputs when debugging is in progress. - **Mask after 3+ turns**: Verbose outputs whose key points have already been extracted into the conversation flow. Replace with a compact reference: `[Obs:{ref_id} elided. Key: {summary}. Full content retrievable.]` - **Always mask immediately**: Repeated/duplicate outputs, boilerplate headers and footers, outputs already summarized earlier in the conversation.

Masking should achieve 60-80% reduction in masked observations with less than 2% quality impact. The key is maintaining retrievability — store the full content externally and keep the reference ID in context so the agent can request the original if needed.

### KV-Cache Optimization

Maximize prefix cache hits by structuring prompts so that stable content occupies the prefix and dynamic content appears at the end. KV-cache stores Key and Value tensors computed during inference; when consecutive requests share an identical prefix, the cached tensors are reused, saving both cost and latency.

Apply this ordering in every prompt:

1. System prompt (most stable — never changes within a session) 2. Tool definitions (stable across requests) 3. Frequently reused templates and few-shot examples 4. Conversation history (grows but shares prefix with prior turns) 5. Current query and dynamic content (least stable — always last)

Design prompts for cache stability: remove timestamps, session counters, and request IDs from the system prompt. Move dynamic metadata into a separate user message or tool result where it does not break the prefix. Even a single whitespace change in the prefix invalidates the entire cached block downstream of that change.

Target 70%+ cache hit rate for stable workloads. At scale, this translates to 50%+ cost reduction and 40%+ latency reduction on cached tokens.

### Context Partitioning

Partition work across sub-agents when a single context cannot hold the full problem without triggering aggressive compaction. Each sub-agent operates in a clean, focused context for its subtask, then returns a structured result to a coordinator agent.

Plan partitioning when estimated task context exceeds 60% of the window limit. Decompose the task into independent subtasks, assign each to a sub-agent, and aggregate results. Validate that all partitions completed before merging, merge compatible results, and apply summarization if the aggregated output still exceeds budget.

This approach achieves separation of concerns — detailed search context stays isolated within sub-agents while the coordinator focuses on synthesis. However, coordination has real token cost: the coordinator prompt, result aggregation, and error handling all consume tokens. Only partition when the savings exceed this overhead.

### Budget Management

Allocate explicit token budgets across context categories before the session begins: system prompt, tool definitions, retrieved documents, message history, tool outputs, and a reserved buffer (5-10% of total). Monitor usage against budget continuously and trigger optimization when any category exceeds its allocation or total utilization crosses 70%.

Use trigger-based optimization rather than periodic optimization. Monitor these signals:

- Token utilization above 80% — trigger compaction - Attention degradation indicators (repetition, missed instructions) — trigger masking + compaction - Quality score drops below baseline — audit context composition before optimizing

## Practical Guidance

### Optimization Decision Framework

Select the optimization technique based on what dominates the context:

| Context Composition | First Action | Second Action | |---|---|---| | Tool outputs dominate (>50%) | Observation masking | Compaction of remaining turns | | Retrieved documents dominate | Summarization | Partitioning if docs are independent | | Message history dominates | Compaction with selective preservation | Partitioning for new subtasks | | Multiple components contribute | KV-cache optimization first, then layer masking + compaction | — | | Near-limit with active debugging | Mask resolved tool outputs only — preserve error details | — |

### Performance Targets

Track these metrics to validate optimization effectiveness:

- **Compaction**: 50-70% token reduction, <5% quality degradation, <10% latency overhead from the compaction step itself - **Masking**: 60-80% reduction in masked observations, <2% quality impact, near-zero latency overhead - **Cache optimization**: 70%+ hit rate for stable workloads, 50%+ cost reduction, 40%+ latency reduction - **Partitioning**: Net token savings after accounting for coordinator overhead; break-even typically requires 3+ subtasks

Iterate on strategies based on measured results. If an optimization technique does not measurably improve the target metric, remove it — optimization machinery itself consumes tokens and adds latency.

## Examples

**Example 1: Compaction Trigger**

```python if context_tokens / context_limit > 0.8: context = compact_context(context) ```

**Example 2: Observation Masking**

```python if len(observation) > max_length: ref_id = store_observation(observation) return f"[Obs:{ref_id} elided. Key: {extract_key(observation)}]" ```

**Example 3: Cache-Friendly Ordering**

```python # Stable content first context = [system_prompt, tool_definitions] # Cacheable context += [reused_templates] # Reusable context += [unique_content] # Unique ```

**Example 4: Budget-triggered optimization policy**

```yaml budgets: tool_outputs: 35% message_history: 30% retrieved_documents: 20% reserved_buffer: 15% triggers: tool_outputs_over_budget: mask resolved observations total_context_over_70_percent: compact message history repeated_irrelevant_retrievals: tighten retrieval scope ```

## Guidelines

1. Measure before optimizing—know your current state 2. Apply masking before compaction — remove low-value bulk first, then summarize what remains 3. Design for cache stability with consistent prompts 4. Partition before context becomes problematic 5. Monitor optimization effectiveness over time 6. Balance token savings against quality preservation 7. Test optimization at production scale 8. Implement graceful degradation for edge cases

## Gotchas

1. **Whitespace breaks KV-cache**: Even a single whitespace or newline change in the prompt prefix invalidates the entire KV-cache block downstream of that point. Pin system prompts as immutable strings — do not interpolate timestamps, version numbers, or session IDs into them. Diff prompt templates byte-for-byte between deployments.

2. **Timestamps in system prompts destroy cache hit rates**: Including `Current date: {today}` or similar dynamic content in the system prompt forces a full cache miss on every new day (or every request, if using time-of-day). Move dynamic metadata into a user message or a separate tool result appended after the stable prefix.

3. **Compaction under pressure loses critical state**: When the model performing compaction is itself under context pressure (>85% utilization), its summarization quality degrades — it omits task goals, drops user co

Detail teknis

Versi
1.0.0
Lisensi
Unknown
Pembaruan terakhir
23 Agu 2026
Diterbitkan
23 Agu 2026

Ringkasan keputusan

Perlu validasi

56
Siap
Tinjau
Tahap

recent repository activity

Audit

Tinjauan pemasangan

Tinjauan pemasangan dan adopsi

74
Perlu ditinjau
Keamanan
75/100
Pemeliharaan
100/100
Pasang
92/100
Buka audit lengkapLihat laporan evaluasi

Bukti tervalidasi Agent

Bukti tervalidasi Agent

Laporan hasil setelah resolve, tinjau, pasang, dan satu eksekusi terbatas.

0
Terbukti
Needs first agent runPasang otomatis: tinjau duluTerakhir: Tidak diketahui
Tingkat sukses
Kegagalan terbaru
Hasil
0
Kualitas output
Gagal
0
Tidak relevan
0
Pemasangan
0
Diblokir risiko
0
Perlu penyiapan
0
Produksi
0

Belum ada data hasil Agent. Eksekusi pertama dapat melaporkan keberhasilan, kebutuhan setup, blok risiko, kegagalan, atau tidak relevan melalui /api/agent/outcome.

Pasang

Tambahkan ke alur Agent

Gratis dan sumber terbuka. Tinjau laporan sebelum memasang pada Agent produksi.

Siklus pertumbuhan

Kit berbagi

X

Draf berbasis skenario untuk context-optimization, siap untuk posting manual di X.

Catatan kurator
A practical pick for a repeatable workflow:

context-optimization: >-

33 stars

https://www.openagentskill.com/skills/shipshitdev-context-optimization?ref=x
Buka draf X
Balasan opsional dengan perintah pemasangan
Listing + install path for context-optimization:
https://www.openagentskill.com/skills/shipshitdev-context-optimization?ref=x

Install: npx skills add shipshitdev/skills --skill context-optimization
Buka draf balasan

Sumber listing

Diindeks Registry

Dapat diklaim

Listing ini diindeks dari sumber publik dan belum ditandai resmi hingga klaim pemelihara disetujui.

Diindeks oleh
Indeks komunitas OpenAgentSkill

Atribusi menautkan ke repositori publik atau profil kreator. Kreator dapat mengklaim listing untuk memperbarui sinyal kepemilikan.

Klaim skill ini

Klaim pemilik

Klaim listing skill ini

Listing Diindeks Registry ini dikaitkan dengan shipshitdev, tetapi belum ditandai resmi. Klaim untuk menambahkan sinyal pemilik terverifikasi dan membuat pembaruan peluncuran, pemasangan, serta audit berikutnya lebih tepercaya.

Kit backlink kreator

Tambahkan badge bukti ke README Anda

Tampilkan listing kanonis, sinyal kepercayaan dan audit saat ini, serta bukti Agent-Proven nyata di tempat pengembang mengevaluasi repositori.

[![Listed on OpenAgentSkill](https://www.openagentskill.com/api/badge/shipshitdev-context-optimization?metric=listed&label=Listed)](https://www.openagentskill.com/skills/shipshitdev-context-optimization)
[![OpenAgentSkill Trust](https://www.openagentskill.com/api/badge/shipshitdev-context-optimization?metric=trust&label=Trust)](https://www.openagentskill.com/skills/shipshitdev-context-optimization)
[![OpenAgentSkill Audit](https://www.openagentskill.com/api/badge/shipshitdev-context-optimization?metric=audit&label=Audit)](https://www.openagentskill.com/skills/shipshitdev-context-optimization/audit)
[![Agent Proven](https://www.openagentskill.com/api/badge/shipshitdev-context-optimization?metric=proven&label=Agent%20Proven)](https://www.openagentskill.com/skills/shipshitdev-context-optimization)

Penulis

S

shipshitdev

@shipshitdev

Kecocokan platform

Sinyal kesehatan

Star GitHub
33
Skor kualitas
34/100
Push GitHub terakhir
20 Agu 2026
Petunjuk framework
Tidak diketahui
Tampilan OpenAgentSkill
0
Salinan pemasangan
0
Klik keluar
0

Sinyal komunitas

Bagikan apakah skill ini bermanfaat untuk alur kerja Agent Anda. Masukan gabungan meningkatkan peringkat dari waktu ke waktu.

Kepercayaan & keamanan

Hanya sandbox

63
  • Adopsi GitHub33 star GitHubPeriksa
  • Aktivitas star/fork33 star dan 3 fork; aktivitas issue tidak tersedia dalam metadata saat iniPeriksa
  • Pemeliharaan terbaru2 hari sejak pushLulus
  • Kejelasan lisensiTidak diketahuiPeriksa
  • Kelengkapan README/SKILL.mdMetadata publik memerlukan konteks README/SKILL.md yang lebih kuatInfo
  • Risiko dependensi/runtimeAkses kredensial atau variabel lingkunganInfo