# Repository Guidelines

## Zen Browser / ChatGPT Desktop Automation
The user may have Zen Browser open at `https://chatgpt.com/`. On this desktop, Zen runs under X11 and can be automated with `xdotool`.

Find the ChatGPT window by class and title:

```bash
for w in $(xdotool search --class zen); do
  printf '%s ' "$w"
  xdotool getwindowname "$w"
done
```

Typical ChatGPT titles are `ChatGPT — Zen Browser` for the start page and `<conversation title> — Zen Browser` after a chat begins. Focus the matching window with:

```bash
xdotool windowactivate --sync <window-id>
```

To type into ChatGPT, click the prompt box, type text, then press Return as a separate command. Do not write `xdotool ... type 'hello' key Return`; that can type the literal text `keyReturn` into the prompt.

```bash
xdotool windowactivate --sync <window-id>
xdotool mousemove <prompt-x> <prompt-y> click 1
xdotool type --delay 25 'hello'
xdotool key --clearmodifiers Return
```

Screenshots are acceptable for verification or locating UI coordinates only. Do not use screenshots or OCR to read ChatGPT responses when the task asks to copy text. Use the ChatGPT copy button and then read the clipboard directly:

```bash
printf '' | xclip -selection clipboard
xdotool windowactivate --sync <window-id>
xdotool mousemove <copy-button-x> <copy-button-y> click 1
sleep 0.5
xclip -selection clipboard -o
```
