skill-compact

skill-compact is a skill for Claude Code, Codex from JuanJoseGonGi/skill-compact. It costs 103 tokens per session (1,254 once invoked), scanned A, original, MIT.

A workflow for reviewing and reorganizing collections of agent skills. It finds duplicate or overly large instructions and separates shared material into reusable references.

In plain words
What is it for?
Use it to scan skills, identify overlaps and size problems, group related content, and prepare a more compact structure after approval.
Why use it?
It reduces repeated instructions and makes skills easier for agents to load and maintain.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths.

Good fit Use it to scan skills, identify overlaps and size problems, group related content, and prepare a more compact structure after approval.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/juanjosegongi/skill-compact/skill-compact
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 JuanJoseGonGi/skill-compact --skill skill-compact
Clone the repo
git clone --depth 1 https://github.com/JuanJoseGonGi/skill-compact

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 skill-compact

README.md
[![agentmods](https://agentmods.dev/badge/skills/juanjosegongi/skill-compact/skill-compact/github.svg)](https://agentmods.dev/skills/juanjosegongi/skill-compact/skill-compact)
Your own site
<a href="https://agentmods.dev/skills/juanjosegongi/skill-compact/skill-compact"><img src="https://agentmods.dev/badge/skills/juanjosegongi/skill-compact/skill-compact/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 skill-compact

Your own site · 80×15
<a href="https://agentmods.dev/skills/juanjosegongi/skill-compact/skill-compact"><img src="https://agentmods.dev/badge/skills/juanjosegongi/skill-compact/skill-compact.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 103 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,254 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.00103 $0.01254
Opus 5 $0.00051 $0.00627
Sonnet 5 $0.00021 $0.00251
Haiku 4.5 $0.00010 $0.00125

Measured 9d ago against content hash c13c118cf55d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

skill-compact 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 9d 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.

SKILL.md · 158 lines

How it starts

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

Skill Compact

Analyze, deduplicate, and restructure agent skills following the agentskills.io specification.

When to use

  • User has many installed skills with potential overlap
  • Skills are monolithic (>300 lines) without progressive disclosure
  • Multiple skills share boilerplate content
  • User wants to clean up and optimize their skills collection
  • User wants to update skills from upstream and re-compact

Prerequisites

Ensure tsx is available. If not, install it:

npm install -g tsx

Workflow

Follow these phases in order. Always get user approval before modifying files.

Phase 1: Scan and Analyze

Run the scanner to get a full inventory:

npx tsx scripts/scan.ts <skills-dir>

Where <skills-dir> is typically ~/.claude/skills or .claude/skills.

Review the JSON output. Focus on:

  • summary.monolithicSkills - skills >300 lines without references/
  • summary.skillsOverLineLimit - skills violating the 500-line limit
  • summary.totalTokens - total context cost of all skills

Present a summary table to the user showing: skill name, lines, tokens, has-refs, has-scripts.

Phase 2: Cluster and Identify Duplicates

Run the grouper to find overlapping clusters:

npx tsx scripts/group.ts <skills-dir>

Review the clusters. For each cluster with overlapScore > 0.2:

  1. Read the full SKILL.md of each skill in the cluster
  2. Identify specific overlapping content (shared paragraphs, identical code blocks, repeated templates)
  3. Identify what is unique to each skill
  4. Consult references/strategies.md for the appropriate compaction strategy

Present each cluster to the user with:

  • Which skills overlap and how
  • The proposed strategy (merge/absorb/extract-shared/refactor)
  • Expected line savings

Phase 3: Compact (with user approval)

Before making any changes, create a backup:

npx tsx scripts/backup.ts <skills-dir>

For each approved compaction, apply the strategy. See references/strategies.md for detailed instructions per strategy type.

Read the full file on GitHub · 158 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. 9d ago First seen · 158 lines · 103 tokens per session scan A c13c118cf55d

Subscribe to this mod's changes

skill-compact is a skill published in the GitHub repository JuanJoseGonGi/skill-compact (3 stars, last pushed 6mo ago), licensed MIT. It adds 103 tokens to every session and 1,254 once invoked, about $0.0005 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-08-31.

Related

Other skills, from other repositories

sessionend

End-of-session ritual that turns sessions into institutional memory via Zengram. Detects repeatable workflows worth capturing as skills AND mistakes/corrections worth capturing as CLAUDE.md rules. Reflects honestly, stores to Zengram, updates local memory, spots workflow patterns, and proposes rule updates. Use when…

ZenSystemAI/Zengram · 147 tokens

testing-anti-patterns

Reviews test code to identify and fix common testing anti-patterns including flaky tests, over-mocking, brittle assertions, test interdependency, and hidden test logic. Flags bad patterns, explains the specific defect, and provides corrected implementations. Use when reviewing test code, debugging intermittent or…

rohitg00/skillkit · 95 tokens

handoff-protocols

Manages work transitions between team members or agents by creating structured handoff documents, summarizing project status, documenting key decisions, blockers, and open questions, and generating onboarding briefs. Use when someone needs to hand off, hand over, or transition a project; pass work to another person or…

rohitg00/skillkit · 116 tokens

parallel-investigation

Coordinates parallel investigation threads to simultaneously explore multiple hypotheses or root causes across different system areas. Use when debugging production incidents, slow API performance, multi-system integration failures, or complex bugs where the root cause is unclear and multiple plausible theories exist…

rohitg00/skillkit · 97 tokens

hypothesis-testing

Applies the scientific method to debugging by helping users form specific, testable hypotheses, design targeted experiments, and systematically confirm or reject theories to find root causes. Use when a user says their code isn't working, they're getting an error, something broke, they want to troubleshoot a bug, or…

rohitg00/skillkit · 103 tokens

trace-and-isolate

Applies systematic tracing and isolation techniques to pinpoint exactly where a bug originates in code. Use when a bug is hard to locate, code is not working as expected, an error or crash appears with unclear cause, a regression was introduced between recent commits, or you need to narrow down which component…

rohitg00/skillkit · 120 tokens