|
| 1 | +## Goal |
| 2 | + |
| 3 | +Improve an existing Agent Skill so it triggers more reliably, stays lean, and produces better outputs for the intended workflow. |
| 4 | + |
| 5 | +## Additional Context |
| 6 | + |
| 7 | +- Favor targeted iteration over full rewrites; keep what already works and change only the parts blocking activation or execution quality |
| 8 | +- Prefer optimization grounded in real prompts, evals, reviewer feedback, transcripts, or repeated failures over speculative cleanup |
| 9 | + |
| 10 | +## Workflow |
| 11 | + |
| 12 | +### Arguments |
| 13 | + |
| 14 | +<arguments> |
| 15 | +$ARGUMENTS |
| 16 | +</arguments> |
| 17 | + |
| 18 | +### Interpret Arguments |
| 19 | + |
| 20 | +- If `<arguments>` contains a skill path, folder, slug, or `SKILL.md` reference, store it as `<skill-ref>` |
| 21 | +- If `<arguments>` includes an optimization focus such as triggering, output quality, evals, or excess complexity, store it as `<optimization-focus>` |
| 22 | +- If `<arguments>` includes evidence such as prompts, failing cases, reviewer feedback, transcripts, or related files, store it as `<optimization-inputs>` |
| 23 | +- If `<arguments>` includes constraints, audience, tools, or notes, store them as `<additional-context>` |
| 24 | +- If `<skill-ref>` is still missing, derive it from the conversation |
| 25 | +- If the target skill still cannot be determined, STOP and report that a skill reference is required |
| 26 | + |
| 27 | +### Load Skill Context |
| 28 | + |
| 29 | +- Resolve `<skill-ref>` to the target skill directory and store it as `<skill-dir>` |
| 30 | +- Confirm `<skill-dir>/SKILL.md` exists; if not, STOP and report that the skill could not be found |
| 31 | +- Read the current `SKILL.md` |
| 32 | +- Read only the support files that materially affect the optimization focus, such as `references/`, `scripts/`, `assets/`, `evals/`, or nearby docs |
| 33 | +- If optimization evidence was provided through `<optimization-inputs>`, load and use it as source context |
| 34 | + |
| 35 | +### Reapply Skill Workflow |
| 36 | + |
| 37 | +- Identify the smallest set of changes that will improve `<optimization-focus>` without rewriting working parts of the skill |
| 38 | +- If the skill already matches the requested focus and no meaningful improvement is justified, STOP and report that no changes are needed |
| 39 | + |
| 40 | +<%~ include("@skill-authoring", { mode: "optimize" }) %> |
| 41 | + |
| 42 | +### Output |
| 43 | + |
| 44 | +If the target skill cannot be determined, display: |
| 45 | +``` |
| 46 | +Skill reference required |
| 47 | +
|
| 48 | +Provide the skill path, folder, slug, or `SKILL.md` target to optimize. |
| 49 | +
|
| 50 | +No additional steps are required. |
| 51 | +``` |
| 52 | + |
| 53 | +If the target skill cannot be found, display: |
| 54 | +``` |
| 55 | +Skill not found |
| 56 | +
|
| 57 | +Target: <skill-ref> |
| 58 | +
|
| 59 | +No additional steps are required. |
| 60 | +``` |
| 61 | + |
| 62 | +If no meaningful optimization is needed, display: |
| 63 | +``` |
| 64 | +No skill changes needed |
| 65 | +
|
| 66 | +Skill: <skill-dir> |
| 67 | +Reason: <no-change-reason> |
| 68 | +
|
| 69 | +No additional steps are required. |
| 70 | +``` |
| 71 | + |
| 72 | +When the skill is optimized, display: |
| 73 | +``` |
| 74 | +Optimized skill: <skill-dir> |
| 75 | +
|
| 76 | +Updated files: |
| 77 | +<file-lines> |
| 78 | +
|
| 79 | +Validation: |
| 80 | +<validation-results> |
| 81 | +
|
| 82 | +No additional steps are required. |
| 83 | +``` |
0 commit comments