diff --git a/README.md b/README.md index 97dc35b..38a81c5 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,47 @@ chmod +x .claude/hooks/claudeception-activator.sh If you already have a `settings.json`, merge the `hooks` configuration into it. +### Windows / PowerShell + +The activation hook is also available as a native PowerShell script for Windows users. + +1. Clone the skill (if you haven't already): + +```powershell +git clone https://github.com/blader/Claudeception.git "$env:USERPROFILE\.claude\skills\claudeception" +``` + +2. Create the hooks directory and copy the PowerShell script: + +```powershell +New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.claude\hooks" +Copy-Item "$env:USERPROFILE\.claude\skills\claudeception\scripts\claudeception-activator.ps1" ` + "$env:USERPROFILE\.claude\hooks\" +``` + +3. Add the hook to your Claude settings (`~/.claude/settings.json`): + +```json +{ + "hooks": { + "UserPromptSubmit": [ + { + "hooks": [ + { + "type": "command", + "command": "pwsh -File %USERPROFILE%\\.claude\\hooks\\claudeception-activator.ps1" + } + ] + } + ] + } +} +``` + +> **Note:** Use `pwsh` (PowerShell 7+) rather than `powershell` for best compatibility. If you have existing hooks in `settings.json`, merge the `UserPromptSubmit` array into your existing `hooks` object. + +**Project-level installation** follows the same pattern — copy the `.ps1` to `.claude/hooks/` in your repo and reference it with a relative path in `.claude/settings.json`. + The hook injects a reminder on every prompt that tells Claude to evaluate whether the current task produced extractable knowledge. This achieves higher activation rates than relying on semantic description matching alone. ## Usage diff --git a/scripts/claudeception-activator.ps1 b/scripts/claudeception-activator.ps1 new file mode 100644 index 0000000..6f19262 --- /dev/null +++ b/scripts/claudeception-activator.ps1 @@ -0,0 +1,44 @@ +#!/usr/bin/env pwsh + +# claudeception-activator.ps1 +# Native Windows/PowerShell activator hook for Claudeception. +# Equivalent to scripts/claudeception-activator.sh for non-Unix environments. +# +# Hook type: UserPromptSubmit +# Purpose: Outputs a reminder for Claude to evaluate whether the current task +# produced extractable knowledge worth saving as a reusable skill. +# +# Installation: +# 1. Copy this script to $env:USERPROFILE\.claude\hooks\ +# 2. Add to $env:USERPROFILE\.claude\settings.json (see README for details) + +[Console]::OutputEncoding = [System.Text.Encoding]::UTF8 + +Write-Output @" +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +🧠 MANDATORY SKILL EVALUATION REQUIRED +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +CRITICAL: After completing this user request, you MUST evaluate whether +it produced extractable knowledge using the claudeception skill. + +EVALUATION PROTOCOL (NON-NEGOTIABLE): + +1. COMPLETE the user's request first +2. EVALUATE: Ask yourself: + - Did this require non-obvious investigation or debugging? + - Was the solution something that would help in future similar situations? + - Did I discover something not immediately obvious from documentation? + +3. IF YES to any question above: + ACTIVATE: Use Skill(claudeception) NOW to extract the knowledge + +4. IF NO to all questions: + SKIP: No skill extraction needed + +This is NOT optional. Failing to evaluate means valuable knowledge is lost. +The claudeception skill will decide whether to actually create a new +skill based on its quality criteria. + +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +"@