{
  "skill_name": "common-context-optimization",
  "evals": [
    {
      "id": 1,
      "prompt": "Our AI agent conversation is 15,000 tokens and getting slow. The last tool call returned 2000 lines of raw JSON logs. How should we handle this?",
      "expected_output": "Immediately mask the large tool output: extract the 3-5 critical data points, then replace the raw 2000-line JSON in context with a semantic summary placeholder. Trigger compaction since the session exceeds 8k tokens — preserve Goal, Active Task, Current Errors, Key Decisions; drop intermediate tool calls.",
      "assertions": [
        { "type": "contains", "value": "mask" },
        { "type": "contains", "value": "compact" }
      ]
    },
    {
      "id": 2,
      "prompt": "After 30 turns of conversation my agent keeps losing track of the original goal. What context strategy should I use?",
      "expected_output": "Apply context compaction. Every 10 turns: summarize keeping User Goal, Active Task, Current Errors, Key Decisions; drop chat chit-chat and corrected assumptions. Write the compacted state to the System Prompt or Memory File. This preserves State over Dialogue.",
      "assertions": [
        { "type": "contains", "value": "compaction" },
        { "type": "contains", "value": "goal" }
      ]
    },
    {
      "id": 3,
      "prompt": "I'm seeing high latency on my LLM API calls. The context keeps growing and I think it's causing cache misses.",
      "expected_output": "Enforce KV-Cache Awareness: maintain static prefix ordering (System -> Tools -> RAG -> User). Never insert content in the middle of history — append-only. This maximizes pre-fill cache hits and reduces latency from repeated context processing.",
      "assertions": [
        { "type": "contains", "value": "cache" },
        { "type": "contains", "value": "append" }
      ]
    }
  ],
  "should_not_trigger": [
    "How do I set up a PostgreSQL database?",
    "Write a React component for a login form",
    "Configure ESLint for a TypeScript project"
  ]
}
