add-yardstick-metriclisted
Install: claude install-skill tidymodels/skills
# Add Yardstick Metric
Guide for developing new metrics that extend the yardstick package. This skill
provides best practices, code templates, and testing patterns for creating
custom performance metrics.
--------------------------------------------------------------------------------
## Two Development Contexts
This skill supports **two distinct development contexts**:
### 🆕 Extension Development (Default)
**Creating a new R package** that extends yardstick with custom metrics.
- ✅ Use this for: New packages, standalone metrics, CRAN submissions
- ⚠️ **Constraint**: Can only use exported functions (no `:::`)
### 🔧 Source Development (Advanced)
**Contributing directly to yardstick** via pull requests.
- ✅ Use this for: Contributing to tidymodels/yardstick repository
- ✨ **Benefit**: Can use internal functions and package infrastructure
--------------------------------------------------------------------------------
## Getting Started
**INSTRUCTIONS FOR CLAUDE:** Run the verification script first to determine the
development context:
```bash
Rscript -e 'source(Sys.glob(path.expand("~/.claude/plugins/cache/tidymodels-skills/tidymodels-dev/*/tidymodels/shared-references/scripts/verify-setup.R"))[1])'
```
**Then follow the appropriate path based on the output:**
- **Output: "All checks for source development complete."** → Go to [Source
Development Guide](references/source-guide.md)
- **Output: "All checks for extension development complete." (no warnings)*