src/caelterra/skills/optimise-skill/SKILL.md
Audits and rewrites Agent Skills (SKILL.md + supporting files) for clarity, token efficiency, and progressive disclosure. Use when the user asks to optimize, improve, review, or clean up a skill. Do NOT use for creating new skills from scratch or for editing files that are not part of a skill directory.
npx skillsauth add laitszkin/apollo-toolkit optimise-skillInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Analyze a skill's full directory and produce an optimized rewrite. The goal is not to change what the skill does — it is to make the skill easier for an LLM to understand and execute effectively. Achieve this by removing redundancy, separating concerns, and replacing rigid instructions with guiding principles. Every change must survive independent adversarial verification via a fresh Hermes instance.
## Gotchas section captures environment-specific facts that break model defaults.A well-structured skill separates three distinct concerns:
| Layer | What it contains | Where it lives | | -------------- | ------------------------------------------------------ | --------------- | | Behavioral | How to think, what to check, what principles to follow | SKILL.md | | Format | What the output structure looks like | Template files | | Tool | CLI flags, API params, external commands | Reference files |
The most common problem in unoptimized skills is mixing these layers together — templates that tell the agent what to do, SKILL.md sections that describe output formats, and reference files that contain behavioral rules. Your job is to untangle them so that each piece of content lives in exactly the right layer.
Read the full skill directory, including SKILL.md, templates, and reference files. Before optimizing, understand three things about this skill: what it produces and who consumes it downstream, what it reads from upstream stages, and which parts actually get used downstream versus which are decorative.
The description in the YAML frontmatter is the only metadata the agent uses to decide whether to load this skill. If the description is wrong, the skill is invisible regardless of how good the body is.
Check the existing description against these criteria:
If the description fails any criterion, rewrite it. A bad description makes the entire skill body invisible — it is the highest-leverage single change you can make.
Description anti-patterns (see references/description-patterns.md for before and after examples):
references/description-patterns.md.For each instruction in SKILL.md, ask: would a frontier model do this correctly without being told?
If the answer is yes, delete the instruction. Instructions the model would follow anyway waste tokens and dilute the rules that actually matter.
Examples of content that should be removed:
git diff to see changes" because the model already knows git.Keep only what is project-specific, non-obvious, or cases where the model's default behavior would be wrong.
Go through every section across all files and classify it as behavioral, format, or tool guidance. When you find content in the wrong layer, move it to the correct one:
references/ directory.The key question for any piece of content is: if I removed this file, what would the agent lose? If the answer is "behavioral guidance," that content belongs in SKILL.md. If the answer is "a structure to fill in," it belongs in a template. If the answer is "CLI flags to look up," it belongs in a reference file.
For each field, section, and table in the skill's output, ask who actually reads it downstream. Prune what nobody consumes. This includes tables that duplicate information expressed elsewhere, columns that are never referenced downstream, key-value pairs that would be clearer and shorter as natural language, and speculative fields that ask for predictions or guesses.
This is the most common bug in skills that dispatch subagents. When a skill instructs the orchestrator to inject a prompt into a subagent via terminal(command="hermes chat -q ..."), that prompt is the only content the subagent receives. The subagent has no access to the orchestrator's SKILL.md, templates, or reference files.
Audit every subagent prompt for these broken references:
Fix every instance by making each subagent prompt fully self-contained. Any rule, table, or format the subagent needs must appear verbatim inside the prompt, either in the prompt text itself or piped in via cat references/checklist.md. This is the highest-leverage single fix in skills that dispatch subagents — a non-self-contained prompt produces hallucinated output that passes all other verification checks but is wrong.
See references/subagent-self-containment.md for a concrete before and after example.
Compare closely related rules across files because contradictions confuse agents. Look for the same rule expressed with different wording in SKILL.md versus a template, a downstream skill assuming a structure that an upstream stage changed, and two steps in the workflow that overlap in purpose or decision logic.
After untangling, restructure SKILL.md so it guides the agent's thinking rather than scripting every keystroke. Use references/example_skill.md as a format reference.
Principles to apply:
Review the original skill for environment-specific facts that would break the model's default assumptions. These are the highest-value content per token in the entire skill. Add a ## Gotchas section to SKILL.md.
Good gotchas worth keeping:
.tsx files."Bad gotchas that should be deleted because they are too vague:
Verification is mandatory. An unverified optimization is indistinguishable from degradation. If any check fails, go back to the relevant phase, fix the issue, and then re-run the check. Verification uses independent Hermes instances via hermes chat -q so that an agent with no memory of the optimization process evaluates the result from scratch.
When optimizing a batch of 5 or more skills, running the full Check A through Check D protocol per skill is impractical. Instead, apply structural patterns uniformly across all skills (three-layer separation, removing what the model already knows, compressing frameworks), run a structural validator per skill such as create-skill's validate-skill.py, and reserve the full adversarial verification for the most complex or ambiguous skill in the batch — the one with the highest behavioral density. The structural patterns provide the primary value at batch scale while the full verification protocol is most valuable for individual deep rewrites.
Run an independent Hermes instance to evaluate the skill's frontmatter. This check confirms that the description triggers correctly — neither missing relevant queries nor matching irrelevant ones.
hermes chat -q "You are evaluating an Agent Skill's frontmatter. Agents decide whether to load this skill based entirely on the YAML metadata below. Based strictly on this metadata, do the following. First, generate 3 realistic user prompts that SHOULD trigger this skill. Second, generate 3 user prompts that sound similar but should NOT trigger. Third, critique the description: is it too broad, too narrow, or missing negative triggers? Fourth, propose a revised description if improvements are needed.
---
name: <skill-name>
description: <description>
---"
Replace <skill-name> and <description> with the actual values from the optimized skill. If the independent agent identifies false positives or false negatives, fix the description before proceeding.
Run an independent Hermes instance with the full optimized SKILL.md to simulate execution. This check reveals ambiguities, missing steps, and hallucination risks.
The prompt for the independent agent must include the full SKILL.md content. Embed it directly:
hermes chat -q "Act as an autonomous agent that has just triggered this skill. Simulate execution step-by-step on a typical input.
For each step, write your internal monologue covering four things. First, what exactly are you doing? Second, which specific file are you reading or running? Third, flag any Execution Blockers: exact lines where you must guess or hallucinate because the instructions are ambiguous. Fourth, if the skill dispatches subagents, check whether the injected prompt is self-contained — does it reference anything the subagent cannot see such as tables, sections, or files from the orchestrator's SKILL.md?
Here is the full skill:
<PASTE FULL SKILL.md HERE>"
Replace <PASTE FULL SKILL.md HERE> with the complete content of the optimized SKILL.md. If the independent agent guesses or hallucinates at any step, that instruction needs to be clearer. Fix it and re-run this check.
Run an independent Hermes instance in adversarial mode to probe for missing fallbacks and brittle assumptions:
hermes chat -q "Act as a ruthless QA tester. Your goal is to break this skill. Ask 3 to 5 highly specific questions about edge cases, failure states, or missing fallbacks. Focus on four areas. What if a referenced file is missing or renamed? What if the input violates assumptions baked into the skill? Are there implicit environment or toolchain assumptions? What happens if a script fails mid-execution? Do not fix these issues yet — just ask the numbered questions and wait for me to answer them.
Here is the full skill:
<PASTE FULL SKILL.md HERE>"
Answer each question the independent agent raises, then apply the corresponding fixes to the skill.
Final manual pass through this checklist. Every item must be confirmed:
Output the complete optimized skill. If the original skill had supporting files such as templates, reference files, or scripts, include the updated versions of those too. Flag any files that should be deleted because their content was merged into SKILL.md or pruned entirely.
references/example_skill.md — Format reference for optimized SKILL.md structure.references/subagent-self-containment.md — Concrete before and after example of the most common subagent-prompt bug.references/description-patterns.md — Before and after examples of description optimization, covering implementation-detail openings, missing user-language triggers, stale negative triggers, and exclusionary descriptions on fuzzy boundaries.development
Guides the agent through creating a new Agent Skill from scratch. Use when the user wants to build a skill, create a new skill, scaffold a skill directory, or author a SKILL.md. Do NOT use for optimising or rewriting existing skills — use 'optimise-skill' for that. Do NOT use for editing files that are already part of a skill. Do NOT use for creating non-skill content like documentation, scripts, or project files.
development
Guides the agent through creating a new Agent Skill from scratch. Use when the user wants to build a skill, create a new skill, scaffold a skill directory, or author a SKILL.md. Do NOT use for optimising or rewriting existing skills — use 'optimise-skill' for that. Do NOT use for editing files that are already part of a skill. Do NOT use for creating non-skill content like documentation, scripts, or project files.
development
Review a pull request — interactive PR selection via `gh`, 4-dimension code review (hallucinated code, architecture, performance, test validity), then post severity-graded comments with fix suggestions on the PR. Not for spec-based review — use `review` instead.
tools
協助完成自動化版本發佈。同步文檔、更新版本號、推送 tag 並建立 GitHub Release。