Detect project tools and generate a /check command for linting and typechecking
Detects your project's language and tools, then creates a `/fix` command that runs linting/typechecking and spawns parallel agents to auto-fix all issues.
/plugin marketplace add KenKaiii/minimal-claude/plugin install minimal-claude@minimal-claude-marketplaceYou are setting up a project for automated code quality checks. Follow these steps carefully:
Check for these files in the current directory to determine the project type:
package.json → JavaScript/TypeScript (Node.js)pyproject.toml or requirements.txt or setup.py → Pythongo.mod → GoCargo.toml → Rustcomposer.json → PHPbuild.gradle or pom.xml → JavaRead the relevant config file to understand the project structure.
Based on the project type, check if these tools are already configured:
package.json for: eslint, prettier, typescript, @typescript-eslint/*.eslintrc.*, .prettierrc.*, tsconfig.jsonpackage.json scripts for: lint, typecheck, type-check, or tscmypy, pylint, black, ruff, flake8 in dependenciesmypy.ini, .pylintrc, pyproject.tomlgolint, gofmt, staticcheckclippy, rustfmt (built-in to Rust toolchain)Cargo.toml for workspace configurationIf tools are missing, install them based on the project type:
# Detect package manager (npm, yarn, pnpm, bun)
# Install missing tools, e.g.:
npm install --save-dev eslint prettier typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin
# Add scripts to package.json if missing:
# "lint": "eslint ."
# "typecheck": "tsc --noEmit"
pip install mypy pylint black ruff
# or add to requirements-dev.txt / pyproject.toml
go install golang.org/x/lint/golint@latest
go install honnef.co/go/tools/cmd/staticcheck@latest
rustup component add clippy rustfmt
IMPORTANT: Always check if tools exist first. Only install if missing.
Create a file at .claude/commands/fix.md with the following structure:
---
name: fix
description: Run typechecking and linting, then spawn parallel agents to fix all issues
---
# Project Code Quality Check
This command runs all linting and typechecking tools for this project, collects errors, groups them by domain, and spawns parallel agents to fix them.
## Step 1: Run Linting and Typechecking
Run the appropriate commands for this project:
[INSERT PROJECT-SPECIFIC COMMANDS HERE]
## Step 2: Collect and Parse Errors
Parse the output from the linting and typechecking commands. Group errors by domain:
- **Type errors**: Issues from TypeScript, mypy, etc.
- **Lint errors**: Issues from eslint, pylint, ruff, clippy, etc.
- **Format errors**: Issues from prettier, black, rustfmt, gofmt
Create a list of all files with issues and the specific problems in each file.
## Step 3: Spawn Parallel Agents
For each domain that has issues, spawn an agent in parallel using the Task tool:
**IMPORTANT**: Use a SINGLE response with MULTIPLE Task tool calls to run agents in parallel.
Example:
- Spawn a "type-fixer" agent for type errors
- Spawn a "lint-fixer" agent for lint errors
- Spawn a "format-fixer" agent for formatting errors
Each agent should:
1. Receive the list of files and specific errors in their domain
2. Fix all errors in their domain
3. Run the relevant check command to verify fixes
4. Report completion
## Step 4: Verify All Fixes
After all agents complete, run the full check again to ensure all issues are resolved.
Replace [INSERT PROJECT-SPECIFIC COMMANDS HERE] with the actual commands for the detected project type.
npm run lint
npm run typecheck
mypy .
pylint src/
black --check .
go vet ./...
staticcheck ./...
gofmt -l .
cargo clippy -- -D warnings
cargo fmt -- --check
After generating the /fix command, inform the user:
/fix command has been created at .claude/commands/fix.md/fix to lint, typecheck, and auto-fix all issues"Important Notes:
.claude/commands/ directory if it doesn't existname and description/fix command must spawn agents in parallel (single response, multiple Task tool calls)