/hyperpowers:skills-auto-activationfrom hyperpowers
Makes skill activation more reliable through better descriptions, explicit triggers, or a custom hook system. Use when skills aren't being used automatically.
Ships in hyperpowers. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
<skill_overview> Skills often don't activate despite keywords; make activation reliable through better descriptions, explicit triggers, or custom hooks. </skill_overview>
<rigidity_level> HIGH FREEDOM - Choose solution level based on project needs (Level 1 for simple, Level 3 for complex). Hook implementation is flexible pattern, not rigid process. </rigidity_level>
<quick_reference>
| Level | Solution | Effort | Reliability | When to Use |
|---|---|---|---|---|
| 1 | Better descriptions + explicit requests | Low | Moderate | Small projects, starting out |
| 2 | CLAUDE.md references | Low | Moderate | Document patterns |
| 3 | Custom hook system | High | Very High | Large projects, established patterns |
Hyperpowers includes: Auto-activation hook at hooks/user-prompt-submit/10-skill-activator.js
</quick_reference>
<when_to_use> Use this skill when:
Prerequisites:
<the_problem>
Symptoms:
Community reports:
Root cause: Skills rely on Claude recognizing relevance (not deterministic) </the_problem>
<solution_levels>
❌ Bad:
name: backend-dev
description: Helps with backend development
✅ Good:
name: backend-dev-guidelines
description: Use when creating API routes, controllers, services, or repositories in backend - enforces TypeScript patterns, error handling with Sentry, and Prisma repository pattern
Key elements:
Instead of: "How do I create an endpoint?"
Try: "Use my backend-dev-guidelines skill to create an endpoint"
Result: Works, but tedious
Reference skills in CLAUDE.md:
## When Working on Backend
Before making changes:
1. Check `/skills/backend-dev-guidelines` for patterns
2. Follow repository pattern for database access
The backend-dev-guidelines skill contains complete examples.
Pros: No custom code Cons: Claude still might not check
How it works:
Result: "Night and day difference" - skills consistently used
User submits prompt
↓
UserPromptSubmit hook intercepts
↓
Analyze prompt (keywords, intent, files)
↓
Check skill-rules.json for matches
↓
Inject activation reminder
↓
Claude sees: "🎯 USE these skills: ..."
↓
Claude loads and uses relevant skills
{
"backend-dev-guidelines": {
"type": "domain",
"enforcement": "suggest",
"priority": "high",
"promptTriggers": {
"keywords": ["backend", "controller", "service", "API", "endpoint"],
"intentPatterns": [
"(create|add|build).*?(route|endpoint|controller|service)",
"(how to|pattern).*?(backend|API)"
]
},
"fileTriggers": {
"pathPatterns": ["backend/src/**/*.ts", "server/**/*.ts"],
"contentPatterns": ["express\\.Router", "export.*Controller"]
}
},
"test-driven-development": {
"type": "process",
"enforcement": "suggest",
"priority": "high",
"promptTriggers": {
"keywords": ["test", "TDD", "testing"],
"intentPatterns": [
"(write|add|create).*?(test|spec)",
"test.*(first|before|TDD)"
]
},
"fileTriggers": {
"pathPatterns": ["**/*.test.ts", "**/*.spec.ts"],
"contentPatterns": ["describe\\(", "it\\(", "test\\("]
}
}
}
#!/usr/bin/env node
// ~/.claude/hooks/user-prompt-submit/skill-activator.js
const fs = require('fs');
const path = require('path');
// Load skill rules
const rules = JSON.parse(fs.readFileSync(
path.join(process.env.HOME, '.claude/skill-rules.json'), 'utf8'
));
// Read prompt from stdin
let promptData = '';
process.stdin.on('data', chunk => promptData += chunk);
process.stdin.on('end', () => {
const prompt = JSON.parse(promptData);
// Analyze prompt for skill matches
const activatedSkills = analyzePrompt(prompt.text);
if (activatedSkills.length > 0) {
// Inject skill activation reminder
const context = `
🎯 SKILL ACTIVATION CHECK
Relevant skills for this prompt:
${activatedSkills.map(s => `- **${s.skill}** (${s.priority} priority)`).join('\n')}
Check if these skills should be used before responding.
`;
console.log(JSON.stringify({
decision: 'approve',
additionalContext: context
}));
} else {
console.log(JSON.stringify({ decision: 'approve' }));
}
});
function analyzePrompt(text) {
// Match against all skill rules
// Return list of activated skills with priorities
}
For complete working implementation: See resources/hook-implementation.md
Phase 1 (Week 1): Basic keyword matching
{"keywords": ["backend", "API", "controller"]}
Phase 2 (Week 2): Add intent patterns
{"intentPatterns": ["(create|add).*?(route|endpoint)"]}
Phase 3 (Week 3): Add file triggers
{"fileTriggers": {"pathPatterns": ["backend/**/*.ts"]}}
Phase 4 (Ongoing): Refine based on observation </solution_levels>
### Before Hook SystemReal user: "Skills went from 'expensive decorations' to actually useful"
## Hook System LimitationsToken usage:
Performance:
Maintenance:
Use Model Context Protocol to provide skills as context.
Pros: Built into Claude system Cons: Still not deterministic, same activation issues
Modify Claude's system prompt to always check certain skills.
Pros: Works without hooks Cons: Limited to Pro plan, can't customize per-project
Always explicitly request skill usage.
Pros: No setup required Cons: Tedious, easy to forget, doesn't scale
Combine all guidelines into CLAUDE.md.
Pros: Always loaded Cons: Violates progressive disclosure, wastes tokens
Recommendation: Level 3 (hooks) for large projects, Level 1 for smaller projects
<critical_rules>
All of these mean: Try Level 1 first, then decide.
<verification_checklist> Before building hook system:
If Level 1 works: Don't build hook system
If Level 1 insufficient: Build hook system (Level 3) </verification_checklist>
**This skill covers:** Skill activation strategiesRelated skills:
This skill enables:
Hyperpowers includes: Auto-activation hook at hooks/user-prompt-submit/10-skill-activator.js
Official documentation:
When stuck:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
22 skills in this plugin
/analyzing-test-effectivenessUse to audit test quality with SRE scrutiny - identifies weak tests, missing cases, and creates task docs for improvements/brainstormingUse when shaping a feature before implementation - turns rough ideas into an approved markdown spec and local task directory/building-hooksUse when creating Claude Code hooks - covers hook patterns, composition, testing, progressive enhancement from simple to advanced/debugging-with-toolsUse when encountering bugs or test failures - systematic debugging using debuggers, internet research, and agents to find root cause before fixing/dispatching-parallel-agentsUse when facing 3+ independent failures that can be investigated without shared state or dependencies - dispatches multiple Claude agents to investigate and fix independent problems concurrently/executing-plansUse to execute an approved local markdown task directory iteratively - work the current Now slice, update docs, then stopnpx claudepluginhub withzombies/hyperpowers --plugin hyperpowersOther plugins' skills for the same job