commit 1e3e6034849922abc69d21f940efd443da32a8b6 Author: Zhongwei Li Date: Sun Nov 30 08:56:25 2025 +0800 Initial commit diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..0673645 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,14 @@ +{ + "name": "shavakan-hooks", + "description": "Personal hooks collection: skill/agent auto-activation, build checking (TS/Python/Go), and POSIX compliance", + "version": "1.2.0", + "author": { + "name": "shavakan", + "email": "cs.changwon.lee@gmail.com" + }, + "hooks": [ + "./newline/hooks.json", + "./skill-activation/hooks.json", + "./build-checker/hooks.json" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..200cc07 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# shavakan-hooks + +Personal hooks collection: skill/agent auto-activation, build checking (TS/Python/Go), and POSIX compliance diff --git a/build-checker/hooks.json b/build-checker/hooks.json new file mode 100644 index 0000000..0174e80 --- /dev/null +++ b/build-checker/hooks.json @@ -0,0 +1,28 @@ +{ + "description": "Automatically check builds after file edits - supports TypeScript, Python, and Go", + "hooks": { + "PostToolUse": [ + { + "matcher": "Write|Edit|MultiEdit", + "hooks": [ + { + "type": "command", + "command": "file_path=$(echo \"$TOOL_RESULT\" | grep -o '\"file_path\":\"[^\"]*\"' | sed 's/\"file_path\":\"\\(.*\\)\"/\\1/'); if [ -n \"$file_path\" ]; then echo \"$file_path\" >> /tmp/claude-code-edits.txt; fi", + "timeout": 2 + } + ] + } + ], + "Stop": [ + { + "hooks": [ + { + "type": "command", + "command": "npx tsx \"$HOME/.claude/plugins/marketplaces/shavakan/hooks/build-checker/check-builds.ts\"", + "timeout": 30 + } + ] + } + ] + } +} diff --git a/newline/hooks.json b/newline/hooks.json new file mode 100644 index 0000000..5b36f1b --- /dev/null +++ b/newline/hooks.json @@ -0,0 +1,17 @@ +{ + "description": "Ensure POSIX compliance by adding final newlines to files", + "hooks": { + "PostToolUse": [ + { + "matcher": "Write|Edit|MultiEdit", + "hooks": [ + { + "type": "command", + "command": "file_path=$(grep -o '\"file_path\":\"[^\"]*\"' | sed 's/\"file_path\":\"\\(.*\\)\"/\\1/'); if [ -f \"$file_path\" ] && [ -n \"$(tail -c1 \"$file_path\")\" ]; then echo >> \"$file_path\"; fi", + "timeout": 5 + } + ] + } + ] + } +} diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..822001b --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,53 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:Shavakan/claude-marketplace:hooks", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "1fe62aff53977f422af0ca35941c99b4d587e059", + "treeHash": "e183585fe8707e49484189438e280ee1ebd7fa7df9892d4a546b665da9730b1a", + "generatedAt": "2025-11-28T10:12:47.289384Z", + "toolVersion": "publish_plugins.py@0.2.0" + }, + "origin": { + "remote": "git@github.com:zhongweili/42plugin-data.git", + "branch": "master", + "commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390", + "repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data" + }, + "manifest": { + "name": "shavakan-hooks", + "description": "Personal hooks collection: skill/agent auto-activation, build checking (TS/Python/Go), and POSIX compliance", + "version": "1.2.0" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "5db9e799c9e9281702c25af064f76f125886f584e268c6535352cb9890b33656" + }, + { + "path": "skill-activation/hooks.json", + "sha256": "231f0fbc05314e0d4360de18a1f6508f286c4d44a67765856844ad4dedf1742f" + }, + { + "path": "build-checker/hooks.json", + "sha256": "49ab79d2a013df09a9f8ce6cc80d6d53377b10cf7da54dd812faf9b9e70d90fb" + }, + { + "path": "newline/hooks.json", + "sha256": "50357b086b9eb92ac7f330f62475ff4d279d77772277ebdc45de1529d24aa36c" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "2a10e410411107080076b980d69cda582058c1bc9d0d4517af871782630ae9f0" + } + ], + "dirSha256": "e183585fe8707e49484189438e280ee1ebd7fa7df9892d4a546b665da9730b1a" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file diff --git a/skill-activation/hooks.json b/skill-activation/hooks.json new file mode 100644 index 0000000..f5ac3e9 --- /dev/null +++ b/skill-activation/hooks.json @@ -0,0 +1,16 @@ +{ + "description": "Auto-activate skills based on user prompt analysis", + "hooks": { + "UserPromptSubmit": [ + { + "hooks": [ + { + "type": "command", + "command": "npx tsx \"$HOME/.claude/plugins/marketplaces/shavakan/hooks/skill-activation/analyze-prompt.ts\" \"$USER_PROMPT\"", + "timeout": 3 + } + ] + } + ] + } +}