Skip to content
Back to skills

2531 Setup Skill Hook 14752a8c

ASecurity

Set up the skill-activation-prompt hook in your project with automatic configuration

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
toolsshellbashnode

Works with

  • claude code

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 2531-setup-skill-hook_14752a8c --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 2531 Setup Skill Hook 14752a8c?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 2531 Setup Skill Hook 14752a8c
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-2531-setup-skill-hook-14752a8c/badge)](https://www.skillsdirectory.com/skills/tools-only-2531-setup-skill-hook-14752a8c)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
---
description: Set up the skill-activation-prompt hook in your project with automatic configuration
allowed-tools: Bash, Read, Write, Edit, Glob, AskUserQuestion
argument-hint: "[project-path]"
---

# Setup Skill Activation Hook

You are setting up the skill-activation-prompt hook for a Claude Code project.

## Your Task

1. **Determine the target project directory:**
   - If the user provided a path argument, use that
   - Otherwise, use the current working directory
   - Confirm the path exists and is a valid project directory

2. **Check prerequisites:**
   - Verify Node.js is installed (`node --version`)
   - Check if `.claude/` directory exists (create if needed)

3. **Copy hook files:**
   - Create `.claude/hooks/` directory if it doesn't exist
   - Copy these files from the plugin to the target:
     - `skill-activation-prompt.sh`
     - `skill-activation-prompt.ts`
     - `package.json`
     - `tsconfig.json`
   - Make the shell script executable

4. **Install dependencies:**
   - Run `npm install` in the `.claude/hooks/` directory

5. **Create skill-rules.json template:**
   - Create `.claude/skills/` directory if it doesn't exist
   - Create a starter `skill-rules.json` with example rules
   - Ask user if they want to customise the rules now or later

6. **Update settings.json:**
   - Check if `.claude/settings.json` exists
   - If it exists, merge the hook configuration (preserve existing settings)
   - If not, create it with the hook configuration

7. **Verify setup:**
   - Confirm all files are in place
   - Show a summary of what was configured

## Hook Files Location

The hook source files are in the ultimate-skill-creator plugin:
```
${CLAUDE_PLUGIN_ROOT}/hooks/skill-activation-prompt/
```

Use `${CLAUDE_PLUGIN_ROOT}` to reference the plugin directory.

## Starter skill-rules.json Template

Create with practical examples (adjust skill names to match your installed skills):

```json
{
  "version": "1.0.0",
  "skills": {
    "xlsx": {
      "type": "domain",
      "enforcement": "suggest",
      "priority": "high",
      "promptTriggers": {
        "keywords": ["spreadsheet", "excel", "csv", "xlsx"],
        "intentPatterns": ["create.*spreadsheet", "export.*excel"]
      }
    },
    "pdf-processing-pro": {
      "type": "domain",
      "enforcement": "suggest",
      "priority": "high",
      "promptTriggers": {
        "keywords": ["pdf", "extract text", "ocr"],
        "intentPatterns": ["read.*pdf", "convert.*pdf"]
      }
    }
  }
}
```

Note: Users should customise this with their actual installed skill names.

## Settings.json Hook Configuration

For `UserPromptSubmit` events, the `matcher` field is omitted (it operates at the conversation level, not on tool names):

```json
{
  "hooks": {
    "UserPromptSubmit": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/skill-activation-prompt.sh"
          }
        ]
      }
    ]
  }
}
```

## Important Notes

- If settings.json already has hooks configured, merge carefully - don't overwrite existing hooks
- The hook expects `skill-rules.json` in `.claude/skills/`, not `.claude/hooks/`
- Always make the shell script executable with `chmod +x`
- Run npm install to get the `tsx` dependency

## Success Message

After setup, inform the user:
- The hook is now active and will trigger on every prompt
- They should edit `.claude/skills/skill-rules.json` to add their own skill triggers
- Link to the hook README for configuration reference

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…