common-architecture-di…
Draw architecture diagrams as editable draw.io files with a fixed house style, C4 levels, and evidence-tagged shapes. Use when producing a system context,…
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.
$ npx -y skills add hoangnguyen0403/agent-skills-standard --skill common-context-optimization --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/common-context-optimizationContext preview
The summary Claude sees to decide when to auto-load this skill.
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.
name: common-context-optimization
description: 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.
metadata:
triggers:
files:
- '*.log'
- 'chat-history.json'
keywords:
- reduce tokens
- optimize context
- summarize history
- clear output**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.
**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**:
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.
**Goal**: Maximize pre-fill cache hits.
The portable SDLC standards layer for AI coding agents. Sync once, then work in your own runtime.
Repo: hoangnguyen0403/agent-skills-standard
Draw architecture diagrams as editable draw.io files with a fixed house style, C4 levels, and evidence-tagged shapes. Use when producing a system context,…
Enforce SOLID principles, guard-clause style, function size limits, and intention-revealing naming across all languages. Use when refactoring for readability,…
Standardize BRD and BRD-lite discovery for business goals, stakeholder impact, current-to-future state, and measurable value outcomes. Use when creating BRD,…
Conduct high-quality, persona-driven code reviews. Use when reviewing PRs, critiquing code quality, or analyzing changes for team feedback.
Standardize dynamic application security testing for backend APIs, frontend web apps, and mobile clients. Covers ZAP, Nuclei, Nikto, sqlmap, ffuf, browser…
Troubleshoot systematically using the Scientific Method. Use when debugging crashes, tracing errors, diagnosing unexpected behavior, or investigating…