skills/skills-authoring/skill-activation-patterns/SKILL.md
Design skills that fire at the right moment — neither over-eager (noise) nor under-eager (silent). Covers activation specificity, trigger phrases, disambiguation between overlapping skills, and debugging activation. Use this skill when multiple skills could fire on the same query, a skill never fires, or a skill fires too often. Activate when: skill won't activate, skill over-activates, overlapping skills, skill triggers, skill selection, skill disambiguation.
npx skillsauth add latestaiagents/agent-skills skill-activation-patternsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
A skill that fires at the wrong time is as useless as one that never fires. Design activation like you'd design a cron expression: specific, testable, boundaried.
The model matches your skill against user queries using:
Invest most in (3) and (4).
Skill fires when user pastes or describes an error:
description: |
Decode Java stack traces and suggest root causes.
Use this skill when user shares a stack trace, exception, or runtime error in Java.
Activate when: Exception, NullPointerException, stack trace, Caused by, Java error, runtime crash.
Include the literal tokens that appear in errors. Users paste them verbatim.
Skill fires when user expresses a goal:
description: |
Refactor code to extract methods, rename, and improve structure without changing behavior.
Use this skill when user asks to refactor, clean up, or restructure existing code.
Activate when: refactor, clean up, extract method, rename, restructure, DRY up, improve this code.
Match imperative verbs and goal phrases.
Skill fires when the user mentions a specific tool:
description: |
Configure Next.js App Router — server components, server actions, middleware, caching.
Use this skill when the user is working with Next.js App Router, specifically app/ directory routes.
Activate when: Next.js, App Router, server component, server action, app/ directory, use server.
Name the technology and its key concepts; matches work well.
Skill fires during a known phase of work:
description: |
Pre-release checklist for a production deploy — changelog, version bump, migration safety, smoke tests.
Use this skill when user is about to deploy to production, cut a release, or tag a version.
Activate when: deploy to prod, release, version bump, production release, pre-release check.
Workflow skills need to be clearly scoped to that phase or they fire constantly.
If two skills could both fire on "help me write a test", they compete. Differentiate in the description itself.
On "write a test for MyComponent", both fire. Model picks randomly.
The "NOT for..." line is a powerful routing hint.
Symptom: skill fires on nearly every query. Cause: description too broad.
description: |
Help with coding tasks.
Activate when: code, programming, development.
description: |
Help refactoring existing code for readability — NOT for new code generation, bug fixing, or debugging.
Use this skill when user specifically asks to refactor, clean up, or restructure.
Activate when: refactor, clean up, extract method, DRY up, improve readability.
"NOT for X" sentences are explicit guards. Use them.
Symptom: skill has clear use case but never fires. Cause: description misses the user's vocabulary.
Audit real queries users send. Add their exact phrasings:
Activate when:
- merge conflict, resolve conflicts # jargon
- CONFLICT markers, <<<<<<< HEAD # literal tokens
- git says there's a conflict # natural phrasing
- merge failed, can't merge # error paraphrases
- rebase stopped, rebase conflict # related workflows
Mix jargon, error strings, and natural phrasings.
Some patterns explicitly should NOT activate the skill. Call them out:
description: |
Write SQL migrations safely.
Use for: ALTER TABLE, new columns with defaults, adding indexes on prod tables.
DO NOT use for: read-only queries (use sql-query-helper), ORM model changes, new tables from scratch.
Activate when: ALTER TABLE, add column, migration, safe migration, Postgres lock, online DDL.
Explicit negatives reduce competition with nearby skills.
See the skill-testing companion skill. Briefly:
help, handle, manage. Match too broadlytests, bugs, configdevelopment
Test skills for correct activation, content quality, and regression — both automated checks (frontmatter validity, lint) and manual verification (query-suite activation testing). Covers CI integration and how to catch skill regressions before users do. Use this skill when adding skills to a repo, setting up CI for a skill library, or debugging "the skill exists but doesn't work". Activate when: test skills, validate skills, skill CI, skill linting, skill activation test, skill regression.
documentation
Write the YAML frontmatter for a SKILL.md file so it activates reliably — name, description, and activation keywords that the model matches against. Covers length, tone, and the most common frontmatter mistakes. Use this skill when authoring a new skill, fixing a skill that isn't auto-activating, or reviewing skills for publication. Activate when: SKILL.md frontmatter, skill description, skill activation, skill YAML, write a skill, author a skill.
development
Structure SKILL.md content so the model reads just enough — concise summary up front, progressively deeper detail, examples on demand. Covers section ordering, length budgets, when to split into multiple skills. Use this skill when writing or refactoring a skill body, one skill has grown too long, or a skill is wordy but not useful. Activate when: SKILL.md structure, skill content, skill too long, split skill, progressive disclosure, skill body.
development
OWASP A04 - XML External Entity (XXE) Prevention. Use this skill when parsing XML, processing SOAP requests, handling SVG uploads, or working with XML-based formats. Activate when: XML parsing, SOAP, SVG upload, XML input, DOCTYPE, DTD, external entity, XML bomb, billion laughs, XSLT.