VIRIM Infotech
Your AI Assisted Product Developers

vm-dev-tooling-setup

Skill detail with category, linked agents, and source metadata.

vm-dev-tooling-setup

Sets up developer pre-commit tooling for a repository: Husky hooks, lint-staged, Prettier formatting, type checking, and test execution on staged files. Detects the project language/framework and configures the appropriate toolchain. Produces a setup verification report. Use when a repository lacks pre-commit quality gates.

Category: devops Used by 1 agents

Source: .github/skills/devops/vm-dev-tooling-setup/SKILL.md

Used By Agents

Preview

View source preview (first 3000 chars)

# VM Dev Tooling Setup

## Overview

Detects a repository's language, package manager, and existing tooling configuration, then installs and configures pre-commit quality gates. Prevents broken, unformatted, or type-unsafe code from being committed. Works for Node.js/TypeScript and Python projects. Produces a `docs/dev-tooling/setup-report.md` confirming what was configured.

## When to Use

- A new repository has no pre-commit hooks configured
- The team wants to enforce formatting, linting, and type safety before code reaches CI
- An existing repository has inconsistent formatting that needs to be locked down
- Adding a test-on-staged-files gate to prevent broken commits

## When NOT to Use

- Repositories where pre-commit hooks cannot be used (e.g., locked-down enterprise CI systems where only server-side hooks are permitted)
- Projects that already have a fully configured Husky + lint-staged setup
- Repositories without a `package.json` (Node) or `pyproject.toml`/`setup.py` (Python)

## Inputs

```json
{
  "repository_path": "path to repository root",
  "language": "auto-detect | node | python",
  "hooks": {
    "pre_commit": ["format", "lint", "typecheck", "test-staged"],
    "commit_msg": false
  },
  "formatter": "prettier (node) | black (python) | auto",
  "linter": "eslint (node) | ruff (python) | auto",
  "type_checker": "typescript (node) | mypy (python) | pyright | none",
  "test_on_staged": true
}
```

All fields are optional — skill auto-detects from project files when not provided.

## Method

### Step 1: Detect Project Configuration

Read the repository root and determine:

**Node.js / TypeScript detection:**
- Presence of `package.json` → Node project
- Presence of `tsconfig.json` → TypeScript enabled
- Existing `package.json` scripts for `lint`, `test`, `typecheck`
- Existing `.prettierrc`, `.eslintrc`, or equivalent
- Package manager: `package-lock.json` → npm | `yarn.lock` → yarn | `pnpm-lock.yaml` → pnpm

**Python detection:**
- Presence of `pyproject.toml`, `setup.py`, or `requirements.txt` → Python project
- Presence of `[tool.black]`, `[tool.ruff]`, `[tool.mypy]` in `pyproject.toml`
- Virtual env indicator: `.venv/`, `venv/`, `.python-version`

If both are present, configure both toolchains.

### Step 2: Node.js / TypeScript Setup

**Install dev dependencies (write install command to report, do not execute unless `execute` tool available and user confirms):**

```bash
npm install --save-dev husky lint-staged prettier
```

Add TypeScript type checker if `tsconfig.json` present:
```bash
npm install --save-dev typescript
```

Add ESLint if not present:
```bash
npm install --save-dev eslint @eslint/js
```

**Configure `package.json` additions:**

```json
{
  "scripts": {
    "prepare": "husky"
  },
  "lint-staged": {
    "*.{ts,tsx,js,jsx}": ["prettier --write", "eslint --fix"],
    "*.{md,json,yaml,yml}": ["prettier --write"]
  }
}
```

**Create `.husky/pre-commit`:**

```sh
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.s