---
name: trivia
description: 'Advice, cat facts, jokes, and on-this-day anniversaries from free public APIs. Tools: advice, cat-fact, joke, on-this-day. Use when a request needs any of these; each tool''s own trigger is in SKILL.md.'
compatibility: Requires fragletc and Docker. Network access required.
metadata:
  tags: world
  tools: advice.py, cat-fact.py, joke.py, on-this-day.py
---

# Trivia

Advice, cat facts, jokes, and on-this-day anniversaries from free public APIs.

Every tool below is one executable file beside this `SKILL.md`, in the directory the commands below call `<skill-dir>`. Run it directly. Two host requirements: [`fragletc`](https://github.com/ofthemachine/fraglet) (`curl -fsSL https://raw.githubusercontent.com/ofthemachine/fraglet/main/install.sh | sh && fragletc version`) and Docker; the image, parameters, outputs and network reach are declared in the file itself. Before running a tool, print its contract:

```sh
<skill-dir>/advice.py --fraglet-help
```

Parameters are passed as `-p name=value` (a `file` parameter takes a host path); declared outputs are copied out with `--output <name>[=<host path>]`. A missing required parameter fails host-side with exit 2 before any container starts; otherwise the tool's own exit code is the run's. A declared output not named with `--output` is produced and discarded (a stderr note says what you could have copied). Add `--receipt run.json` (or set `FRAGLETC_RECEIPT_DIR`) to record the run: the receipt carries the tool's `procedure_hash`, image digest, parameters, and every input and output by content hash, and `receipt/attest.py` can verify it later without re-running anything.

## Tools

### `advice.py`

A random piece of advice (Advice Slip API, no API key).

Use when the user asks for a random piece of advice, or a caption or meme needs one.

```sh
<skill-dir>/advice.py
```

Parameters:
- none

Outputs:
- stdout

Runs in `ofthemachine/python3@sha256:a015b4f9f0e7c1648f8fcd4164f6a296dd3c9189404f88f333a9764d08d13522`; network required — output depends on live external state; do not cache indefinitely.

### `cat-fact.py`

A random cat fact (catfact.ninja, no API key).

Use when the user asks for a cat fact, or a caption or meme needs one.

```sh
<skill-dir>/cat-fact.py
```

Parameters:
- none

Outputs:
- stdout

Runs in `ofthemachine/python3@sha256:a015b4f9f0e7c1648f8fcd4164f6a296dd3c9189404f88f333a9764d08d13522`; network required — output depends on live external state; do not cache indefinitely.

### `joke.py`

Fetch a random humorous joke or one-liner (icanhazdadjoke.com, no API key).

Use when the user asks for a joke or one-liner, or a caption or meme needs one.

```sh
<skill-dir>/joke.py
```

Parameters:
- none

Outputs:
- stdout

Runs in `ofthemachine/python3@sha256:a015b4f9f0e7c1648f8fcd4164f6a296dd3c9189404f88f333a9764d08d13522`; network required — output depends on live external state; do not cache indefinitely.

### `on-this-day.py`

Notable events that happened on a month and day in history, from Wikipedia's "On this day" feed (Wikimedia API, no key). One "YEAR<TAB>text" line per event, most recent first, count-limited, so a briefing can pick the one that rhymes with today.

Use when the user asks what happened on this day in history, or a newspaper, briefing, or caption wants an anniversary for a given date.

```sh
<skill-dir>/on-this-day.py -p month="<month>" -p day="<day>" [-p count=8]
```

Parameters:
- `month` (string, required) — Month as a number, 1-12
- `day` (string, required) — Day of the month, 1-31
- `count` (string, optional, default `8`) — How many events to print

Outputs:
- stdout

Runs in `ofthemachine/python3@sha256:a015b4f9f0e7c1648f8fcd4164f6a296dd3c9189404f88f333a9764d08d13522`; network required — output depends on live external state; do not cache indefinitely.
