home / skills / gigaverse-app / skillet / metaskill-triggering

metaskill-triggering skill

/metaskill/skills/metaskill-triggering

This skill optimizes trigger keywords and frontmatter description to reliably activate the metaskill, ensuring specificity and keyword-variants.

npx playbooks add skill gigaverse-app/skillet --skill metaskill-triggering

Review the files below or copy the command above to add this skill to your agents.

Files (3)
SKILL.md
5.4 KB
---
name: metaskill-triggering
description: Optimize skill triggers and descriptions for reliable activation. Use when skill is not triggering, optimizing trigger keywords, writing frontmatter, debugging activation, or when user mentions "trigger", "frontmatter", "description", "skill not triggering", "optimize trigger", "skill won't fire", "skill activation", "trigger keywords".
---

# Skill Trigger Optimization

## Critical Insight

**ONLY the `description` field affects triggering.** All other frontmatter fields affect execution, not discovery.

At startup, Claude loads ONLY `name` + `description` (not full SKILL.md body). Matching is keyword-based, not deeply semantic.

## The Trigger Formula

```yaml
description: <What it does> + <Specific actions> + <When to use it> + <Trigger keywords>
```

### Example Breakdown

```yaml
# ✅ OPTIMAL - Hits all four parts
description: Write and review tests following TDD and best practices. ALWAYS use this skill BEFORE writing or modifying any test code. Triggers on "test", "tests", "testing", "TDD", "test-driven", "pytest", "add tests", "write tests", "test this", "unit test", "integration test", "test coverage", "bug fix", "fix bug", "verify", "edge case", or when about to create/edit files in tests/ directory.
```

| Part | Example Content |
|------|-----------------|
| What it does | "Write and review tests following TDD and best practices" |
| Specific actions | "BEFORE writing or modifying any test code" |
| When to use | "when about to create/edit files in tests/ directory" |
| Trigger keywords | "test", "tests", "testing", "TDD", "pytest"... |

## Keyword Best Practices

### Include Variants

```yaml
# ✅ All forms of the word
"test", "tests", "testing", "test-driven"

# ❌ Only one form - misses variations
"testing"
```

### Include User Phrases

```yaml
# ✅ Actual phrases users say
"add tests", "write tests", "test this", "TDD this"

# ❌ Only formal terms
"implement unit tests"
```

### Include Action Verbs

```yaml
# ✅ Action-oriented
"write", "create", "fix", "review", "optimize"

# ❌ Passive/noun-only
"tests", "code", "documentation"
```

### Include Slang and Abbreviations

```yaml
# ✅ How users actually talk
"TDD", "mf" (if appropriate), common abbreviations

# ❌ Only formal language
"test-driven development methodology"
```

## Common Trigger Failures

### 1. Description Too Vague

```yaml
# ❌ FAILS - No specific keywords
description: Helps with testing stuff.

# ✅ WORKS - Specific and keyword-rich
description: Write and run pytest tests. Use when creating tests, fixing test failures, or when user mentions "test", "pytest", "fixture", "mock".
```

### 2. Missing Keyword Variants

```yaml
# ❌ FAILS - Misses "tests" and "testing"
description: Write test code...

# ✅ WORKS - All variants
description: ...triggers on "test", "tests", "testing"...
```

### 3. No "Use When" Clause

```yaml
# ❌ FAILS - Claude doesn't know WHEN to use it
description: Handles test code.

# ✅ WORKS - Clear trigger conditions
description: ...Use when writing tests, reviewing test code, or debugging test failures.
```

### 4. Missing User Phrases

```yaml
# ❌ FAILS - Formal terms only
description: Implements unit test suites.

# ✅ WORKS - Includes casual phrases
description: ...triggers on "add tests", "write tests", "test this", "TDD this mf"...
```

## Frontmatter Fields Reference

### Triggering-Related

| Field | Effect on Triggering |
|-------|---------------------|
| `name` | Used with `/skill-name` invocation |
| `description` | **ONLY field that affects auto-triggering** |
| `disable-model-invocation` | `true` = blocks ALL auto-discovery |

### Execution-Related (No Trigger Effect)

| Field | Purpose |
|-------|---------|
| `allowed-tools` | Restricts tools available during skill |
| `skills` | Makes other skills available (for groups) |

## Pro Tips

### 1. Self-Recognition

Claude should trigger skills when IT plans actions, not just when user says keywords:

```yaml
# ✅ Includes Claude's planned actions
description: ...or when about to create/edit files in tests/ directory.
```

### 2. Negative Keywords (What NOT to Trigger On)

Can't specify directly, but make description specific enough:

```yaml
# ✅ Specific enough to avoid false positives
description: Write PYTEST tests for Python code...
# Won't trigger on "test the API endpoint" (manual testing)
```

### 3. Maximum Description Length

~1024 characters. Prioritize keywords over prose.

### 4. Test Your Triggers

Use the `metaskill-trigger-tester` agent to probe skill triggering.

## Debugging Non-Triggering Skills

1. **Check description exists** - Missing = never triggers
2. **Check `disable-model-invocation`** - `true` blocks auto-discovery
3. **Grep for keywords** - Are user's words in description?
4. **Check variants** - "testing" present but not "test"?
5. **Add explicit "Use when" clause** - Often missing
6. **Add user phrases** - Include how users actually talk

## Related Skills

- For naming conventions, see `/metaskill-naming`
- For skill structure and writing, see `/metaskill-authoring`
- For skill group pattern, see `/metaskill-grouping`
- For plugin packaging and placement, see `/metaskill-packaging`
- To test triggers, use the `metaskill-trigger-tester` agent

## Reference Files

- [references/frontmatter-fields.md](references/frontmatter-fields.md) - All frontmatter fields
- [references/description-patterns.md](references/description-patterns.md) - Good and bad examples

Overview

This skill optimizes skill triggers and descriptions to ensure reliable automatic activation. I focus on crafting a single, keyword-rich description that Claude reads at startup and uses for discovery. The goal is predictable triggering by combining what the skill does, specific actions, when to use it, and the trigger keywords.

How this skill works

At startup the agent loads only the name and description for discovery, so the description alone determines auto-triggering. I inspect the description for four parts: what it does, specific actions, when to use it, and a comprehensive set of trigger keywords and phrases. I also debug common failures like vague descriptions, missing variants, lacking "use when" clauses, or disabled model invocation.

When to use it

  • Skill never auto-triggers or triggers inconsistently
  • You want to add or refine trigger keywords and user phrases
  • Writing or editing a skill description or frontmatter
  • Debugging skill activation during agent planning
  • Preparing skills for predictable, low-noise discovery

Best practices

  • Make the description explicit: state what the skill does and specific actions it performs
  • Include an explicit "Use when" clause describing conditions or planned agent actions
  • List keyword variants, synonyms, slang, and user phrases (e.g., "test", "tests", "testing", "add tests")
  • Prefer action verbs and short phrases over passive nouns
  • Keep description concise and keyword-dense (aim under ~1024 characters)
  • Verify disable-model-invocation is not set to true, as that blocks discovery

Example use cases

  • Convert a vague description into the trigger formula so it reliably fires on user prompts
  • Add casual user phrases and abbreviations to catch conversational requests
  • Debug a skill that never runs by checking description presence and keyword coverage
  • Add a "when to use" clause so the agent triggers the skill while planning file edits
  • Test trigger behavior with a trigger-tester agent to validate coverage

FAQ

Which frontmatter field controls auto-triggering?

Only the description field affects auto-triggering; other fields affect execution but not discovery.

How do I avoid false positives?

Make the description specific about scope and language (e.g., target language or context) and include precise "use when" conditions to reduce noise.