Skill yaml cleanup
Audit and reduce YAML frontmatter bloat in SKILL.md files. Trigger to: scan skill directories, identify oversized frontmatter, propose deduplication/flattening/migration optimizations, and apply approved changes. Requires user approval before writing.From its SKILL.md
npx -y skills add jovd83/skill-yaml-cleanupAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
7.8 KB, ~1.7k tokens by cl100k_base, as published. Nobody here has run it
Skill YAML Cleanup
Author: jovd83 | Version: 2.0.0 | License: MIT
Audit and optimize YAML frontmatter in SKILL.md files. Agent platforms enforce a 1,000-character limit on frontmatter blocks. Exceeding this causes preloading failures and context overflow. This skill finds, analyzes, and — with your approval — fixes oversized blocks.
When to Trigger
- User says "clean up skill metadata", "frontmatter is too long", "reduce YAML bloat", or "audit skills"
- Skills are failing to preload or causing context overflow
- New metadata fields were added and may have exceeded the limit
- Auditing or migrating a skill registry
Workflow
Follow these phases in order. Never modify files before the approval gate in Phase 3.
Phase 1 — Audit
Scan the skills directory and report all oversized frontmatter blocks:
python scripts/audit.py --dir <skills_directory>
Report to the user:
- Total skills scanned
- Total over the 1,000-char limit
- Grouped by severity: Critical (>1,300), Warning (1,100–1,300), Tolerable (1,000–1,100)
Use --json for structured output when chaining with other tools.
Phase 2 — Analyze and Propose
For each oversized skill, determine which optimizations apply:
python scripts/analyze.py --file <path/to/SKILL.md>
| Optimization | When to Apply | Typical Saving |
|---|---|---|
| Deduplication | Duplicate metadata: blocks exist | 200–500 chars |
| Flattening | Vertical YAML lists (- item) in metadata | 20–80 chars |
| Noise removal | Empty fields, tags:, metadata-tags:, external tool configs | 50–200 chars |
| Field migration | Non-dispatcher fields: license, author, version, maturity, compatibility, homepage, platforms | 50–270 chars |
| Description trim | Description > 300 chars (last resort) | 50–180 chars |
Present a before/after diff for each proposed change:
Skill: release-manager-skill (1,524 → ~970 chars, saves 554)
Actions: field-migration, description-trim, flattening
BEFORE description:
"Validate and prepare GitHub releases following SemVer and CHANGELOG standards. Trigger to: ..."
AFTER description:
"Validate and prepare GitHub releases. Trigger for: SemVer changelogs, version bumps, release commits, CI/CD monitoring, and repo bootstrap."
Fields to REMOVE from frontmatter (moved to body):
license, compatibility, author, version, maturity
Do not apply changes yet. Present the full proposal and ask: "Shall I apply these changes?"
Phase 3 — Approval Gate (mandatory)
Wait for explicit user confirmation. This is a hard stop.
- Yes to all: proceed to Phase 4
- Yes to some: apply only the approved skills/optimizations
- No: stop — no files are modified
Phase 4 — Apply
Apply approved changes using the bundled scripts. Run in this order per skill:
scripts/deduplicate.py --file <path> --backup— merge duplicate metadata blocksscripts/flatten.py --file <path>— convert vertical lists to inline valuesscripts/remove_noise.py --file <path>— strip noise/decorative fieldsscripts/migrate_to_body.py --file <path>— move non-dispatcher fields to body- Manual description trim (if approved) — edit the
description:value directly
Always use --backup on the first script to create a .bak safety copy. Subsequent scripts operate on the already-backed-up file.
Use --dry-run on any script to preview without writing.
Phase 5 — Verify
Re-run the audit on modified files only:
python scripts/audit.py --dir <skills_directory> --files <changed_file1> <changed_file2>
Report the final result:
- ✅ Skills now clean (≤ 1,000 chars)
- ⚠️ Skills still over (and by how much)
If any skill remains over after all safe optimizations, report it as requiring manual description editing and show the user the exact line to trim.
Alternative: Unified Pipeline
For convenience, all phases can be run through a single command:
python scripts/cleanup.py --dir <skills_directory> --analyze --apply --backup --dry-run
Remove --dry-run to apply changes. The unified CLI still requires the agent to present results and obtain approval before the --apply phase.
Frontmatter vs. Body Contract
Stays in frontmatter (dispatcher reads these)
name, description, all metadata.dispatcher-* keys
Moves to body (agent reads the full file)
license, compatibility, author, version, maturity, homepage, platforms
The agent reads the entire SKILL.md — moving fields to the body loses nothing. The dispatcher preloader only reads the frontmatter block.
Migrated metadata format in body:
> **Author:** jovd83 | **Version:** 2.0.0 | **License:** MIT
> **Compatibility:** Requires Python 3.10+
Guardrails
- Never apply without approval. The Phase 3 approval gate is mandatory and non-negotiable.
- Never trim
dispatcher-*keys. These are the routing contract. Only shorten values where safe. - Preserve semantic meaning. When shortening descriptions or capability values, keep all trigger keywords. Do not remove domain terms that help the dispatcher match the skill.
- Do not over-abbreviate intents.
prepare_releaseis acceptable;prep_relis not. - Always use
--backupon the first write to a file. If something goes wrong, the.bakfile provides recovery. - Use
--dry-runfirst when uncertain about the impact of an optimization.
Scripts Reference
| Script | Purpose | Key Flags |
|---|---|---|
scripts/cleanup.py | Unified pipeline (audit → analyze → apply) | --analyze, --apply, --dry-run, --backup, --json |
scripts/audit.py | Scan directory, report oversized files | --dir, --files, --limit, --json |
scripts/analyze.py | Per-skill optimization recommendations | --file, --json |
scripts/deduplicate.py | Merge duplicate metadata blocks | --file, --dry-run, --backup |
scripts/flatten.py | Convert vertical lists to inline values | --file, --dry-run, --backup |
scripts/remove_noise.py | Strip noise/decorative fields | --file, --dry-run, --backup |
scripts/migrate_to_body.py | Move non-dispatcher fields to body | --file, --dry-run, --backup |
Optional Integration: Telemetry
If your environment uses a skill dispatcher with telemetry logging, log usage after each invocation:
./log-dispatch.cmd --skill skill-yaml-cleanup --intent <intent> --model <model> --reason <reason>
This is optional and depends on your infrastructure setup.
What ships with it: 20 files
162.9 KB alongside SKILL.md, 14 of them executable
evals/
- evals.json1.7 KB
scripts/
- analyze.pyruns6.7 KB
- audit.pyruns4.9 KB
- cleanup.pyruns3.1 KB
- _common.pyruns12.4 KB
- deduplicate.pyruns4.5 KB
- flatten.pyruns2.7 KB
- __init__.pyruns37 B
- migrate_to_body.pyruns3.4 KB
- remove_noise.pyruns2.5 KB
- validate_repo.ps1runs639 B
- validate_repo.pyruns1.3 KB
tests/
- test_common.pyruns2.2 KB
- test_normalize.pyruns8.3 KB
- test_scripts.pyruns3.1 KB
- audit_results.json96.5 KB
- CHANGELOG.md1.8 KB
- .gitignore258 B
- LICENSE1.0 KB
- README.md5.9 KB