Efficient Check Handler
A command template for utilities workflows. Streamlines development with pre-configured patterns and best practices.
Efficient Check Handler
Run all project health checks in parallel -- linting, type checking, formatting, and security audits -- and report a unified pass/fail status.
When to Use This Command
Run this command when...
- You want a single command to verify linting, types, formatting, and security are all clean
- You are about to open a PR and need to confirm all checks pass before pushing
- You want to run checks in parallel to save time compared to sequential execution
Avoid this command when...
- You only need to run one specific check like linting in isolation
- Your CI already runs these checks and you trust the remote pipeline completely
Quick Start
# .claude/commands/efficient-check-handler.md --- allowed-tools: ["Bash"] --- Detect available checkers (eslint, tsc, prettier, npm audit). Run all checks in parallel. Report unified results.
Example usage:
/efficient-check-handler
Example output:
Running checks in parallel...
[PASS] ESLint 0 errors, 0 warnings (1.8s)
[PASS] TypeScript 0 errors (3.2s)
[WARN] Prettier 4 files need formatting (0.9s)
[PASS] npm audit 0 vulnerabilities (2.1s)
Overall: WARN (3 passed, 1 warning)
Core Concepts
| Concept | Description |
|---|---|
| Parallel execution | Runs all checks concurrently to minimize total wall-clock time |
| Auto-detection | Discovers available linters, formatters, and type checkers in the project |
| Unified report | Aggregates results from all tools into a single pass/warn/fail status |
| Exit codes | Returns 0 (all pass), 1 (any failure), or 2 (warnings only) |
Detect Tools --> Fork Processes
|
+------------+------------+
| | |
ESLint tsc Prettier audit
| | | |
+------------+------------+---------+
|
Unified Report
Configuration
| Option | Default | Description |
|---|---|---|
checks | auto | Which checks to run (lint, types, format, security) |
parallel | true | Run all checks concurrently |
fix | false | Auto-fix issues where the tool supports it |
strict | false | Treat warnings as failures |
timeout | 60s | Per-check timeout before aborting |
Best Practices
- Run before every PR -- catching issues locally is faster than waiting for CI feedback loops.
- Enable fix mode for formatting -- auto-fix prettier and eslint issues rather than just reporting them.
- Keep checks fast -- if any single check takes over 30 seconds, consider caching or limiting its scope.
- Pin tool versions -- different versions of ESLint or Prettier may produce inconsistent results.
- Add to git hooks -- use husky or lefthook to run checks automatically on pre-push.
Common Issues
- Check tool not found -- the command looks for tools in node_modules/.bin and PATH. Ensure they are installed.
- Conflicting lint and format rules -- ESLint and Prettier can conflict. Use eslint-config-prettier to disable overlapping rules.
- Timeout on large projects -- type checking large TypeScript projects can be slow. Increase the timeout or use project references.
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Git Commit Message Generator
Generates well-structured conventional commit messages by analyzing staged changes. Follows Conventional Commits spec with scope detection.
React Component Scaffolder
Scaffolds a complete React component with TypeScript types, Tailwind styles, Storybook stories, and unit tests. Follows project conventions automatically.
CI/CD Pipeline Generator
Generates GitHub Actions workflows for CI/CD including linting, testing, building, and deploying. Detects project stack automatically.