Skip to content
Back to skills

Fog Of Chess Engine Mode Implementation

ASecurity

Implement a new engineMode variant end-to-end in Fog of Chess — types, UCI bridge, adapter, server polling, REST endpoint, and UI panel — following the validator mode pattern.

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added October 1, 2026
ai-agentsapi

Works with

  • cli
  • api

Security analysis

A100/100

Scanned October 1, 2026

npx -y skills add williamblair333/Uncle-J-s-Refinery --skill fog-of-chess-engine-mode-implementation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Fog Of Chess Engine Mode Implementation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Fog Of Chess Engine Mode Implementation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/williamblair333-fog-of-chess-engine-mode-implementation/badge)](https://www.skillsdirectory.com/skills/williamblair333-fog-of-chess-engine-mode-implementation)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md

---
name: fog-of-chess-engine-mode-implementation
description: Implement a new engineMode variant end-to-end in Fog of Chess — types, UCI bridge, adapter, server polling, REST endpoint, and UI panel — following the validator mode pattern.
---

## When to use

When adding a new `engineMode` to the Fog of Chess platform that requires:
- A new UCI score/analysis pipeline
- Server-side game state annotation
- A REST endpoint for per-game analysis
- A new UI panel in `GameEndPhase`
- A new option in the `Lobby` dropdown

## Key steps demonstrated

### 1. Verify handoff claims before starting
Run `/verify-handoff-claims` against the TODO list. Check `types.ts`, `config.ts`, `server.ts`, and `game.ts` to confirm what is actually wired vs. merely declared.

### 2. Orient with jCodeMunch
get_repo_outline          # overall structure
get_file_outline server.ts  # polling loop location
get_file_outline uci.ts     # existing UCI bridge surface
get_file_outline adapter.ts # adapter class methods

### 3. Layer the implementation bottom-up

**types.ts** — add the new mode literal to `EngineMode` union and any new annotation/result types (e.g. `MoveAnnotation`).

**uci.ts** — add score parsing to the `info` line handler; add a `scoredResolve` slot and a new `getBestMoveWithScore()` method that resolves `{ move, score }` instead of just `move`.

**adapter.ts** — add `evaluatePosition(fen, timeMs)` that calls `getBestMoveWithScore` and returns the score; close over the UCI instance.

**server.ts** (four touch-points):
1. Import new annotation type
2. Add tracking maps (e.g. `validatorAnnotations`, `analysisInProgress`) after existing AI tracking constants
3. Add a `GET /api/analysis/:matchID` endpoint before the replay endpoint
4. In the polling loop:
   - Persist annotations before `continue` on ended games
   - Inject the new mode branch before the existing drafting-phase block

**GameEndPhase.tsx** — add `useState` for analysis fetch + `useEffect` to `GET /api/analysis/:matchID`; render a collapsible panel listing annotated moves.

**GameEndPhase.css** — add panel styles (`.analysis-panel`, `.blunder`, `.inaccuracy` highlight classes).

**Lobby.tsx** (two touch-points):
1. Add the new `<option>` to the engine mode `<select>`
2. Conditionally hide depth slider (analysis runs at fixed time) and show the Black join link (both players are human)

### 4. Type-check both workspaces
cd /opt/proj/proj-fog-of-chess && npx tsc --noEmit
cd /opt/proj/proj-fog-of-chess/client && npx tsc --noEmit

### 5. Index changed files
After edits, call `index_file` on every modified file to keep jCodeMunch current.

## Files touched (validator mode reference)
- `src/types.ts` — mode literal + annotation types
- `src/engine/uci.ts` — score parsing + `getBestMoveWithScore`
- `src/engine/adapter.ts` — `evaluatePosition`
- `src/server.ts` — maps, REST endpoint, polling loop branches
- `client/src/components/GameEndPhase.tsx` — analysis panel
- `client/src/components/GameEndPhase.css` — panel styles
- `client/src/components/Lobby.tsx` — mode select + conditional UI

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.