|
| 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 | +[](https://www.npmjs.com/package/puzzletide) |
| 13 | +[](https://github.com/Caravaca-Labs/puzzletide-cli/tree/main/docs) |
| 14 | +[](https://github.com/Caravaca-Labs/puzzletide-cli/blob/main/docs/agent-skills.md) |
| 15 | +[](./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 |
0 commit comments