How to Debug Skill Activation¶
This guide helps you troubleshoot when skills aren't loading or behaving as expected.
Quick Diagnostic¶
Run the built-in diagnostic command:
This shows:
- Which skills match your phrase
- What triggers fired (keywords, patterns)
- Loading order and priority
Common Issues¶
Issue: Skill Not Activating¶
Symptoms:
- Agent doesn't apply expected behavior
- No mention of skill in response
- Output lacks skill-defined patterns
Diagnosis Steps:
-
Check skill exists:
-
Verify activation rules exist:
-
Test keyword matching:
/core:doctor activation-test "keyword from your prompt"
```
**Common Fixes:**
| Problem | Fix |
|---------|-----|
| Missing `skill-rules-fragment.json` | Create activation rules file |
| Keywords don't match prompt | Add relevant keywords to rules |
| Pattern regex is wrong | Test pattern at regex101.com |
| Skill not in installed plugin | Add plugin to marketplace.json |
---
### Issue: Wrong Skill Activates
**Symptoms:**
- Unexpected behavior in output
- Wrong tone or methodology applied
- Conflicting instructions
**Diagnosis Steps:**
1. **Check what activated:**
```bash
/core:doctor activation-test "your exact prompt"
```
2. **Review priority settings:**
```bash
grep -r "priority" plugins/*/skills/*/skill-rules-fragment.json
```
3. **Check for keyword overlap:**
Look for common keywords across multiple skills.
**Common Fixes:**
| Problem | Fix |
|---------|-----|
| Multiple skills share keywords | Make keywords more specific |
| Priority too high | Lower priority in rules file |
| Overly broad patterns | Narrow regex patterns |
---
### Issue: Skill Loads But Doesn't Affect Output
**Symptoms:**
- Diagnostic shows skill activated
- Output doesn't reflect skill content
- Agent seems to ignore instructions
**Diagnosis Steps:**
1. **Check skill content is actionable:**
```bash
cat plugins/*/skills/*/SKILL.md | head -50
```
2. **Verify SKILL.md isn't empty or malformed:**
```bash
wc -l plugins/*/skills/*/SKILL.md
```
3. **Check for conflicting instructions:**
Review CLAUDE.md and other skills for contradictions.
**Common Fixes:**
| Problem | Fix |
|---------|-----|
| Passive language | Use imperative: "Do X" not "X should be done" |
| Too abstract | Add concrete examples |
| Conflicts with CLAUDE.md | Align or prioritize instructions |
| Skill too long | Move detail to resources/, keep SKILL.md < 500 lines |
---
## Activation Rules Deep Dive
### Understanding skill-rules-fragment.json
```json
{
"my-skill": {
"type": "domain",
"enforcement": "suggest",
"priority": "high",
"promptTriggers": {
"keywords": ["audit", "report"],
"intentPatterns": ["(create|write).*(report)"]
},
"fileTriggers": {
"pathPatterns": ["**/reports/**"]
}
}
}
Trigger Types¶
| Trigger | How It Works | Example |
|---|---|---|
keywords |
Exact word match (case-insensitive) | "audit" matches "Run an audit" |
intentPatterns |
Regex match on full prompt | "(create|write).*(report)" |
pathPatterns |
Glob match on file paths | "**/reports/**" |
Priority Levels¶
| Priority | When Loaded | Use Case |
|---|---|---|
critical |
Always first | Core standards |
high |
Before medium/low | Important domain skills |
medium |
Default order | General skills |
low |
Last | Optional enhancements |
Enforcement Levels¶
| Level | Behavior |
|---|---|
require |
Must load if triggered |
suggest |
Agent decides based on context |
optional |
Only if explicitly relevant |
Testing Workflow¶
Step 1: Isolate the Skill¶
Test with a minimal prompt that should trigger only your skill:
Step 2: Verify Rules File¶
Check JSON syntax:
Step 3: Test Regex Patterns¶
Use regex101.com with:
- Flavor: ECMAScript (JavaScript)
- Test string: Your expected prompt
Step 4: Check Hook Execution¶
The UserPromptSubmit hook handles activation. Verify it's configured:
Step 5: Review Full Activation Chain¶
User Prompt
↓
UserPromptSubmit Hook (core-dependencies)
↓
Scan all skill-rules-fragment.json files
↓
Match keywords and patterns
↓
Inject activation suggestions
↓
Agent loads relevant skills
Logging and Debugging¶
Enable Verbose Mode¶
Some environments support verbose logging:
Manual Activation Test¶
Ask the agent directly:
Check Skill Content¶
Read what the agent sees:
Troubleshooting Checklist¶
Use this checklist when skills aren't working:
- Skill directory exists in correct location
SKILL.mdfile is present and not emptyskill-rules-fragment.jsonexists with valid JSON- Keywords in rules match words in your prompt
- Regex patterns are valid (test at regex101.com)
- Plugin is registered in
marketplace.json core-dependenciesplugin is installed- No syntax errors in any JSON files
- Skill content uses imperative language
- No conflicting skills with higher priority
Related¶
Reference¶
- Skill Reference - All available skills
- Configuration - Environment setup
Explanation¶
- Understanding Skills - Skill concepts
- Architecture - System design
How-To¶
- Plugin Authoring - Creating plugins
- Troubleshooting - General issues