common-context-optimization skillA
common-context-optimization is agent-read markdown (skill) from hoangnguyen0403/agent-skills-standard: Maximize context window efficiency, reduce latency, and prevent lost-in-middle issues through strategic masking and compaction. Use when token budgets are tight, tool outputs overflow the context, conversations drift from intent, or latency spikes from cache misses..
Indexed from public GitHub and served as immutable, content-addressed versions. Install it pinned to an exact SHA-256 with the mdr CLI, and every file is verified against the hash recorded here before it reaches your agent. The deterministic audit below grades the latest version, and the same file always earns the same grade.
What the file says
## **Priority: P1 (HIGH)** ## 1. Observation Masking (Noise Reduction) **Problem**: Large tool outputs (logs, JSON lists) overwhelm context and degrade reasoning. **Solution**: Replace raw output with semantic summaries _after_ consumption. 1. **Identify** outputs exceeding 50 lines or 1 KB. 2. **Extract** critical data points immediately. 3. **Mask** by rewriting history to replace raw data with summary placeholder. 4. **See** `references/masking.md` for patterns. See [implementation examples](references/implementation.md) for masking patterns. ## 2. Context Compaction (State Preservation) **Problem**: Long conversations drift from original intent. **Solution**: Recursive summarization that preserves _State_ over _Dialogue_. 1. **Trigger** compaction every 10 turns or 8k tokens. 2. **Compact**: - **Keep**: User Goal, Active Task, Current Errors, Key Decisions. - **Drop**: Chat chit-chat, intermediate tool calls, corrected assumptions. 3. **Format**: Update System Prompt or Memory File with compacted state. 4. **See** `references/compaction.md` for algorithms. See [implementation examples](references/implementation.md) for compacted state format. …
Read the whole file at its exact version.
How to install
mdr add hoangnguyen0403/agent-skills-standard/common-context-optimization@git:20260714.6bf9b5emdr add hoangnguyen0403/agent-skills-standard/common-context-optimization@sha256:0c292b0274a1068ePin to a label to follow the author's releases, or to a sha256 to freeze the exact bytes forever. Either way the resolved hash is written to mdr.lock, and mdr install reproduces it on any machine.
[](https://markdownregistry.com/a/art_qa6qcvh4sqwawcvx)
1 badge views in 30 days
Versions
| version | committed | commit | size | audit | |
|---|---|---|---|---|---|
| git:20260714.6bf9b5e latest | 2026-07-14 | 6bf9b5e | 2,287 B | A | view · diff |
| git:20260627.0588377 | 2026-06-27 | 0588377 | 2,295 B | A | view · diff |
| git:20260513.7eab4bf | 2026-05-13 | 7eab4bf | 2,288 B | A | view |
Audit of the latest version
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (2287 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
hoangnguyen0403/agent-skills-standard · 571 stars · license MIT · pushed 2026-09-24 · branch develop
API
GET https://markdownregistry.com/api/v1/artifacts/art_qa6qcvh4sqwawcvx GET https://markdownregistry.com/api/v1/resolve?ref=hoangnguyen0403/agent-skills-standard/common-context-optimization GET https://markdownregistry.com/api/v1/blob/0c292b0274a1068e2c92de1cd55ac2eeaf424d0cf27e0a1cb0e2ccd15483709b
Your agent does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
More from hoangnguyen0403/agent-skills-standard
Every file in hoangnguyen0403/agent-skills-standard