agentleFS
HyperVonHyperVon/agent-guidance-kit/skills/skill-optimizer/SKILL.md

skill-optimizer

Skill1 starsChanged 15 days agoApache-2.0View on GitHub

Optimize an agent playbook for lower context cost without weakening routing, safety, correctness, or verification. Use when asked to compress, deduplicate, rationalize, or reduce guidance; report first and apply only explicitly approved findings.

30 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use octocat, linting-neostandard-eslint9 and 8 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • mcollinaSkill

    octocat

    Use this skill whenever the prompt contains any `github.com` URL, even if the user only pastes a link and gives no GitHub-specific keywords. Handles git and GitHub operations using the gh CLI. Triggers include any GitHub link to an issue, pull request, commit, compare page, Actions run, release, discussion, or repository. Covers creating and reviewing PRs, repository security advisories (GHSA), their comments, and fix PRs in their temporary private forks, private vulnerability report discussions, watching CI checks, interactive rebasing, branch cleanup, submodule management, and repository archaeology with git log/blame/bisect.

    Also in 3 projects that use this

  • mcollinaSkill

    linting-neostandard-eslint9

    Configures ESLint v9 flat config and neostandard for JavaScript and TypeScript projects, including migrating from legacy `.eslintrc*` files or the `standard` package. Use when you need to set up or fix linting with `eslint.config.js` or `eslint.config.mjs`, troubleshoot lint errors, configure neostandard rules, migrate from `.eslintrc` to flat config, or integrate linting into CI pipelines and pre-commit hooks.

    Also in 3 projects that use this

  • VercelSkill

    oauth

    Configure OAuth providers (Google, Apple, Microsoft, Facebook, GitHub, etc.) to work with portless local dev URLs. Use when setting up OAuth redirect URIs, fixing "redirect_uri_mismatch" or "invalid redirect" errors, configuring sign-in providers for local development, or when a provider rejects .localhost subdomains. Triggers include "OAuth not working with portless", "redirect URI mismatch", "Google/Apple/Microsoft sign-in fails locally", "configure OAuth for local dev", or any task involving OAuth callback URLs with portless domains.

    Also in 3 projects that use this

  • AnthropicSkill

    documentation

    Write and maintain technical documentation. Trigger with "write docs for", "document this", "create a README", "write a runbook", "onboarding guide", or when the user needs help with any form of technical writing — API docs, architecture docs, or operational runbooks.

    Also in 3 projects that use this

  • MicrosoftSkill

    init

    Also in 3 projects that use this

  • SentrySkill

    skill-creator

    Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.

    Also in 4 projects that use this

  • +4 more from mcollina

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 5 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 21 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Never optimize away safety controls, approval rules, source-of-truth ownership, distinct routing, or required verification.

    line 23
  2. Distinctive:

    Read the candidates and classify evidence as:

    line 42
  3. Distinctive:

    No mode or a request to inspect means report-only.

    line 79
  4. Very specific:

    When reducing SKILL.md size via progressive disclosure, strictly partition content:

    line 86
  5. Distinctive:

    All non-negotiable safety rules, approval gates, and authorization boundaries.

    line 91
  6. Distinctive:

    Stop conditions, report shape, and required verification commands.

    line 93
  7. Very specific:

    Every extracted reference file must have an explicit, clickable relative link from SKILL.md describing exactly when to load it, and must be …

    line 101

“Common” is measured: kept by at least 6 in 10 of the 21 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Skill Optimizer

Reduce context cost as a semantic change, not a word-count contest. A shorter rule that loses a trigger, exception, safety gate, or validation step is a regression.

Boundary

  • rules-and-skills-audit owns structural overlap, conflicts, and drift.
  • skill-reviewer owns missing content and domain depth.
  • skill-authoring owns edits after named findings are approved.
  • This skill owns measurement, context reduction, and preservation evidence.

Never optimize away safety controls, approval rules, source-of-truth ownership, distinct routing, or required verification. Keep intentional reinforcement, different audiences, and thin harness pointers when they improve discovery.

Workflow

  1. Establish the root, branch/status, applicable guidance, and files intentionally skipped. Preserve unrelated worktree changes.
  2. Produce a read-only inventory of the guidance surface. Count lines, words, characters, headings, and links per file; estimate a rough characters / 4 token proxy; and list exact repeated prose candidates. Treat the proxy as a comparison aid, not a tokenizer result or proof of semantic duplication. When copying this skill into a project, either reimplement this small inventory locally or inspect sizes directly while reading the guidance.
  3. Account for the context surface, not only the files in the inventory: loaded skills, root instructions, harness projections, tool descriptions, linked references, and large generated outputs can all create routing or attention cost. Record which surfaces were inspected and which were not.
  4. Read the candidates and classify evidence as:
    • exact or near duplication with one clear canonical owner;
    • projection bloat that repeats rather than points to canonical guidance;
    • a progressive-disclosure miss where rare detail can move behind a clear link;
    • routing waste from broad or ambiguous descriptions and indexes;
    • context poisoning, distraction, confusion, or instruction clash that makes relevant evidence harder to select or trust;
    • drift or conflict, which is a correctness finding rather than mere savings.
  5. For every candidate, record the current owner, replacement owner, exact change, estimated removable content, risk, preserved trigger/invariant/exception, one matching prompt, one neighboring prompt, one tie-breaker, and checks.
  6. Report before editing. Include the baseline, ranked findings, conservative savings ranges, keep-separate decisions, skipped files, and a reversible apply order. State whether measurements are proxies or tokenizer-verified.
  7. Apply only the named findings or bounded group the user explicitly approves. Re-read the changed guidance, inspect the complete diff, and validate routing and links after each group through skill-authoring.

Measurement trust

Confirm any size or duplication measurement against an independent check before trusting it: re-read the changed files, re-count the affected sections, and verify the diff. Treat a missing or unverified measurement as a blocker on the baseline, not a silent proxy.

Measurement and stop rule

Compare a before/after measure that matches the proposed change: context tokens or characters, loaded-file count, routing false positives, task output quality, verification completeness, or evaluation pass rates. A smaller file is not a success if it causes a safety, ownership, trigger, or verification regression. Remove optimization machinery that has no measurable benefit, and stop when the remaining repetition is intentional reinforcement, a distinct audience projection, or a high-risk rule that must remain visible.

Approval boundary

No mode or a request to inspect means report-only. Words such as “optimize” or “apply” do not authorize an unrelated sweep. An explicit implementation request may authorize only the files and bounded change named by the user; otherwise stop after the report and ask which findings to apply.

Progressive disclosure partitioning

When reducing SKILL.md size via progressive disclosure, strictly partition content:

  • Must remain in SKILL.md (Always Loaded with Skill):
    • Frontmatter name and routeable description with trigger keywords;
    • Core contract (Input, Output, Owner, Non-goals, Side effects);
    • All non-negotiable safety rules, approval gates, and authorization boundaries;
    • Step-by-step sequential workflow and decision tree;
    • Stop conditions, report shape, and required verification commands.
  • May move to references/<topic>.md (Loaded On-Demand):
    • Deep domain reference manuals, syntax catalogs, and exhaustive API tables;
    • Large illustrative examples, sample outputs, and scenario walkthroughs;
    • Secondary or edge-case troubleshooting runbooks;
    • External intake and provenance audit procedures.

Every extracted reference file must have an explicit, clickable relative link from SKILL.md describing exactly when to load it, and must be a valid repository-relative link.

Context surface prioritization

Prioritize optimizations based on context lifecycle impact:

  1. Tier 1 (Always-On Entrypoints): AGENTS.md, OPERATING.md, CLAUDE.md, .cursorrules. High impact—loaded into every prompt context.
  2. Tier 2 (Harness Projections & System Manifests): Agent tool descriptions, prompt templates. Medium impact—loaded during tool/agent initialization.
  3. Tier 3 (Conditional Skills): skills/<name>/SKILL.md. Scoped impact—loaded only when skill triggers.
  4. Tier 4 (On-Demand References): references/*.md. Zero baseline cost—loaded only upon explicit file read.

Anti-patterns

  • deleting repeated text solely because it repeats;
  • moving safety invariants, approval gates, or core workflow steps out of SKILL.md into reference files;
  • applying "telegraphic compression" (stripping syntax and contextual verbs into terse fragments) that increases LLM ambiguity and error rates;
  • optimizing Tier 3/4 conditional guidance while leaving high-cost Tier 1 entrypoints bloated;
  • replacing a portable rule with an unresolvable or orphaned link;
  • treating a frequency report as semantic equivalence;
  • moving a high-risk rule behind an optional reference;
  • applying a broad mechanical rewrite, commit, publication, or external action without explicit authorization.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.