Context optimize

From jjongguet/oh-my-product · View interactive version

Context optimize is an AI agent skill from the GitHub repository jjongguet/oh-my-product. Analyze and optimize context for signal-to-noise ratio — deduplicate, compress, prioritize, and prune.

How to use this skill

Skill file

Context Optimize Skill (oh-my-product)

Optimize prompt and context files for maximum signal density.

Use when

Workflow

  1. Audit: Measure current context size and composition
  2. Score: Rate each section for signal density (useful / total tokens)
  3. Identify issues: Flag duplicates, stale entries, verbose sections
  4. Propose changes: Show diff of recommended optimizations
  5. Apply: With user approval, apply the optimizations

Optimization Strategies

| Strategy | Description | Risk |

|----------|-------------|------|

| Deduplicate | Remove repeated instructions across layers | Low |

| Compress | Shorten verbose sections preserving meaning | Low |

| Prioritize | Move high-signal content earlier in context | Low |

| Prune | Remove stale or irrelevant entries | Medium |

| Restructure | Improve formatting for model parsing | Low |

Metrics

Before: 4,200 tokens | Signal: 62% | Redundancy: 18% | Stale: 12%
After:  2,800 tokens | Signal: 89% | Redundancy: 3%  | Stale: 0%
Savings: 33% token reduction

5-Layer Context Model

oh-my-product contexts follow this priority hierarchy:

  1. System/Runtime: Gemini CLI constraints (immutable)
  2. Project Standards: GEMINI.md + context/omp-core.md
  3. Session Memory: .omp/state/, memory entries
  4. Active Task: Current plan, taskboard, PRD
  5. Execution Traces: Recent iteration results

Optimization targets layers 2-5 (layer 1 is immutable).

Safety Rules

Related commands

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.