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 alivirgo/Major-AI-Skills --skill avoid-duplicate-system-messagesgit clone --depth 1 https://github.com/alivirgo/Major-AI-SkillsWrote 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/alivirgo/major-ai-skills/avoid-duplicate-system-messages)<a href="https://agentmods.dev/skills/alivirgo/major-ai-skills/avoid-duplicate-system-messages"><img src="https://agentmods.dev/badge/skills/alivirgo/major-ai-skills/avoid-duplicate-system-messages/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/alivirgo/major-ai-skills/avoid-duplicate-system-messages"><img src="https://agentmods.dev/badge/skills/alivirgo/major-ai-skills/avoid-duplicate-system-messages.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.00025 | $0.01234 |
| Opus 5 | $0.00013 | $0.00617 |
| Sonnet 5 | $0.00005 | $0.00247 |
| Haiku 4.5 | $0.00003 | $0.00123 |
Grade A, and why
avoid-duplicate-system-messages 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 yesterday.
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.
How it starts
The opening of the file, as written. The whole thing — 121 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Deduplicate System Messages (Prompt Cache Prefix Consolidation)
Overview
Many multi-agent frameworks inject fresh role: "system" messages or duplicate guideline blocks into the middle of conversation histories (e.g., re-injecting system rules after every tool execution).
Scattering system messages throughout the message array causes two severe issues:
- Breaks Prompt Caching: Modern LLM caching engines (Anthropic Prompt Caching, OpenAI Prefix Caching) require a static, uninterrupted prefix. Injecting dynamic system messages invalidates the cache on every turn.
- Input Token Inflation: Re-sending 1,500 tokens of system instructions on every turn across 40 turns burns 60,000 redundant input tokens.
The System Prompt Consolidation Protocol enforces a single, canonical, immutable system header at Turn 0, ensuring maximum prompt cache hit rates (90% discount) and zero redundant token spend.
Fragmented System Injection vs. Consolidated Prefix Cache
┌─────────────────────────────────────────────────────────────┐
│ Prompt Cache Invalidation │
│ │
│ Fragmented System Injections (Anti-Pattern): │
│ • Turn 0: System Message (1,200 tokens) │
│ • Turn 1: User Request │
│ • Turn 2: System Message ("Remember to be concise!") │
│ ↳ INVALIDATES PROMPT CACHE AT TURN 2! Full re-bill! │
│ • Turn 3: System Message ("Follow tool rules!") │
│ ↳ INVALIDATES PROMPT CACHE AT TURN 3! │
│ │
│ Consolidated Single-Prefix Architecture (Cached): │
│ • Turn 0: Single Static Consolidated System Header │
│ ↳ CACHE_CONTROL: EPHEMERAL (Locks in 90% discount) │
│ • Turn 1..50: Dynamic User & Assistant Turns ONLY │
│ ↳ 100% Cache Hit Rate across entire 50-turn session! │
└─────────────────────────────────────────────────────────────┘
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.
- yesterday Changed · -15 tokens per session 1f4622d89800
- 6d ago First seen · 121 lines · 40 tokens per session scan A ace4ac2a537b
avoid-duplicate-system-messages is a skill published in the GitHub repository alivirgo/Major-AI-Skills (1 stars, last pushed today), licensed MIT. It adds 25 tokens to every session and 1,234 once invoked, about $0.0001 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-09-05.
Other skills, from other repositories
ai-wrapper-product-v2
AI Wrapper Product workflow skill. Use this skill when the user needs Expert in building products that wrap AI APIs (OpenAI, Anthropic, and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.
ai-engineering-toolkit
AI Engineering Toolkit workflow skill. Use this skill when the user needs 6 production-ready AI engineering workflows: prompt evaluation (8-dimension scoring), context budget planning, RAG pipeline design, agent security audit (65-point checklist), eval harness building, and product sense coaching and the operator…
zipai-optimizer
Skill "zipai-optimizer" from nickdesi/ZipAI, covering zipai: ultra-dense token optimizer, rules, 1. zero filler, 2. ambiguity and 3. prompt caching.
azure-ai-projects-py
Build AI applications using the Azure AI Projects Python SDK (azure-ai-projects). Use when working with Foundry project clients, creating versioned agents with PromptAgentDefinition, running evalua...
azure-ai-projects-ts
Build AI applications using Azure AI Projects SDK for JavaScript (@azure/ai-projects). Use when working with Foundry project clients, agents, connections, deployments, datasets, indexes, evaluation...
ai-product
Every product will be AI-powered. The question is whether you'll build it right or ship a demo that falls apart in production. This skill covers LLM integration patterns, RAG architecture, prompt ...