Fail Early
- `write-testthat-tests` - write tests that verify error paths
LLM Evaluation
Evaluated by: xiaomi/mimo-v2-flash:free
Last evaluated: March 29, 2026
Prompt Preview
---
name: fail-early-pattern
description: >
Apply the fail-early (fail-fast) pattern to detect and report errors at
the earliest possible point. Covers input validation with guard clauses,
meaningful error messages, assertion functions, and anti-patterns that
silently swallow failures. Primary examples in R with general/polyglot
guidance. Use when writing functions that accept external input, adding
input validation before CRAN submission, refactoring code that silently
produces wr...
Full prompt length: 13092 characters
Tools & Technologies
- Python
- typescript
- Docker
- Rust
- TypeScript