Use when skills aren't activating reliably - covers official solutions (better descriptions) and custom hook system for deterministic skill activation
<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>
<results> ### Before Hook SystemReal user: "Skills went from 'expensive decorations' to actually useful" </results>
<limitations> ## 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 </alternatives>
<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>
<integration> **This skill covers:** Skill activation strategiesRelated skills:
This skill enables:
Hyperpowers includes: Auto-activation hook at hooks/user-prompt-submit/10-skill-activator.js
</integration>
Official documentation:
When stuck:
npx skills add withzombies/skills-auto-activation下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer