Skill Press

No. 589 · k2

Cloudflare K2

A field guide from Cloudflare

Cloudflare

When to use it

Build and troubleshoot Cloudflare K2 or K2 Streams durable logs. Use for stream setup, producing from Workers or HTTP, configuring retention and inputs, and consuming through subscriptions.

Rank
No. 589 of 971
Installs
Not listed yet
Runs in
Claude, Codex, Cursor, GitHub Copilot
Length
270 words · 1 min
Files
3
License
Apache-2.0

Get this skill

Download the skill folder (.zip, 7 KB) ↓ · SKILL.md only ↓

Agent prompt

Paste into a coding agent with terminal access. Check the upstream requirements for the skill you’re installing.

Prompt
Install the "k2" Agent Skill by Cloudflare, from https://github.com/cloudflare/skills.

1. Fetch the whole folder skills/k2 — SKILL.md plus every script, reference, and asset beside it, not just SKILL.md. For example:
   skill_checkout=$(mktemp -d)
   git init "$skill_checkout"
   git -C "$skill_checkout" fetch --depth 1 https://github.com/cloudflare/skills.git 5108325ecceabc899c761e07aa617b09c02445ee
   git -C "$skill_checkout" checkout --detach FETCH_HEAD
2. Copy it into your skills directory as a folder named "k2":
   - Claude Code: ~/.claude/skills/k2/ (all projects) or .claude/skills/k2/ (this project only)
   - Another agent: the directory you load Agent Skills from (folders containing a SKILL.md)
3. Check that k2/SKILL.md exists and its frontmatter says name: k2.
4. Read SKILL.md, then tell me in two or three sentences what the skill does and when it will trigger, and list any dependencies it mentions (Python packages, npm packages, CLIs) that aren't installed yet. Don't install them without asking.

skills CLI

One command; the skills.sh installer detects your agents (Claude Code, Cursor, Codex, and more).

Terminal
npx skills add https://github.com/cloudflare/skills/tree/5108325ecceabc899c761e07aa617b09c02445ee/skills/k2 --skill k2

Claude.ai

Upload the .zip as a custom skill.

  1. In Settings → Capabilities, turn on “Code execution and file creation”.
  2. Download the .zip above.
  3. Go to Customize → Skills, click + → Create skill → Upload a skill, and choose it.
Anthropic’s guide to using skills ↗

Contents

  1. Documentation
  2. Skill feedback

The skill, in full

K2 is a durable log for decoupling event producers and consumers. Start with the K2 overview, then retrieve the relevant current documentation before giving setup instructions, code, limits, availability, permissions, or API details. The docs are the source of truth over this skill. K2 is in public beta on the Workers Paid plan; check the overview for current availability and beta storage limits.

Documentation

Task Docs Check for
Create a stream and try K2 Get started Prerequisites, setup sequence, current API examples
Understand streams and subscriptions Concepts Record model and delivery behavior
Configure a stream Configuration Inputs, authentication, CORS, retention
Produce from HTTP or a Worker Produce records Request and binding syntax, encoding, errors, retries
Consume through subscriptions Consume records Leases, acknowledgements, retries, errors
Reason about duplicates and redelivery Delivery guarantees At-least-once delivery, leases, retention effects
Size a stream or consumer Limits Current quotas and size limits
Estimate cost Pricing Billing status, data produced, consumed, and retained

Retrieve the matching pages above for each task and use their current examples. For capacity or cost questions, check current limits and pricing before quoting values, and state whether billing is enabled yet.

For SQL transformation and delivery to R2 Iceberg tables, use the basin skill. For task processing, consult Queues.

Skill feedback

If the user reports that this skill gave incorrect or outdated guidance, or is missing information, read references/skill-feedback.md.

More in Databases & Storage

All Databases & Storage skills →

More from Cloudflare

From cloudflare/skills at 5108325, Apache-2.0. Install counts from skills.sh.