feat(optimize-skill): skill to optimize existing skills via the security-suite refactor patterns#427
Merged
Merged
Conversation
6e24085 to
8d23e57
Compare
…ity-suite refactor patterns Adds `optimize-skill` (capability:setup) — the refactoring sibling of `write-skill`. It takes an existing framework skill (or sweeps a set) and applies the five restructuring patterns proven on the security suite, as behavior-preserving proposals gated by the validator (green-before / green-after): - split — slim an oversized SKILL.md into linked siblings (the apache#410 pattern; addresses the PRINCIPLES.md P14 cap) - config-lift — move concrete values into <project-config> (apache#386/apache#387/apache#388) - out-of-context — read/PATCH one field without loading the body (apache#412 github-body-field, apache#424 github-rollup) - fetch-upfront — batch per-item round-trips (apache#347) - preflight-classifier — skip obvious no-ops before LLM passes (apache#414/apache#416) SKILL.md is 297 lines; the pass catalogue (smell / exemplar PR / mechanics / behavior-preservation guarantee / validation) lives in the patterns.md sibling. Reads only framework-internal files, so no injection-guard / Privacy-LLM callouts. Ships a step-diagnose eval (5 auto-comparable cases incl. an injection-resistance case) so the skill is not released without an eval (P8). Wires the skill into the capability->skill map and the eval index. Generated-by: Claude Code (Opus 4.8)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Adds
optimize-skill(capability:setup) — the refactoring sibling ofwrite-skill.write-skillauthors a net-new skill;optimize-skilltakes anexisting one (or sweeps a set) and makes it leaner without changing what it
does, applying the five restructuring patterns proven on the security-skill
suite. Every pass is a behavior-preserving proposal the maintainer signs off on,
gated by the skill validator (green-before / green-after).
This is also the tool to close the P14 gap surfaced in the PRINCIPLES.md audit
(#147): 14
SKILL.mdfiles currently exceed the proposed 500-line cap.The five passes (each distilled from a landed PR)
splitconfig-liftout-of-contextfetch-upfrontpreflight-classifierEach carries an explicit behavior-preservation guarantee — moved bytes are
identical bytes; rewires change how a step runs, never what it decides.
A pass that would alter the prose a human signs off on is out of scope.
Contents
.claude/skills/optimize-skill/SKILL.md— 297 lines (under the cap it enforces)..claude/skills/optimize-skill/patterns.md— the pass catalogue (smell / exemplar / mechanics / guarantee / validation).tools/skill-evals/evals/optimize-skill/step-diagnose/— 5 auto-comparable eval cases incl. an injection-resistance case, so the skill ships with an eval (P8).docs/labels-and-capabilities.md) and the eval index.Reads only framework-internal files → no injection-guard / Privacy-LLM callouts.
Testing
pre-commitfull suite green (skill-and-tool validator incl. capability-sync, placeholder linter, markdownlint); eval runner parses all 5 cases; lychee link/anchor check clean.Generated-by: Claude Code (Opus 4.8)