AGENT SKILL

agent-skill-kit-description-optimizer

Optimize a SKILL.md description for trigger quality — generate synthetic positive and negative queries, score the current description by hit-rate vs false-positive, and propose three ranked rewrites. Use when the user asks to auto-tune, improve, or rewrite a skill description, fix a skill that never fires, or measure description quality.

License 许可
Apache-2.0
最近更新
2026-05-28
Stars
★ 1
Forks
0

01 前言 Front Matter

name
agent-skill-kit-description-optimizer
tier
app
license
Apache-2.0
description
Optimize a SKILL.md description for trigger quality — generate synthetic positive and negative queries, score the current description by hit-rate vs false-positive, and propose three ranked rewrites. Use when the user asks to auto-tune, improve, or rewrite a skill description, fix a skill that never fires, or measure description quality.
compatibility
requires `skills-ref` CLI

03 SKILL.md 正文

Agent Skill Description Optimizer

Wraps skills-ref optimize. Generates trigger queries, scores the current description against the F04 rubric, and proposes three deterministic rewrites. The --apply N flag commits the chosen variant back to disk with byte-preservation of every other line.

When to use

  • "Improve this description"
  • "Why doesn't my skill ever fire?"
  • "Optimize the SKILL.md descriptions in this tree"
  • "Rewrite this description to score higher"
  • "Measure description quality before shipping"

Where LLM-quality variants come from

The CLI ships deterministic variants only — three template-based transforms, < 200 ms, no network, no API keys, no provider config. This is intentional: when the skill runs inside an AI harness (Claude Code, an SDK agent, etc.), the calling harness is itself an LLM with provider credentials already attached. Asking the CLI to hold a separate API key duplicates auth surface for no benefit.

When higher-quality rewrites are wanted, the harness does the work:

  1. Run skills-ref optimize <dir> --baseline-only --format json to get the current score + breakdown.
  2. The harness reads the SKILL.md and generates its own three improved descriptions, using whatever model/auth it already has.
  3. The harness writes the chosen description directly into the YAML frontmatter (Edit / Write).
  4. Run skills-ref validate <dir> to confirm the post-edit file passes (the same gate --apply uses internally).

--apply N remains useful for the deterministic case — it preserves bytes and auto-rolls back on validation failure.

Invocation

# Score the current description only (no rewrites)
skills-ref optimize /path/to/skill-dir --baseline-only

# Score + propose three ranked variants (sorted by F04 score desc)
skills-ref optimize /path/to/skill-dir

# Apply variant 0 in-place (with re-validation safety + auto-rollback)
skills-ref optimize /path/to/skill-dir --apply 0

# Machine-readable output for the CI gate
skills-ref optimize /path/to/skill-dir --format json

Output shape

Human format reports the baseline and each variant on its own block:

/abs/path/SKILL.md
  provider: none
  baseline: score=98/100 hit=6/8 false=1/8
  variants:
    [0] score=99/100 hit=5/8 false=1/8
        rationale: lead-with-verb + append trigger phrase
        text: <rewritten description>

JSON format is canonical sorted-key output containing baseline, variants, queries, provider, path. Both runtimes emit byte-identical JSON (parity-tested against the frozen .agents/skills/agent-skill-kit-commons/fixtures/optimize/expected/low-score-vague.json snapshot).

Two scores per variant

  • score — F04's description-quality score (0–100). The deterministic ranker sorts variants by this.
  • hit_rate.score — (positive_hits / positive_total - false_positives / false_total) * 100, clamped to 0–100. Surfaced for CI gating without re-running F04's scorer.

Safety contract for --apply

  • The description: line in the YAML frontmatter is replaced; every other line is byte-preserved.
  • A .bak file is created before write.
  • After write, the validator runs against the same directory.
  • On validation failure, the backup restores the original and the .bak is removed; the CLI exits 1.
  • On success, the .bak is deleted; the CLI exits 0.

Limits

  • The deterministic rewriter is intentionally conservative — three template-based transforms, no LLM. For higher-quality variants, see "Where LLM-quality variants come from" above; the harness generates them, the CLI does not.
  • The chars / 4 token estimate from the prompt emitter is not used here; the optimizer's input is bounded by the body excerpt (first 1000 chars) and the query JSON.
  • The trigger-phrase regex re-uses F04's; both share the same edge cases (e.g. "for " inside "helpful for" matches as a trigger). The lint pipeline is the canonical filter; this skill defers to it.

Reference

Full specification: see the canonical spec at ../../../agentskills.io.md.

04 同仓库更多 Skills

carlosmarte
carlosmarte/agents-skills-kit

agent-skill-kit-validator

Validate one or many SKILL.md files against the agentskills.io specification — frontmatter, naming, body, optional-directory, and reference checks. Use when the user asks to validate a skill, audit skills, check SKILL.md, or run skills-ref against an existing skill or directory tree.

★ 1
carlosmarte
carlosmarte/agents-skills-kit

agent-skill-kit-security-auditor

Audit a skills tree for the four canonical security findings — unauthorized frontmatter fields, command-injection patterns in scripts, unvetted cross-repo dependency origins, and host-path leaks in body or scripts. Use when the user asks to audit, scan, security-check, or harden a skill or skills directory.

★ 1
carlosmarte
carlosmarte/agents-skills-kit

agent-skill-kit-prompt-emitter

Emit progressive-disclosure artifacts from a skills tree — an `<available_skills>` XML block for stage-1 agent startup, or canonical JSON of frontmatter properties for CI consumption. Use when the user asks to export skill metadata, build a prompt block, generate JSON for CI, or wire skills into an agent host.

★ 1
carlosmarte
carlosmarte/agents-skills-kit

agent-skill-kit-discoverability-linter

Score a SKILL.md description 0-100 for trigger quality, flag vague language, warn on vendor-specific frontmatter, and verify relative file references resolve. Use when the user asks to lint a skill, improve discoverability, score a description, or check why an agent never fires their skill.

★ 1
carlosmarte
carlosmarte/agents-skills-kit

agent-skill-kit-dependency-resolver

Resolve and topologically sort skill dependencies, enforce the spec §3.3 inversion rule (project→app→team→org), warn on unpinned versions, and fail-closed on incompatible range conflicts. Use when the user asks to check skill dependencies, sort skills by build order, detect cycles, or audit skill version pinning.

★ 1
carlosmarte
carlosmarte/agents-skills-kit

agent-skill-kit-creator

Scaffold and validate agent skills against SKILL_SPEC.md (frontmatter, naming rules, structure). Use when the user asks to create a new agent skill, generate a SKILL.md file, scaffold a skill directory, or validate existing skills. Tier/scope (company, enterprise, org, team, project, application) is optional and off by default — engaged only when the user opts in with --tiers / --agents-skills-kit-tiers.

★ 1