Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add HoangNguyen0403/agent-skills-standard --skill common-context-optimizationgit clone --depth 1 https://github.com/HoangNguyen0403/agent-skills-standardWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/hoangnguyen0403/agent-skills-standard/common-context-optimization)<a href="https://agentmods.dev/skills/hoangnguyen0403/agent-skills-standard/common-context-optimization"><img src="https://agentmods.dev/badge/skills/hoangnguyen0403/agent-skills-standard/common-context-optimization/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/hoangnguyen0403/agent-skills-standard/common-context-optimization"><img src="https://agentmods.dev/badge/skills/hoangnguyen0403/agent-skills-standard/common-context-optimization.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00052 | $0.00513 |
| Opus 5 | $0.00026 | $0.00257 |
| Sonnet 5 | $0.00010 | $0.00103 |
| Haiku 4.5 | $0.00005 | $0.00051 |
Grade A, and why
common-context-optimization scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually 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.
- Identify outputs exceeding 50 lines or 1 KB.
- Extract critical data points immediately.
- Mask by rewriting history to replace raw data with summary placeholder.
- See
references/masking.mdfor patterns.
See implementation examples for masking patterns.
2. Context Compaction (State Preservation)
Problem: Long conversations drift from original intent. Solution: Recursive summarization that preserves State over Dialogue.
- Trigger compaction every 10 turns or 8k tokens.
- Compact:
- Keep: User Goal, Active Task, Current Errors, Key Decisions.
- Drop: Chat chit-chat, intermediate tool calls, corrected assumptions.
- Format: Update System Prompt or Memory File with compacted state.
- See
references/compaction.mdfor algorithms.
See implementation examples for compacted state format.
3. KV-Cache Awareness (Latency)
Goal: Maximize pre-fill cache hits.
- Static Prefix: Enforce strict ordering — System -> Tools -> RAG -> User.
- Append-Only: Never insert into middle of history; append new turns only.
References
Anti-Patterns
- No raw tool dumps: Mask large outputs immediately after extracting data.
- No unbounded growth: Compact every 10 turns to preserve intent over dialogue.
- No middle insertions: Append-only history maximizes KV cache hits.
What ships with it
3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 12d ago First seen · 60 lines · 52 tokens per session scan A 0c292b0274a1
common-context-optimization is a skill published in the GitHub repository HoangNguyen0403/agent-skills-standard (565 stars, last pushed 2d ago), licensed MIT. It adds 52 tokens to every session and 513 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
inspector-workbench
Runs Inspector UI work on the standalone Threads state lab so the agent can see the overlay. Use when a CopilotKit employee asks an agent to fix, polish, add, or debug Inspector UI, chrome, panes, overlay actions, launcher, Home, Threads, Playground, Memory, or any visual behavior in @copilotkit/web-inspector. Don't…
elite-engineer
The operating system for elite software engineering in TypeScript, React, and Next.js. Enforces the cognitive models, architecture laws, type-level patterns, component design, visual standards, and performance mandates that separate exceptional software from the ordinary — grounded in named sources (Torvalds…
oma-frontend
Frontend specialist for React, Next.js, Angular, TypeScript with FSD-lite architecture, shadcn/ui, and design system alignment. Use for UI, component, page, layout, CSS, Tailwind, shadcn, Angular, and RxJS work.
code-quality
Comprehensive frontend code review for TypeScript 6 and React 19.2 — clean code principles, component patterns, type safety, accessibility, and performance. Use when user says "review code", "refactor", "check this PR", or before merging changes.
design-patterns
Frontend design patterns with React 19.2 and TypeScript 6 examples (Composition, Compound Components, Custom Hooks, Render Props, HOC, State Machines). Use when user asks "implement pattern", "use composition", or when designing reusable components.
react-nextjs
React 19.2 + Next.js 16 development - Server Components, Cache Components, proxy.ts, View Transitions, App Router, TypeScript 6, and Tailwind CSS v4. Use when building frontend apps, creating components, or asking "how do I set up X?".