Skip to content

Commit faaf2cd

Browse files
committed
feat: Chess AI enhancements + AI safety improvements
Chess Engine Enhancements: - Counter-Move Heuristic for better move ordering - Static Exchange Evaluation (SEE) in quiescence search - Gaussian noise difficulty scaling for more natural play - Multi-PV analysis support - Pondering implementation with ponder hit detection - Opening book expansion to 90+ named openings - Counter-move statistics tracking - Endgame tablebases interface (ChessEndgame.ts) - Comprehensive Chess unit tests (37 tests) AI Agent Safety: - Pre-flight safety check detects VS Code terminal, shows instructions, exits safely - Signal file now includes timestamp (30s TTL) to prevent stale agent detection - State file staleness check on startup (60s TTL) handles forced terminal closes - Updated copilot-instructions.md with critical warning at top - Added .vscode/settings.json with Copilot instructions - Updated README.md and LIKU-CORE.md with AI warnings - clearAgentSignal() called on app exit
1 parent 786017f commit faaf2cd

28 files changed

+3058
-286
lines changed

.github/copilot-instructions.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# LikuBuddy - GitHub Copilot Coding Agent Instructions
22

3+
## ⛔ CRITICAL: READ BEFORE ANY ACTION
4+
5+
> **DO NOT run `npm start` or `node dist/index.js` in this terminal!**
6+
>
7+
> This is a TUI application that will **hang your IDE** if run inline.
8+
>
9+
> **To play games (Chess, Snake, etc.):**
10+
> 1. **READ FIRST:** [LIKU-CORE.md](../LIKU-CORE.md) - Required setup & launch instructions
11+
> 2. **THEN READ:** Game-specific docs in `docs/ai/` (e.g., `LIKU-CHESS.md`)
12+
>
13+
> The game MUST run in a **separate terminal window**, not in VS Code's integrated terminal.
14+
> See LIKU-CORE.md for the correct `Start-Process` command.
15+
16+
---
17+
318
## Project Overview
419

520
**LikuBuddy** is an AI-powered generative game platform and terminal companion built as a TUI (Terminal User Interface) extension for the Gemini CLI. It enables users to create games through natural language descriptions, play built-in arcade games, manage a virtual companion (Liku), and track progress through a SQLite database.

.vscode/settings.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"chat.instructionsFilesLocations": {
3+
"**/*.md": true
4+
},
5+
"github.copilot.chat.codeGeneration.instructions": [
6+
{
7+
"text": "⚠️ DO NOT run 'npm start' or 'node dist/index.js' in this terminal! This TUI will hang the IDE. Read LIKU-CORE.md first for proper launch instructions."
8+
}
9+
],
10+
"github.copilot.chat.terminalChatLocation": "quickChat",
11+
"files.associations": {
12+
"LIKU-*.md": "markdown"
13+
}
14+
}

LIKU-CORE.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,18 +174,23 @@ Register your identity before playing Chess to trigger your intro video:
174174

175175
**Windows:**
176176
```powershell
177+
# Signal file format: Line 1 = agent ID, Line 2 = timestamp (expires after 30s)
177178
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.liku-ai" | Out-Null
178-
Set-Content -Path "$env:USERPROFILE\.liku-ai\current-agent.txt" -Value "claude"
179+
$timestamp = [DateTimeOffset]::UtcNow.ToUnixTimeMilliseconds()
180+
Set-Content -Path "$env:USERPROFILE\.liku-ai\current-agent.txt" -Value "claude`n$timestamp"
179181
```
180182

181183
**Linux/macOS:**
182184
```bash
185+
# Signal file format: Line 1 = agent ID, Line 2 = timestamp (expires after 30s)
183186
mkdir -p ~/.liku-ai
184-
echo "claude" > ~/.liku-ai/current-agent.txt
187+
echo -e "claude\n$(date +%s%3N)" > ~/.liku-ai/current-agent.txt
185188
```
186189

187190
**Supported IDs:** `claude`, `gemini`, `chatgpt`, `grok` (and aliases like `anthropic`, `openai`, `google`, etc.)
188191

192+
> **Note:** Signal files expire after 30 seconds to prevent stale agent detection from previous sessions.
193+
189194
### ⏳ Intro Video Handling (CRITICAL)
190195

191196
When entering Chess, your intro video plays for **10 seconds**. The state file will show:

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,19 @@
2828

2929
---
3030

31+
## ⛔ FOR AI AGENTS: READ THIS FIRST
32+
33+
> **DO NOT run `npm start` in VS Code's integrated terminal!**
34+
>
35+
> This is a TUI that will hang your IDE. You MUST:
36+
> 1. **Read [LIKU-CORE.md](LIKU-CORE.md)** - Essential setup and launch instructions
37+
> 2. **Read game docs** in `docs/ai/` before playing any game
38+
>
39+
> The correct way to launch is via `Start-Process` (Windows) or background process (Linux).
40+
> See LIKU-CORE.md for details.
41+
42+
---
43+
3144
## 🎯 What is Liku-AI?
3245

3346
Liku-AI is a **terminal-based game platform** designed for both human players and AI agents. It provides:

0 commit comments

Comments
 (0)