Back to Skills

cloudflare-kv

dave1010
Updated Today
12 views
0
View on GitHub
Otherdata

About

This skill enables developers to persist tool data in Cloudflare KV using the shared `TOOLS_KV` namespace. It provides conventions for key naming with `<tool-name>:<key>` structure and recommends storing small JSON blobs or strings. Use this skill when you need to implement atomic operations like get/put/delete while handling null cases and maintaining data isolation between tools.

Quick Install

Claude Code

Recommended
Plugin CommandRecommended
/plugin add https://github.com/dave1010/tools
Git CloneAlternative
git clone https://github.com/dave1010/tools.git ~/.claude/skills/cloudflare-kv

Copy and paste this command in Claude Code to install this skill

Documentation

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.

GitHub Repository

dave1010/tools
Path: .skills/cloudflare-kv

Related Skills

content-collections

Meta

This skill provides a production-tested setup for Content Collections, a TypeScript-first tool that transforms Markdown/MDX files into type-safe data collections with Zod validation. Use it when building blogs, documentation sites, or content-heavy Vite + React applications to ensure type safety and automatic content validation. It covers everything from Vite plugin configuration and MDX compilation to deployment optimization and schema validation.

View skill

hybrid-cloud-networking

Meta

This skill configures secure hybrid cloud networking between on-premises infrastructure and cloud platforms like AWS, Azure, and GCP. Use it when connecting data centers to the cloud, building hybrid architectures, or implementing secure cross-premises connectivity. It supports key capabilities such as VPNs and dedicated connections like AWS Direct Connect for high-performance, reliable setups.

View skill

llamaindex

Meta

LlamaIndex is a data framework for building RAG-powered LLM applications, specializing in document ingestion, indexing, and querying. It provides key features like vector indices, query engines, and agents, and supports over 300 data connectors. Use it for document Q&A, chatbots, and knowledge retrieval when building data-centric applications.

View skill

csv-data-summarizer

Meta

This skill automatically analyzes CSV files to generate comprehensive statistical summaries and visualizations using Python's pandas and matplotlib/seaborn. It should be triggered whenever a user uploads or references CSV data without prompting for analysis preferences. The tool provides immediate insights into data structure, quality, and patterns through automated analysis and visualization.

View skill