precommit
Validates git changes and repository state before committing. Uses systematic analysis to assess impact, identify risks, and verify completeness across repositories.
Instructions
Validates git changes and repository state before committing with systematic analysis. Use for multi-repository validation, security review, change impact assessment, and completeness verification. Guides through structured investigation with expert analysis.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Absolute path to the repository root. Required in step 1. | |
| step | Yes | Step 1: outline how you'll validate the git changes. Later steps: report findings. Review diffs and impacts, use `relevant_files`, and avoid pasting large snippets. | |
| model | Yes | Currently in auto model selection mode. CRITICAL: When the user names a model, you MUST use that exact name unless the server rejects it. If no model is provided, you may use the `listmodels` tool to review options and select an appropriate match. Top models: gemini-2.5-pro (score 100, 1.0M ctx, thinking, code-gen); gemini-3-pro-preview (score 100, 1.0M ctx, thinking, code-gen); gemini-2.5-flash (score 61, 1.0M ctx, thinking); gemini-2.0-flash (score 56, 1.0M ctx, thinking); gemini-2.0-flash-lite (score 42, 1.0M ctx). | |
| images | No | Optional absolute paths to screenshots or diagrams that aid validation. | |
| findings | Yes | Record git diff insights, risks, missing tests, security concerns, and positives; update previous notes as you go. | |
| focus_on | No | Optional emphasis areas such as security, performance, or test coverage. | |
| compare_to | No | Optional git ref (branch/tag/commit) to diff against; falls back to staged/unstaged changes. | |
| confidence | No | Confidence level: exploring (just starting), low (early investigation), medium (some evidence), high (strong evidence), very_high (comprehensive understanding), almost_certain (near complete confidence), certain (100% confidence locally - no external validation needed) | |
| hypothesis | No | Current theory about issue/goal based on work | |
| step_number | Yes | Current pre-commit step number (starts at 1). | |
| temperature | No | 0 = deterministic · 1 = creative. | |
| total_steps | Yes | Planned number of validation steps. External validation: use at most three (analysis → follow-ups → summary). Internal validation: a single step. Honour these limits when resuming via continuation_id. | |
| issues_found | No | List issues with severity (critical/high/medium/low) plus descriptions (bugs, security, performance, coverage). | |
| files_checked | No | Absolute paths for every file examined, including ruled-out candidates. | |
| thinking_mode | No | Reasoning depth: minimal, low, medium, high, or max. | |
| include_staged | No | Whether to inspect staged changes (ignored when `compare_to` is set). | |
| precommit_type | No | 'external' (default, triggers expert model) or 'internal' (local-only validation). | external |
| relevant_files | No | Absolute paths of files involved in the change or validation (code, configs, tests, docs). Must be absolute full non-abbreviated paths. | |
| continuation_id | No | Unique thread continuation ID for multi-turn conversations. Works across different tools. ALWAYS reuse the last continuation_id you were given—this preserves full conversation context, files, and findings so the agent can resume seamlessly. | |
| severity_filter | No | Lowest severity to include when reporting issues. | all |
| include_unstaged | No | Whether to inspect unstaged changes (ignored when `compare_to` is set). | |
| relevant_context | No | Methods/functions identified as involved in the issue | |
| next_step_required | Yes | True to continue with another step, False when validation is complete. CRITICAL: If total_steps>=3 or when `precommit_type = external`, set to True until the final step. When continuation_id is provided: Follow the same validation rules based on precommit_type. | |
| use_assistant_model | No | Use assistant model for expert analysis after workflow steps. False skips expert analysis, relies solely on your personal investigation. Defaults to True for comprehensive validation. |