Claude Skills
CollectionsCompareWorkflowsNominate
Sign inSign up
© 2026 Curated Agent Skills·Learn more about Agent Skills
Back to repository

pre-commit-setup

verified

This skill should be used when the user asks to "set up pre-commit",

View on GitHub

Marketplace

functional-claude

nthplusio/functional-claude

Plugin

pre-commit

Repository
Verified Org

nthplusio/functional-claude

plugins/pre-commit/skills/pre-commit-setup/SKILL.md

Last Verified

February 2, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/nthplusio/functional-claude/blob/main/plugins/pre-commit/skills/pre-commit-setup/SKILL.md -a claude-code --skill pre-commit-setup

Installation paths:

Claude
.claude/skills/pre-commit-setup/
Powered by add-skill CLI

Instructions

# Pre-Commit Setup

Analyze the repository and create a configuration file for pre-push checks.

## What This Does

1. Scans the repository for ecosystem indicators (JS/TS, Python, Rust, Go)
2. Detects available typecheck, lint, build, and test tools
3. Creates `.claude/pre-commit.json` with discovered configuration
4. Reports what was found and how to customize

## Setup Process

### Step 1: Detect Ecosystems

Check for these files in the project root:

| File | Ecosystem |
|------|-----------|
| `package.json` | JavaScript/TypeScript |
| `tsconfig.json` | TypeScript (confirms JS ecosystem) |
| `pyproject.toml`, `setup.py`, `requirements.txt` | Python |
| `Cargo.toml` | Rust |
| `go.mod` | Go |

Run these checks:

```bash
# Check what exists
ls -la package.json tsconfig.json pyproject.toml setup.py requirements.txt Cargo.toml go.mod 2>/dev/null
```

### Step 2: Detect Tools Per Ecosystem

#### JavaScript/TypeScript

**Typecheck detection:**
```bash
# Check for TypeScript
if [ -f "tsconfig.json" ]; then
  # Check package.json for typecheck script
  grep -q '"typecheck"' package.json 2>/dev/null && echo "npm run typecheck"
  grep -q '"type-check"' package.json 2>/dev/null && echo "npm run type-check"
  # Fallback to tsc
  grep -q '"typescript"' package.json 2>/dev/null && echo "npx tsc --noEmit"
fi
```

**Lint detection:**
```bash
# Check for lint script first
grep -q '"lint"' package.json 2>/dev/null && echo "npm run lint"

# Check for ESLint config
ls eslint.config.* .eslintrc* 2>/dev/null && echo "npx eslint ."

# Check for Biome
[ -f "biome.json" ] && echo "npx biome check ."
```

**Build detection:**
```bash
# Check for build script
grep -q '"build"' package.json && echo "npm run build"

# Check for Turbo
[ -f "turbo.json" ] && echo "turbo run build"

# Check for monorepo workspaces
[ -f "pnpm-workspace.yaml" ] && echo "pnpm -r build"
[ -f "lerna.json" ] && echo "lerna run build"
```

**Test detection:**
```bash
# Check for test script
grep -q '"test"' package.j

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
6354 chars