@@ -15,8 +15,11 @@ This skill supports **two distinct development contexts** with different capabil
1515** Use when:** Creating a new R package that defines custom tuning parameters
1616
1717- ✅ Build new packages extending Tidymodels with custom parameters
18+
1819- ✅ Use all exported dials functions with ` dials:: ` prefix
20+
1921- ❌ Cannot use internal functions (` ::: ` )
22+
2023- 📘 ** Start here:** [ Extension Development Guide] ( references/extension-guide.md )
2124
2225** Package detection:** DESCRIPTION file does NOT have ` Package: dials `
@@ -26,9 +29,13 @@ This skill supports **two distinct development contexts** with different capabil
2629** Use when:** Contributing parameter definitions directly to tidymodels/dials repository
2730
2831- ✅ Contribute parameters to dials package itself
32+
2933- ✅ Access internal helper functions without ` dials:: ` prefix
34+
3035- ✅ Use validation helpers (` check_type() ` , ` check_range() ` )
36+
3137- ✅ Create custom finalize functions with ` range_get() ` /` range_set() `
38+
3239- 📗 ** Start here:** [ Source Development Guide] ( references/source-guide.md )
3340
3441** Package detection:** DESCRIPTION file has ` Package: dials `
@@ -56,8 +63,11 @@ usethis::create_package("myextension")
5663** dials** is the tuning parameter infrastructure package for Tidymodels. It provides:
5764
5865- Parameter object definitions (quantitative and qualitative)
66+
5967- Parameter range specifications and transformations
68+
6069- Grid generation methods (regular, random, space-filling)
70+
6171- Integration with tune, parsnip, recipes, and workflows packages
6272
6373The name reflects the idea that tuning predictive models can be like turning a set of dials on a complex machine.
@@ -76,25 +86,41 @@ The name reflects the idea that tuning predictive models can be like turning a s
7686** INSTRUCTIONS FOR CLAUDE:** Check if ` repos/dials/ ` exists in the current working directory. Use this to guide development:
7787
7888** If ` repos/dials/ ` exists:**
89+
7990- ✅ Use it as a reference throughout development
91+
8092- Read source files (e.g., ` repos/dials/R/param_mtry.R ` ) to study implementation patterns
93+
8194- Read test files (e.g., ` repos/dials/tests/testthat/test-param_mtry.R ` ) for testing patterns
95+
8296- Reference these files when answering complex questions or solving problems
97+
8398- Look at actual code structure, validation patterns, and edge case handling
8499
85100** If ` repos/dials/ ` does NOT exist:**
101+
86102- Suggest cloning the repository using the scripts in [ Repository Access Guide] ( references/package-repository-access.md )
103+
87104- This is ** optional but strongly recommended** for high-quality development
105+
88106- If the user declines, reference files using GitHub URLs:
107+
89108 - Format: ` https://github.com/tidymodels/dials/blob/main/R/[file-name].R `
109+
90110 - Example: https://github.com/tidymodels/dials/blob/main/R/param_mtry.R
111+
91112 - This allows users to click through to see implementations
92113
93114** When to use repository references:**
115+
94116- Complex implementation questions (e.g., "How does dials handle finalization?")
117+
95118- Debugging issues (compare user's code to working implementation)
119+
96120- Understanding patterns (study similar parameters)
121+
97122- Test design (see how dials tests edge cases)
123+
98124- Architecture decisions (understand internal structure)
99125
100126See [ Repository Access Guide] ( references/package-repository-access.md ) for setup instructions.
@@ -137,8 +163,11 @@ See [Repository Access Guide](references/package-repository-access.md) for setup
137163** Decision guide:**
138164
139165- ** Quantitative, simple range** : Fixed numeric bounds, no transformation → [ Quantitative Parameters] ( references/quantitative-parameters.md )
166+
140167- ** Quantitative, transformed** : Log scale or other transformation → [ Quantitative Parameters] ( references/quantitative-parameters.md ) + [ Transformations] ( references/transformations.md )
168+
141169- ** Quantitative, data-dependent** : Upper bound depends on dataset → [ Quantitative Parameters] ( references/quantitative-parameters.md ) + [ Data-Dependent Parameters] ( references/data-dependent-parameters.md )
170+
142171- ** Qualitative** : Discrete categorical options → [ Qualitative Parameters] ( references/qualitative-parameters.md )
143172
144173---
@@ -353,21 +382,29 @@ values_aggregation <- c("none", "min", "max", "mean", "sum")
353382### Core Guides
354383
355384- [ Extension Development Guide] ( references/extension-guide.md ) - Creating new packages with custom parameters
385+
356386- [ Source Development Guide] ( references/source-guide.md ) - Contributing to dials package
357387
358388### Parameter Types
359389
360390- [ Parameter System Overview] ( references/parameter-system.md ) - Architecture and parameter classes
391+
361392- [ Quantitative Parameters] ( references/quantitative-parameters.md ) - Creating numeric parameters
393+
362394- [ Qualitative Parameters] ( references/qualitative-parameters.md ) - Creating categorical parameters
395+
363396- [ Transformations] ( references/transformations.md ) - Using log scale and custom transformations
397+
364398- [ Data-Dependent Parameters] ( references/data-dependent-parameters.md ) - Using unknown() and finalization
399+
365400- [ Grid Integration] ( references/grid-integration.md ) - How parameters work with grids
366401
367402### Source Development
368403
369404- [ Testing Patterns (Source)] ( references/testing-patterns-source.md ) - dials-specific testing
405+
370406- [ Best Practices (Source)] ( references/best-practices-source.md ) - dials conventions and patterns
407+
371408- [ Troubleshooting (Source)] ( references/troubleshooting-source.md ) - Common issues in dials
372409
373410---
@@ -379,8 +416,11 @@ values_aggregation <- c("none", "min", "max", "mean", "sum")
379416Before creating custom parameters in a new package, ensure your package is properly set up:
380417
381418- ** R Package Structure** : See [ Extension Prerequisites] ( references/package-extension-prerequisites.md )
419+
382420- ** Dependencies** : Add ` dials ` to DESCRIPTION Imports
421+
383422- ** Roxygen** : Configure documentation system
423+
384424- ** Testing** : Set up testthat framework
385425
386426### For Source Development
@@ -426,13 +466,19 @@ See [Development Workflow](references/package-development-workflow.md) for detai
426466Essential tests for all parameters:
427467
428468- ** Range validation** : Parameter accepts valid ranges
469+
429470- ** Type checking** : Correct type enforcement
471+
430472- ** Grid integration** : Works with ` grid_regular() ` , ` grid_random() `
473+
431474- ** Value utilities** : ` value_sample() ` and ` value_seq() ` work correctly
475+
432476- ** Edge cases** : Invalid inputs produce errors
433477
434478See testing guides:
479+
435480- Extension: [ Testing Requirements] ( references/package-extension-requirements.md#testing-requirements )
481+
436482- Source: [ Testing Patterns (Source)] ( references/testing-patterns-source.md )
437483
438484---
@@ -444,7 +490,9 @@ See testing guides:
444490dials follows strict naming conventions:
445491
446492- Parameter files: ` R/param_[name].R `
493+
447494- Test files: ` tests/testthat/test-params.R ` (shared), ` test-constructors.R `
495+
448496- One parameter per file (usually)
449497
450498### Documentation Patterns
@@ -499,8 +547,11 @@ This convention is strongly recommended for consistency.
499547### Related Skills
500548
501549- [ add-yardstick-metric] ( ../add-yardstick-metric/SKILL.md ) - Custom metrics may need custom tuning parameters
550+
502551- [ add-recipe-step] ( ../add-recipe-step/SKILL.md ) - Recipe steps often have tunable parameters
552+
503553- [ add-parsnip-model] ( ../add-parsnip-model/SKILL.md ) - Model specifications have tunable main arguments
554+
504555- [ add-parsnip-engine] ( ../add-parsnip-engine/SKILL.md ) - Model engines have tunable parameters
505556
506557---
0 commit comments