optimize-skills
Original:🇺🇸 English
Translated
1 scripts
Use when creating or refining SKILL.md-based skills, or diagnosing weak triggering (under/over-triggering, vague descriptions, bloated context, or missing workflow guidance).
14installs
Sourceahgraber/skills
Added on
NPX Install
npx skill4agent add ahgraber/skills optimize-skillsTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Optimizing Skills
Use this skill to create, review, or improve SKILL.md-based skills so they trigger correctly, stay concise, and execute reliably.
When to Use
- Creating a new reusable skill from repeated work patterns.
- Updating an existing skill that under-triggers, over-triggers, or misfires.
- Tightening a skill that is too long, redundant, or hard to execute.
- Converting narrative guidance into concise, imperative instructions.
- Rebalancing where content should live across ,
SKILL.md,references/, andassets/.scripts/
Overview
What is a Skill?
A skill is a reference guide for proven techniques, patterns, or tools, typically classed as procedural knowledge or best practices.
Skills help future Agent instances find and apply effective approaches.
Skills are: Reusable techniques, patterns, tools, reference guides
Skills are NOT: Narratives about how you solved a problem once
When to Create a Skill
Create when:
- Technique wasn't intuitively obvious to you or required multiple iterations to get right.
- You'd reference this again across projects / Others would benefit from knowing this.
- Pattern applies broadly (not project-specific)
- Triggerable by specific user intents or common failure modes.
Don't create for:
- One-off solutions
- Standard practices well-documented elsewhere
- Project-specific conventions that aren't broadly applicable
Workflow
Phase 1: Preparation
- Choose the path:
- New skill: initialize scaffold and baseline structure.
- Existing skill: load current and related resources as baseline.
SKILL.md
- Define the target workflow first:
- List the execution steps in order, including prerequisites, gates, and outputs.
- Keep steps imperative and executable.
- Determine trigger scenarios in working notes:
- Capture 2-3 scenarios that must trigger the skill.
- Capture up to 2 scenarios that must not trigger the skill.
- Decide whether a flowchart is required:
- Use markdown-only workflow when flow is linear and obvious.
- Add a small DOT flowchart only when branching/loops are non-obvious.
Phase 2: Draft
- Draft metadata and usage guidance from preparation:
- Keep frontmatter to and
name.description - Encode trigger scenarios in and
description(and## When to Usewhen helpful).## When Not to Use
- Keep frontmatter to
- Draft the skill body in imperative form:
- Keep instructions short, specific, and ordered by execution.
- Move deep detail to ,
references/, orassets/and link fromscripts/.SKILL.md
Phase 3: Review and Optimize
- Run scenario and functional checks against realistic prompts.
- Review resource fit:
- Confirm references/assets/scripts are sufficient and scoped.
- Offload verbose sections into resources where appropriate.
SKILL.md
- Optimize the draft:
- Tighten triggering (under/over-triggering).
- Remove redundancy and improve progressive disclosure.
- Re-check whether flowchart usage is still justified.
- Iterate until trigger behavior and execution quality both pass.
Core Principles
- Optimize for triggering: description must emphasize when to use the skill ().
references/skills-search-optimization.md - Treat trigger scenarios as authoring scaffolding; the final skill should expose triggers through and
description.## When to Use - Keep frontmatter metadata small (about 100 tokens combined).
- Keep main under 500 lines and focused on action.
SKILL.md - Use progressive disclosure: metadata -> SKILL.md -> references/scripts/assets.
- Choose the right degree of freedom: text, pseudocode, or scripts depending on fragility.
- Prefer reusable resources (scripts, templates) over repeated prose.
Progressive Disclosure Targets
- Metadata (+
name): small startup footprint, ideally ~100 tokens.description - : keep actionable and concise, target <5000 tokens and <500 lines.
SKILL.md - ,
scripts/,references/: loaded only when needed; keep files narrow so agents pull less context.assets/
Flowchart Guidance
dot
digraph when_flowchart {
"Need to show process guidance?" [shape=diamond];
"Non-obvious decision or loop?" [shape=diamond];
"Use markdown (list/table/code)" [shape=box];
"Use small inline DOT flowchart" [shape=box];
"Need to show process guidance?" -> "Non-obvious decision or loop?" [label="yes"];
"Need to show process guidance?" -> "Use markdown (list/table/code)" [label="no"];
"Non-obvious decision or loop?" -> "Use small inline DOT flowchart" [label="yes"];
"Non-obvious decision or loop?" -> "Use markdown (list/table/code)" [label="no"];
}- Use markdown lists/tables/code blocks by default.
- Add DOT only when decision logic or loops are easy to misapply.
- Avoid placeholder node labels; use concrete actions and conditions.
- Follow for node shapes and labels.
references/graphviz-conventions.dot - Keep flowcharts small and trigger-based; split large flows into focused subgraphs.
Render DOT to SVG with .
Output SVGs are written to the target skill's directory.
scripts/render-dot.pyassets/bash
scripts/render-dot.py skills/optimize-skills/references/skill-workflow.dot
scripts/render-dot.py skills/optimize-skills/SKILL.md
scripts/render-dot.py skills/optimize-skills/SKILL.md --force # overwrite existing SVGsOutput
SKILL.md Structure
txt
skills/
skill-name/
SKILL.md # Main reference (required)
assets/ # (optional) Static reusable resources such as templates or figures
references/ # (optional) On-demand documentation, organized by topic or variant
scripts/ # (optional) Executable helpers for deterministic tasks;
# scripts should be self-contained or clearly declare dependencies,
# include clear errors, and handle edge cases.Rules
- SKILL.md must be named exactly .
SKILL.md - Folder name must be kebab-case, matching the in frontmatter.
name - Do not add README.md inside the skill.
- YAML frontmatter must include and
namefields.description - must be kebab-case and match the folder name.
name - should emphasize when to use the skill and include triggers/symptoms.
description - Avoid workflow summaries in the description.
- Keep descriptions short and specific.
- Prefer /
## When to Usefor trigger cues; do not add a dedicated trigger-scenarios section unless explicitly requested by the repo.## When Not to Use - Refer to for a suggested (but easily modified) template structure.
assets/skill-template.md
Common Mistakes
- Summarizing workflow in instead of stating actionable triggers and symptoms.
description - Copying working trigger scenarios directly into the final skill instead of converting them into and
description.## When to Use - Keeping workflows as one giant graph instead of splitting into trigger-based subgraphs.
- Repeating deep reference material in instead of linking to
SKILL.md.references/ - Leaving scripts implicit: deterministic steps should be executable where possible.
References
- for a suggested SKILL.md structure.
assets/skill-template.md - : checklists, structure guidance, testing, and troubleshooting patterns.
references/best-practices.md - : description and trigger optimization rules.
references/skills-search-optimization.md - : canonical workflow for this skill.
references/skill-workflow.dot - : DOT style and semantics for workflow diagrams.
references/graphviz-conventions.dot