Install
openclaw skills install go-next-moveAnalyze a Go/Weiqi position from an image or board state, use KataGo to recommend the next move at beginner, intermediate, or advanced playing strength. Use when the user asks where black or white should play next, wants a move matched to an opponent's level, or wants AI-assisted handicap-like balancing without changing the board.
openclaw skills install go-next-moveThis skill is being built as a separate move-selection layer from count-go-black-stones.
The intended workflow is:
KataGo is installed through Homebrew and verified on this machine:
katago version
Expected important line:
Using Metal backend
Use this project config after KataGo's bundled GTP config:
katago gtp \
-model /opt/homebrew/share/katago/g170e-b20c256x2-s5303129600-d1228401921.bin.gz \
-config /opt/homebrew/share/katago/configs/gtp_example.cfg \
-config katago/gtp_skill.cfg
Set komi through GTP, not the config file:
boardsize 19
komi 7.5
clear_board
genmove b
For scripted next-move analysis, prefer the JSON analysis engine:
python3 scripts/next_move.py /path/to/board.jpg \
--input image \
--side-to-move black \
--level intermediate \
--visits 400 \
--overlay /tmp/go-next-overlay.jpg \
--source-overlay /tmp/go-source-overlay.jpg \
--source-result-image /tmp/go-source-result.jpg \
--result-image /tmp/go-next-result.jpg
For photo input, the default user-facing image should be the combined original-photo result. It marks existing white stones with black W, existing black stones with white B, and the recommended move as a numbered stone so the user can compare the recognition against the real board at a glance. Use --result-image only when you explicitly want the clean warped-board rendering with a red ring/dot.
Use --source-overlay for user-facing recognition verification. It marks detected stones on the original photo. --overlay is a warped/cropped board view for debugging and may not look like the original photo.
For photo input, the tool should surface the combined original-photo result by default. It is the verification/result image: existing white stones are marked with black W, existing black stones are marked with white B, and the recommended move is drawn as a new stone with the numbered label 1. This makes recognition mistakes easier to spot and leaves room for future multi-step labels. Use --result-image only when you explicitly want the clean warped-board rendering.
For an already recognized board:
python3 scripts/next_move.py /path/to/board_ascii.txt \
--input ascii \
--side-to-move white \
--level beginner
board_ascii is 19 rows of 19 characters:
X or B: black stoneO or W: white stone.: empty pointThe script returns JSON containing:
board_asciirecommendationreasonrecommendations_by_levelcandidate_movesroot_inforesult_image when --result-image is passedsource_result_image for photo input, or optional source_result_image when --source-result-image is passed explicitlyrecognition metadata when input is an imageThe level controls move strength, not explanation depth.
Use --level all when the caller wants all three recommendations at once. Use recommendation for the selected level and recommendations_by_level to compare the three outputs.
The current script chooses levels by candidate rank plus score/winrate loss from KataGo's best move. These thresholds are a practical first pass, not calibrated ranks. The next improvement should tune them with real game examples.
When answering a user, include:
source_result_image for photo input, or result_image for ASCII input.reason.summary plus the bullet-like items in reason.explanation.reason.technical_parameters, especially winrate, score lead, visits, score loss vs best, and PV.reason.comparison_candidates when there are meaningful alternatives.recognition.source_overlay image when available.Do not only return the coordinate. The user-facing answer should always include enough engine data to audit the recommendation: winrate, score lead, visits, and whether the chosen move is the top KataGo move or a deliberately softer level-based move.
Do not invent tactical explanations that are not supported by KataGo data or visible board context. If recognition looks wrong, say the recommendation is not reliable until the board is corrected.