ghost/connect-four

ConnectFour Studio (F-Droid): start a new game, drop a disc in a column and read the engine's reply. Offline, no account.

Proven 76× fewer tokens Score 41/100 Official hard skill python

Token savings

99% fewer tokens
Tokenswithout1,561,970with20,558 (99% fewer)
Timewithout70.3 swith19.3 s (73% less time)
Tool callswithout27with3 (89% fewer)

Agent run: stopped early without the skill, finished with it (not independently checked).

One recorded run each way, claude-haiku-5-5, same phone and same prompt. Watch it in the Before / after tab.

Recorded: new_game · live agent session on a real phone

Control ConnectFour Studio on Android with an AI agent — play Connect Four

Control ConnectFour Studio on Android with an AI agent. Play Connect Four against a perfect-play engine on your phone: an agent starts the game, drops the discs and reads the engine replies.

Target search phrase: AI agent plays Connect Four on Android

Demo shows: new_game (columns=4,4,3)

Ghost in the Droid seed skill for ConnectFour Studio (io.github.patrickric.connectfourstudio), an offline Connect Four game with a perfect-play engine from F-Droid. Offline, no account.

ActionWhat it doesParams
new_gameStart a new gamenone
play_columnDrop a disc in column 1-7 and read the replycolumn
play_movesPlay a sequence of columns on a fresh boardcolumns
get_stateRead move number, side to move and statusnone
undo_moveTake back one move (the < button)none

Toolkit

An agent can drive the whole app with these; compose them.

RoleAction
Entrynew_game
Primitivesplay_column, play_moves, undo_move
Read stateget_state

Install

The app: F-Droid, or https://f-droid.org/packages/io.github.patrickric.connectfourstudio/. The skill:

pip install "ghost-in-the-droid>=1.6.0"   # 1.6.0 is not on PyPI yet: until it ships, git clone the repo and `pip install -e .`
ghost skill install ghost/connect-four

Use

ghost skill run ghost/connect-four new_game --device <serial>
ghost skill run ghost/connect-four play_moves --param columns=4,4,3 --device <serial>
run_skill(name="ghost/connect-four", action="play_column", params={"column": "4"})
# {"column": 4, "state": {"move": 3, "status": "Computer played 2 in 0.00 s.", "to_move": "Human"}}

Try asking: "Play three moves in Connect Four: columns 4, 4 and 3."

Tested on

Real Samsung phone, Android 13 (720x1600, 300 dpi, en-GB), ConnectFour Studio 1.0.1. License: MIT.

Known failure modes and versions tested

Versions tested

App versionAndroidDeviceSkill versionDates
1.0.113Samsung real phone (720x1600, 300 dpi, en-GB)1.0.02026-11-02

Recorded failures

  • The engine's reply column is random among equal moves: do not assert it, assert the move counter and the status text.
  • The labels lag right after a tap: a status of "Computer is thinking..." is not a finished move; the helpers wait for "Computer played" and a counter increase of 2.
  • A finished game (win or draw) shows a different status: the helpers stop and return it.

Popups and first-run screens handled

  • None: the app has no first-run screens and asks for no permissions.

Try a sample prompt or run an action by name. Replace any parameters in braces with your own values.

new_game

Play demo

Try asking

  • Start a new game of Connect Four
  • new connect four game
  • reset the connect 4 board
  • start over in Connect Four
ghost skill run ghost/connect-four new_game

play_column

Play demo

Try asking

  • Drop a disc in the middle column in Connect Four
  • play column 3 in connect four
  • put my piece in the far left column
  • make my move in the centre
ghost skill run ghost/connect-four play_column

play_moves

Play demo

Try asking

  • Play columns 4, 4 and 3 in Connect Four
  • play three moves in Connect Four
  • try the opening 4 4 3
ghost skill run ghost/connect-four play_moves

get_state

Play demo

Try asking

  • What is the Connect Four status?
  • whose turn is it in connect four
  • what move are we on
ghost skill run ghost/connect-four get_state

undo_move

Play demo

Try asking

  • Undo my last Connect Four move
  • take back that move
  • go back one move in connect four
ghost skill run ghost/connect-four undo_move