E

Efficient Check Handler

A command template for utilities workflows. Streamlines development with pre-configured patterns and best practices.

CommandClipticsutilitiesv1.0.0MIT
0 views0 copies

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

ConceptDescription
Parallel executionRuns all checks concurrently to minimize total wall-clock time
Auto-detectionDiscovers available linters, formatters, and type checkers in the project
Unified reportAggregates results from all tools into a single pass/warn/fail status
Exit codesReturns 0 (all pass), 1 (any failure), or 2 (warnings only)
Detect Tools --> Fork Processes
                     |
        +------------+------------+
        |            |            |
     ESLint        tsc       Prettier    audit
        |            |            |         |
        +------------+------------+---------+
                     |
              Unified Report

Configuration

OptionDefaultDescription
checksautoWhich checks to run (lint, types, format, security)
paralleltrueRun all checks concurrently
fixfalseAuto-fix issues where the tool supports it
strictfalseTreat warnings as failures
timeout60sPer-check timeout before aborting

Best Practices

  1. Run before every PR -- catching issues locally is faster than waiting for CI feedback loops.
  2. Enable fix mode for formatting -- auto-fix prettier and eslint issues rather than just reporting them.
  3. Keep checks fast -- if any single check takes over 30 seconds, consider caching or limiting its scope.
  4. Pin tool versions -- different versions of ESLint or Prettier may produce inconsistent results.
  5. Add to git hooks -- use husky or lefthook to run checks automatically on pre-push.

Common Issues

  1. Check tool not found -- the command looks for tools in node_modules/.bin and PATH. Ensure they are installed.
  2. Conflicting lint and format rules -- ESLint and Prettier can conflict. Use eslint-config-prettier to disable overlapping rules.
  3. Timeout on large projects -- type checking large TypeScript projects can be slow. Increase the timeout or use project references.
Community

Reviews

Write a review

No reviews yet. Be the first to review this template!

Similar Templates