add-puzzle-typelisted
Install: claude install-skill pjt222/agent-almanac
# Add Puzzle Type
Scaffold a new puzzle type across all pipeline integration points in jigsawR.
## When to Use
- Adding a completely new puzzle type to the package
- Following the established integration checklist (CLAUDE.md 10-point pipeline)
- Ensuring nothing is missed when wiring a new type end-to-end
## Inputs
- **Required**: New type name (lowercase, e.g. `"triangular"`)
- **Required**: Geometry description (how pieces are shaped/arranged)
- **Required**: Whether the type needs external packages (add to Suggests)
- **Optional**: Parameter list beyond the standard (grid, size, seed, tabsize, offset)
- **Optional**: Reference implementation or algorithm source
## Procedure
### Step 1: Create Core Puzzle Module
Create `R/<type>_puzzle.R` with the internal generation function:
```r
#' Generate <type> puzzle pieces (internal)
#' @noRd
generate_<type>_pieces_internal <- function(params, seed) {
# 1. Initialize RNG state
# 2. Generate piece geometries
# 3. Build edge paths (SVG path data)
# 4. Compute adjacency
# 5. Return list: pieces, edges, adjacency, metadata
}
```
Follow the pattern in `R/voronoi_puzzle.R` or `R/snic_puzzle.R` for structure.
**Got:** Function returns a list with `$pieces`, `$edges`, `$adjacency`, `$metadata`.
**If fail:** Compare the return structure against `generate_voronoi_pieces_internal()` to identify missing list elements or incorrect types.
### Step 2: Wire into jigsawR_clean.R
Edit `R/jigsawR_clean.R`:
1. Add `"<type>"` to