From 9f4fe0f55fb7b37aea91c441698f70200b646d9e Mon Sep 17 00:00:00 2001 From: Zhongwei Li Date: Sat, 29 Nov 2025 18:19:07 +0800 Subject: [PATCH] Initial commit --- .claude-plugin/plugin.json | 12 ++++++++ README.md | 3 ++ hooks/hooks.json | 59 ++++++++++++++++++++++++++++++++++++++ plugin.lock.json | 45 +++++++++++++++++++++++++++++ 4 files changed, 119 insertions(+) create mode 100644 .claude-plugin/plugin.json create mode 100644 README.md create mode 100644 hooks/hooks.json create mode 100644 plugin.lock.json diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..0dc66a6 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,12 @@ +{ + "name": "hook-complexity-monitor", + "description": "Monitor code complexity and maintain code quality", + "version": "1.1.1", + "author": { + "name": "Dev GOM", + "url": "https://github.com/Dev-GOM/claude-code-marketplace" + }, + "hooks": [ + "./hooks" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..abfedd6 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# hook-complexity-monitor + +Monitor code complexity and maintain code quality diff --git a/hooks/hooks.json b/hooks/hooks.json new file mode 100644 index 0000000..34c396c --- /dev/null +++ b/hooks/hooks.json @@ -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 + } + ] + } + ] + } +} diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..7ba9268 --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,45 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:Dev-GOM/claude-code-marketplace:plugins/hook-complexity-monitor", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "6f614a2744fa3fee0b86be1cc2042df704a786f1", + "treeHash": "8704bca2d7930fe13d906338c43f26337014c59b8d9f81ed9bdd362b7594c01f", + "generatedAt": "2025-11-28T10:10:15.664767Z", + "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": "hook-complexity-monitor", + "description": "Monitor code complexity and maintain code quality", + "version": "1.1.1" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "6e8602145fb51c52adea5b817d8ab5372ae14b724da0be5f3280a2c0468989b6" + }, + { + "path": "hooks/hooks.json", + "sha256": "9920358da319c7c555cc9f0cb647e8b7571d8deaba429dde11ff2d6eba1d4bb7" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "3c642934c97470771828d1fb2b40372c1cb322a6560f9ead6c1b357cbcf1007c" + } + ], + "dirSha256": "8704bca2d7930fe13d906338c43f26337014c59b8d9f81ed9bdd362b7594c01f" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file