setup_git_and_precommit
Sets up Git and pre-commit hooks by auto-detecting project type and generating appropriate configurations for Python, JavaScript, or TypeScript.
Instructions
Use this tool to automatically set up git and pre-commit hooks for a project. This tool will: 1) Initialize a git repository if one doesn't exist (runs 'git init'), 2) Detect the project type automatically (Python/JS/TS), 3) Create a .pre-commit-config.yaml file with appropriate hooks for the project type, 4) Install the pre-commit hooks (runs 'pre-commit install'). For Python projects: Sets up pre-commit framework with Black, Flake8, isort, and common hooks. For JS/TS projects: Sets up Husky + lint-staged with ESLint and Prettier. Call this tool when the user wants to 'set up', 'initialize', 'install', or 'configure' git or pre-commit hooks.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "setup_git_and_precommit"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo_path | No | Absolute path to the repository to set up. If not provided, defaults to current working directory. | |
| force_project_type | No | Force a specific project type instead of auto-detection. Use this when auto-detection fails or user specifies a particular setup. |