Fast procedural Rubik's cube solver that requests photos, converts them to cube state string, and uses Python scripts to generate step-by-step solutions.
Before using this skill, ensure the required libraries are installed:
pip3 install kociemba
If the solver returns a dependency error during execution, install missing packages at that time.
Follow these steps in order. Each step contains all required information.
Request exactly 6 photos from the user, one of each cube face IN THIS SPECIFIC ORDER with correct orientation.
Photos must be in JPEG or PNG format.
Display the text visualization for each requested face photo.
Instructions for User:
Photo 1: White face (center) - Hold cube with BLUE on top
(Blue on top)
? ? ?
? W ?
? ? ?
Photo 2: Orange face (center) - Hold cube with WHITE on top
(White on top)
? ? ?
? O ?
? ? ?
Photo 3: Green face (center) - Hold cube with WHITE on top
(White on top)
? ? ?
? G ?
? ? ?
Photo 4: Red face (center) - Hold cube with WHITE on top
(White on top)
? ? ?
? R ?
? ? ?
Photo 5: Blue face (center) - Hold cube with WHITE on top
(White on top)
? ? ?
? B ?
? ? ?
Photo 6: Yellow face (center) - Hold cube with GREEN on top
(Green on top)
? ? ?
? Y ?
? ? ?
For each photo, analyze the colors and run the validation script. Don't show validation output to the user until all 6 faces are processed. Once all 6 faces are validated, show the user a single visualization for confirmation.
Reading Order for Each Face (left-to-right, top-to-bottom):
1 2 3
4 5 6
7 8 9
Color codes to use:
For each photo:
Analyze the photo: Read the 9 stickers in order (left-to-right, top-to-bottom) and create a 9-character string
Validate silently using the script to cache the face:
python3 scripts/solve_cube.py validate <9-char-color-string>
python3 scripts/solve_cube.py validate WWGWWBRRRIf validation fails (format error), re-check your color reading and try again
Continue until all 6 faces are validated
After all 6 faces are validated:
Render the complete cube state for user review:
python3 scripts/solve_cube.py render
Show the visualization and ask user for confirmation: Display the markdown output from the render command, then ask:
"Please review the cube state above. Does this match your physical cube?
After asking, STOP and wait for the user's next message:
If user reports corrections:
python3 scripts/solve_cube.py validate <corrected-9-char-color-string>python3 scripts/solve_cube.py renderNote: While you should request photos in the order specified in Step 1, the validation script automatically detects each face from its center color, so you can process them in any order during validation.
Once all 6 faces are validated and cached:
Concatenate faces: python3 scripts/solve_cube.py concat
Solve the cube: python3 scripts/solve_cube.py solve <54-character-string>
If solve fails:
If the solve command in Step 3 fails, review the cube state with the user to identify and correct errors:
Render the current cube state for visual review:
python3 scripts/solve_cube.py render
Ask the user: "Here's the current cube state. Please review and tell me any corrections needed:
[Show the markdown output]
Reference corrections by face and position number (e.g., 'U3 should be Red', 'F5 should be Blue')."
If user reports corrections:
python3 scripts/solve_cube.py validate <corrected-9-char-color-string>python3 scripts/solve_cube.py renderAfter making all corrections:
python3 scripts/solve_cube.py concatpython3 scripts/solve_cube.py solve <54-character-string>If still failing after corrections:
python3 scripts/solve_cube.py clear to clear the cacheOnce the solve succeeds in Step 3, present the solution to the user.
The solve command outputs:
Simply pass the solution output to the user. Example format:
SOLUTION:
Raw moves: R U R' F2 D' L2
SETUP: Hold cube with WHITE face on top and GREEN face toward you
Step 1: Turn RIGHT face clockwise 90° [R]
Step 2: Turn TOP face clockwise 90° [U]
Step 3: Turn RIGHT face counterclockwise 90° [R']
Step 4: Turn FRONT face 180° (either direction works) [F2]
Step 5: Turn BOTTOM face counterclockwise 90° [D']
Step 6: Turn LEFT face 180° (either direction works) [L2]
User can:
Clean up and return control:
If you need to start over:
python3 scripts/solve_cube.py clearFace validation errors
Concatenation errors
clear command if you need to start over"Unable to solve cube" errors
"Invalid cube configuration" errors
Repeated failures after 2-3 attempts
# Validate a face (script auto-detects which face from center color)
python3 scripts/solve_cube.py validate <9-char-color-string>
# Concatenate all cached faces into 54-char string
python3 scripts/solve_cube.py concat
# Render markdown visualization (from cached faces)
python3 scripts/solve_cube.py render
# Render markdown visualization (from specific cube string)
python3 scripts/solve_cube.py render <54-char-string>
# Solve from 54-character string
python3 scripts/solve_cube.py solve <54-char-string>
# Translate solution moves to friendly instructions
python3 scripts/solve_cube.py translate <solution-string>
# Clear all cached faces
python3 scripts/solve_cube.py clear