---
name: pp-iclasspro
description: "Read iClassPro public catalogs, local history, and an authenticated read-only Office Portal surface. Trigger phrases: `what classes does this gym have`, `check openings at`, `read iClassPro families`, `check the staff dashboard`, `read attendance`, `read transactions`, `use iclasspro`, `run iclasspro`."
author: "bobe"
license: "Apache-2.0"
argument-hint: "<command> [args] | install cli|mcp"
allowed-tools: "Read Bash"
metadata:
  openclaw:
    requires:
      bins:
        - iclasspro-pp-cli
    install:
      - kind: go
        bins: [iclasspro-pp-cli]
        module: github.com/mvanhorn/printing-press-library/library/productivity/iclasspro/cmd/iclasspro-pp-cli
---
<!-- GENERATED FILE — DO NOT EDIT.
     This file is a verbatim mirror of library/productivity/iclasspro/SKILL.md,
     regenerated post-merge by tools/generate-skills/. Hand-edits here are
     silently overwritten on the next regen. Edit the library/ source instead.
     See the repository agent guide, section "Generated artifacts: registry.json, cli-skills/". -->

# iClassPro — Printing Press CLI

## Prerequisites: Install the CLI

This skill drives the `iclasspro-pp-cli` binary. **You must verify the CLI is installed before invoking any command from this skill.** If it is missing, install it first:

1. Install via the Printing Press installer. It defaults binaries to `$HOME/.local/bin` on macOS/Linux and `%LOCALAPPDATA%\Programs\PrintingPress\bin` on Windows:
   ```bash
   npx -y @mvanhorn/printing-press-library install iclasspro --cli-only
   ```
2. Verify: `iclasspro-pp-cli --version`
3. Ensure the reported install directory is on `$PATH` for the agent/runtime that will invoke this skill.

If the `npx` install fails (no Node, offline, etc.), fall back to a direct Go install (requires Go 1.26.6 or newer). This installs into `$GOPATH/bin` (default `$HOME/go/bin`), so add that directory to `$PATH` instead:

```bash
go install github.com/mvanhorn/printing-press-library/library/productivity/iclasspro/cmd/iclasspro-pp-cli@latest
```

If `--version` reports "command not found" after install, the runtime cannot see the binary directory on `$PATH`. Do not proceed with skill commands until verification succeeds.

iClassPro powers thousands of gymnastics, swim, dance, and cheer businesses and ships no developer API at all. This CLI treats the portal's own endpoints as one: it works against any account by its portal slug, keeps every sync in local SQLite, and answers the questions the upstream API structurally cannot — what changed since last week (drift), how fast a class is filling (fill-rate), and what registration opens next (opens-soon). It also exposes the filters the portal UI uses but nobody documented, including free-text search and openings-only.

## When to Use This CLI

Use this CLI whenever a task involves an iClassPro-powered business: gymnastics gyms, swim schools, dance and cheer studios. It is the right tool for reading a gym's class and camp catalog, searching or filtering it, watching for openings and registration windows, exporting schedules to a website or calendar, and comparing several gyms at once. It is especially suited to agencies and multi-location operators, because every command takes a portal slug and the local mirror can hold many accounts side by side. Prefer it over ad-hoc HTTP calls, because it knows which filters the API actually honors and which it silently ignores.

## Anti-triggers

Do not use this CLI for:
- Do not use this CLI to enroll a student, add to a cart, apply a promo code, or pay — it is read-only by design and has no such commands.
- Do not use it to mutate staff-side records, take attendance, charge or refund a family, generate/export reports, read staff payroll, or manage time clocks. Its Office Portal surface is an explicit read-only allow-list.
- Do not use it to cancel or reschedule a booking on a family's behalf; direct the person to the customer portal.
- Do not point it at a class-management product that is not iClassPro — Mariana Tek, Vagaro, Jackrabbit, and Sutra all have unrelated APIs.
- Do not treat its output as a system of record for enrollment counts; openings is a portal-facing number, not the gym's roster.

## Unique Capabilities

These capabilities aren't available in any other tool for this API.

### Local history the API forgets
- **`watch`** — Get told the moment a spot frees up in a class or camp that is currently full.

  _Reach for this instead of re-polling a list endpoint yourself: it stores every observation, so it reports the transition rather than the current value._

  ```bash
  iclasspro-pp-cli watch scottsdalegymnastics --class 8357 --agent
  ```
- **`drift`** — See what changed between syncs: classes and camps added, removed, retimed, or newly marked deleted.

  _Use this to answer 'what is different since last week' without re-reading the whole catalog into context._

  ```bash
  iclasspro-pp-cli drift scottsdalegymnastics --since 7d --agent
  ```
- **`opens-soon`** — Find registration that has not opened yet or is about to close, across every synced class and camp.

  _This is the only way to see a camp before its registration opens, which is when popular sessions are still winnable._

  ```bash
  iclasspro-pp-cli opens-soon scottsdalegymnastics --days 14 --agent
  ```
- **`fill-rate`** — Show how fast classes are filling over time, by class or by program.

  _Answers whether a class is trending toward full or toward cancellation, which no upstream call can express._

  ```bash
  iclasspro-pp-cli fill-rate scottsdalegymnastics --programs 589 --agent
  ```

### Catalog hygiene and publishing
- **`calendar`** — Export synced camps and classes to an RFC 5545 calendar file, one event per session.

  _Turns a portal catalog into something a calendar app, a website, or a newsletter can consume directly._

  ```bash
  iclasspro-pp-cli calendar scottsdalegymnastics --format ics --out fall-camps.ics
  ```
- **`lint`** — Flag catalog quality problems: missing descriptions or images, expired registration windows, deleted-but-listed programs.

  _Use before publishing a schedule to a website; it catches the records that will render blank or dead._

  ```bash
  iclasspro-pp-cli lint scottsdalegymnastics --agent
  ```

### Multi-tenant reach
- **Expired customer-session fallback** — Retry the anonymous Open API when a stored customer JWT returns HTTP 401.

  _A login that was once needed cannot later take down a catalog the account publishes publicly. Sign-in-gated accounts still surface their login requirement._

  ```bash
  iclasspro-pp-cli locations examplegym --agent
  ```
- **`tenant`** — Report which surfaces an account actually exposes: open, sign-in-gated, or plan-gated.

  _Run this first against any new account; it prevents mistaking a sign-in gate for a gym with no classes._

  ```bash
  iclasspro-pp-cli tenant examplegym --agent
  ```
- **`compare`** — Compare the same kind of program across several gyms at once.

  _Built for franchise and agency operators who track many gyms and need one table instead of many tabs._

  ```bash
  iclasspro-pp-cli compare --accounts scottsdalegymnastics,oasisgymnastics,tigar --agent
  ```

### Read-only Office Portal access
- **`admin`** — Read an explicit allow-list of authenticated staff resources without mutation, export, or response caching.

  _Provides staff-side visibility without giving an agent a generic request escape hatch or any write capability. Attendance reads discover the internal timeslot from the class and date when it is unambiguous._

  ```bash
  iclasspro-pp-cli admin families examplegym --q smith --limit 25 --agent
  iclasspro-pp-cli admin attendance examplegym 12345 2026-08-12 --agent
  ```

## Command Reference

**admin** — Authenticated, read-only Office Portal data

- `iclasspro-pp-cli admin capabilities` — Describe the allow-listed staff reads without requiring a session
- `iclasspro-pp-cli admin dashboard <account>` — Saved dashboard and available widget catalog
- `iclasspro-pp-cli admin families <account>` — Search families
- `iclasspro-pp-cli admin students <account>` — Search students
- `iclasspro-pp-cli admin class-search <account>` — Search staff-side classes
- `iclasspro-pp-cli admin enrollments <account>` — Search enrollments
- `iclasspro-pp-cli admin attendance <account> <class-id> <date> [timeslot-id]` — Read one roster and attendance state; omit `timeslot-id` to discover the unique event for that date
- `iclasspro-pp-cli admin transactions <account>` — Search gateway transaction history
- `iclasspro-pp-cli admin reports <account>` — List report definitions; never generate or export

**auth** — Read-only customer and staff sessions

- `iclasspro-pp-cli auth staff-login <account>` — Exchange environment credentials for a private Office Portal cookie session
- `iclasspro-pp-cli auth staff-status` — List staff sessions without exposing cookies
- `iclasspro-pp-cli auth staff-logout <account>` — Remove a stored staff session

**bookings** — The portal booking menu — the authoritative source of camp typeIds

- `iclasspro-pp-cli bookings <account> <locationId>` — Booking menu tiles for a location; camp tiles carry the typeId that 'camps list' requires

**camps** — Camps and events — open gyms, clinics, kids night out, school-break camps

- `iclasspro-pp-cli camps get` — Full camp detail including HTML description, per-session blocks, room, instructors, and deletion/expiry flags
- `iclasspro-pp-cli camps list` — List camps for one camp type. typeId comes from 'bookings', NOT from 'programs camps'

**classes** — Ongoing classes — the primary catalog

- `iclasspro-pp-cli classes get` — Full class detail including the HTML description the list endpoint omits
- `iclasspro-pp-cli classes list` — List classes with server-side filtering. Only the flags below are honored upstream; any other filter is applied locally

**instructors** — Instructors teaching classes at a location

- `iclasspro-pp-cli instructors <account> <locationId>` — Instructors who teach classes; ids are valid values for 'classes list --instructors'

**levels** — Skill levels used to band classes

- `iclasspro-pp-cli levels <account> <locationId>` — Active skill levels with display colors; ids are valid values for 'classes list --levels'

**locations** — Physical locations for an account

- `iclasspro-pp-cli locations <account>` — List every location on an iClassPro account, with contact details and portal branding

**news** — Portal news articles

- `iclasspro-pp-cli news <account> <articleId>` — Fetch a single portal news article by id

**parties** — Birthday party booking availability

- `iclasspro-pp-cli parties <account> <locationId>` — Dates a party can be booked at a location

**products** — ProShop retail catalog

- `iclasspro-pp-cli products <account> <locationId>` — Retail products with pricing, sale state, variations, and inventory

**programs** — Program categories for classes, camps, and appointments

- `iclasspro-pp-cli programs appointments` — Appointment program categories; returns a plan-gate message on accounts without the appointments subscription
- `iclasspro-pp-cli programs camps` — Camp program categories. These ids are programIds, NOT the typeIds 'camps list' needs — use 'bookings' for those
- `iclasspro-pp-cli programs classes` — Class program categories; ids are valid values for 'classes list --programs'

**sessions** — Enrollment sessions (date-bounded terms)

- `iclasspro-pp-cli sessions <account>` — Sessions for an account; ids are valid values for 'classes list --sessions'


### Finding the right command

When you know what you want to do but not which command does it, ask the CLI directly:

```bash
iclasspro-pp-cli which "<capability in your own words>"
```

`which` resolves a natural-language capability query to the best matching command from this CLI's curated feature index. Exit code `0` means at least one match; exit code `2` means no confident match — fall back to `--help` or use a narrower query.

## Recipes

### Narrow a large class list down to just what an agent needs

```bash
iclasspro-pp-cli classes list oasisgymnastics --openings 1 --limit 50 --agent --select id,name,openings,allowWaitlist,schedule.dayName,schedule.startTime
```

Some gyms return well over a hundred classes with nested schedule arrays; selecting dotted paths keeps the payload small enough to reason over without paging through raw JSON.

### Resolve camp type ids the correct way, then list that type

```bash
iclasspro-pp-cli bookings scottsdalegymnastics 1 --agent --select title,target,targetParams.typeId
```

The booking menu is the only authoritative source of camp type ids; feeding a programId from 'programs camps' into --type-id silently returns nothing.

### Publish a gym's camp schedule to a calendar file

```bash
iclasspro-pp-cli calendar scottsdalegymnastics --format ics --out fall-camps.ics
```

Builds one event per camp session from the block and schedule arrays, with the portal registration link attached to each event.

### Check several gyms for openings in one pass

```bash
iclasspro-pp-cli compare --accounts scottsdalegymnastics,oasisgymnastics,tigar --agent
```

Joins the synced copies of each account locally, which is the only way to line up programs whose names and ids differ per gym.

### Audit a catalog before pushing it to a client website

```bash
iclasspro-pp-cli lint scottsdalegymnastics --agent
```

Flags the records that will render blank or dead on a site: missing descriptions, missing images, expired registration windows, and programs already marked deleted upstream.

### Establish a staff session without putting credentials in shell history

```bash
ICLASSPRO_STAFF_USERNAME=staff-user ICLASSPRO_STAFF_PASSWORD='...' iclasspro-pp-cli auth staff-login examplegym
```

The password is used only for login and is never persisted. Verify with 'auth staff-status'; status output never exposes the cookie.

### Record an authoritative catalog snapshot

```bash
iclasspro-pp-cli sync examplegym --resources classes,camps --agent
```

Only a complete classes-and-camps walk replaces the snapshot used by `drift`. A classes-only or camps-only run still updates openings history and the search cache, but it cannot make the omitted resource type look deleted.

### Read staff-side operational data

```bash
iclasspro-pp-cli admin families examplegym --q smith --limit 25 --agent
```

The admin group covers dashboard, families, students, class search, enrollments, attendance, transactions, and report definitions through an explicit read-only endpoint allow-list.

### Keep public reads working after a customer session expires

```bash
iclasspro-pp-cli locations examplegym --agent
```

The CLI tries a stored customer session first. If iClassPro rejects that JWT with HTTP 401, it automatically retries the same read through the anonymous Open API. Public catalogs continue normally; gated catalogs return their sign-in message so you can run `auth login` again.

### Read attendance without hunting for an internal timeslot ID

```bash
iclasspro-pp-cli admin attendance examplegym 12345 2026-08-12 --agent
```

The CLI resolves the date's unique `tsId` through the Office Portal schedule endpoint before reading the roster. If a class has multiple events that day, the error lists their non-sensitive timeslot IDs so you can pass the intended one as the optional fourth argument.

## Auth Setup

Most accounts need no credentials for public catalog reads. Customer-gated catalogs use 'auth login'. If a stored customer token expires, the CLI retries the same read anonymously so an optional stale login cannot break a public catalog; a genuinely gated catalog still reports that a fresh login is required. Staff-side reads use a separate Office Portal session created by 'auth staff-login' from ICLASSPRO_STAFF_USERNAME and ICLASSPRO_STAFF_PASSWORD. Credentials are never accepted as flags, passwords are never persisted, and only server-issued session material is stored in the private 0600 session file. The admin surface is an explicit read-only allow-list and does not cache Office Portal responses.

Run `iclasspro-pp-cli doctor` to verify setup.

## Agent Mode

Add `--agent` to any command. Expands to: `--json --compact --no-input --no-color --yes`.

- **Pipeable** — JSON on stdout, errors on stderr
- **Filterable** — `--select` keeps a subset of fields. Dotted paths descend into nested structures; arrays traverse element-wise. Critical for keeping context small on verbose APIs:

  ```bash
  iclasspro-pp-cli bookings mock-value mock-value --agent --select id,name,status
  ```
- **Previewable** — `--dry-run` shows the request without sending
- **Offline-friendly** — sync/search commands can use the local SQLite store when available
- **Non-interactive** — never prompts, every input is a flag
- **Read-only** — do not use this CLI for create, update, delete, publish, comment, upvote, invite, order, send, or other mutating requests

### Response envelope

Commands that read from the local store or the API wrap output in a provenance envelope:

```json
{
  "meta": {"source": "live" | "local", "synced_at": "...", "reason": "..."},
  "results": <data>
}
```

Parse `.results` for data and `.meta.source` to know whether it's live or local. A human-readable `N results (live)` summary is printed to stderr only when stdout is a terminal AND no machine-format flag (`--json`, `--csv`, `--compact`, `--quiet`, `--plain`, `--select`) is set — piped/agent consumers and explicit-format runs get pure JSON on stdout.

## Paths and state

Agents should treat the CLI's path resolver as part of the runtime contract:

- Use `--home <dir>` for one invocation, or set `ICLASSPRO_HOME=<dir>` to relocate all four path kinds under one root.
- Use per-kind env vars only when a specific kind must diverge: `ICLASSPRO_CONFIG_DIR`, `ICLASSPRO_DATA_DIR`, `ICLASSPRO_STATE_DIR`, `ICLASSPRO_CACHE_DIR`.
- Resolution order is per-kind env var, `--home`, `ICLASSPRO_HOME`, XDG (`XDG_CONFIG_HOME`, `XDG_DATA_HOME`, `XDG_STATE_HOME`, `XDG_CACHE_HOME`), then platform defaults.
- `config` contains settings like `config.toml` and profiles. `data` contains `credentials.toml`, `data.db`, cookies, and auth sidecars. `state` contains persisted queries, jobs, and `teach.log`. `cache` contains regenerable HTTP/cache files.
- Stored secrets live in `credentials.toml` under the data dir. Existing legacy `config.toml` secrets are read for compatibility and leave `config.toml` on the first auth write.
- Run `iclasspro-pp-cli doctor --fail-on warn` to surface path and credential-location warnings. `agent-context` exposes a schema v4 `paths` block for agents that need the resolved dirs.
- For MCP, pass relocation through the MCP host config. The MCP binary does not inherit CLI flags:

  ```json
  {
    "mcpServers": {
      "iclasspro": {
        "command": "iclasspro-pp-mcp",
        "env": {
          "ICLASSPRO_HOME": "/srv/iclasspro"
        }
      }
    }
  }
  ```

Fleet precedence: an inherited per-kind env var overrides an explicit `--home` for that kind. Use `ICLASSPRO_HOME` or per-kind vars as durable fleet levers, and use `--home` only for a single invocation. Relocation is not reversible by unsetting env vars; move files manually before clearing `ICLASSPRO_HOME`, or `doctor` will not find credentials left under the former root.

## Automatic learning

This CLI ships a self-capturing learning loop. The CLI does its own bookkeeping: every invocation is journaled locally, a failed flag followed by a corrected retry auto-derives a `flag_alias` candidate, and a `teach` on a query family without a playbook auto-synthesizes a `playbook_candidate` from the session's journal. Your job is judgment only: `recall` first, act on surfaced candidates, `teach` the final answer, `playbook amend` when you observe a correction. You never record failures by hand.

### Step 1: `recall` before any di