chess-best-move

Detect chess pieces from board images and compute best moves with Stockfish.

127|27|Updated Mar 27, 2026
One-click install
npx skills add https://github.com/lazyFrogLOL/Harness_Engineering --skill chess-best-move-lazyfroglol
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: chess-best-move
Source: https://github.com/lazyFrogLOL/Harness_Engineering/tree/main/skills/chess-best-move
Command: npx skills add https://github.com/lazyFrogLOL/Harness_Engineering --skill chess-best-move-lazyfroglol

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill guides an agent to reliably extract a chess position from a photographic or scanned board image, validate the detected position for legality, and determine the optimal or forced moves using a chess engine without guessing when image detection is unreliable.

Core Features & Use Cases

  • Calibrate image-specific color signatures for board squares and piece colors to minimize false detections.
  • Detect an 8x8 grid, determine square occupancy, and produce a human-readable debug representation for incremental verification.
  • Validate detected positions with strict rules (exactly one king per side, pawn and piece count limits, total pieces ≤32) and decline to proceed on invalid detections.
  • Load validated positions into a UCI chess engine (e.g., Stockfish via python-chess) to compute best moves, verify legality, and confirm mate sequences.
  • Use case: turn a user-supplied photo of a tournament board into a verified move suggestion or request FEN/clarification when detection fails.

Quick Start

Provide the board image and ask the assistant to detect pieces, validate the position, and return the best legal move with verification.

Frequently Asked Questions about chess-best-move

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find the best chess move from a board image?

To find the best chess move from a board image, the Skill analyzes the photo to detect an 8x8 grid, calibrates piece colors, validates the position legality, and uses the Stockfish UCI engine to compute the optimal move.

How does image analysis work for detecting chess pieces and generating a FEN?

Image analysis for chess piece detection works by calibrating specific color signatures for board squares and pieces, determining square occupancy across an 8x8 grid, and validating the position to generate an accurate FEN representation.

Can I use this to verify if a detected chess position is legal before asking Stockfish?

Yes, you can verify if a detected chess position is legal because the Skill applies strict validation rules, checking for exactly one king per side, pawn count limits, and a maximum of 32 total pieces before loading the position into a UCI chess engine.

What happens if piece detection fails on my photographic chessboard image?

If piece detection fails on a photographic chessboard image, the Skill declines to proceed on invalid detections and will request FEN input or clarification from the user instead of guessing the position.

Does this Skill support checkmate detection and forced move sequences?

Yes, the Skill supports checkmate detection and forced move sequences by loading validated chess positions into a UCI engine like Stockfish to compute best moves, verify legality, and confirm mate sequences.

What is the best way to analyze tactical chess puzzles from scanned board images?

The best way to analyze tactical chess puzzles from scanned images is to apply calibrated color sampling and grid detection to extract the position, validate piece counts, and compute the optimal move using a UCI chess engine.