Initial commit

This commit is contained in:
Zhongwei Li
2025-11-30 08:56:25 +08:00
commit 1e3e603484
6 changed files with 131 additions and 0 deletions

View File

@@ -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"
]
}

3
README.md Normal file
View File

@@ -0,0 +1,3 @@
# shavakan-hooks
Personal hooks collection: skill/agent auto-activation, build checking (TS/Python/Go), and POSIX compliance

28
build-checker/hooks.json Normal file
View File

@@ -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
}
]
}
]
}
}

17
newline/hooks.json Normal file
View File

@@ -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
}
]
}
]
}
}

53
plugin.lock.json Normal file
View File

@@ -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": []
}
}

View File

@@ -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
}
]
}
]
}
}