optimize-skill

optimize-skill is a skill for Claude Code, Codex from Agent-Threat-Rule/agent-threat-rules. It costs 69 tokens per session (770 once invoked), scanned A, original, MIT.

A workflow for reviewing and improving an existing coding-agent skill. It checks the skill's structure, instructions, references, activation description, and clarity before applying approved changes.

In plain words
What is it for?
Use it to measure and refine an existing SKILL.md and its reference files; it is not intended for creating a new skill from scratch.
Why use it?
It helps explain why a skill is hard to discover, too long, or inconsistent with recommended organization. It also requires a quality review and confirmation before optimization changes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to measure and refine an existing SKILL.md and its reference files; it is not intended for creating a new skill from scratch.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/agent-threat-rule/agent-threat-rules/real-hyf0-optimize
Install

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.

Any agent
npx skills add Agent-Threat-Rule/agent-threat-rules --skill real-hyf0-optimize
Clone the repo
git clone --depth 1 https://github.com/Agent-Threat-Rule/agent-threat-rules

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for optimize-skill

README.md
[![agentmods](https://agentmods.dev/badge/skills/agent-threat-rule/agent-threat-rules/real-hyf0-optimize/github.svg)](https://agentmods.dev/skills/agent-threat-rule/agent-threat-rules/real-hyf0-optimize)
Your own site
<a href="https://agentmods.dev/skills/agent-threat-rule/agent-threat-rules/real-hyf0-optimize"><img src="https://agentmods.dev/badge/skills/agent-threat-rule/agent-threat-rules/real-hyf0-optimize/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.

agentmods 80×15 button for optimize-skill

Your own site · 80×15
<a href="https://agentmods.dev/skills/agent-threat-rule/agent-threat-rules/real-hyf0-optimize"><img src="https://agentmods.dev/badge/skills/agent-threat-rule/agent-threat-rules/real-hyf0-optimize.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 770 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00069 $0.00770
Opus 5.5 $0.00028 $0.00308
Sonnet 5.5 $0.00014 $0.00154
Haiku 4.5 $0.00007 $0.00077

Measured 2mo ago against content hash 06000b2950f7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

optimize-skill 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 2mo 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

data/skill-benchmark/benign/real-hyf0--optimize-skill.md · 84 lines

How it starts

The opening of the file, as written. The whole thing — 84 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Workflow

Follow these 5 steps in order. Copy this checklist into your response and check off each step as you complete it:

Task Progress:
- [ ] Step 1: Read the target skill
- [ ] Step 2: Run the quality checklist
- [ ] Step 3: Identify optimization opportunities
- [ ] Step 4: Apply optimizations
- [ ] Step 5: Validate improvements

Step 1: Read the Target Skill

Read the target skill's SKILL.md and all files in its reference/ directory (if any).

Collect these metrics:

  • Total line count of SKILL.md
  • Total line count across all reference files
  • Frontmatter fields present vs. missing
  • Number of reference files and whether all are linked from SKILL.md

Report these metrics to the user before proceeding.

Step 2: Run the Quality Checklist

Score each item in the quality checklist as PASS, FAIL, or N/A: -> See quality-checklist

Present the full scorecard to the user before making any changes. Ask for confirmation to proceed with optimizations.

Step 3: Identify Optimization Opportunities

Review all FAIL items from the checklist. Prioritize by impact (highest first):

  1. Description quality — Most common cause of skill not being invoked. Fix first.
  2. Content compression — Remove knowledge the agent already has. Reduces token cost and noise.
  3. Progressive disclosure — Split oversized SKILL.md into reference files, or merge tiny reference files back.
  4. Structure clarity — Improve headers, cross-references, and flow. Numbered steps for workflows.
  5. Consistency — Fix terminology, formatting, and style inconsistencies.
  6. Triggering precision — Under-triggering: add keywords, trigger phrases, concrete use cases. Over-triggering: add negative triggers ("Do NOT use for X"), narrow the scope.

List each optimization opportunity with:

  • What is wrong
  • Why it matters
  • What the fix will be

Step 4: Apply Optimizations

For each issue identified in Step 3, apply the fix. Use compression techniques where applicable: -> See compression-techniques

Read the full file on GitHub · 84 lines

Changes

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.

  1. 2mo ago First seen · 84 lines · 69 tokens per session scan A 06000b2950f7

Subscribe to this mod's changes

optimize-skill is a skill published in the GitHub repository Agent-Threat-Rule/agent-threat-rules (445 stars, last pushed yesterday), licensed MIT. It adds 69 tokens to every session and 770 once invoked, about $0.0003 per session on Opus 5.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.

Related

optimize-skill compared with skills from other repositories

optimize-skill next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
optimize-skillAgent-Threat-Rule/agent-threat-rulesSkill445yesterdayMITA69Claude Code, Codex
cordon-installilyautov/cordonSkill64d agoMITA156Claude Code
case-011-skill-shellmeghal86/promptsonarSkill72d agoMITA0Claude Code, Codex
case-019-exclusion-noisemeghal86/promptsonarSkill72d agoMITA0Claude Code, Codex
brin-checksuperagent-ai/brinSkill508mo agononeA44Claude Code, Codex
integrate-arcjet-guard-claude-agent-sdkarcjet/arcjet-jsSkill7042d agoApache-2.0A92Claude Code
integrate-arcjet-guard-langchainarcjet/arcjet-jsSkill7042d agoApache-2.0A101Claude Code, Codex