agentleFS
chenxi-bot21chenxi-bot21/claude-workspace-standard/skills/kaggle-competition/SKILL.md

kaggle-competition

Skill2 starsChanged 5 months agoMITView on GitHub

A lean, auditable harness for running Kaggle competitions from an agent: a pluggable competition registry, a shared download -> model -> submit -> score loop, and two submission paths — a CSV path for getting-started/Playground competitions and a kernel path (scaffold -> push -> poll -> pull) for code-competitions whose scoring code must run on Kaggle's own GPU infra. Use when entering, automating, or submitting to a Kaggle competition, or when building a repeatable pipeline that lands real leaderboard scores on a public profile.

1 other project uses a version of this, 1 of them edited.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Wrote their own version · 0

    None found.

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository5 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    API token: Create a Kaggle API token (Settings → API → *Create New Token*).

    line 36
  2. Distinctive:

    Every Kaggle competition submits one of two ways.

    line 69
  3. Distinctive:

    Keep the harness untouched so it stays auditable.

    line 121

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Kaggle Competition Harness

A thin CLI wrapper over the official kaggle API that turns a competition into a repeatable, hand-off-able pipeline. It exists to keep two things separate: the plumbing (download data, submit, read the score) which is identical for every competition, and the modelling which is not. You add a competition by adding one registry entry; you never edit the harness.

The design goal is an honest, auditable pipeline: every score that reaches a résumé or public profile is a real number pulled from the Kaggle API after an actual submission, never an estimate.

When to use

  • Entering a new Kaggle competition and wanting a clean local project layout.
  • Automating the download → build submission → submit → record-score loop.
  • Submitting to a code-competition (scoring code runs on Kaggle, not your machine — e.g. GPU notebooks with no internet at scoring time).
  • Building portfolio signal: real leaderboard placements on a public profile.

Prerequisites (one-time, human actions)

  1. API token. Create a Kaggle API token (Settings → API → Create New Token). Either auth style works and is auto-detected:
    • classic ~/.kaggle/kaggle.json (username + key), or
    • newer ~/.kaggle/access_token.
  2. Accept the rules per competition. The API rejects downloads and submissions until you click Join / I Understand and Accept on each competition's rules page. One click each, once. This is the one step the agent cannot do for you.

Project layout

harness.py and registry.py sit at the root of your Kaggle working directory, next to a competitions/ tree:

<root>/
  registry.py              # key -> {slug, title, rules_url, ...}  (the pluggable seam)
  harness.py               # the shared plumbing (copy from scripts/)
  LEADERBOARD.md           # real scores only, pulled from the API
  competitions/
    <key>/
      data/                # downloaded + unzipped (git-ignore this — large)
      model.py             # builds submission.csv          (CSV path)
      submission.csv
      kernel/              # code-competitions only          (kernel path)
        kernel-metadata.json
        notebook.ipynb     # or main.py
        output/            # pulled-back run outputs
      README.md            # approach + score

The two submission paths

Every Kaggle competition submits one of two ways. The harness supports both with parallel command sets.

CSV path — getting-started / Playground

A local model script trains on your machine and writes submission.csv; the harness uploads it.

python harness.py download <key>        # pull + unzip the data
python competitions/<key>/model.py      # your code -> submission.csv
python harness.py submit   <key> -m "message"
python harness.py score    <key>        # read the leaderboard score back off the API

Kernel path — code-competitions

Some competitions forbid uploading a CSV: the scoring code must run on Kaggle's own infrastructure (a notebook/script, often GPU, usually with no internet at scoring time). The harness scaffolds the kernel, pushes and runs it on Kaggle, polls status, and pulls the output back.

python harness.py kernel-init   <key> [--gpu] [--script] [--code-file f]
#   ... edit competitions/<key>/kernel/<code-file> ...
python harness.py kernel-push   <key>   # push + run on Kaggle infra
python harness.py kernel-status <key>   # poll the run
python harness.py kernel-output <key>   # pull outputs (submission.csv) locally

kernel-init writes a kernel-metadata.json that wires the competition as an input source (so the notebook can read /kaggle/input/<comp>/), sets enable_internet:false (code-competition scoring is offline), toggles GPU, and resolves your Kaggle username automatically. It refuses to overwrite an existing kernel unless you pass --force.

The final code-competition submit is a human website click — open the completed notebook on Kaggle and click Submit. This is deliberate: it is the same accept-the-rules-style real-world action the API can't take, and it keeps a human in the loop before a scored, quota-consuming submission.

Operating discipline

  • Honesty rule. LEADERBOARD.md records only real API-pulled scores. What goes on a résumé is what the public profile shows.
  • Watch the daily submission cap. Most competitions cap submissions per day (commonly 5). Don't burn slots on noise — confirm a change beats the current best offline (cross-validation) before spending a slot.
  • Long kernel runs die on the hidden rerun. Code-competitions re-run your notebook on hidden test data with a time budget. A notebook that takes hours locally can complete-but-not-score on the rerun. Build for minutes, not hours.
  • Pluggable, not hard-coded. New competition = new registry.py entry. Keep the harness untouched so it stays auditable.

Prior art

Two heavier public Kaggle agent skills exist and are worth knowing: NVIDIA/nvidia-kaggle and the official Kaggle/kaggle-skills. They generalize the same kernel push → run → poll loop and add research helpers (ingesting leaderboard writeups, discussions, and public kernels into a local database). This skill deliberately stays a thin CLI wrapper you can read top to bottom — no plugin install, no untrusted scripts, an enforced honesty rule. If manual research of top solutions becomes your bottleneck, NVIDIA's fetch_leaderboard_writeups / fetch_writeup scripts are the piece worth borrowing.

Files

  • scripts/harness.py — the CLI: download | submit | score | kernel-*.
  • scripts/registry.py — the competition registry (edit this; two worked examples included — one CSV, one code-competition).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.