open_calc
Play demoTry asking
- Open the RPN calculator
- open RPNcalc
ghost skill run ghost/rpn-calculator open_calc 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.
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.
3.3× fewer tokens, 1.2× faster with the skill. Agent run: finished without the skill, finished with it (not independently checked).
| Run | Time | Tokens | Tool calls | Result |
|---|---|---|---|---|
| No skill: agent drives by hand | 34.2 s | 142,215 | 11 | finished |
| With skill: find_skill, run_skill | 29.4 s | 42,726 | 4 | finished |
Prompt: Evaluate 3 4 + 2 * on the RPN calculator and tell me the result. Do not use the Play Store, no installs, no sign-in.
Same prompt, same phone, clean app state per side. Left: no skill, the agent drives the UI by hand. Right: find_skill + run_skill. 'ok' means the agent finished its turn; the result was not independently checked.
One recorded pair on samsung-a03s, claude-haiku-5-5; tokens count every input, cache and output token once per assistant message. Not a signed run: it adds no run evidence.
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.
| Action | What it does | Params |
|---|---|---|
open_calc | Restart the app and read the stack. | none |
clear_all | Clear the entry and the whole stack. | none |
type_number | Type a number into the X register (digits, a dot, a leading minus). Follow with enter before the next number. | value |
enter | Press Enter: lifts the stack and leaves a copy of X that the next typed number overwrites. | none |
operate | Apply an operator to the top of the stack: + - * / ^ % neg swap. | op |
evaluate | Clear the stack and evaluate a whole RPN expression such as '3 4 + 2 *' (tokens separated by spaces; operators + - * / ^ neg). | expression |
get_stack | Read the stack (top of stack first). | none |
An agent can drive the whole app with these; compose them.
| Role | Action |
|---|---|
| Entry | open_calc |
| Primitives | type_number, enter, operate, evaluate, clear_all |
| Read state | get_stack |
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
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."
Real Samsung phone, Android 13 (720x1600, 300 dpi, en-GB), RPNcalc 9. License: MIT.
| App version | Android | Device | Skill version | Dates |
|---|---|---|---|---|
| 9 | 13 | Samsung real phone (720x1600, 300 dpi, en-GB) | 1.0.0 | 2026-11-02 |
SOFT.md is the narrative an agent reads when the exact steps no longer match your app version and it has to adapt the skill.
What each action means, which UI landmarks it relies on and how success is recognised, so an agent can adapt it to another app of this kind or another version.
Package: dev.pesic.rpncalc (RPNcalc, GPL-3.0-only, version 9 from the official F-Droid repository, sha256-verified)
Verified: 2026-11-02 on a real Samsung phone, Android 13, 720x1600 @ 300 dpi, en-GB. Offline, no account.
Skill class: HARD. No login, no checkpoints.
open_calc()Force-stops and relaunches.
clear_all()Taps C (entry) and then AC (stack).
type_number(value)Taps the digit keys and the plus/minus key for a negative number.
enter()Taps Enter.
operate(op)Taps the operator; with two numbers it replaces them by the result (Y op X).
evaluate(expression)Types each number, presses Enter only between two numbers and applies each operator. The expected result is computed in Python and compared with the stack top.
get_stack()Reads the stack lines (content-desc views) above the keypad.
The two roll keys (R up/down) and the undo key are not driven (they have no usable label); the stack view shows only the last lines, so very deep stacks are truncated.
Try a sample prompt or run an action by name. Replace any parameters in braces with your own values.
open_calcTry asking
ghost skill run ghost/rpn-calculator open_calc clear_allTry asking
ghost skill run ghost/rpn-calculator clear_all type_numberTry asking
ghost skill run ghost/rpn-calculator type_number enterTry asking
ghost skill run ghost/rpn-calculator enter operateTry asking
ghost skill run ghost/rpn-calculator operate evaluateTry asking
ghost skill run ghost/rpn-calculator evaluate get_stackTry asking
ghost skill run ghost/rpn-calculator get_stack Each release is an immutable git tag. The tree hash pins the exact skill directory the installer verifies.
| Version | Released | App versions | Tree | Size | Provenance |
|---|---|---|---|---|---|
1.0.0latest | never | >=1.3 | pending | 21.0 KB | untagged |