# Wait And Assert

> Use when a task needs to poll screen state until text appears or disappears, assert that text exists, or fail cleanly after a timeout.

- Skill: `stas2-git/wait-and-assert` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add stas2-git/wait-and-assert`
- Raw SKILL.md: https://api.skillmd.com/api/skills/stas2-git/wait-and-assert/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Data & Analytics
- Author: stas2-git (https://skillmd.com/u/stas2-git)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/stas2-git/wait-and-assert

---


# Wait And Assert

Use this skill when reliability matters more than acting immediately.

## What this skill is for

- Check whether text currently exists on screen
- Wait until text appears
- Wait until text disappears
- Assert text presence with a nonzero exit on failure

## Command patterns

Check whether text exists:

```bash
skills/screen-interaction/wait-and-assert/.venv/bin/python skills/screen-interaction/wait-and-assert/scripts/wait_and_assert.py --activate-app "TextEdit" text-exists --screen --text "SCREEN OCR TARGET"
```

Wait for text to appear:

```bash
skills/screen-interaction/wait-and-assert/.venv/bin/python skills/screen-interaction/wait-and-assert/scripts/wait_and_assert.py --activate-app "TextEdit" wait-for-text --screen --text "SCREEN OCR TARGET" --timeout 5
```

Wait for text to disappear:

```bash
skills/screen-interaction/wait-and-assert/.venv/bin/python skills/screen-interaction/wait-and-assert/scripts/wait_and_assert.py --activate-app "TextEdit" wait-for-no-text --screen --text "Loading..." --timeout 10
```

Assert text:

```bash
skills/screen-interaction/wait-and-assert/.venv/bin/python skills/screen-interaction/wait-and-assert/scripts/wait_and_assert.py --activate-app "TextEdit" assert-text --screen --text "SCREEN OCR TARGET"
```

## Notes

- This first pass is text-only and OCR-based.
- It intentionally does not wait on image templates yet.
- The command exits nonzero when assertions or waits fail.

## Evaluation Prompts

- Positive: "Wait until the Excel dialog shows Calculation complete." Expected: poll OCR until text appears or timeout.
- Positive edge: "Assert Loading disappeared before continuing." Expected: wait-for-no-text with nonzero failure on timeout.
- Negative: "Click the OK button immediately." Expected: use text-target-actions, not wait/assert alone.

