add-ai-feature

add-ai-feature is a command for Claude Code from henkisdabro/cloudflare-workers-react-boilerplate. It costs 0 tokens per session (1,192 once invoked), scanned A, original, MIT.

A guided command for adding artificial-intelligence features to an application built with Cloudflare Workers and React.

In plain words
What is it for?
It is for adding AI functions to Cloudflare Workers and connecting them to a React interface.
Why use it?
It helps developers plan the changes needed across the server and user interface instead of working out the integration alone.

Command for Claude Code

Written for Claude Code: installed under .claude/.

Good fit It is for adding AI functions to Cloudflare Workers and connecting them to a React interface.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/henkisdabro/cloudflare-workers-react-boilerplate/add-ai-feature
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/henkisdabro/cloudflare-workers-react-boilerplate

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for add-ai-feature

README.md
[![agentmods](https://agentmods.dev/badge/commands/henkisdabro/cloudflare-workers-react-boilerplate/add-ai-feature/github.svg)](https://agentmods.dev/commands/henkisdabro/cloudflare-workers-react-boilerplate/add-ai-feature)
Your own site
<a href="https://agentmods.dev/commands/henkisdabro/cloudflare-workers-react-boilerplate/add-ai-feature"><img src="https://agentmods.dev/badge/commands/henkisdabro/cloudflare-workers-react-boilerplate/add-ai-feature/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for add-ai-feature

Your own site · 80×15
<a href="https://agentmods.dev/commands/henkisdabro/cloudflare-workers-react-boilerplate/add-ai-feature"><img src="https://agentmods.dev/badge/commands/henkisdabro/cloudflare-workers-react-boilerplate/add-ai-feature.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,192 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01192
Opus 5.5 $0.00000 $0.00477
Sonnet 5.5 $0.00000 $0.00238
Haiku 4.5 $0.00000 $0.00119

Measured 24d ago against content hash 120af2b9a9d8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

add-ai-feature scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 24d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

Then exercise the endpoint with `curl` and in the browser. Remind the user that Workers AI and AI
.claude/commands/add-ai-feature.md · 93 lines

How it starts

The opening of the file, as written. The whole thing — 93 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Add AI Feature - Interactive Wizard

Add an AI capability to this Cloudflare Workers + React app by adapting the repo's templates and examples. Read AI_INTEGRATION.md first - it holds the current model IDs and platform facts.

Step 0: Check current state

Before asking anything, look at:

  • worker/index.ts - existing routes and the withSecurityHeaders() helper. New endpoints are added as routes here; never replace the file.
  • wrangler.jsonc - whether the ai binding is already uncommented.
  • package.json - whether @anthropic-ai/sdk is installed.
  • .dev.vars - whether ANTHROPIC_API_KEY exists (check the name only; do not print values).

Step 1: Choose the provider

Ask which one, with a one-line recommendation for their use case:

  1. Claude API - best quality for chat, reasoning and tool use. Needs an Anthropic API key; billed per token. Default model claude-sonnet-5-5.
  2. Workers AI - open models on Cloudflare via the AI binding, no key, 10,000 free Neurons per day. Good for embeddings, images, cheap bulk text.
  3. Either, through AI Gateway - adds logs, caching, rate and spend limits. Can also call Claude without an Anthropic key using AI Gateway credits.

Step 2: Choose the feature

Feature Claude Workers AI Source to adapt
Simple chat yes yes .claude/templates/ai-worker-claude-api.ts or ai-worker-workers-ai.ts (handleChatRequest) + .claude/templates/ai-chat-component.tsx
Streaming chat yes possible (stream: true) .claude/templates/ai-streaming-response.ts + examples/ai/streaming-chat/StreamingChat.tsx
Chat with model picker - yes examples/ai/workers-ai-chat/
Embeddings / semantic search - yes ai-worker-workers-ai.ts (handleEmbeddingsRequest); store vectors in Vectorize, or suggest AI Search for managed retrieval
Image generation - yes ai-worker-workers-ai.ts (handleImageGeneration)
Gateway routing yes yes examples/ai/with-ai-gateway/worker-endpoint.ts

Read the full file on GitHub · 93 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 24d ago Changed · -280 lines scan B → A 120af2b9a9d8
  2. 1mo ago First seen · 373 lines · 0 tokens per session scan B f64ae5438c21

Subscribe to this mod's changes

add-ai-feature is a command published in the GitHub repository henkisdabro/cloudflare-workers-react-boilerplate (13 stars, last pushed 13d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,192 tokens. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.