You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: skills/introduce-puzzmo-sdk/SKILL.md
+19-4Lines changed: 19 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,7 +62,21 @@ Add the `@puzzmo/sdk` package and wire up the game lifecycle.
62
62
63
63
5. Wire up state saving - call `sdk.updateGameState(stateString)` whenever the game state changes so the host can save progress.
64
64
65
-
6. Create a `sample-puzzle.json` file with test puzzle data that matches what the game expects.
65
+
6. Create puzzle fixture files for local testing. Make a `fixtures/puzzles/` directory and add a few different puzzle JSON files that exercise different aspects of the game:
66
+
67
+
```
68
+
fixtures/puzzles/
69
+
easy/
70
+
small-grid.json
71
+
basic.json
72
+
hard/
73
+
large-grid.json
74
+
tricky.json
75
+
```
76
+
77
+
Each JSON file should contain puzzle data in the format the game expects. Try to create at least 2-3 puzzles with different characteristics (e.g. varying difficulty, size, or edge cases) so the game can be tested against realistic variety.
78
+
79
+
If the original game already has a few puzzles hardcoded, use those as a starting point for creating the fixture files. Then delete the buttons which may have been used to load them, since the simulator will handle loading puzzles from the fixtures.
66
80
67
81
7. Set up the dev simulator for local testing. Add the Vite plugin to `vite.config.ts`:
68
82
@@ -74,21 +88,22 @@ Add the `@puzzmo/sdk` package and wire up the game lifecycle.
74
88
plugins: [
75
89
puzzmoSimulator({
76
90
slug: "my-game",
77
-
puzzlePath: "./sample-puzzle.json",
91
+
fixturesGlob: "./fixtures/puzzles/**/*.json",
78
92
}),
79
93
],
80
94
})
81
95
```
82
96
83
97
The plugin automatically:
84
98
- Injects the simulator UI in dev mode only (tree-shaken from production builds)
99
+
- Loads fixtures from the glob pattern, organized by folder as categories
85
100
- Handles OAuth callback routing for authenticated API features
86
101
87
102
For non-Vite setups, load the SDK and simulator from jsDelivr:
0 commit comments