How this skill is triggered — by the user, by Claude, or both
Slash command
/plinth:git-workflow-hooksThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Install git hooks that prevent common workflow mistakes in your development process.
Install git hooks that prevent common workflow mistakes in your development process.
Installs a pre-push git hook that:
v1.2.3 without using /plinth:releaseratorgit push --no-verify if you absolutely must bypassRun this skill once per project to install the hooks:
Check that we're in a git repository with a hooks directory:
# Check for .git directory
test -d .git && echo "GIT_REPO" || echo "NOT_GIT"
# Check hooks directory
test -d .git/hooks && echo "HOOKS_EXIST" || echo "HOOKS_MISSING"
Validation:
mkdir -p .git/hooksCheck if a pre-push hook already exists:
test -f .git/hooks/pre-push && echo "EXISTS" || echo "MISSING"
If hook exists:
Example user prompt (if non-plinth hook exists):
⚠️ Existing pre-push hook detected
Your .git/hooks/pre-push file already contains a hook that wasn't installed by plinth.
How would you like to proceed?
1. Backup existing hook to .git/hooks/pre-push.backup and install plinth hook
2. Skip installation (keep existing hook)
Choose an option (1-2):
Copy the hook from the skill directory to the git hooks directory:
# Copy hook file
cp skills/git-workflow-hooks/pre-push .git/hooks/pre-push
# Make executable
chmod +x .git/hooks/pre-push
Verify installation:
# Check file exists
test -f .git/hooks/pre-push && echo "INSTALLED" || echo "FAILED"
# Check executable
test -x .git/hooks/pre-push && echo "EXECUTABLE" || echo "NOT_EXECUTABLE"
If backup was requested (from Step 2):
# Backup existing hook first
cp .git/hooks/pre-push .git/hooks/pre-push.backup
Verify the hook works by checking its output:
# Test that the hook script is valid bash
bash -n .git/hooks/pre-push && echo "VALID" || echo "SYNTAX_ERROR"
If syntax error: Report the error and suggest manual inspection.
Display installation summary to user:
✅ Git workflow hooks installed successfully!
**Installed hooks**:
- pre-push: Blocks manual version tag pushes
**What this means**:
- You cannot push version tags (v*.*.*) directly
- Use /plinth:releaserator to create releases properly
- Emergency override: git push --no-verify
**Testing the hook**:
Try pushing a version tag to see it in action:
git tag v99.99.99
git push origin v99.99.99
(This should be blocked with a helpful error message)
**Removing the hook**:
If you need to uninstall:
rm .git/hooks/pre-push
If backup was created:
Add to output:
**Backup created**:
- Your original hook saved to: .git/hooks/pre-push.backup
Triggers: When you run git push
Checks:
Action if match:
Allows:
Version tag pattern:
^v[0-9]+\.[0-9]+\.[0-9]+
Matches:
v1.0.0 ✓v1.2.3 ✓v10.20.30 ✓Does not match:
v1.0.0-alpha ✗ (pre-release allowed)v1.0.0-rc.1 ✗ (release candidate allowed)feature-v1 ✗ (not a version tag)1.0.0 ✗ (missing v prefix)This intentionally allows pre-release tags since they may have different workflows.
Error: No .git directory found
Message:
❌ Not a git repository
This skill must be run from the root of a git repository.
Run: git init
Action: Exit without making changes
Warning: Existing pre-push hook not installed by plinth
Message:
⚠️ Existing pre-push hook detected
Your .git/hooks/pre-push file contains a hook not installed by plinth.
Action: Ask user how to proceed (backup vs skip)
Error: Failed to copy or chmod hook
Message:
❌ Failed to install pre-push hook
Could not copy hook file to .git/hooks/pre-push or make it executable.
Check permissions on .git/hooks/ directory.
Action: Report failure and suggest manual inspection
Error: Hook file has bash syntax error
Message:
❌ Hook has syntax errors
The installed hook at .git/hooks/pre-push has bash syntax errors.
Please report this issue: https://github.com/pborenstein/plinth/issues
Action: Report error but don't remove hook (let user inspect)
This skill can be extended with additional hooks:
/plinth:session-wrapup<<<<<<Adding new hooks:
skills/git-workflow-hooks/After running this skill, verify:
.git/hooks/pre-push-x permission)--no-verify)npx claudepluginhub pborenstein/plinthConfigures Git hooks with Husky, pre-commit, and custom scripts to enforce code quality, linting, and testing before commits and pushes.
Safely stages, commits, and pushes git changes with conventional commit messages, respecting protected branches and remote configuration.
Manages Git branching strategies, Conventional Commits, PR workflows, merge conflict resolution, CI/CD integration, and git hooks setup with frameworks like lefthook, captainhook, husky, or pre-commit.