Use when skills aren't activating reliably - covers official solutions (better descriptions) and custom hook system for deterministic skill activation
Hyperpowers includes: Auto-activation hook at hooks/user-prompt-submit/10-skill-activator.js
Prerequisites:
Symptoms:
Community reports:
Root cause: Skills rely on Claude recognizing relevance (not deterministic)
ā 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
Real user: "Skills went from 'expensive decorations' to actually useful"
Token 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
All of these mean: Try Level 1 first, then decide.
If Level 1 works: Don't build hook system
If Level 1 insufficient: Build hook system (Level 3)
Related skills:
This skill enables:
Hyperpowers includes: Auto-activation hook at hooks/user-prompt-submit/10-skill-activator.js
Official documentation:
When stuck: