precommit
Validate code changes before committing by analyzing security, performance, quality, tests, or breaking changes. Specify files, focus areas, and severity levels to ensure pre-commit checks meet project standards.
Instructions
Pre-commit validation for code changes
Input Schema
Name | Required | Description | Default |
---|---|---|---|
compareTo | No | Git ref to compare against (e.g., 'main', 'HEAD~1'). If not provided, analyzes current changes | |
files | No | Specific files to validate (optional - will analyze git changes if not provided) | |
focus | No | Validation focus area | all |
includeStaged | No | Include staged changes in validation | |
includeUnstaged | No | Include unstaged changes in validation | |
provider | No | AI provider to use | gemini |
severity | No | Minimum severity level to report | medium |
task | Yes | What to validate for pre-commit (e.g., 'review changes before commit', 'validate security implications', 'check for breaking changes') |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"compareTo": {
"description": "Git ref to compare against (e.g., 'main', 'HEAD~1'). If not provided, analyzes current changes",
"type": "string"
},
"files": {
"description": "Specific files to validate (optional - will analyze git changes if not provided)",
"items": {
"type": "string"
},
"type": "array"
},
"focus": {
"default": "all",
"description": "Validation focus area",
"enum": [
"security",
"performance",
"quality",
"tests",
"breaking-changes",
"all"
],
"type": "string"
},
"includeStaged": {
"default": true,
"description": "Include staged changes in validation",
"type": "boolean"
},
"includeUnstaged": {
"default": false,
"description": "Include unstaged changes in validation",
"type": "boolean"
},
"provider": {
"default": "gemini",
"description": "AI provider to use",
"enum": [
"openai",
"gemini",
"azure",
"grok"
],
"type": "string"
},
"severity": {
"default": "medium",
"description": "Minimum severity level to report",
"enum": [
"critical",
"high",
"medium",
"low",
"all"
],
"type": "string"
},
"task": {
"description": "What to validate for pre-commit (e.g., 'review changes before commit', 'validate security implications', 'check for breaking changes')",
"type": "string"
}
},
"required": [
"task"
],
"type": "object"
}