Initial commit

This commit is contained in:
Zhongwei Li
2025-11-29 18:19:07 +08:00
commit 9f4fe0f55f
4 changed files with 119 additions and 0 deletions

59
hooks/hooks.json Normal file
View File

@@ -0,0 +1,59 @@
{
"description": "Monitors code complexity metrics and warns when thresholds are exceeded",
"version": "1.1.1",
"author": "Dev GOM",
"lastUpdated": "2025-10-20",
"hooks": {
"SessionStart": [
{
"description": "Initialize plugin configuration at session start",
"priority": 100,
"enabled": true,
"hooks": [
{
"type": "command",
"command": "node ${CLAUDE_PLUGIN_ROOT}/scripts/init-config.js",
"description": "Creates default configuration file if it doesn't exist",
"timeout": 5000,
"continueOnError": true,
"suppressOutput": true
}
]
}
],
"PostToolUse": [
{
"description": "Check code complexity after Write or Edit operations",
"matcher": "Write|Edit",
"priority": 100,
"enabled": true,
"hooks": [
{
"type": "command",
"command": "node ${CLAUDE_PLUGIN_ROOT}/scripts/check-complexity.js",
"description": "Analyzes cyclomatic complexity, function length, file length, and nesting depth",
"timeout": 10000,
"continueOnError": true,
"suppressOutput": true
}
]
}
],
"Stop": [
{
"description": "Finalize complexity session and write to log",
"priority": 80,
"enabled": true,
"hooks": [
{
"type": "command",
"command": "node ${CLAUDE_PLUGIN_ROOT}/scripts/finalize-session.js",
"description": "Writes accumulated complexity issues to log file in session format",
"timeout": 5000,
"continueOnError": true
}
]
}
]
}
}