ghost/rpn-calculator

RPNcalc (F-Droid): a reverse Polish notation (stack) calculator. Type numbers, press Enter, apply operators and read the stack, or evaluate a whole RPN expression. Offline, no account.

Runs 3.3× fewer tokens Score 38/100 Official hard skill python

Token savings

70% fewer tokens
Tokenswithout142,215with42,726 (70% fewer)
Timewithout34.2 swith29.4 s (14% less time)
Tool callswithout11with4 (64% fewer)

Agent run: finished 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: open_calc · live agent session on a real phone

Control RPNcalc on Android with an AI agent

Control RPNcalc on Android with an AI agent. Compute with reverse Polish notation: an agent evaluates an RPN expression or drives the stack key by key.

Target search phrase: AI agent uses an RPN calculator on Android

Demo shows: type_number (value=12.5)

Ghost in the Droid seed skill for RPNcalc (dev.pesic.rpncalc), an offline RPN stack calculator. The keypad and the stack lines are in the accessibility tree, so an agent can compute exactly and read the stack. Offline, no account.

ActionWhat it doesParams
open_calcRestart the app and read the stack.none
clear_allClear the entry and the whole stack.none
type_numberType a number into the X register (digits, a dot, a leading minus). Follow with enter before the next number.value
enterPress Enter: lifts the stack and leaves a copy of X that the next typed number overwrites.none
operateApply an operator to the top of the stack: + - * / ^ % neg swap.op
evaluateClear the stack and evaluate a whole RPN expression such as '3 4 + 2 *' (tokens separated by spaces; operators + - * / ^ neg).expression
get_stackRead the stack (top of stack first).none

Toolkit

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

RoleAction
Entryopen_calc
Primitivestype_number, enter, operate, evaluate, clear_all
Read stateget_stack

Install

The app: F-Droid, or https://f-droid.org/packages/dev.pesic.rpncalc/. 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/rpn-calculator

Use

ghost skill run ghost/rpn-calculator evaluate --param expression="3 4 + 2 *" --device <serial>
run_skill(name="ghost/rpn-calculator", action="evaluate", params={"expression": "3 4 + 2 *"})
# {"result": {"state": {"stack": ["14"], "top": "14"}}}

Try asking: "Evaluate 3 4 + 2 * on the RPN calculator and tell me the result."

Tested on

Real Samsung phone, Android 13 (720x1600, 300 dpi, en-GB), RPNcalc 9. License: MIT.

Known failure modes and versions tested

Versions tested

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

Recorded failures

  • Between two numbers press enter (or use evaluate); after enter the stack shows the number twice until you type the next one.
  • An operator with fewer than two numbers on the stack fails.
  • Division by zero and very long results depend on the app's own error display.

Popups and first-run screens handled

  • None.

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

open_calc

Play demo

Try asking

  • Open the RPN calculator
  • open RPNcalc
ghost skill run ghost/rpn-calculator open_calc

clear_all

Play demo

Try asking

  • Clear the RPN calculator stack
  • clear the stack
ghost skill run ghost/rpn-calculator clear_all

type_number

Play demo

Try asking

  • Type the number 12.5 on the RPN calculator
  • key in 42
ghost skill run ghost/rpn-calculator type_number

enter

Play demo

Try asking

  • Press Enter on the RPN calculator
  • push the number on the stack
ghost skill run ghost/rpn-calculator enter

operate

Play demo

Try asking

  • Add the top two numbers on the RPN calculator
  • multiply the top two numbers
  • swap x and y
ghost skill run ghost/rpn-calculator operate

evaluate

Play demo

Try asking

  • Evaluate 3 4 + 2 * in reverse Polish notation
  • compute (3+4)*2 with the RPN calculator
  • what is 10 4 - 2.5 /
ghost skill run ghost/rpn-calculator evaluate

get_stack

Play demo

Try asking

  • What is on the RPN calculator stack?
  • show the stack
ghost skill run ghost/rpn-calculator get_stack