Back to skills
SkillHub ClubAnalyze Data & AIFull StackData / AI

cloudflare-kv

Use when persisting tool data in Cloudflare KV - Describes bindings, key naming, and function conventions.

Packaged view

This page reorganizes the original catalog entry around fit, installability, and workflow context first. The original raw source lives below.

Stars
7
Hot score
83
Updated
March 20, 2026
Overall rating
C1.7
Composite score
1.7
Best-practice grade
A92.0

Install command

npx @skill-hub/cli install dave1010-tools-cloudflare-kv

Repository

dave1010/tools

Skill path: .agents/skills/cloudflare-kv

Use when persisting tool data in Cloudflare KV - Describes bindings, key naming, and function conventions.

Open repository

Best for

Primary workflow: Analyze Data & AI.

Technical facets: Full Stack, Data / AI.

Target audience: everyone.

License: Unknown.

Original source

Catalog source: SkillHub Club.

Repository owner: dave1010.

This is still a mirrored public skill entry. Review the repository before installing into production workflows.

What it helps with

  • Install cloudflare-kv into Claude Code, Codex CLI, Gemini CLI, or OpenCode workflows
  • Review https://github.com/dave1010/tools before adding cloudflare-kv to shared team environments
  • Use cloudflare-kv for development workflows

Works across

Claude CodeCodex CLIGemini CLIOpenCode

Favorites: 0.

Sub-skills: 0.

Aggregator: No.

Original source / Raw SKILL.md

---
name: cloudflare-kv
description: "Use when persisting tool data in Cloudflare KV - Describes bindings, key naming, and function conventions."
---

## Cloudflare KV basics

- Cloudflare deploys a shared KV namespace bound as `TOOLS_KV` for all tools. Use the binding directly; do not create new namespaces per tool.
- Structure keys as `<tool-name>:<key>` so data stays isolated between tools.
- Store small JSON blobs or strings. For structured data, serialize to JSON and document the schema in the tool README.

## Access patterns

- Prefer atomic operations like `TOOLS_KV.get`, `put`, and `delete`. For counters, use `TOOLS_KV.get` + `put` with retries or Workers KV atomic counters when available.
- Always handle the `null` case on `get` to avoid `undefined` data paths for first-time users.
- Cache reads in memory during a single request when multiple lookups are required.

## Cloudflare Functions

- Name or prefix Functions after the tool, e.g. `counter_increment` or `counter/functions/increment` so routes stay organized.
- In Functions, read and write KV via the `env.TOOLS_KV` binding provided in the handler signature.
- Return descriptive error messages and HTTP status codes for KV failures to simplify debugging.

## Example

The `counter` tool stores its count in `TOOLS_KV` under the key `counter:value`. Reuse that pattern whenever you need shared state across sessions.
cloudflare-kv | SkillHub