# Parallel Execution Requirement
## Rule
All independent commands within a hook stage MUST use `parallel: true`. Sequential execution of independent checks is prohibited — it wastes developer time.
## Format
```yaml
# Good — parallel execution
pre-commit:
parallel: true
commands:
lint:
glob: "*.{ts,tsx}"
run: npx eslint {staged_files}
format:
glob: "*.{ts,tsx,json}"
run: npx prettier --check {staged_files}
secrets:
run: gitleaks protect --staged
```
```yaml
# Bad — sequential (3x slower)
pre-commit:
commands:
lint:
run: npx eslint {staged_files}
format:
run: npx prettier --check {staged_files}
secrets:
run: gitleaks protect --staged
```
## When Sequential IS Appropriate
```yaml
# Format then lint — lint depends on formatting
pre-commit:
piped: true
commands:
format:
glob: "*.{ts,tsx}"
run: npx prettier --write {staged_files}
lint:
glob: "*.{ts,tsx}"
run: npx eslint {staged_files}
```
## Performance Targets
| Hook Stage | Target Time | Max Time |
|------------|------------|----------|
| pre-commit | < 5 seconds | 10 seconds |
| commit-msg | < 1 second | 3 seconds |
| pre-push | < 30 seconds | 60 seconds |
## Anti-Patterns
- Sequential execution of independent lint, format, and security checks
- Missing `parallel: true` on hook stages with 2+ commands
- Pre-commit hooks exceeding 10 seconds (developers will skip)
- Running tests in pre-commit instead of pre-push