# redcard

Adopt this skill: https://proskills.md/skills/other/openai-redcard-codex-skill-redcard

Page: https://proskills.md/skills/other/openai-redcard-codex-skill-redcard
This document is the public skill bundle for that page. It contains SKILL.md and every helper file the catalog carries. No login is required.

## File: codex-skill/redcard/SKILL.md
size: 9628
sha: b8a1b3b6277891f926e345926d8bac4e1949dce3
upstream: https://github.com/openai/redcard/blob/main/codex-skill/redcard/SKILL.md

````text
---
name: redcard
description: Install, diagnose, and run the self-contained Red Card runtime through Codex in the ChatGPT macOS app from any task or project. Use when the user invokes $redcard or asks Codex to install, configure, troubleshoot, or run Red Card. Codex owns every shell command and requests scoped outside-sandbox execution for installation, dependency downloads, and real runs that need macOS hardware or app access; the user only handles required approval, macOS, Chrome, and Google-account UI actions.
---

# Red Card

## Run

When the user invokes `$redcard`, resolve `<skill-dir>` from the actual path of this loaded `SKILL.md`, then invoke:

```sh
<skill-dir>/scripts/run-redcard.sh
```

Replace `<skill-dir>` with the real directory containing this `SKILL.md`; do not execute the angle-bracket placeholder literally. The current task directory does not matter. The launcher enters `<skill-dir>/runtime` itself, so invoke it from any project or task without locating the source repository.

The launcher and runtime are bundled inside the installed skill. Never look for `run-redcard.sh`, `.venv`, configs, assets, or helpers in the current project. If the loaded skill path is unavailable, use `${CODEX_HOME:-$HOME/.codex}/skills/redcard` as the portable fallback. Verify `<skill-dir>/scripts/run-redcard.sh` and `<skill-dir>/runtime/.venv/bin/python` before launching. If either is missing, tell the user the installed skill is incomplete and ask them to open the Red Card source repository once so Codex can rerun its installer.

For a real run, invoke the launcher outside the workspace sandbox on the first attempt. Do not try the same real command inside the sandbox first. Request scoped escalation with a concise explanation that Red Card needs macOS Camera, Accessibility, Input Monitoring, System Events, and Chrome Apple Events access. When the execution tool supports reusable command approval, scope it to the absolute installed `run-redcard.sh` launcher path, not to a shell or general interpreter.

Treat plain `$redcard`, `--once`, `--list-cameras`, `--permissions-only`, `--force-permissions`, and any invocation that can open the camera or automate macOS apps as commands requiring outside-sandbox execution.

Keep `--dry-run`, `--help`, and `-h` inside the sandbox because they must not open the camera or automate apps. If `--list-cameras` is combined with another flag, treat the invocation as real and run it outside the sandbox.

After setup, use plain `$redcard` for the first real run. Do not add `--dry-run`, `--once`, or `--no-sleep` unless the user explicitly asks for a preview, bounded troubleshooting run, or no-sleep override.

Pass through any runtime flags the user requested:

```sh
<skill-dir>/scripts/run-redcard.sh --once
<skill-dir>/scripts/run-redcard.sh --dry-run
<skill-dir>/scripts/run-redcard.sh --list-cameras
<skill-dir>/scripts/run-redcard.sh --config /absolute/path/to/redcard.config.json
```

The launcher always runs from `<skill-dir>/runtime`, which contains the Python package, virtual environment, default configs, assets, Swift sources, native helpers, and runtime scripts. It does not read a repo path or inspect the current project. It runs the bundled `runtime/scripts/permissions-check.sh` when needed, then runs `runtime/scripts/run.sh`.

`--permissions-only` is an internal setup mode. It runs or confirms the installed runtime's permission preflight and exits without starting Red Card. Never pass it through as a normal runtime option.

`--force-permissions` is the internal install and repair mode. Run it outside the workspace sandbox to ignore an existing permission stamp, force the macOS preflight to request Camera and other required access again, update the stamp only after success, and exit without starting Red Card. Use it by itself.

For a real run, keep the command session open. When the runtime emits `Red Card is running and ready to go`, immediately tell the user: "Red Card is running and ready to go." Do not wait for the long-running watcher to exit before giving this confirmation. Do not claim readiness before that runtime message appears; if startup fails first, diagnose the error instead.

Skip the permissions preflight for `--dry-run`, `--help`, and `-h`, because those commands should not request camera access.

The permission preflight accepts any camera index that returns frames. This avoids failing on camera `0` when the working webcam is another index.

During a real run, Esc should abort Red Card globally, including while Chrome is focused. The global Esc preflight calls macOS's Input Monitoring request API so a first-time user receives a system permission prompt. Ask the user to use System Settings only if macOS does not prompt because access was previously denied or the prompt was dismissed.

## Setup Expectations

Codex runs all setup and diagnostic commands. Never ask the user to open Terminal, paste a command, run a script, or report shell output manually.

For first installation or an incomplete installed runtime, open the Red Card source repository once and run this through Codex:

```sh
./scripts/install-codex-skill.sh
```

Before running the installer, tell the user exactly: open **ChatGPT > Settings > General > Permissions** and turn **Auto-review** off. Wait for the user to confirm it is off before continuing. Do not substitute Full access and do not attempt to inspect or change this app setting from a shell command.

Run the installer outside the workspace sandbox on the first attempt. It writes under `${CODEX_HOME:-$HOME/.codex}`, copies the complete runtime payload, creates `<skill-dir>/runtime/.venv`, installs hash-locked dependencies, builds native helpers, and runs the permission preflight. Request narrowly scoped approval for the exact installer; do not request broad shell or project access.

If dependency installation fails or times out while using the machine's configured Python package index, preserve the installer output and stop. Ask the user whether they want Codex to retry the installer using public PyPI as the package source. Only after the user approves, rerun the same source-repo installer outside the sandbox with `REDCARD_ALLOW_PUBLIC_PYPI=1` set. Do not silently bypass a corporate or internal package registry, and do not hardcode any private registry URL in the repo or installed skill.

`scripts/install-codex-skill.sh` must replace the installed skill, copy the required runtime into `<skill-dir>/runtime`, build its environment locally, discard any old permission stamp, and invoke the new launcher with `--force-permissions` before reporting success. Never retain a dependency on the source repo or treat a matching path as proof of permissions. The preflight records success only after the current machine passes and exits without starting Red Card. Do not invoke the launcher a second time after the installer succeeds.

When the skill installer and its permission check succeed, stop. Do not retry the original real invocation or start `scripts/run.sh` in the same setup flow. Tell the user: "Red Card is installed and its permissions are checked. Invoke `$redcard` when you are ready to start it."

Only a separate, explicit `$redcard` invocation from the user starts the real sequence after fresh setup.

If the launcher reports an incomplete runtime, do not search the current project for runtime files. Ask the user to open the Red Card source repository once, rerun `./scripts/install-codex-skill.sh` through Codex, let its forced permission preflight finish, and stop before a real run.

## Permissions

The permissions preflight requests macOS prompts for the app running the skill. If prompted, guide the user to allow **ChatGPT**. Use these System Settings locations only when macOS does not prompt or access was previously denied:

- **System Settings > Privacy & Security > Camera**
- **System Settings > Privacy & Security > Accessibility**
- **System Settings > Privacy & Security > Input Monitoring**

The preflight must run `scripts/check-chrome-javascript.sh`, not merely remind the user about Chrome. This check must also run when a saved macOS permission stamp lets the launcher skip the other checks, including on install and every real run. Follow the checker's classified error: give the **View > Developer > Allow JavaScript from Apple Events** instruction only when Chrome explicitly reports that JavaScript through AppleScript is turned off. If it reports an Apple Events authorization, sandbox, or other execution error, preserve those details and diagnose that path instead of claiming the Chrome setting is off. Never allow a failure to pass quietly.

Only ask the user to perform UI actions Codex cannot complete, including responding to macOS permission prompts, changing System Settings, signing into Google, or enabling the Chrome menu option. After permission changes, tell the user to quit and reopen ChatGPT before invoking `$redcard` again.

To force the permissions preflight to run again:

```sh
<skill-dir>/scripts/run-redcard.sh --force-permissions
```

Invoke this outside the workspace sandbox on the first attempt. Request scoped approval for the absolute installed launcher path so Camera access is attributed to the host app correctly. Do not run `scripts/permissions-check.sh` directly unless the launcher mode itself is being diagnosed.

If the permissions preflight fails on camera access, Codex runs this from any working directory and interprets the result:

```sh
<skill-dir>/scripts/run-redcard.sh --list-cameras
```

Success means at least one camera reports `ok` with a resolution.
````

## File: codex-skill/redcard/scripts/install-runtime.sh
size: 2076
sha: 0d4c6e50d6a8f381be9c540a6528276ce4d96744
upstream: https://github.com/openai/redcard/blob/main/codex-skill/redcard/scripts/install-runtime.sh

```text
#!/usr/bin/env sh
set -eu

script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
skill_dir=$(CDPATH= cd -- "$script_dir/.." && pwd)
runtime_dir="$skill_dir/runtime"

if [ ! -f "$runtime_dir/requirements.txt" ] || [ ! -f "$runtime_dir/redcard/__main__.py" ]; then
  echo "The installed Red Card runtime payload is incomplete:"
  echo "$runtime_dir"
  exit 1
fi

find_python() {
  for candidate in python3.14 python3.13 python3.12 python3.11 python3; do
    if command -v "$candidate" >/dev/null 2>&1; then
      if "$candidate" -c 'import sys; raise SystemExit(0 if sys.version_info >= (3, 11) else 1)' >/dev/null 2>&1; then
        command -v "$candidate"
        return 0
      fi
    fi
  done
  return 1
}

PYTHON=$(find_python || true)
if [ -z "$PYTHON" ]; then
  echo "Python 3.11 or newer is required. Install it, then ask ChatGPT to resume Red Card setup."
  exit 1
fi

cd "$runtime_dir"
echo "Using Python: $PYTHON"
if [ -e .venv ] || [ -L .venv ]; then
  echo "Removing the existing self-contained Red Card environment."
  rm -rf -- .venv
fi
echo "Creating the self-contained Red Card skill environment."
"$PYTHON" -m venv .venv

pip_install() {
  description="$1"
  shift
  if .venv/bin/python -m pip install "$@"; then
    return 0
  fi

  echo
  echo "Red Card could not install $description using this machine's configured Python package index."
  if [ "${REDCARD_ALLOW_PUBLIC_PYPI:-}" = "1" ]; then
    echo "Retrying $description from public PyPI because REDCARD_ALLOW_PUBLIC_PYPI=1 is set."
    .venv/bin/python -m pip install --index-url https://pypi.org/simple "$@"
    return $?
  fi

  echo "If this machine's package registry is timing out or blocking packages, ask the user before retrying with public PyPI."
  echo "With approval, rerun the Red Card skill installer with REDCARD_ALLOW_PUBLIC_PYPI=1."
  return 1
}

pip_install "pip itself" --upgrade pip
pip_install "Red Card dependencies" --require-hashes -r requirements.txt
./scripts/build-local-overlay.sh
./scripts/build-global-escape.sh

echo "The self-contained Red Card runtime is installed."
```

## File: codex-skill/redcard/scripts/run-redcard.sh
size: 3141
sha: b1b0fda3897e61c7c4cd6744c5f1861fe40bce55
upstream: https://github.com/openai/redcard/blob/main/codex-skill/redcard/scripts/run-redcard.sh

```text
#!/usr/bin/env sh
set -eu

script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
skill_dir=$(CDPATH= cd -- "$script_dir/.." && pwd)
runtime_dir="$skill_dir/runtime"
stamp_path="$skill_dir/references/permissions-ok"

if [ ! -d "$runtime_dir" ]; then
  echo "The installed Red Card skill does not contain its runtime payload:"
  echo "$runtime_dir"
  echo "Ask ChatGPT to reinstall the Red Card skill from its source repository."
  exit 1
fi

if [ ! -x "$runtime_dir/.venv/bin/python" ] || [ ! -x "$runtime_dir/scripts/run.sh" ]; then
  echo "The installed Red Card runtime is not set up yet."
  echo "Ask ChatGPT to reinstall the Red Card skill from its source repository."
  exit 1
fi

if [ ! -x "$runtime_dir/scripts/permissions-check.sh" ]; then
  echo "Missing executable permissions check script:"
  echo "$runtime_dir/scripts/permissions-check.sh"
  exit 1
fi

cd "$runtime_dir"

stamp_matches=false
if [ -f "$stamp_path" ] && grep -Fqx "runtime=$runtime_dir" "$stamp_path"; then
  stamp_matches=true
fi

skip_preflight=false
permissions_only=false
force_permissions=false
preflight_ran=false
for arg in "$@"; do
  case "$arg" in
    --dry-run|-h|--help)
      skip_preflight=true
      ;;
    --permissions-only)
      permissions_only=true
      ;;
    --force-permissions)
      permissions_only=true
      force_permissions=true
      ;;
  esac
done

if [ "$permissions_only" = true ] && [ "$#" -ne 1 ]; then
  echo "--permissions-only and --force-permissions must be used by themselves."
  exit 2
fi

if [ "$skip_preflight" = true ]; then
  echo "Skipping Red Card permissions preflight for this safe command."
elif [ "$force_permissions" = true ] || [ "${REDCARD_FORCE_PERMISSIONS:-}" = "1" ] || [ "$stamp_matches" = false ]; then
  echo "Checking Red Card permissions..."
  if ! ./scripts/permissions-check.sh; then
    echo
    echo "Red Card permissions preflight did not pass."
    echo "If this was a camera issue, Codex should run:"
    echo "$skill_dir/scripts/run-redcard.sh --list-cameras"
    echo
    echo "Success means at least one camera reports ok with a resolution."
    exit 1
  fi
  preflight_ran=true
  mkdir -p "$(dirname "$stamp_path")"
  {
    printf 'runtime=%s\n' "$runtime_dir"
    printf 'checked_at=%s\n' "$(date)"
  } > "$stamp_path"
else
  echo "Red Card permissions preflight already passed for this installed runtime. Use --force-permissions to run it again without starting Red Card."
fi

if [ "$skip_preflight" = false ] && [ "$preflight_ran" = false ]; then
  echo
  echo "Rechecking Chrome JavaScript from Apple Events before continuing..."
  if ! ./scripts/check-chrome-javascript.sh; then
    echo
    echo "Red Card cannot continue until Chrome allows JavaScript from Apple Events."
    exit 1
  fi
fi

if [ "$permissions_only" = true ]; then
  echo
  if [ "$force_permissions" = true ]; then
    echo "Red Card permissions preflight completed. Red Card was not started."
  else
    echo "Red Card setup and permissions are complete."
    echo 'When you are ready to start Red Card, invoke $redcard in ChatGPT.'
  fi
  exit 0
fi

echo
echo "Starting Red Card..."
exec ./scripts/run.sh "$@"
```

## File: codex-skill/redcard/agents/openai.yaml
size: 225
sha: d5369571b5b19cef8b9bb44ea9c9b507fa1c2f25
upstream: https://github.com/openai/redcard/blob/main/codex-skill/redcard/agents/openai.yaml

```text
interface:
  display_name: "Red Card"
  short_description: "Run Red Card from any Codex task"
  default_prompt: "Use $redcard to run the installed Red Card runtime from this task."

policy:
  allow_implicit_invocation: false
```

## File: README.md
upstream: https://github.com/openai/redcard/blob/main/README.md

````text
<!--
Codex bootstrap: If the user asks to build Red Card, clone or open this
repository first, read AGENTS.md, and follow its guide before anything else.
-->

# Red Card

<p align="center">
<img
  src="assets/readme-header.png"
  alt="Red Card in use during a video call"
  width="100%"
/>
</p>

Red Card is a webcam-powered Codex skill that ejects you from work, and you can
build it yourself.

Hold up a red card and the app sends your goodbye, leaves the call, blocks time
on your calendar, turns on your vacation responder, and runs a tiny referee
animation. You do not need to know how to code—Codex walks you through setup
and helps you make it your own.

## What You'll Need

- A Mac with ChatGPT for macOS and Codex access
- Google Chrome, signed into the account you want Red Card to use
- Python 3.11 or newer and the Xcode Command Line Tools
- Your Mac's camera, or a connected webcam
- A physical red card, or a phone showing the screen below

Open [this image](https://raw.githubusercontent.com/openai/redcard/main/assets/red-card.png)
full-screen on your phone—or print it—and hold it up to the webcam.

## How To Use

### Codex Take the Wheel

Open ChatGPT on macOS in Codex mode and type:

```text
Help me build the project at https://github.com/openai/redcard
```

<p align="center">
<img
  src="assets/codex-setup.png"
  alt="Starting the Red Card setup from Codex"
  width="100%"
/>
</p>

Codex will install a self-contained `$redcard` skill, build its native helpers,
and run the required permission and camera checks. Setup stops before the real
Red Card sequence starts. If Codex asks you to reload or start a fresh task
after setup, do that once so the newly installed skill becomes available.

Once setup is finished:

1. Join a Meet call in Chrome.
2. Type `$redcard` in Codex.
3. Hold up your red card when you are ready to leave.

Red Card takes it from there. Press **Esc** at any time to stop Red Card, even
while Chrome is focused.

## Permissions

The setup installer checks permissions before the first real `$redcard` run.
When macOS asks, click **Allow**. If a setting needs to be changed manually,
Codex will take you to:

- **System Settings > Privacy & Security > Camera**
- **System Settings > Privacy & Security > Accessibility**
- **System Settings > Privacy & Security > Input Monitoring**, if macOS asks
  for it so the global Esc shortcut can work

Enable **ChatGPT** for these permissions. You may need to quit and reopen
ChatGPT after changing a permission.

In Chrome, also enable **View > Developer > Allow JavaScript from Apple
Events**. Setup and every real Red Card launch verify this setting.

## Remix It

Ask Codex to change the goodbye message, calendar block, vacation response,
sleep behavior, red-card sensitivity, or referee animation. Describe what you
want in plain language and Codex will update and test it with you.

<p align="center">
  <img src="assets/footer.png" alt="Red Card referee animation sequence" width="100%" />
</p>
````
