- Home
- Skills
- Game Development
- Rubik's Cube Solver — Near-Optimal 3x3 Solutions
More screenshots
Works with the AI Agents you already use
Rubik's Cube Solver — Near-Optimal 3x3 Solutions
by 悲观
Two extra passes squeeze out extra moves on hard cubes.
$19
What it does
- Solves any valid 3x3 cube state given as a 54-character facelet string (Kociemba order U,R,F,D,L,B) and return
- Runs a three-pass search — min2phase-style two-phase solving, an inverse-problem improvement pass, and a shard
- Solves one cube from the command line or whole batches from a directory layout, writing one solution file per
- Verifies every solution it writes by replaying it against the input state, and ships an independent verifier s
- Includes a seeded scramble generator for reproducible testing, full algorithm documentation, and worked exampl
Who it's for
Speedcubers and puzzle enthusiasts
Short, trustworthy solutions for scrambles and practice states.
Try asking: “Solve this cube: FRDFURDUURBRURDUDBLRFBFLBDBLLLDDFBURLUFFLLURDFFUBBLDBR”
Developers building cube, puzzle or game features
A dependable solver component for their projects.
Try asking: “I have a list of cube facelet strings. Can you solve them all and verify the results?”
Students and educators
A real demonstration of two-phase search, pruning tables and symmetry reduction on a real problem.
Try asking: “Give me a 25-move scramble and then show me the solution.”
Agent and tooling builders
A deterministic, offline solver their workflows can call.
Try asking: “Solve this cube offline and verify the solution by replay.”
Rubik's Cube Solver — Near-Optimal 3x3 Solutions
Example session with this skill installed
Solve this cube: FRDFURDUURBRURDUDBLRFBFLBDBLLLDDFBURLUFFLLURDFFUBBLDBR
- Read your context and instructions
- Compiled the rubik s cube
F' D2 F2 L U' B' R2 D L2 B' F2 R2 U L2 B2 U' F U2 — 18 moves (HTM), verified by replay: applying the solution to the scrambled state restores the solved cube exactly.
Connects securely to your tools. The creator never sees your data.
About this skill
Rubik's Cube Solver takes a scrambled 3x3 cube as a 54-character facelet string — the format used across the cubing ecosystem — and returns a short solution in standard Singmaster notation (half-turn metric). It is built around an original implementation of the classic two-phase approach: phase 1 drives the cube into the G1 subgroup (orientation solved, slice edges placed), phase 2 finishes the permutation using only the ten moves that preserve G1. Six conjugate frames, three-axis pruning and five pruning tables keep the search fast; symmetry reduction (twist 2187→324 classes, flip 2048→336, corner permutation 40320→2768) keeps the tables small. Two extra passes squeeze out extra moves on hard cubes. If the two-phase result is 19 moves or longer, the solver attacks the inverse cube with a tightened budget and keeps any strictly shorter, replay-verified improvement. If the result is still 18 or longer, a sharded deep search — blocks keyed by phase-1 length, conjugate frame and first pre-move, scheduled cheapest-first under a fixed 70M-node budget — hunts for one more move. Everything is deterministic: all budgets are fixed counters, never clocks, so the same input always produces byte-identical output. Every solution is verified by replay before it is written, and the package includes the verifier, a seeded scramble generator, three worked examples with real outputs, and full documentation of the algorithm and the I/O format. Zero dependencies, no network access, runs anywhere Node.js 22 runs.
Near-optimal, not proven optimal: the search is budgeted and does not prove no shorter solution exists.
Worst-case runtime is budget-bound: a hard cube can take tens of seconds on a slow or shared CPU while the deep-search pass spends its fixed node budget.
3x3 only; solutions are HTM only (no QTM or slice-move notation).
Input must be a physically reachable cube state; the solver assumes valid facelet strings.
Requires Node.js 22.18+ (erasable-syntax TypeScript, executed directly by Node; standard library only). Entry points: scripts/main.ts (batch: reads <input>/<id>/cube.txt, writes <output>/<id>/solution.txt; directories via RUBIK_INPUT_DIR / RUBIK_OUTPUT_DIR), scripts/solve.ts (single cube), scripts/verify.ts (replay verification), scripts/scramble.ts (seeded scramble generator). Tools used: Terminal/Shell, Read Files, Write Files. Typical runtime: ~1–3 s for easy/medium cubes; hard cubes that trigger the deep-search pass can take tens of seconds on a slow core (budget is node-count based).
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 2 days ago
- Software
Node.js 22.18+
Permissions
What's inside
Creator
悲观
2 skills on Agensi
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.