Pp prediction goat

From mvanhorn/printing-press-library · View interactive version

Pp prediction goat is an AI agent skill from the GitHub repository mvanhorn/printing-press-library. Every Polymarket and Kalshi market in one slim agent-native CLI, with cross-venue topic search and screens no other... Trigger phrases: `what are the odds on`, `polymarket odds for`, `kalshi odds for`, `find prediction markets for`, `what's trending on polymarket`, `what's resolving this week`, `com

How to use this skill

Skill file

<!-- GENERATED FILE — DO NOT EDIT.

This file is a verbatim mirror of library/payments/prediction-goat/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/". -->

Prediction GOAT — Printing Press CLI

Prerequisites: Install the CLI

This skill drives the prediction-goat-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:

```bash

npx -y @mvanhorn/printing-press-library install prediction-goat --cli-only

```

  1. Verify: prediction-goat-pp-cli --version
  2. Ensure $GOPATH/bin (or $HOME/go/bin) is on $PATH.

If the npx install fails (no Node, offline, etc.), fall back to a direct Go install (requires Go 1.26.6 or newer):

go install github.com/mvanhorn/printing-press-library/library/payments/prediction-goat/cmd/prediction-goat-pp-cli@latest

If --version reports "command not found" after install, the install step did not put the binary on $PATH. Do not proceed with skill commands until verification succeeds.

Read-only by design and by CI lint - the binary structurally cannot trade. topic <name> returns every related Polymarket + Kalshi market/event/tag in one ~3KB ranked bundle (vs the official Polymarket CLI's ~250KB firehose). Local SQLite + FTS5 keeps queries instant and free after one sync. Six screens (trending, resolving, liquid, mispriced, movers, new) cover the workflows agents and odds researchers run every week.

When to Use This CLI

Reach for prediction-goat-pp-cli when an agent needs current prediction-market odds across both Polymarket and Kalshi without trading. The killer commands are topic, compare, and the six screens - every other command exists so power users can drill into one venue or one market. The CLI is read-only by structural CI guarantee: it cannot place orders, hold a wallet, or sign trades, which makes it safe to embed in agent toolchains.

Unique Capabilities

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

Cross-venue intelligence

_When an agent needs current odds on a topic, this is the one-call answer across both venues without fanning out to two platform tools and re-ranking by hand._

```bash

prediction-goat-pp-cli topic kanye --json

```

_The clearest signal that one venue is wrong or one side is mispricing - useful for calibration research, not trading._

```bash

prediction-goat-pp-cli mispriced --threshold 0.05 --json

```

_Tells an agent or analyst 'which venue has the better/different number on this outcome' in one read-only call._

```bash

prediction-goat-pp-cli compare 'arizona basketball' --json

```

_When you already know the two slugs/tickers (e.g. from topic <theme>), diff shows you exactly where the venues disagree._

```bash

prediction-goat-pp-cli markets diff <pm-slug> <kalshi-ticker> --json

```

Discovery walks

_The reliable way to anchor into multi-outcome event families without guessing slug suffixes (the gamma frontend appends -467, -595 etc)._

```bash

prediction-goat-pp-cli polymarket event-of will-ghana-win-the-2026-fifa-world-cup

```

_One call returns every team in a World Cup event, every draft slot, every WCF candidate, with prices. The path that works when topic + public-search both miss the long tail._

```bash

prediction-goat-pp-cli polymarket siblings will-ghana-win-the-2026-fifa-world-cup --agent

```

_Faster + higher recall than topic when you know roughly what you're looking for (e.g. searching WEST surfaces KXNBAWEST, the conference championship series with $29M of volume)._

```bash

prediction-goat-pp-cli kalshi-series-search WEST --agent

```

Screens

_One command answers 'what should I be watching today' without scraping two homepages._

```bash

prediction-goat-pp-cli trending --json --limit 20

```

_Tells an agent 'what's about to settle' without re-paging two cursors._

```bash

prediction-goat-pp-cli resolving --week --json

```

_Filters out thin markets that will move on a single 100-dollar bet._

```bash

prediction-goat-pp-cli liquid --min-volume 100000 --json

```

_Surfaces narrative shifts (price-driven) vs hype shifts (volume-driven from )._

```bash

prediction-goat-pp-cli movers --window 7d --json

```

_Newly listed markets are where the alpha and mispricings live._

```bash

prediction-goat-pp-cli new --days 7 --json

```

Command Reference

comments - Comment system and user interactions

events - Event management and event-related operations

markets - Market data and market-related operations

profiles - User profile management

public-profile - Manage public profile

public-search - Manage public search

series - Series management and related operations

series-summary - Manage series summary

sports - Sports-related endpoints including teams and game data

status - Manage status

tags - Tag management and related tag operations

teams - Manage teams

Finding the right command

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

prediction-goat-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

Find every market for a topic across both venues

prediction-goat-pp-cli topic kanye --json --select markets.title,markets.venue,markets.yesProbability,markets.endDate

Slim ranked bundle of every related PM + Kalshi market. --select reduces to four fields per row; an agent sees ~1KB instead of the firehose.

What's settling this week?

prediction-goat-pp-cli resolving --week --json --select title,venue,endDate,liquidity --limit 10

Local SQL filter on end_date < now+7d across both venues, sorted by liquidity descending. --select keeps the response tiny.

Side-by-side odds comparison

prediction-goat-pp-cli compare 'arizona basketball' --json

Resolves the topic to paired markets and renders YES/NO + implied prob for each venue side-by-side. Tells you exactly where PM and Kalshi disagree.

Enumerate every child market under a Kalshi event

When the event ticker is known (often discovered via kalshi-series-search then kalshi events list --series), one call returns every child market with live prices:

prediction-goat-pp-cli kalshi events get KXMENWORLDCUP-26 --with-markets --agent

Passes with_nested_markets=true to the upstream /events/{ticker} endpoint. The response includes a markets array with ticker, title, yes_sub_title, status, yes_ask_dollars, no_ask_dollars, volume_24h_fp, and expiration_time for each child. This is the lightweight alternative to a full sync walk when you only need one event's children.

List every Kalshi event under a series

prediction-goat-pp-cli kalshi events list --series KXMENWORLDCUP --agent

Filters /events by series_ticker. The --series flag forces --data-source live since the local store doesn't index by series ticker. Use this before kalshi events get --with-markets when you don't know the exact event ticker — series → event → markets in three calls.

Catch mispricings across venues

prediction-goat-pp-cli mispriced --threshold 0.05 --json --select pair.pm.title,pair.kalshi.title,delta

Returns same-outcome market pairs where implied probabilities diverge by 5+ percentage points. Slim output via --select. Untraded Kalshi markets (those carrying the platform default 17c ask with zero volume) are filtered before pairing so the result is actionable divergence, not noise.

What are the odds X wins event Y? (event-walk recipe)

When you know one outcome's market slug but want every sibling under the same multi-outcome event (e.g. all 48 World Cup teams or all 14 NBA lottery picks), walk from any known slug to the parent event and back to all siblings:

prediction-goat-pp-cli polymarket siblings will-ghana-win-the-2026-fifa-world-cup --agent

Returns the parent event metadata plus every sibling market with yesPercent populated. Bypasses the upstream /public-search endpoint which goes stale for celebrity and multi-outcome hub topics. Pair with polymarket event-of <market-slug> when you only want the parent event slug.

Find a Kalshi series by substring

prediction-goat-pp-cli kalshi-series-search WEST --agent

Substring grep over locally synced kalshi_series rows. Useful when the FTS ranker buries the series ticker you want (e.g. KXNBAWEST below higher-term-frequency matches). Requires a prior prediction-goat-pp-cli kalshi sync.

Apples-to-apples cross-venue probabilities

Every priced row in JSON output carries both yesProbability (0-1 float, canonical machine field) and yesPercent (rounded 0-100, for display). Always surface yesPercent to humans; use yesProbability for math. mispriced pairs additionally carry deltaPercent alongside the canonical delta. Kalshi markets without real trading (no last price, no volume, wide spread overshooting $1.00) carry untraded: true and the text-mode YES column shows untraded instead of a misleading platform-default percent.

Auth Setup

No authentication required.

Run prediction-goat-pp-cli doctor to verify setup.

Agent Mode

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

```bash

prediction-goat-pp-cli comments list --agent --select id,name,status

```

Response envelope

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

{
  "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.

Automatic learning

Two-call protocol: recall before discovery, teach & before emitting. The CLI does entity-aware match validation AND surfaces stored playbooks for the query family; you read the envelope and follow the six-branch decision tree. Skipping either side costs you free recall hits in future sessions.

Step 1: `recall` before any discovery

Before topic, compare, polymarket siblings, kalshi events list, or any other discovery command on a new user question, run:

prediction-goat-pp-cli recall "<user's question>" --agent

The response envelope:

{
  "query": "...",
  "normalized": "world cup",
  "query_entities": ["England"],
  "found": true | false,
  "match_score": 0.0,
  "results": [
    { "resource_id": "...", "resource_type": "...", "venue": "...",
      "confidence": 2, "entity_match": "exact|partial|unknown",
      "source": "taught|preseed|recipe", "warnings": ["..."] }
  ],
  "mismatches": [ /* only when --debug-mismatches */ ],
  "warnings": [ /* top-level */ ],
  "playbook": {
    "query_family": "...",
    "playbook": {
      "steps": [ { "cmd": "kalshi events get $EVENT --with-markets", "purpose": "..." }, ... ],
      "entity_slots": ["$TEAM", "$EVENT", "$SERIES"],
      "expected_tool_calls": 2
    },
    "slots_resolved": { "$TEAM": { "token": "portugal", "canonical": "Portugal" } },
    "notes": "kalshi events list pages by created_at desc; --series forces --data-source live"
  },
  "notes": "kalshi events list pages by created_at desc; --series forces --data-source live"
}

Step 2: six-branch decision tree

Read playbook, notes, results[0], and warnings in that order:

if Playbook present:
    -> READ Playbook.notes verbatim FIRST (workarounds + gotchas the CLI surface doesn't expose)
    -> replay Playbook.steps in order, substituting Playbook.slots_resolved entries
       for the entity slot tokens. If a step's slot is unresolved, fall back to
       discovery for that step only.
    -> Playbook.expected_tool_calls is a budget; if you find yourself running
       materially more, record the divergence via teach-playbook at end-of-session.

elif Notes present (no Playbook):
    -> read Notes verbatim before any discovery step; they carry known gotchas
       for this query family even when no structured choreography exists yet.

elif Found AND Results[0].EntityMatch == "exact" AND Results[0].Confidence >= 2:
    -> skip discovery; fetch live prices for Results[*].ResourceID in parallel
       (kalshi markets get <ticker>, markets get-by-slug <pm-slug>, etc.)

elif Found AND Results[0].EntityMatch == "partial":
    -> candidate hint, NOT a hit; read the resource title to validate before trusting

elif (any row in Mismatches[] when --debug-mismatches was passed):
    -> treat as cold start; the stored learning is for a different entity
       (e.g., a "Portugal" learning won't satisfy an "England" query — different canonical)

else:  // Found == false, no playbook, no notes
    -> cold start; run discovery normally; teach the answer afterward AND record
       a playbook + notes via teach-playbook so the next session of the same
       family is faster.

Playbook and Notes are orthogonal to the per-resource path. A recall response can carry both a Playbook AND a Results[] hit -- use both: the Playbook tells you which choreography to run; the resource hits short-circuit specific steps. Default to skipping mismatches; pass --debug-mismatches only when investigating cold-start surprises.

The three playbooks prediction-goat ships out of the box cover the highest-volume query shapes: odds_for_team (single-team odds inside a multi-outcome event), event_markets (every child market under a specific Kalshi event or Polymarket parent event), and series_summary (Kalshi series header + active events + top markets). Each ships with notes capturing the dogfood-discovered gotchas for that shape (untraded-flag filtering, --series forces live data-source, parent-vs-child ticker disambiguation).

Step 3: always read `warnings`

Step 4: `teach &` after finalizing your response

After assembling your user-facing response containing tickers/slugs but BEFORE emitting it, fire the teach call in the background. Append a shell & so the call returns immediately and does not block the user-facing response:

prediction-goat-pp-cli teach --query "<user's question>" --resource <id1> --resource <id2>

Silent on success. Teach the most specific resource — if you fetched a parent event during discovery but the answer lives in a specific child ticker, teach the child. The CLI writes a parent_event_when_child_exists warning to teach.log when you don't, surfaced by learnings list --warnings. The user never sees it. The CLI uses seeded entity_lookups (ISO 3166 country codes plus NFL/NBA/MLB/MLS team rosters with aliases) for cross-alias resolution at recall time, so a teach under "Niners" satisfies future "49ers" queries automatically.

Step 5: record a playbook when discovery took >5 calls

If you ran more than 5 tool calls to answer the question AND you discovered workarounds the CLI didn't surface (silently-dropped flags, undocumented params, pagination tricks, payload gotchas, untraded-flag noise), record them so the next session of the same query family skips that discovery. Prefer the integrated one-call form — record the resource learning and the playbook in the same teach invocation:

# Common case: record both the resource learning AND the playbook in one call.
prediction-goat-pp-cli teach \
  --query "<user's question>" \
  --resource <id1> \
  --playbook-file ~/playbooks/series-summary.json \
  --playbook-notes-file ~/playbooks/series-summary-notes.md
# (append shell `&` to background it)

# Alternate: playbook-only (no resource ticker to record alongside).
prediction-goat-pp-cli teach-playbook \
  --query "<user's question>" \
  --playbook-file ~/playbooks/series-summary.json \
  --notes-file ~/playbooks/series-summary-notes.md

Playbook files are JSON with steps, entity_slots, expected_tool_calls. Notes files are markdown carrying the gotchas verbatim. On the integrated teach form, the playbook flags are optional — at least one of them must be set to upsert a playbook, but you can also omit them entirely for a resource-only teach. On the standalone teach-playbook form, at least one of --playbook-file and --notes/--notes-file must be set; both empty is rejected. Playbooks are keyed on the structural query family (entities stripped) so a recipe taught from "odds Portugal wins world cup" applies to England, Brazil, and every other country query of the same shape, with slots_resolved binding the live query's canonical at recall time.

The three families prediction-goat already ships with playbooks (odds_for_team, event_markets, series_summary) cover the common shapes; if your query family already has a playbook, prefer playbook amend (Step 6) over a full re-teach.

When you DO find a playbook on a future recall, treat it as ground truth: replay the steps with slots_resolved substitutions, skip the discovery that the choreography already documents, and read notes before any step.

Step 6: `playbook amend &` when your debug response identifies a correction

If your debug-protocol response identifies a concrete correction the notes or playbook should know — a workaround, an undocumented endpoint shape, a stale field name, observed schema drift, an empty-payload fallback — fire playbook amend BEFORE emitting your user-facing response. Same fire-and-forget posture as teach.

prediction-goat-pp-cli playbook amend \
  --query "<exact recall query string>" \
  --add-note "<your concrete correction>"
# (append shell `&` to background it)

What counts as worth amending: a behavior you OBSERVED this session that future-you would benefit from knowing. Examples worth amending:

What does NOT belong in notes:

The amend command appends to the family's existing notes with a timestamped marker ([amend YYYY-MM-DDTHH:MMZ]: <text>). Multiple amends accumulate; the audit trail is visible. If no playbook exists yet for the family, amend creates a notes-only one (so cold-start corrections still land). Use playbook list --agent to inspect what's stored.

Worked examples

The three traces this protocol was built from:

  1. Cold: "odds USA wins world cup" — recall returns found=false (no taught row yet, preseed may have created one). Run discovery (kalshi-series-search WORLD, walk children). Answer with KXMENWORLDCUP-26-US. Teach the child:

```bash

prediction-goat-pp-cli recall "odds USA wins world cup" --agent

# found=false -> discovery

prediction-goat-pp-cli kalshi-series-search WORLD --agent

prediction-goat-pp-cli kalshi events get KXMENWORLDCUP-26 --with-markets --agent

# ...respond with KXMENWORLDCUP-26-US...

prediction-goat-pp-cli teach --query "odds USA wins world cup" --resource KXMENWORLDCUP-26-US

# (append shell & to background it)

```

  1. Warm: "odds portugal wins world cup" — recall returns found=true, results[0].entity_match="exact", results[0].confidence>=2. Skip discovery; fetch live prices in parallel:

```bash

prediction-goat-pp-cli recall "odds portugal wins world cup" --agent

# found=true, results=[{resource_id: "KXMENWORLDCUP-26-PT", entity_match: "exact"}, ...]

prediction-goat-pp-cli kalshi markets get KXMENWORLDCUP-26-PT --agent

```

  1. Warm-but-mismatched: "odds england wins the world cup" — recall returns found=false even though a Portugal learning shares the non-entity tokens. The entity validator filtered the Portugal row into mismatches (only visible with --debug-mismatches). Treat as cold; the recipe engine may resolve KXMENWORLDCUP-26-GB directly via the seeded country_iso2 lookup; otherwise discover normally.

`teach-recipe` for explicit template authorship

Recipe inference auto-extracts templates from two structurally-similar teaches (Portugal + USA + the country_iso2 lookup yields the World Cup template). You can author a template up front:

prediction-goat-pp-cli teach-recipe \
  --query-template "odds {entity} wins world cup" \
  --resource-template "KXMENWORLDCUP-26-{entity:country_iso2}" \
  --resource-type kalshi_markets

Optional — only reach for it when you want a recipe to land before two teaches accumulate, or when the resource template needs a strategy (* suffix for prefix search).

`teach-lookup` for adding entity mappings

ISO country codes and major-league sports rosters are pre-seeded. Use teach-lookup only for gaps:

prediction-goat-pp-cli teach-lookup --kind country_iso2 --canonical "Curaçao" --value CW

Computed kinds (lowercase, uppercase, kebab-case, capitalize-first, slug) are resolved by string transform — they need no rows.

Disabling learning

Auditing past teaches

prediction-goat-pp-cli learnings list --agent             # all rows
prediction-goat-pp-cli learnings list --warnings --agent  # rows whose teach raised a warning (parent-vs-child, no-entity-overlap)
prediction-goat-pp-cli forget "<query>" --resource <id>   # undo one teach
prediction-goat-pp-cli forget "<query>" --all             # undo every teach for that query

Use learnings list --warnings to find mis-teaches the CLI flagged but didn't block.

Agent Feedback

When you (or the agent) notice something off about this CLI, record it:

prediction-goat-pp-cli feedback "the --since flag is inclusive but docs say exclusive"
prediction-goat-pp-cli feedback --stdin < notes.txt
prediction-goat-pp-cli feedback list --json --limit 10

Entries are stored locally at ~/.prediction-goat-pp-cli/feedback.jsonl. They are never POSTed unless PREDICTION_GOAT_FEEDBACK_ENDPOINT is set AND either --send is passed or PREDICTION_GOAT_FEEDBACK_AUTO_SEND=true. Default behavior is local-only.

Write what surprised you, not a bug report. Short, specific, one line: that is the part that compounds.

Output Delivery

Every command accepts --deliver <sink>. The output goes to the named sink in addition to (or instead of) stdout, so agents can route command results without hand-piping. Three sinks are supported:

| Sink | Effect |

|------|--------|

| stdout | Default; write to stdout only |

| file:<path> | Atomically write output to <path> (tmp + rename) |

| webhook:<url> | POST the output body to the URL (application/json or application/x-ndjson when --compact) |

Unknown schemes are refused with a structured error naming the supported set. Webhook failures return non-zero and log the URL + HTTP status on stderr.

Named Profiles

A profile is a saved set of flag values, reused across invocations. Use it when a scheduled agent calls the same command every run with the same configuration - HeyGen's "Beacon" pattern.

prediction-goat-pp-cli profile save briefing --json
prediction-goat-pp-cli --profile briefing comments list
prediction-goat-pp-cli profile list --json
prediction-goat-pp-cli profile show briefing
prediction-goat-pp-cli profile delete briefing --yes

Explicit flags always win over profile values; profile values win over defaults. agent-context lists all available profiles under available_profiles so introspecting agents discover them at runtime.

Exit Codes

| Code | Meaning |

|------|---------|

| 0 | Success |

| 2 | Usage error (wrong arguments) |

| 3 | Resource not found |

| 5 | API error (upstream issue) |

| 7 | Rate limited (wait and retry) |

| 10 | Config error |

Argument Parsing

Parse $ARGUMENTS:

  1. Empty, help, or --help → show prediction-goat-pp-cli --help output
  2. Starts with install → ends with mcp → MCP installation; otherwise → see Prerequisites above
  3. Anything else → Direct Use (execute as CLI command with --agent)

MCP Server Installation

Install the MCP binary from this CLI's published public-library entry or pre-built release, then register it:

claude mcp add prediction-goat-pp-mcp -- prediction-goat-pp-mcp

Verify: claude mcp list

Direct Use

  1. Check if installed: which prediction-goat-pp-cli

If not found, offer to install (see Prerequisites at the top of this skill).

  1. Match the user query to the best command from the Unique Capabilities and Command Reference above.
  2. Execute with the --agent flag:

```bash

prediction-goat-pp-cli <command> [subcommand] [args] --agent

```

  1. If ambiguous, drill into subcommand help: prediction-goat-pp-cli <command> --help.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.