Claude Code Skills for Kalshi & Polymarket US Bot Builders (3 Copy-Paste Skills)

KalshiPolymarket US Agent workflows (no trading)

Short answer: A Claude Code skill is a folder with a SKILL.md file: YAML frontmatter (a description that tells Claude when to use it) plus Markdown instructions. Project skills live in .claude/skills/<name>/SKILL.md, and you run one with /name or let Claude load it when relevant. For bot builders, skills are great for repeatable checks, but they're instructions, not enforcement: hard rules belong in hooks, deny rules and code.

What are the key facts?

  • A skill is a directory with a SKILL.md: frontmatter between --- lines, then instructions. The directory name (or name field) becomes the /command.
  • Locations: ~/.claude/skills/<name>/ (all your projects), .claude/skills/<name>/ (this repo, commit it). Older .claude/commands/*.md files still work.
  • Only description is recommended; Claude uses it to decide when to load the skill, and cuts it (with when_to_use) at 1,536 characters. The body only loads when the skill is used.
  • disable-model-invocation: true means only you can run the skill with /name. The docs suggest it for anything with side effects or timing you want to control.
  • allowed-tools grants tools without asking during that turn; it doesn't restrict anything. disallowed-tools removes tools while the skill runs, and in the main conversation the block clears when you send your next message. We use it to block Edit and Write in all three skills.
  • Never pre-approve order scripts or broad Bash(*), and read the frontmatter of any skill you didn't write.
  • Cursor and Grok Build read .claude/skills/ and honor disable-model-invocation. Codex reads .agents/skills/ and needs agents/openai.yaml with allow_implicit_invocation: false instead. Strict Agent Skills validators reject the Claude Code-only fields.
DifficultyBeginner
Time20–30 min
Cost$0
Works withClaude Code, Cursor, Codex, Grok Build

What will you build?

Three project skills in .claude/skills/: /docs-check (verify every endpoint the bot uses against the official docs), /paper-review (summarize a paper-trading log without ever touching keys) and /preflight-live (a go-live checklist only you can trigger, which never places orders).

Who is it for?

Claude Code users building Kalshi or Polymarket US bots who keep pasting the same "check the docs" and "review my paper log" instructions.

Not for: Skills that place trades, read keys or decide what to trade. None of these do.

What we found when we checked this page

On Dec 2, 2026 we rebuilt the three skills from the prompt below in a copy of the Kalshi demo bot from our Claude Code bot recipe (our newest build of it, from Oct 23). We ran that bot in paper mode on live Kalshi demo data, with no keys, so it sent no orders. Then we followed each skill by hand, step by step, against the real code, the real logs and Kalshi's live docs, and checked the files with skills-ref, the Agent Skills reference validator. We didn't run them inside Claude Code, Cursor, Codex or Grok Build, so this shows what the instructions ask for, not how a given model carries them out.

What we found (Dec 2, 2026)

  • /preflight-live would have passed a daily loss limit that can never trigger. The bot checks state.daily_loss_usd (risk.py:44), but risk.py:24 sets it to 0 ("placeholder until fills are wired") and nothing ever updates it. The old checklist only asked for "the lines that enforce" each limit, and that line exists. It now asks for the check and the line that updates the value it compares. A value that never changes is a FAIL.
  • /paper-review missed two copies of the bot writing one log. We started a second paper run before the first had stopped (our mistake). For 32 seconds the log alternated between two markets about 2 seconds apart, with a 10-second poll. The old instructions only said "bugs", and the time span and counts looked normal. The skill now flags entries closer together than the poll interval, or for two markets at once. A second live copy of a bot can double your orders.
  • It also didn't count idle loops. Of 23 entries, 12 were "no ask": the eSoccer market we picked had its only ask taken between our scan and the run. The skill now counts no-action entries by reason and says which time zone the log uses (this bot logs UTC).
  • The secrets check broke outside git. Our bot folder isn't a git repo, so git ls-files failed with "fatal: not a git repository". The checklist now marks that UNKNOWN and lists any .env or key files on disk by name only. There were none, just .env.example.
  • The prompt built thinner skills than the files on this page. A fresh build from the Oct 25 prompt dropped the entry count, the by-market breakdown, the .gitignore check and the closing line. The Dec 2 prompt spells all of them out, so prompt and files match.
  • /docs-check found nothing wrong, as it should. The bot makes 3 calls: GET /markets/{ticker}, POST /portfolio/events/orders and DELETE /portfolio/events/orders. All 3 are in Kalshi's current docs, and the order body has all 6 required Create Order (V2) fields. One thing worth knowing: Kalshi's Cancel All Orders page says that if you omit subaccount, it can cancel orders in any subaccount.
  • Docs changes since Oct 25. Claude Code: in the main conversation, disallowed-tools now clears when you send a message after the turn that ran the skill, and skills served by MCP servers ignore allowed-tools and disallowed-tools. Cursor's skills page now covers the Agents Window, which reads .agents/skills/ and .cursor/skills/ and, for compatibility, .claude/skills/ and .codex/skills/. Its name must match the folder name. Grok Build and Codex still match this page: allowed-tools does nothing in Grok Build, and Codex uses allow_implicit_invocation: false.
  • skills-ref gave the same result. Built from GitHub main, it rejected all three files for the Claude Code-only fields (disallowed-tools, and disable-model-invocation on preflight-live). With those two lines removed, all three validated.

What we found (Oct 25, 2026)

  • /preflight-live failed a safe bot for the wrong reasons. The old checklist hardcoded one design: a --live flag plus a typed confirmation, and a file called tests/test_limits.py. Our bot has neither. Its base URL is hardcoded to demo (broker.py:6), so going live takes a code change, which is stricter. Its limit tests are in tests/test_v2.py (10 pass). The new checklist asks how live mode turns on and runs whatever tests the repo has.
  • The tests only ran in the repo's own environment. With the system Python, pytest stopped on ModuleNotFoundError: requests. In the bot's .venv, all 10 passed. The checklist now says to use the repo's environment and not install anything.
  • /paper-review asked for P&L the log can't give. The demo log had 10 entries over 38 seconds: 1 dry-run order, 7 "holding", 2 kill-switch blocks, and no fills. "Simulated P&L after fees" invites a made-up number. The skill now says "no fills logged, P&L unknown" when that's the case.
  • Codex would auto-run /preflight-live. The page said to symlink .agents/skills for Codex. Codex doesn't read disable-model-invocation. Its manual-only switch is policy: allow_implicit_invocation: false in the skill's agents/openai.yaml, so we added that file. In Codex you call it as $preflight-live.
  • "Don't edit code" can now be enforced in Claude Code. The new disallowed-tools field removes tools while a skill is active. We use it for Edit, Write and NotebookEdit. We left Bash on: on macOS and Linux, Claude Code searches files through Bash, so blocking it would stop the skills from reading the repo.
  • The Claude Code fields don't validate as strict Agent Skills. skills-ref passed the old docs-check and paper-review and rejected preflight-live: "Unexpected fields in frontmatter: disable-model-invocation". The new files fail the same way on disallowed-tools. Claude Code and Cursor accept them, and Grok Build ignores fields it doesn't know. Remove those fields before uploading a skill to claude.ai.
  • allowed-tools means three different things. Claude Code: it grants tools for that turn and restricts nothing. Grok Build: it "does not grant or restrict tools". Cursor doesn't list it. We still don't use it.
  • /docs-check found nothing wrong. All 8 calls in that version of the bot (POST and DELETE /portfolio/events/orders, GET /portfolio/orders, /portfolio/positions, /portfolio/balance, /markets/{ticker}, /markets) are in Kalshi's current docs. The order body has the V2 required fields. The skill now starts from each venue's llms.txt index, which lists every page.

The three skills, as we use them now. Copy them as-is or paste the prompt below.

1. .claude/skills/docs-check/SKILL.md: Claude can load it on its own before it writes API code.

---
name: docs-check
description: Check every Kalshi or Polymarket endpoint, request field and auth header in this repo against the official docs. Use before writing or changing API client code, or when a request fails with 400, 401 or 404.
disallowed-tools: Edit Write NotebookEdit
---
Check this repo's API calls against the official docs, not memory.
Start from these indexes. Adding .md to a Kalshi page URL gives plain text.
- Kalshi: https://docs.kalshi.com/llms.txt
- Polymarket US: https://docs.polymarket.us/llms.txt
- Polymarket international: https://docs.polymarket.com/llms.txt

1. List every endpoint, method, request field and auth header the code
   uses, with file:line.
2. Open the doc page for each one and read it.
3. Check required body fields and allowed values (enums).
4. Report a table: endpoint | file:line | doc URL | OK, mismatch,
   undocumented or deprecated | detail.
5. Suggest fixes. Don't edit code; I'll ask.
Never open .env, *.pem or *.key files.

2. .claude/skills/paper-review/SKILL.md: reads the bot's own log. No keys involved.

---
name: paper-review
description: Summarize the bot's newest paper-trading or demo log in logs/. Use when asked how the bot did, what it would have traded, or whether it hit a limit.
disallowed-tools: Edit Write NotebookEdit
---
Read the newest file in logs/. Report:
- the time span (say which time zone the log uses) and the entry count
- would-be orders, fills and rejections, by market
- every limit or kill-switch block, with its reason
- no-action entries counted by reason (no ask, market closed, price
  over max)
- P&L after fees, only if the log records fills with prices. Otherwise
  write "no fills logged, P&L unknown". Never estimate fills.
- anything that looks like a bug: repeated orders, missing exits,
  errors, entries closer together than the poll interval, or entries
  for two markets or configs at once (two copies of the bot running)
Say that paper fills are optimistic and demo markets aren't live markets.
Don't recommend trades or say the strategy works.
Never open .env, *.pem or *.key files.

3. .claude/skills/preflight-live/SKILL.md: only you can start it, and it never starts the bot.

---
name: preflight-live
description: Pre-live checklist for this trading bot. Checks only; it never starts trading.
disable-model-invocation: true
disallowed-tools: Edit Write NotebookEdit
---
Mark each item PASS, FAIL or UNKNOWN and show the file:line or command
output behind it. Don't run the bot, place or cancel orders, install
packages or change files.
1. Live switch: show how live mode turns on (flag, config, base URL,
   keys). It must take a deliberate step from me, and the production URL
   must appear only behind that step.
2. Limits: for max order size, max exposure and max daily loss, show
   the check AND the line that updates the value it compares. A value
   that is never updated (a placeholder) is FAIL. Run the repo's
   existing tests in its own environment and show the summary line
   (UNKNOWN if there are none).
3. Kill switch: show the check that stops new orders and the cancel-all
   call. On Kalshi that is DELETE /portfolio/events/orders.
4. Secrets: `git ls-files` lists no .env, key or wallet file, and
   .gitignore covers them. Not a git repo: UNKNOWN, and list any such
   files on disk by name only.
5. Track record: date range and count of paper or demo decisions in
   logs/, plus any errors or limit breaches. FAIL if under several days.
End with: "Going live is your call. Start it yourself."

For Codex, add .claude/skills/preflight-live/agents/openai.yaml:

policy:
  allow_implicit_invocation: false

What /preflight-live reported on our demo bot, Dec 2 (followed by hand, trimmed):

1. Live switch   PASS     broker.py:7 BASE_URL = demo host; no prod URL in
                          repo. Keys only enable signed demo calls.
2. Limits        FAIL     size risk.py:40, exposure risk.py:42 (updated
                          risk.py:28). Daily loss risk.py:44 compares
                          daily_loss_usd, set to 0 at risk.py:24
                          ("placeholder until fills are wired"), never
                          updated. .venv/bin/python -m pytest: 18 passed
3. Kill switch   PASS     risk.py:17-18 KILL file or BOT_KILL=1; bot.py:20
                          broker.py:57 DELETE /portfolio/events/orders
4. Secrets       UNKNOWN  git ls-files: fatal: not a git repository.
                          .gitignore has .env, .env.*, *.pem, *.key,
                          secrets/. On disk: only .env.example
5. Track record  FAIL     logs/decisions.jsonl: 14:25:37-14:26:18 UTC,
                          5 decisions, 0 errors. Under several days.
Going live is your call. Start it yourself.

And /paper-review on the log from our overlapping runs, Dec 2 (followed by hand, trimmed):

Span: 2026-12-02 14:21:11 to 14:24:11 UTC (log is UTC), 23 entries
Orders: 1 dry run, KXNBASTL-26DEC02TORSAS-TORJWALTER14-2, bid 1 @ $0.38
Fills: none logged. Rejections: none.
Blocks: 10 x "kill switch on" (14:23:11-14:24:11)
No action: 12 x "no ask" (KXESOCCERGAME-26DEC020922FROSOUSM-OUSM)
P&L: no fills logged, P&L unknown
Bug: 14:23:01-14:23:33 entries alternate between OUSM and
     TORJWALTER14-2 about 2 s apart, under the 10 s poll. Two copies
     of the bot were running.
Paper fills are optimistic and demo markets aren't live markets.

On a clean single run, the same skill flagged a different bug. The bot proposed the same $0.38 buy on every loop (3 dry-run orders in 21 seconds), and only max_orders_per_minute stopped the 4th and 5th. Nothing in it checks whether it already holds that position.

Built this before Dec 2? Paste this into Claude Code in that repo:

Update the skills in .claude/skills/ (show the diff, then apply):
1. preflight-live, limits: for each limit show the check AND the line
   that updates the value it compares. A value that is never updated
   (a placeholder) is FAIL, not PASS.
2. preflight-live, secrets: if this isn't a git repo, mark UNKNOWN and
   list any .env, key or wallet files on disk by name only.
3. paper-review: say which time zone the log uses; count no-action
   entries by reason; flag entries closer together than the poll
   interval, or for two markets/configs at once (two copies running).

Already made the Oct 19 skills? Paste this into Claude Code in that repo:

Update the skills in .claude/skills/ (show the diff, then apply):
1. docs-check: start from https://docs.kalshi.com/llms.txt,
   https://docs.polymarket.us/llms.txt and
   https://docs.polymarket.com/llms.txt; check required fields and enums.
2. paper-review: report P&L only if fills with prices are logged,
   otherwise "no fills logged, P&L unknown". Never estimate fills.
3. preflight-live: don't assume a --live flag or tests/test_limits.py.
   Ask how live mode turns on, and run this repo's existing tests in its
   own environment. Add UNKNOWN for checks that can't be done.
4. Add "disallowed-tools: Edit Write NotebookEdit" to all three.
5. Add preflight-live/agents/openai.yaml with
   policy: allow_implicit_invocation: false

What prompt do you paste into your AI coding tool?

Works in Claude Code, Cursor, Codex/ChatGPT, Grok or any agent that can write files. Paste it into an empty folder. Read what it builds before you run anything.

Create three Claude Code project skills in this bot repo. Follow the
official docs at https://code.claude.com/docs/en/skills (SKILL.md: YAML
frontmatter between --- lines, then Markdown instructions).

1. .claude/skills/docs-check/SKILL.md
   description: check every Kalshi / Polymarket endpoint, request field
   and auth header in this repo against the official docs; use before
   writing API code or on 400/401/404 errors.
   frontmatter: disallowed-tools: Edit Write NotebookEdit
   Body: start from https://docs.kalshi.com/llms.txt,
   https://docs.polymarket.us/llms.txt and
   https://docs.polymarket.com/llms.txt. List calls with file:line, open
   each doc page, check required fields and enums, report a table (OK /
   mismatch / undocumented / deprecated). Suggest fixes, don't edit.
2. .claude/skills/paper-review/SKILL.md
   description: summarize the newest paper/demo log in logs/.
   frontmatter: disallowed-tools: Edit Write NotebookEdit
   Body: time span (say which time zone the log uses) and entry count;
   would-be orders, fills and rejections by market; limit and
   kill-switch blocks with reasons; no-action entries counted by reason
   (no ask, market closed, price over max). Flag as bugs: repeated
   orders, missing exits, errors, and entries closer together than the
   poll interval or for two different markets/configs at once (two
   copies of the bot running). P&L after fees only if fills with prices
   are logged; otherwise "no fills logged, P&L unknown". Never estimate
   fills. Say paper fills are optimistic. No trade advice.
3. .claude/skills/preflight-live/SKILL.md
   frontmatter: disable-model-invocation: true and
   disallowed-tools: Edit Write NotebookEdit
   Body: PASS / FAIL / UNKNOWN with file:line or command output for:
   how live mode turns on (must be deliberate, prod URL only behind it);
   order size, exposure and daily loss limits: show the check AND the
   line that updates the value it compares; a value that is never
   updated (a placeholder) is FAIL. Run the repo's existing tests in its
   own environment (UNKNOWN if there is none);
   kill check and cancel-all (Kalshi: DELETE /portfolio/events/orders);
   secrets: git ls-files shows no .env, key or wallet file and
   .gitignore covers them (not a git repo: UNKNOWN, and list any such
   files on disk by name only); date range of logs/ (FAIL if under
   several days). Never run the bot, place or cancel orders, install
   packages or change files. End with "Going live is your call. Start
   it yourself."
   Also add .claude/skills/preflight-live/agents/openai.yaml with
   policy: allow_implicit_invocation: false (Codex's manual-only switch).

Rules for all three: no allowed-tools, no !`command` lines, never open
.env, *.pem or *.key files. Show me the files when done.

How do you build it, step by step?

  1. Open your bot repo in a terminal and start Claude Code with claude.
  2. Create the skills: paste the prompt, or copy the three files from the section above into .claude/skills/.
  3. Check they loaded. Ask Claude Code "What skills are available?" or type / and look for docs-check, paper-review and preflight-live. Claude Code watches skill folders, so edits apply without a restart. A brand-new top-level skills folder needs /reload-skills.
  4. Run /docs-check before your next API change. It's the fastest way to catch an outdated endpoint, such as Kalshi's move to Create Order V2 at POST /portfolio/events/orders.
  5. Run /paper-review after a day of paper or demo trading.
  6. Run /preflight-live only when you're considering live mode. Because of disable-model-invocation: true, Claude can't start it on its own. Expect FAILs early on: on Dec 2 ours failed the track-record check after 41 seconds of demo logs, and the daily loss check because it was a placeholder. That's the point.
  7. Commit .claude/skills/ so the skills travel with the repo. Cursor and Grok Build read it as-is. For Codex, symlink .agents/skills to .claude/skills and keep the agents/openai.yaml file, or Codex may start $preflight-live on its own.

How do you test it in paper or demo mode first?

None of these skills trade. /paper-review is built for the paper and demo phase: it reads the log your bot already writes, so you get a consistent summary every time without giving the agent keys or account access.

Treat its P&L line with suspicion. Paper fills assume you got the price you saw, and Kalshi notes demo markets may not behave like real ones. If your bot only logs decisions, as ours did, there's no P&L to report, and the skill says so instead of guessing.

What safety checks does it need before real money?

Tick every box before the bot touches real money. The full rules file, .gitignore and pre-commit hook are in the Safety Pack.

Which official docs did we check?

Endpoints and rules were checked against these pages on Dec 2, 2026. APIs change, so if something here disagrees with the official docs, trust the docs and tell us.

Frequently asked questions

What are Claude Code skills?

Reusable instruction packages. Each is a folder with a SKILL.md file. Claude adds the skill's description to its context and loads the full instructions when the skill is relevant, or when you type /skill-name.

Where do Claude Code skills go?

Personal skills go in ~/.claude/skills/<name>/SKILL.md and work in all your projects. Project skills go in .claude/skills/<name>/SKILL.md and can be committed to the repo. Plugins and managed settings can also ship skills.

What's the difference between a skill and CLAUDE.md?

CLAUDE.md loads every session, so it's for short, always-true facts. A skill's body loads only when it's used, so it suits longer procedures like a docs check or a pre-live checklist.

What's the difference between skills and hooks?

A skill tells Claude what to do. A hook is a script Claude Code runs every time an event happens, and it can block a tool call. Use skills for workflows and hooks for rules that must never be broken.

Do Claude Code skills work in Cursor, Codex or Grok?

Mostly. Cursor and Grok Build load .claude/skills/ and honor disable-model-invocation. Cursor also wants name to match the folder name. Codex reads .agents/skills/, is called with $name, and uses agents/openai.yaml for manual-only skills. disallowed-tools works only in Claude Code, and Grok Build says allowed-tools neither grants nor restricts tools there.

Why does a validator reject my skill?

The Agent Skills spec allows only name, description, license, compatibility, metadata and allowed-tools. skills-ref validate flags disable-model-invocation and disallowed-tools as unexpected. Claude Code and Cursor are fine with them. Remove them before uploading to claude.ai.

Can a skill place trades for me?

It could if you wrote one that runs order scripts, which is exactly why we don't. Keep order placement in your bot's code behind its own live gate and limits, not in an AI skill.

Claude Code Hooks for Trading Bots: Block Secrets, Gate Live Orders

Copy-paste Claude Code hooks for Kalshi and Polymarket US bot projects: a PreToolUse guard that blocks secret-file access, live-trading commands and git push, plus a PostToolUse hook that re-runs your limit tests. Tested in the input formats Claude Code, Cursor, Grok Build and Codex send.

KalshiPolymarket US Agent guardrails (no trading) Intermediate

More from the kitchen: Recipes by platform · Kalshi & Polymarket fee calculator · How we verify recipes · Safety Pack