Skip to content

Commit 9e33919

Browse files
committed
puzzletide CLI: word search, crossword, and sudoku generator with printables, evals, and agent skills
Local-first puzzle toolkit extracted from the puzzletide.com generators: - Word search, crossword, and sudoku engines (seeded, deterministic, property-tested; sudoku puzzles verified to have a unique solution) - 1,560 bundled themed word banks (25 categories, 14k+ unique words) - Terminal, JSON, SVG, and printable PDF output (puzzle + solution pages) - Textavia-style command model: ptide <ns> <op>, ptide run <tool-id>, tools list/search/info/docs, agent manifest - Verifiable eval tasks for benchmarking agents (by-construction grading) - Hangman and daily sudoku in the terminal - Five SKILL.md agent skills, loadable via: pi install npm:puzzletide
0 parents  commit 9e33919

49 files changed

Lines changed: 8017 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
node-version: [18, 20, 22]
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: ${{ matrix.node-version }}
19+
cache: npm
20+
- run: npm ci
21+
- run: npm run build
22+
- run: npm test

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules/
2+
dist/
3+
*.tsbuildinfo
4+
.DS_Store

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Caravaca Labs
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
<!--
2+
Keyword rationale: "puzzle generator", "word search generator/maker", "crossword maker",
3+
"sudoku generator/solver", "printable puzzles PDF" — the phrases people type on npm/GitHub/pi.dev.
4+
Contiguous phrases to keep intact: "puzzle generator CLI", "word search", "crossword", "sudoku",
5+
"printable PDF", "agent skills".
6+
Banned claims (not shipped): MCP server, PNG output, AI clue generation, nonograms/cryptograms,
7+
speed guarantees for expert sudoku, "full English dictionary" (word tools use the bundled banks).
8+
-->
9+
10+
# PuzzleTide CLI
11+
12+
[![npm package](https://img.shields.io/npm/v/puzzletide?label=npm)](https://www.npmjs.com/package/puzzletide)
13+
[![Docs](https://img.shields.io/badge/docs-GitHub-24292F)](https://github.com/Caravaca-Labs/puzzletide-cli/tree/main/docs)
14+
[![Agent skills](https://img.shields.io/badge/agent_skills-SKILL.md-0F766E)](https://github.com/Caravaca-Labs/puzzletide-cli/blob/main/docs/agent-skills.md)
15+
[![License: MIT](https://img.shields.io/badge/license-MIT-green)](./LICENSE)
16+
17+
Local-first puzzle generator CLI: word search, crossword, and sudoku — with
18+
printable PDF worksheets, 1,560 themed word banks, verifiable agent evals,
19+
and bundled agent skills. From the makers of [puzzletide.com](https://puzzletide.com).
20+
21+
```sh
22+
npm install -g puzzletide
23+
ptide --version
24+
```
25+
26+
The package installs both binaries:
27+
28+
- `ptide`
29+
- `puzzletide`
30+
31+
## Why a CLI for puzzles
32+
33+
Ask a language model to write a word search and you get a grid where half the
34+
words are broken; ask it for a sudoku and you usually get one with several
35+
solutions, or none. Grids are exactly the kind of output LLMs are bad at and
36+
deterministic code is good at.
37+
38+
PuzzleTide CLI is that deterministic code, extracted from the generators that
39+
run [puzzletide.com](https://puzzletide.com):
40+
41+
- Every word search word is placed and verifiable — placement coordinates are
42+
part of the output, and the generators are property-tested.
43+
- Every generated sudoku is checked to have exactly one solution.
44+
- Every crossword is validated against its own clues before it's returned.
45+
- Same `--seed` in, same puzzle out, on any machine.
46+
47+
The package also ships `SKILL.md` agent skills, so coding agents (Pi, Hermes,
48+
OpenClaw, and other SKILL.md-based systems) reach for the CLI instead of
49+
hand-writing grids.
50+
51+
## Command model
52+
53+
```sh
54+
ptide <namespace> <operation> [input] [options] # for humans
55+
ptide run <tool-id> [input] [options] --json # canonical, for scripts/agents
56+
ptide tools list | search <q> | info <id> | docs <id>
57+
ptide agent manifest
58+
```
59+
60+
Use short commands interactively and canonical tool ids in automation:
61+
62+
```sh
63+
ptide sudoku generate --difficulty hard
64+
ptide run puzzle.sudoku.generate --difficulty hard --json
65+
```
66+
67+
## Examples
68+
69+
```sh
70+
# Word search from your own words, printed in the terminal
71+
ptide wordsearch generate --words "coral,shark,kelp,wave,tide"
72+
73+
# Themed word search as a printable PDF (puzzle page + solution page)
74+
ptide wordsearch generate --theme animals/ocean-animals --pdf ocean.pdf
75+
76+
# Crossword with your clues
77+
ptide crossword generate --words "PARIS: Capital of France; TOKYO: Capital of Japan"
78+
79+
# Sudoku: generate, solve, and check
80+
ptide sudoku generate --difficulty expert --seed 42
81+
ptide sudoku solve "53..7....6..195....98....6.8...6...34..8.3..17...2...6.6....28....419..5....8..79"
82+
ptide sudoku validate --file puzzle.txt
83+
84+
# Browse the bundled word banks
85+
ptide words themes --search dinosaur
86+
ptide words match "c_r_l" # crossword-style pattern matching
87+
ptide words anagram coral
88+
89+
# Today's puzzle
90+
ptide daily
91+
```
92+
93+
## Tool families
94+
95+
- **Word search** — 8 placement directions with easy/medium/hard presets,
96+
auto-sized grids (6–30), accent/space/hyphen normalization, word list from
97+
flags, files, or themes.
98+
- **Crossword** — interlocking placement with standard numbering, clue-grid
99+
validation, deterministic fallback clues for theme words, unplaceable words
100+
reported instead of dropped.
101+
- **Sudoku** — easy/medium/hard/expert generation with a uniqueness
102+
guarantee, instant solver, validator that reports conflicts, solvability,
103+
and solution uniqueness.
104+
- **Word banks** — 1,560 themed word lists (14,000+ unique words) across 25
105+
categories: browse, search, pattern-match, anagrams, random picks.
106+
- **Evals** — reproducible puzzle task sets graded by construction, for
107+
benchmarking models and agents (see below).
108+
- **Play** — hangman in the terminal and a shared daily sudoku.
109+
110+
Output formats everywhere: terminal text, `--json` structured data,
111+
`--svg <file>` vector images, `--pdf <file>` printable worksheets
112+
(`--paper letter|a4`, solution page included unless `--no-solution-page`).
113+
114+
## Agent skills
115+
116+
Pi can load the bundled skills directly from this npm package:
117+
118+
```sh
119+
pi install npm:puzzletide
120+
```
121+
122+
The package manifest declares:
123+
124+
```json
125+
{
126+
"pi": {
127+
"skills": ["./skills"]
128+
}
129+
}
130+
```
131+
132+
Five skills are included: word search, crossword, sudoku, printable puzzles,
133+
and agent evals. Each prefers the local CLI and checks `ptide`, `puzzletide`,
134+
then `npx puzzletide`. Skills never auto-install anything; agents should ask
135+
the user before installing.
136+
137+
## Verifiable evals for agents
138+
139+
Puzzle answers are checkable without an answer key: a sudoku answer either
140+
satisfies the rules and preserves the givens or it doesn't; a word search
141+
answer either spells the word along a straight line in the grid or it
142+
doesn't. That makes puzzles clean benchmark tasks — no LLM judge needed.
143+
144+
```sh
145+
ptide eval generate --type sudoku --n 20 --difficulty hard --seed 1 --out tasks.json
146+
# ...run your model on tasks.json, collect [{id, answer}] ...
147+
ptide eval check --tasks tasks.json --answers answers.json --json
148+
```
149+
150+
The (type, difficulty, n, seed) tuple fully determines the task set, so it
151+
names a reproducible benchmark.
152+
153+
## Library usage
154+
155+
The engines are importable TypeScript with no CLI involved:
156+
157+
```ts
158+
import { generateSudoku, generateWordSearch, wordSearchPdf } from 'puzzletide';
159+
160+
const sudoku = generateSudoku({ difficulty: 'hard', seed: 42 });
161+
const search = generateWordSearch({
162+
words: ['coral', 'shark', 'kelp'],
163+
directions: ['E', 'S', 'SE'],
164+
seed: 7,
165+
});
166+
const pdfBytes = await wordSearchPdf(search, { title: 'Ocean Animals' });
167+
```
168+
169+
More docs:
170+
171+
- [CLI commands](./docs/cli.md)
172+
- [Tool registry](./docs/registry.md)
173+
- [Agent skills](./docs/agent-skills.md)
174+
175+
## Online versions
176+
177+
Prefer a browser?
178+
179+
- [PuzzleTide word search](https://puzzletide.com/word-search)
180+
- [PuzzleTide crossword](https://puzzletide.com/crossword)
181+
- [PuzzleTide sudoku](https://puzzletide.com/sudoku)
182+
- [PuzzleTide hangman](https://puzzletide.com/hangman)
183+
- [Printable puzzles](https://puzzletide.com/printable)
184+
- [Make your own puzzle](https://puzzletide.com/maker)
185+
186+
## Privacy
187+
188+
Everything runs locally. No account, no API key, no telemetry, no network
189+
access.
190+
191+
## Development
192+
193+
```sh
194+
npm install
195+
npm run build # tsc → dist/
196+
npm test # vitest + fast-check property tests (build first: CLI tests run dist/)
197+
```
198+
199+
The bundled word banks are compiled from the puzzletide.com dataset with
200+
`npm run build:wordbanks` (maintainers only; the compiled
201+
`data/wordbanks.json` is checked in).
202+
203+
## License
204+
205+
MIT © Caravaca Labs

data/wordbanks.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

docs/agent-skills.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Agent skills
2+
3+
The npm package bundles `SKILL.md` agent skills for Pi, Hermes, OpenClaw, and
4+
other SKILL.md-based agent systems. Pi loads them straight from npm:
5+
6+
```sh
7+
pi install npm:puzzletide
8+
```
9+
10+
The package manifest declares:
11+
12+
```json
13+
{
14+
"pi": {
15+
"skills": ["./skills"]
16+
}
17+
}
18+
```
19+
20+
Each skill prefers the local CLI and checks `ptide`, `puzzletide`, then
21+
`npx puzzletide`. Skills never auto-install dependencies; agents should ask
22+
the user before installing anything.
23+
24+
## puzzletide-word-search
25+
26+
Generate word search puzzles — themed or from custom word lists, terminal or
27+
printable PDF. The core instruction to agents: never hand-write a letter
28+
grid; the CLI guarantees every word is actually findable.
29+
30+
## puzzletide-crossword
31+
32+
Generate crosswords with valid interlocking grids and standard numbering.
33+
Agents write the clues (they're good at that); the CLI builds the grid (it's
34+
good at that).
35+
36+
## puzzletide-sudoku
37+
38+
Generate sudoku with a unique-solution guarantee, solve any puzzle from its
39+
81-character string, and validate user-provided grids for conflicts and
40+
uniqueness.
41+
42+
## puzzletide-printable-puzzles
43+
44+
Print-ready PDF worksheets (puzzle + solution pages, letter or A4) for
45+
classrooms, parties, and activity packets, including multi-sheet packets via
46+
`--seed`.
47+
48+
## puzzletide-agent-evals
49+
50+
Reproducible puzzle task sets with by-construction grading — sudoku answers
51+
are verified against the rules and givens, word search answers against the
52+
grid — for benchmarking models and agents without an LLM judge.
53+
54+
## Skill layout
55+
56+
```
57+
skills/
58+
puzzletide-word-search/SKILL.md
59+
puzzletide-crossword/SKILL.md
60+
puzzletide-sudoku/SKILL.md
61+
puzzletide-printable-puzzles/SKILL.md
62+
puzzletide-agent-evals/SKILL.md
63+
```
64+
65+
The frontmatter carries `openclaw` and `hermes` metadata (tags, required
66+
binaries, install hints) alongside the standard name/description fields.

0 commit comments

Comments
 (0)