跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
浏览器与自动化

enhance-skills

Use when reviewing SKILL.md files for structure and trigger quality.

agent-sh · 已有 AI 审核记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add agent-sh/agentsys --skill enhance-skills

技能说明


name: enhance-skills description: "Use when reviewing SKILL.md files for structure and trigger quality." version: 5.1.0 argument-hint: "[path] [--fix]"

enhance-skills

Analyze skill definitions for trigger quality, structure, and discoverability.

Workflow

  1. Discover - Find all SKILL.md files
  2. Parse - Extract frontmatter and content
  3. Check - Run all pattern checks against knowledge below
  4. Filter - Apply certainty filtering
  5. Report - Generate markdown output
  6. Fix - Apply auto-fixes if --fix flag present

Skill Knowledge Reference

Frontmatter Fields (Complete Reference)

FieldRequiredDescriptionValidation
nameNoDisplay name, defaults to directory namelowercase, max 64 chars
descriptionRecommendedWhat skill does and when to usemax 1024 chars, should include trigger
argument-hintNoAutocomplete hint, e.g., [file-path]keep under 30 chars
disable-model-invocationNotrue = manual only (for side effects)boolean, default false
user-invocableNofalse = hidden from / menu (auto-only)boolean, default true
allowed-toolsNoTools Claude can use without permissioncomma-separated list
modelNoSpecific model when skill is activeopus, sonnet, haiku
contextNofork = run in isolated subagent contextfork or omit
agentNoSubagent type for executionExplore, Plan, general-purpose
hooksNoSkill-scoped lifecycle hooksPreToolUse, PostToolUse

Directory Structure

skills/my-skill/
├── SKILL.md           # Required - core definition (under 500 lines)
├── reference.md       # Optional - detailed documentation
├── examples.md        # Optional - usage examples
└── scripts/           # Optional - helper scripts
    └── helper.py

Storage Locations:

  • Enterprise: Managed settings
  • Personal: ~/.claude/skills/<name>/SKILL.md
  • Project: .claude/skills/<name>/SKILL.md

Invocation Control Patterns

Manual Only (for skills with side effects):

---
name: deploy
description: Deploy to production
disable-model-invocation: true
---

Background Knowledge (auto-only, hidden from menu):

---
name: legacy-context
description: How the legacy payment system works
user-invocable: false
---

Full Access (default - both auto and manual):

---
name: review
description: Use when user asks to review code. Checks quality and security.
---

Trigger Phrases

Description should include trigger context for auto-discovery:

  • "Use when user asks..."
  • "Use when..."
  • "Invoke when..."

Good: "Use when user asks to 'review code', 'check PR', or 'code review'" Bad: "Reviews code" (no trigger context)

Dynamic Context Injection

Skills can inject dynamic content using backtick syntax:

---
name: pr-summary
description: Summarize PR changes
context: fork
agent: Explore
allowed-tools: Bash(gh:*)
---

## Pull request context
- PR diff: !`gh pr diff`
- PR comments: !`gh pr view --comments`
- Changed files: !`gh pr diff --name-only`

Rules:

  • Use ! followed by backtick-wrapped command
  • Limit to 3 injections per skill
  • Each injection adds to context budget

String Substitutions

VariableDescription
$ARGUMENTSAll arguments passed when invoking
${CLAUDE_SESSION_ID}Current session ID

Context Budget

  • Skill descriptions have ~15,000 character default limit
  • Content beyond limit is truncated
  • Check with /context command
  • Increase via: SLASH_COMMAND_TOOL_CHAR_BUDGET=30000

Subagent Execution

When using context: fork:

---
name: deep-research
description: Research a topic thoroughly
context: fork
agent: Explore
allowed-tools: Read, Grep, Glob
---

Research $ARGUMENTS thoroughly:
1. Find relevant files
2. Analyze the code
3. Summarize findings

Agent Types:

AgentPurposeTool Access
ExploreRead-only codebase explorationRead, Grep, Glob only
PlanPlanning-focused reasoningRead, analysis tools
general-purposeFull capabilitiesAll tools

Skill-Scoped Hooks

---
name: secure-operations
hooks:
  PreToolUse:
    - matcher: "Bash"
      hooks:
        - type: command
          command: "./scripts/security-check.sh"
---

Tool Restrictions

Use scoped tool patterns for security:

PatternMeaning
Bash(git:*)Only git commands
Bash(npm:*)Only npm commands
Bash(gh:*)Only GitHub CLI
Read(src/**)Only files in src/

Detection Patterns

1. Frontmatter Validation (HIGH Certainty)

Required:

  • YAML frontmatter with --- delimiters
  • name field (lowercase, max 64 chars)
  • description field (max 1024 chars)

Recommended:

  • version field for tracking
  • argument-hint for skills accepting input
  • allowed-tools for security
  • model when specific model required

Flag:

  • Missing frontmatter delimiters
  • Invalid field values (uppercase name, description >1024 chars)

2. Trigger Quality (HIGH Certainty)

Check: Description includes trigger phrase Trigger patterns: "Use when", "Invoke when", "Use when user asks"

Flag:

  • Description without trigger context
  • Vague descriptions like "Useful tool" or "Does stuff"

3. Invocation Control (HIGH Certainty)

Check: Side-effect skills are protected

Flag:

  • Skills with deploy/ship/publish in name but disable-model-invocation not set
  • Dangerous auto-invocable skills (can accidentally trigger)

4. Tool Restrictions (HIGH Certainty)

Check: Tools are appropriately scoped

Flag:

  • Unrestricted Bash (should be Bash(git:*) or similar)
  • Read-only skills with Write/Edit
  • Research skills with Task tool

5. Content Scope (MEDIUM Certainty)

**Guideli

阅读完整来源 ↗