batch-skill-description-standardization
Skill11 starsChanged 5 months agoMITView on GitHub
Use when needing to standardize descriptions across many skill files at once — change format, fix wording, or enforce a convention like 'Use when...' prefix.
In this repository26 other files it gives its agents.
- agent-capability-comparison-methodologySkill
- autonomous-work-signalingSkill
- checkpoints-and-rewindSkill
- context-aware-task-decompositionSkill
- context-compaction-verification-and-recoverySkill
- cross-session-execution-frameworkSkill
- hermes-agentSkill
- hermes-improvement-multiphase-planSkill
- hermes-tweetSkill
- multi-agent-browser-text-extractionSkill
- multi-role-synthesis-frameworkSkill
- openclaw-hermes-archSkill
- open-source-adaptation-patternSkill
- planSkill
- requesting-code-reviewSkill
- router-learning-systemSkill
- security-hardening-checklistSkill
- self-regulation-brake-systemSkill
- skill-slimming-strategySkill
- spec-driven-developmentSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- think-toolSkill
- token-efficiencySkill
- writing-plansSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 3 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 21
When you need to update descriptions across 20+ SKILL.md files with a consistent pattern (e.g.
- Very specific: line 46
Check each SKILL.md's description line for three problems:
- Very specific: line 84
After running the batch script, re-scan all SKILL.md files to confirm 100% compliance:
- Very specific: line 96
Best defense: Use re.DOTALL and match from description: to the next known YAML key pattern (^[a-z]|^---), NOT just to the next newline.
- Distinctive: line 101
Backup first: Before running a destructive batch update, make a backup tarball of the skills dir:
- Distinctive: line 109
After standardizing descriptions, you may want to slim oversized skills.
- Very specific: line 127
After batch update, confirm ALL files are compliant.
- Distinctive: line 155
No description contains workflow summary
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Batch Skill Description Standardization
When to Use This Skill
When you need to update descriptions across 20+ SKILL.md files with a consistent pattern (e.g. converting all to "Use when..." format).
The Problem
An agent skills directory can have 160+ SKILL.md files with inconsistent descriptions. Some describe workflow instead of triggering conditions. Some start with verbs. Some are 80+ words long. Patching them one-by-one uses 100+ tool calls and is prone to error.
The Superpowers Insight (CSO)
From superpowers' "Claude Search Optimization" analysis:
- If description summarizes workflow, the agent follows the description and SKIPS the skill body.
- Description should ONLY describe WHEN to use, NEVER WHAT the skill does.
- Format: "Use when [precise triggering condition]."
The Workflow
Step 1: Scan and classify
from hermes_tools import search_files, read_file
import re
result = search_files(pattern='SKILL.md', target='files', path='/path/to/skills', limit=200)
files = result['files']Check each SKILL.md's description line for three problems:
- Doesn't start with "Use when" — most common
- Describes workflow (has words like "步驟", "流程", "phase", "checklist", "step 1")
- Too long (over 80 words)
Step 2: Handle the two YAML description formats
There are TWO formats for description in SKILL.md frontmatter:
Format A — Single line:
description: Some text here.Format B — Folded multiline (uses > or >-):
description: >
Long text that spans
multiple lines in the file
but becomes one line in YAML.CRITICAL: For Format B, you CANNOT just replace the description line. You must replace the ENTIRE block from description: to the next YAML key.
Step 3: Write the batch script
Build a Python dict mapping skill identifiers to new descriptions. Use a script with re.sub() to find and replace:
pattern = r'(description:\s*)(.+?)(?=\n(?:---|name:|version:|author:|title:|tags:|category:|metadata:|last_|created:|related|triggers|license:| )|\Z)'
replacement = f'description: {new_desc}'
new_content = re.sub(pattern, replacement, content, count=1, flags=re.DOTALL)This regex handles both single-line and folded multiline descriptions by matching from description: until the next YAML key or section boundary.
Step 4: Verify
After running the batch script, re-scan all SKILL.md files to confirm 100% compliance:
for f in $(find skills -name SKILL.md); do
head -15 "$f" | grep -q "description: Use when" && echo "OK: $f" || echo "FAIL: $f"
donePitfalls
- YAML folded multiline (
>or>-on the description line) is the most common trap. The regex in Step 3 handles it, but test on a few files first.>vs>-:>-strips the trailing newline, which can cause the next YAML key to be concatenated with the description text. If your regex doesn't account for this, you'll get malformed YAML.- Best defense: Use
re.DOTALLand match fromdescription:to the next known YAML key pattern (^[a-z]|^---), NOT just to the next newline.
- Some skills have non-standard frontmatter (e.g., custom keys like
title:,category:,triggers:,related_skills:,triggers:,argument-hint:,allowed-tools:,user-invocable:,homepage:,repository:,platforms:). The regex boundary must account for ALL possible next-key patterns — don't assume a fixed set. - CJK descriptions: Chinese descriptions work fine with "Use when" — no need to rewrite in Chinese. The key is consistency.
- Don't use
patch()tool for batch operations over 20+ files — it uses 1 tool call per file, which burns through your tool call budget fast. Use a Python script with direct file I/O instead. - External package skills: Some skills are bundled from external sources (e.g.
last30daysfrom mvanhorn, auto-generated API docs likepytorch-fsdp). These contain 10K+ words of generated content or vendored scripts. Don't try to slim them — they're not hand-authored. Just flag them as external in the skill body. - Backup first: Before running a destructive batch update, make a backup tarball of the skills dir:
This lets you restore if the regex mangles files.tar czf /tmp/skills-backup-$(date +%Y%m%d).tar.gz /path/to/skills
Step 4: Token Slimming (optional second phase)
After standardizing descriptions, you may want to slim oversized skills. Decision framework:
| Skill Type | What to Do |
| Auto-generated API doc (10K+ words, e.g. pytorch-fsdp) | Rewrite SKILL.md as a 200-word quick start guide with links to official docs. Save original as references/ file. |
| Step-by-step procedure (2K-8K words, e.g. cocos-gray-screen-debug-flow) | Keep core decision tree + flowchart in SKILL.md. Each detailed branch becomes a references/*.md file. |
| External vendored package (e.g. last30days with its own scripts/) | Don't touch. SKILL.md is the package documentation — it's long by design. Just note it's external. |
| Task pipeline (e.g. research-paper-writing) | Keep the high-level flow diagram + phase table in SKILL.md. Each phase's detailed steps go to references/phase-details.md. |
| Internal how-to (< 2000 words) | No action needed unless description needs fixing. |
Token Slimming Pitfalls
- Don't delete content, relocate it: Move detailed instructions to
references/files in the same skill directory. The skill still works — I'llread_filethe reference when needed. - Keep the decision tree: The most valuable part of a debug skill is "which branch to go down", not every detail of every branch. SKILL.md should help me decide WHAT to do; reference files tell me HOW.
- Watch for cross-references: Some skills reference internal sections by anchor. If you split, those anchors break. Replace with file references:
[details](references/foo.md).
Verification
After batch update, confirm ALL files are compliant. There's a trap: head -15 | grep "description: Use when" will FAIL on YAML folded multiline because the description value is literally > or >-, not the actual description text.
Correct verification method:
import subprocess, re
for f in files:
r = subprocess.run(['head', '-15', f], capture_output=True, text=True, timeout=5)
for ln in r.stdout.split('\n'):
if ln.strip().startswith('description:'):
desc = ln.split(':', 1)[1].strip()
if desc in ['>', '>-', '|', '|-']:
# Folded multiline — check the FULL content
r2 = subprocess.run(['sed', '-n', '/description:/,/^[a-z]/p', f], capture_output=True, text=True)
if 'Use when' in r2.stdout or '使用時機' in r2.stdout:
pass # good
else:
print(f"FAIL: {f}")
elif desc.lower().startswith('use when') or desc.lower().startswith('使用時機'):
pass # good
else:
print(f"FAIL: {f}")
breakAlso confirm:
- 100% of descriptions start with "Use when" or "使用時機"
- No description contains workflow summary
- Each description fits in under 120 characters if possible
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
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.

