8000 🔧 Add Pre-commit Integration to /git Command by lmontanares · Pull Request #46 · NomenAK/SuperClaude · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

🔧 Add Pre-commit Integration to /git Command #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

8000
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .claude/commands/git.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ Examples:
- `/git --commit "Add user profile API endpoint"` - Standard commit w/ message
- `/git --pr --reviewers alice,bob --labels api,feature` - Create PR w/ reviewers
- `/git --flow feature "payment-integration" --think` - Full feature workflow
- `/git --pre-commit` - Setup pre-commit framework and basic hooks
- `/git --commit "Fix validation logic" --pre-commit` - Commit with pre-commit validation
- `/git --pre-commit --security` - Setup with security hooks included

Git operations:

Expand All @@ -28,8 +31,12 @@ Git operations:
- feature: Feature branch workflow | hotfix: Emergency fix workflow
- release: Release branch workflow | gitflow: Full GitFlow model

**--pre-commit:** Setup and manage pre-commit hooks | Auto-install framework | Configure quality checks | Run hooks before commits

@include shared/execution-patterns.yml#Git_Integration_Patterns

@include shared/pre-commit-patterns.yml#Pre_Commit_Setup

@include shared/docs-patterns.yml#Standard_Notifications

@include shared/universal-constants.yml#Standard_Messages_Templates
1 change: 1 addition & 0 deletions .claude/commands/shared/execution-patterns.yml
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ Git_Workflows:
Before_Commit:
- "git status → Verify intended files"
- "git diff --staged → Review changes"
- "Run pre-commit hooks if configured"
- "Run tests if available"
- "Check for secrets/credentials"
Before_Push:
Expand Down
32 changes: 32 additions & 0 deletions .claude/commands/shared/pre-commit-patterns.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Pre-commit Patterns
# Simple pre-commit hook configuration and management

```yaml
Pre_Commit_Setup:
Install_Python: "uv add --dev pre-commit && uv run pre-commit install"
Install_Node: "npm install --save-dev pre-commit && npx pre-commit install"
Config: ".pre-commit-config.yaml"

Basic_Hooks:
- "trailing-whitespace"
- "end-of-file-fixer"
- "check-yaml"
- "check-json"
- "check-merge-conflict"

Language_Hooks:
Python: ["black", "ruff", "isort"]
JavaScript: ["eslint", "prettier"]
TypeScript: ["eslint", "prettier"]
Node: ["eslint", "prettier", "npm-audit"]

Security_Hooks:
- "detect-secrets"
- "bandit"

Commands:
Run_All: "pre-commit run --all-files"
Test_Hooks: "pre-commit run --hook-stage manual"
Skip_Hooks: "git commit --no-verify"
Update: "pre-commit autoupdate"
```
3 changes: 3 additions & 0 deletions COMMANDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,11 +351,14 @@ Professional Git operations with safety features.
- `--checkpoint` - Create checkpoint
- `--merge` - Smart merge
- `--history` - History analysis
- `--pre-commit` - Setup and run pre-commit hooks

**Examples:**
```bash
/git --checkpoint "before refactor" # Safety checkpoint
/git --commit --validate --test # Safe commit
/git --pre-commit # Setup pre-commit hooks
/git --commit --pre-commit # Commit with validation
```

### 🎨 Design & Architecture Commands (1)
Expand Down
0