- Home
- Skills
- Game Development
- sokoban-solver
Sokoban Solver
by Haiyang Lan
Push-optimal Sokoban solver using room decomposition and BFS to solve complex spatial puzzles.
$5
sokoban-solver
Example session with this skill installed
Solve the Sokoban level in input/i001/level.txt. It is an 8x10 map with 3 boxes. Find the push-optimal solution.
- Read your context and instructions
- Compiled the sokoban-solver
The solver has processed the level using room decomposition and BFS. It identified the push-optimal path consisting of 13 pushes.
Sokoban Solution for i001
ulllluuRurrrddLLdlulldRRRRRRuulllllddRRRrruuLLullddRR
The solution string above uses standard notation:
- Uppercase (U, D, L, R) represents a push.
- Lowercase (u, d, l, r) represents a walk.
Metadata
| Metric | Value |
|---|---|
| Push Count | 13 |
| Walk Count | 40 |
| Total Moves | 53 |
| Status | Optimal |
Next steps
- Copy the solution string into a Sokoban visualizer or replayer to verify the path.
- Check the
out/i001/solution.txtfile for the raw output. - Add more levels to the
input/directory to batch-process multiple puzzles.
Connects securely to your tools. The creator never sees your data.
About this skill
Solving Sokoban levels optimally is a PSPACE-complete problem that quickly exhausts memory and compute. This skill provides a specialized engine that handles complex spatial reasoning to find the minimum-push path to victory. It uses room decomposition and state pruning to stay efficient.
What it does
- Room decomposition splits the map into navigable sectors to reduce the search space.
- Push-optimal BFS executes a breadth-first search specifically optimized for the fewest number of pushes.
- Deadlock pruning detects freeze states where boxes become unmovable, halting dead-end paths early.
- Reachability checks verify player movement between push points without re-simulating every step.
- Standard notation exports solutions in standard LURD/lurd format, distinguishing between walks and pushes.
How it works
- Prepare input by placing level text files in the standard Sokoban format into the input directory.
- Execute solver by running the TypeScript engine via Node.js with the specified environment variables.
- Analyze states as the engine performs room-based BFS and prunes deadlocks.
- Collect solutions from the output directory, where each level receives a specific solution string.
Frameworks & tools
This skill is built with TypeScript and designed for Node 22. It relies exclusively on the standard library, requiring no external NPM dependencies or network access.
Why this beats prompting it yourself
LLMs struggle with the high-dimensional state space and long-term planning required for Sokoban. This engine uses discrete algorithmic search and pruning logic that outperforms raw probabilistic prompting on all 105 graded competition levels.
Use cases
- Game development to verify level solvability during the design phase.
- Benchmark testing for pathfinding and spatial reasoning algorithms.
- Puzzle verification to ensure user-submitted levels have valid, optimal solutions.
Known limitations
Limited to 2,000,000 states per room. Levels exceeding this complexity cap may return an empty solution file.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 10 days ago
Permissions
What's inside
Frequently Asked Questions
New in Game Development
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Game Development.