From 194eac1a97f95a04db3d1aba7c0d935bb3aaadbc Mon Sep 17 00:00:00 2001 From: Zhongwei Li Date: Sat, 29 Nov 2025 18:19:10 +0800 Subject: [PATCH] Initial commit --- .claude-plugin/plugin.json | 12 ++++++++++ README.md | 3 +++ hooks/hooks.json | 41 ++++++++++++++++++++++++++++++++++ plugin.lock.json | 45 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 101 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..e3c8e45 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,12 @@ +{ + "name": "hook-git-auto-backup", + "description": "Automatically backup your work with git commits after each Claude session", + "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..f10d5aa --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# hook-git-auto-backup + +Automatically backup your work with git commits after each Claude session diff --git a/hooks/hooks.json b/hooks/hooks.json new file mode 100644 index 0000000..e53b036 --- /dev/null +++ b/hooks/hooks.json @@ -0,0 +1,41 @@ +{ + "description": "Automatically creates git commits after each Claude Code session to prevent work loss", + "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 + } + ] + } + ], + "Stop": [ + { + "description": "Auto-commit changes when session ends", + "priority": 100, + "enabled": true, + "hooks": [ + { + "type": "command", + "command": "node ${CLAUDE_PLUGIN_ROOT}/scripts/backup.js", + "description": "Creates timestamped git commit with all changes", + "timeout": 10000, + "continueOnError": false + } + ] + } + ] + } +} diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..d2fae63 --- /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-git-auto-backup", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "ab71666564eabdabd805b03b55aeb4e1d2f129ba", + "treeHash": "e960597ada61bbcd5d1c41c1e3c77a16ccd992a4071d452354e57b1a4e4a0595", + "generatedAt": "2025-11-28T10:10:15.262532Z", + "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-git-auto-backup", + "description": "Automatically backup your work with git commits after each Claude session", + "version": "1.1.1" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "6428213a44e49a4ab2b7765531c0a5b77d5f2fe70e15786cb83575f8301909e6" + }, + { + "path": "hooks/hooks.json", + "sha256": "20fadb30c292cc37e7db7ae26d5de1b7956278638e8cd0d5130a40b686b4bf20" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "25dec50d014aa05bc12327abac05836eb0bf7bf264794d0cf2ede261efb1efda" + } + ], + "dirSha256": "e960597ada61bbcd5d1c41c1e3c77a16ccd992a4071d452354e57b1a4e4a0595" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file