This repository uses lefthook for pre-commit and pre-push checks. Follow this workflow to avoid hook failures.
Lefthook Checks
pre-commit: Security Check
Runs Claude to review the staged diff for:
- Hardcoded API keys, passwords, tokens
- Dangerous functions (eval, exec, system calls)
- SQL injection, XSS vulnerabilities
- Personally identifiable information (PC names, usernames)
Proactive handling: Before committing, review own changes for these issues. If any are found, fix them before staging.
pre-push: Version Check
Runs bun ./scripts/check-version-update.ts. For each plugin with changed files, verifies that .claude-plugin/marketplace.json has an updated version for that plugin entry.
This is the most common failure point.
Workflow
Before Committing
- Review staged changes for security issues (secrets, dangerous patterns)
- If plugin files were modified, proceed to version bump steps below before committing
Version Bump Procedure
When files under plugins/<name>/ have been modified:
-
Identify which plugins have changes:
git diff --name-only origin/master HEADFilter for paths starting with
plugins/<name>/ -
For each changed plugin, bump the
versionfield in.claude-plugin/marketplace.json- Use semver patch bump (e.g.,
0.1.4->0.1.5) unless the change warrants minor/major - New features: minor bump (e.g.,
0.1.4->0.2.0) - Breaking changes: major bump
- Use semver patch bump (e.g.,
-
Run version sync:
bun ./scripts/sync-versions.tsThis copies versions from
marketplace.jsonto eachplugins/*/plugin.json -
Stage and commit the version changes together with the feature changes, or as a separate commit
Before Pushing
Verify all changed plugins have version bumps:
bun ./scripts/check-version-update.ts
If this fails, go back to the version bump procedure.
Commit Message Convention
Follow the existing convention visible in git log:
feat(<plugin-name>): <description>
fix(<plugin-name>): <description>
refactor(<plugin-name>): <description>
chore(<plugin-name>): <description>
Quick Reference
| Step | Action | Command |
|---|---|---|
| 1 | Check changed plugins | git diff --name-only origin/master HEAD |
| 2 | Bump version in marketplace.json | Edit .claude-plugin/marketplace.json |
| 3 | Sync to plugin.json | bun ./scripts/sync-versions.ts |
| 4 | Verify | bun ./scripts/check-version-update.ts |
| 5 | Commit & Push | git add . && git commit && git push |