Skip to content
Agentmart
Submit a tool

add-puzzle-type

Scaffold a new puzzle type across all 10+ pipeline integration points in jigsawR.

Skill by Philipp Thoss

IndexedMIT★ 42
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/pjt222-add-puzzle-type

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Scaffold a new puzzle type across all 10+ pipeline integration points in jigsawR. Creates the core puzzle module, wires it into the unified pipeline (generation, positioning, rendering, adjacency), adds ggpuzzle geom/stat layers, updates DESCRIPTION and config.yml, extends the Shiny app, and creates a comprehensive test suite. Use when adding a completely new puzzle type to the package or following the 10-point integration checklist to ensure nothing is missed end-to-end.

Use cases: testing, data

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/add-puzzle-type

Tools it pre-approves 6

From allowed-tools in SKILL.md: the agent may use these without asking you each time.

  • Read
  • Write
  • Edit
  • Bash
  • Grep
  • Glob

What's inside

Skill name
add-puzzle-type
Description
Scaffold a new puzzle type across all 10+ pipeline integration points in jigsawR. Creates the core puzzle module, wires it into the unified pipeline (generation, positioning, rendering, adjacency), adds ggpuzzle geom/stat layers, updates DESCRIPTION and config.yml, extends the Shiny app, and creates a comprehensive test suite. Use when adding a completely new puzzle type to the package or following the 10-point integration checklist to ensure nothing is missed end-to-end.
License
MIT
Allowed tools
Read, Write, Edit, Bash, Grep, Glob
Metadata
tags: jigsawr, puzzle-type, pipeline, integration, scaffold · author: Philipp Thoss · domain: jigsawr · version: 1.0 · language: R · complexity: advanced
Instructions
236 lines in SKILL.md · view on GitHub

Before installing

  • Pre-approves any shell command

Files (1)

  • SKILL.md

SKILL.md (first lines)

# 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 the `valid_types` vector
2. Add type-specific parameter extraction in the params section
3. Add validation logic for type-specific constraints
4. Add filename prefix mapping (e.g., `"<type>"` -> `"<type>_"`)

```r
# In valid_types
valid_types <- c("rectangular", "hexagonal", "concentric", "voronoi", "snic", "<type>")
```

**Got:** `generate_puzzle(type = "<type>")` is accepted without "unknown type" error.

**If fail:** Verify the type string is added to `valid_types` exactly as spelled, and that parameter extraction covers all required type-specific arguments.

### Step 3: Wire into unified_piece_generation.R

Edit `R/unified_piece_generation.R`:

1. Add dispatch case in `generate_pieces_internal()`
2. Add fusion handling if the type supports PILES notation

```r
# In the switch/dispatch
"<type>" = generate_<type>_pieces_internal(params, seed)
```

**Got:** Pieces are generated when the type is dispatched.

**If fail:** Confirm the dispatch case string matches the type name exactly and that `generate_<type>_pieces_internal` is defined and exported from the puzzle module.

### Step 4: Wire into piece_positioning.R

Edit `R/piece_positioning.R`:

Add positioning dispatch for the new type. Most types use shared positioning logic, but some need custom handling.

**Got:** `apply_piece_positioning()` handles the new type without errors and pieces are placed at correct coordinates.

**If fail:** Check whether the new type needs custom positioning logic or can reuse the shared positioning path. Add a dispatch case if the default path does not apply.

### Step 5: Wire into unified_renderer.R

Edit `R/unified_renderer.R`:

1. Add rendering case in `render_puzzle_svg()`
2. Add edge path function: `get_<type>_edge_paths()`
3. Add piece name function: `get_<type>_piece_name()`

**Got:** SVG output is generated for the new type with correct piece outlines and edge paths.

**If fail:** Verify `get_<type>_edge_paths()` returns valid SVG path data and `get_<type>_piece_name()` produces unique identifiers for each piece.

### Step 6: Wire into adjacency_api.R

Edit `R/adjacency_api.R`:

Add neighbor dispatch so `get_neighbors()` and `get_adjacency()` work for the new type.

**Got:** `get_neighbors(result, piece_id)` returns correct neighbors for any piece in the puzzle.

**If fail:** Check that the adjacency dispatch returns the correct data structure. Test with a small grid and manually verify neighbor relationships against the geometry.

### Step 7: Add ggpuzzle Geom Layer

Edit `R/geom_puzzle.R`:

Create `geom_puzzle_<type>()` using the `make_puzzle_layer()` factory:

```r
#' @export
geom_puzzle_<type> <- function(mapping = NULL, data = NULL, ...) {
  make_puzzle_layer(type = "<type>", mapping = mapping, data = data, ...)
}

From pjt222/agent-almanac, MIT.

More from pjt222/agent-almanac

Signals

Stars
42
Forks
5
Open issues
182
Last commit (this folder)
Aug 17, 2026 (2 months ago)
Last release
Aug 26, 2026 (2 months ago)

From GitHub (fetched Oct 24, 2026).

Details

Version
1.0
License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from Philipp Thoss

Cite this page

add-puzzle-type skill. Agent Mart. https://agentmart.dev/skills/pjt222-add-puzzle-type (last updated 2026-10-24)