PocketGrandmaster — The 4 KB Chess Engine

    by Xue Cheng

    1

    A lightweight, 4KB dependency-free Python chess engine for move calculation, legal move generation, and mate detection.

    $19

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    PocketGrandmaster — The 4 KB Chess Engine

    Example session with this skill installed

    Get the best move for this position: 6k1/5ppp/8/8/8/8/8/R6K w - - 0 1. Also tell me if it is checkmate.

    • Read your context and instructions
    • Compiled the pocketgrandmaster

    I have evaluated the position provided in the FEN string. The engine searched 120,000 nodes to find the optimal move and checked for checkmate status.

    Chess Analysis: 6k1/5ppp/8/8/8/8/8/R6K w - - 0 1

    MetricValue
    Best Move (UCI)a1a8
    Move DescriptionRook from a1 to a8
    StatusCheckmate
    Side to MoveWhite (w)
    Engine Strength~1300 Elo (Casual/Club)

    The engine identified a forced mate-in-1. Because the black king has no legal squares and is under direct attack by the white rook on a8, the game is over.

    Next steps

    1. Apply the move a1a8 to your board state to finalize the game.
    2. Use python3 scripts/chess.py legal "6k1/5ppp/8/8/8/8/8/R6K w - - 0 1" to see all possible moves before the mate.
    3. Reset the board to startpos to begin a new match.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    A tiny, readable Python chess engine you can embed anywhere. Negamax alpha-beta search with quiescence, a transposition table, null-move pruning and killer-move ordering under a fixed 120,000-node budget. Give it a FEN and it returns a best move; also speaks a UCI subset (uci / isready / position / go / quit) and ships a self-checking demo that finds real mating moves. Honest strength: roughly 1250–1350 Elo — built for teaching, prototyping and embedding, not for beating grandmasters. Pure Python, no dependencies, no network calls.

    1250-1350 Elo strength. No opening/endgame databases. UCI subset lacks time controls and pondering. No support for pawn structure or king-safety evaluation terms.

    How to use

    1. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 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 5 days ago

    Software
    Python

    Permissions

    Terminal / Shell
    Write Files
    Listed5 days ago

    What's inside

    Creator

    Xue Cheng

    Xue Cheng

    5 skills on Agensi

    Frequently Asked Questions

    Unlike LLMs which often hallucinate illegal moves, Pocketgrandmaster uses a deterministic alpha-beta search algorithm to ensure every move is 100% legal and strategically sound according to standard chess rules.

    The skill is high-performance because it is dependency-free; it requires only Python 3.9+ and uses zero external libraries, making it compatible with almost any AI agent or environment that supports Python.

    You receive the complete, single-file Python module (under 4KB) which includes the engine logic, move generator, and UCI-compatible interface, ready for immediate integration.

    The engine plays at a casual club level (approximately 1250-1350 Elo), making it an ideal opponent for most human players or for validating puzzle logic in applications.

    Yes, because it communicates using a subset of the standard Universal Chess Interface (UCI) protocol, you can easily hook it up to external chess GUIs or testing harnesses.

    Pocketgrandmaster supports standard FEN (Forsyth-Edwards Notation) for input and UCI coordinate notation (e.g., 'e2e4') for output, ensuring compatibility with most chess data standards.

    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.