Show HN: 一个用于分析国际象棋对局的 Claude Code 技能
Show HN: A Claude Code skill to analyze your chess games

原始链接: https://github.com/brumar/chess-postmortem-skills

本项目利用“Claude Code”将标准的国际象棋引擎数据转化为高质量、个性化的赛后复盘。与仅提供原始数据和复杂变例的传统 Stockfish 分析不同,该系统让 Claude 充当人类教练。它通过自然语言向引擎提问,以解释招法背后的“原因”,且至关重要的是,它会反驳你实际的思考过程,而非仅仅推测你的意图。 若要使用,请提供 Lichess 对局链接,并可选择上传你在对局过程中“大声思考”的录音。系统会自动转录音频,将其与走棋时间对齐,并生成以下内容: * **注释版 PGN:** 针对你的棋力水平量身定制的人类可读解析。 * **交互式 HTML 棋盘:** 用于更深入地探索局面。 * **解说视频:** 包含语音解说和引擎验证分析的完整对局复盘视频。 **适用人群:** 适合希望通过对快棋或慢棋进行深度反思来提升棋力的棋手。每局棋的处理时间约为一小时,因此不适合快速超快棋检查,但非常适合深入研究。你可以通过 GitHub 安装相关技能,让 Claude 自动完成分析、视频渲染及深度调查。

一位开发者(brumar)分享了一项名为“Claude Code”的技能,它将 Claude 与 Stockfish 国际象棋引擎相结合,用于提供个性化的棋局分析。用户可以通过文本或实时语音笔记输入棋局,系统随后会生成一段带有旁白和注释的视频。 该项目旨在通过反思玩家自身的思考过程,使棋局复盘比传统的引擎分析更具吸引力和记忆点。尽管作者承认该工具成本较高(每次约 15 美元)且并不完美,但他们强调了其作为学习辅助工具的价值,即挑战用户的判断。 Hacker News 上的讨论呈现出褒贬不一的评价: * **实用性:** 一些用户认为将大语言模型(LLM)用于棋局解说是很有前景的。他们指出,虽然大语言模型在独立“对弈”方面表现不佳,但能够整合引擎数据来解释战略主题。 * **质疑:** 批评者质疑基于大语言模型的教练系统的有效性,指出大语言模型经常产生“幻觉”,且真正的水平提升需要深度、高认知负荷的学习。另一些人则认为该项目过度依赖人工智能生成的提示词,并批评其性价比过低。 总的来说,该项目被视为一个功能性的概念验证,旨在通过人工智能驱动的定性反馈来增强国际象棋的学习体验。
相关文章

原文

Claude Code skills that turn one of your chess games into a post-mortem you can actually read: plain-language explanations of your mistakes, checked against Stockfish, and a narrated video of the whole game.

out-010.mp4

If the player above does not load (it needs a GitHub login), watch the mp4 directly (10 MB).

6:49, English narration, subtitles.

This is a real game of mine: a 15+10 rapid on lichess (5KmlrdyT), White, Open Sicilian against a Najdorf, around 1700. During the game I recorded myself thinking aloud, in French, with a plain voice recorder running next to the board. After the game I gave Claude two things: the lichess link and the mp3.

Claude transcribed the audio locally with whisper.cpp, then used the clock times in the PGN to match each sentence to the move I was deciding at that moment. So when the video says "at move eight you asked yourself whether the bishop belongs on c4 or e2", that is my own question, answered with the engine. Everything the video shows (the transcript, the Stockfish sweep, the annotated PGN, the storyboard) is in examples/game-010/.

A Stockfish analysis gives you numbers and lines. It is not fun to read, and often it does not tell you why: -1.8 after your move, and a 12-move variation you would never find at the board.

I realized Claude can drive Stockfish itself. It asks the engine the questions a human would ask ("why not the move I played?", "what if Black simply takes?"), keeps asking until the answer makes sense, and writes it down in human terms. And since it knows what I was thinking during the game, it can refute my actual reasoning instead of a guessed one. After the analysis I can keep asking my own questions about any position, and it checks them with the engine before answering.

Probably yes if:

  • you play slow or rapid games and want to learn from them, not just see where the eval bar dropped;
  • you are fine running Claude Code on your machine;
  • you are willing to take notes or talk during the game (optional, but this is what makes the result interesting).

Probably not if you want a quick check of a blitz game. Lichess or chess.com analysis does that in seconds.

It takes time. A full run (sweep, investigations, annotations, video) takes around one hour of processing. Use it on games where you took the time to think, not on every game you play.

Give it your thoughts. I strongly recommend passing your written notes or an audio recording covering the whole game. Without them you get a good engine explanation. With them you get a review of your reasoning: which fears were justified, which plans were sound, which questions you asked yourself and what the answer was.

Hallucinations. The AI can still get something wrong. Every claim is checked against Stockfish and a verifier pass re-reads the result, so in my experience errors are rare. If something looks off, ask Claude to check that position with the engine.

  1. Play a game with some time to think (15+10 rapid, or correspondence).
  2. Record myself thinking aloud during the game (any phone or web voice recorder). For correspondence games, I write notes per move instead.
  3. After the game, open Claude Code and say something like: "analyze this game: , here is my think-aloud recording: ".
  4. Wait about an hour. I get an annotated PGN and a standalone HTML analysis board.
  5. Ask for the video: "make a video of this game".
  6. Read, watch, then ask questions about the positions I still do not understand.
skill what it does
chess-analysis Stockfish sweep of every move, then parallel "investigator" subagents that interrogate the engine with naive questions until every mistake is explained. Output: a layered annotated PGN, a standalone HTML analysis board, and one "plan pause" per game where both sides' plans are derived from the engine. Handles the think-aloud recording: whisper.cpp transcription, alignment to moves via the PGN clocks.
chess-video A narrated video of the whole game (board, arrows, eval gauge, piper TTS, burned-in subtitles) built from a storyboard, plus an interactive HTML viewer.
chess-play Play a game against Claude over PGN files, with the board rendered to PNG for vision and adversarial blunder-check subagents. No engine.

The skills are written for Claude to read, so the SKILL.md files double as the documentation. Start with skills/chess-analysis/SKILL.md.

Copy (or symlink) the skill folders into .claude/skills/ of your project, or into ~/.claude/skills/ for all projects:

git clone https://github.com/brumar/chess-postmortem-skills
cp -r chess-postmortem-skills/skills/* ~/.claude/skills/

Then ask Claude something like "analyze this game: " or "make a video of game 010".

You do not need to set these up by hand. Claude Code can most likely install them for you: ask it to "install the dependencies for the chess skills" and it will read the list below and the SKILL.md files.

  • Python venv with python-chess, cairosvg (analysis), plus pillow, piper-tts for the video. The skills assume a .venv-chess at the repo root and create it if missing.
  • Stockfish. scripts/get_stockfish.sh uses $STOCKFISH or the one on PATH, else downloads the official Linux binary.
  • For video: ffmpeg, and a piper voice (download command in chess-video/SKILL.md).
  • Optional: whisper.cpp for think-aloud transcription.

Game files live in a chess-games/ folder at the root of the project you run Claude in (games/, boards/, video/).

Every comment is pitched at a reader level (audience.level in annotations.json). For your own games, tell Claude your level once and make it stick, for example in your CLAUDE.md:

My lichess handle is <handle>. Write chess analysis for a 1800 player.

Without it, the skill uses the PGN's Elo for the reviewed side and asks when that is missing or provisional.

file stage
games/010-...pgn input, as exported from lichess
games/010-transcript-fr.md think-aloud transcript, whisper.cpp, clock-aligned per ply
games/010-...-sweep.json per-ply Stockfish evals (depth 22)
games/010-frag-*.json annotation fragments returned by each investigator / the plan pause / the brief-comment pass
games/010-analysis-*.json engine lines each investigator discovered (query.py --log sidecars)
games/010-assemble.py, 010-annotations.json fragments merged into the build spec
games/010-...-annotated.pgn the deliverable of stage 2
games/010-...-viewer.html standalone analysis board, open it in a browser
video/storyboard-010.json storyboard for stage 3
video/out-010.mp4, .srt, .html the narrated video (6:49), subtitles, and annotation viewer

To regenerate the video, download the piper voice into examples/game-010/video/voices/ and run make_video.py on the storyboard.

MIT, except the vendored chess.js (BSD 2-Clause) and the cburnett piece set (CC BY-SA / GFDL). See LICENSE.

联系我们 contact @ memedata.com