diff --git a/.agents/mcp_config.json b/.agents/mcp_config.json
new file mode 100644
index 0000000..34b85fd
--- /dev/null
+++ b/.agents/mcp_config.json
@@ -0,0 +1,9 @@
+{
+ "mcpServers": {
+ "cloudflare": { "url": "https://mcp.cloudflare.com/mcp" },
+ "cloudflare-docs": { "url": "https://docs.mcp.cloudflare.com/mcp" },
+ "cloudflare-bindings": { "url": "https://bindings.mcp.cloudflare.com/mcp" },
+ "cloudflare-builds": { "url": "https://builds.mcp.cloudflare.com/mcp" },
+ "cloudflare-observability": { "url": "https://observability.mcp.cloudflare.com/mcp" }
+ }
+}
diff --git a/.agents/plugins/cloudflare/.agents/plugins/marketplace.json b/.agents/plugins/cloudflare/.agents/plugins/marketplace.json
new file mode 100644
index 0000000..5d98c9c
--- /dev/null
+++ b/.agents/plugins/cloudflare/.agents/plugins/marketplace.json
@@ -0,0 +1,20 @@
+{
+ "name": "cloudflare",
+ "interface": {
+ "displayName": "Cloudflare"
+ },
+ "plugins": [
+ {
+ "name": "cloudflare",
+ "source": {
+ "source": "url",
+ "url": "https://github.com/cloudflare/skills.git"
+ },
+ "policy": {
+ "installation": "AVAILABLE",
+ "authentication": "ON_INSTALL"
+ },
+ "category": "Developer Tools"
+ }
+ ]
+}
diff --git a/.agents/plugins/cloudflare/.claude-plugin/marketplace.json b/.agents/plugins/cloudflare/.claude-plugin/marketplace.json
new file mode 100644
index 0000000..ac5c577
--- /dev/null
+++ b/.agents/plugins/cloudflare/.claude-plugin/marketplace.json
@@ -0,0 +1,15 @@
+{
+ "$schema": "https://code.claude.com/schemas/marketplace.json",
+ "name": "cloudflare",
+ "owner": {
+ "name": "Cloudflare",
+ "url": "https://workers.cloudflare.com"
+ },
+ "plugins": [
+ {
+ "name": "cloudflare",
+ "source": "./",
+ "description": "Build, test, and deploy applications on Cloudflare with platform guidance Skills and the Cloudflare MCP server."
+ }
+ ]
+}
diff --git a/.agents/plugins/cloudflare/.claude-plugin/plugin.json b/.agents/plugins/cloudflare/.claude-plugin/plugin.json
new file mode 100644
index 0000000..086b7a4
--- /dev/null
+++ b/.agents/plugins/cloudflare/.claude-plugin/plugin.json
@@ -0,0 +1,9 @@
+{
+ "name": "cloudflare",
+ "description": "Build, test, and deploy applications on Cloudflare with platform guidance Skills and the Cloudflare MCP server.",
+ "version": "1.0.0",
+ "mcpServers": "./.mcp.json",
+ "author": {
+ "name": "Cloudflare"
+ }
+}
diff --git a/.agents/plugins/cloudflare/.codex-plugin/plugin.json b/.agents/plugins/cloudflare/.codex-plugin/plugin.json
new file mode 100644
index 0000000..df8b6dc
--- /dev/null
+++ b/.agents/plugins/cloudflare/.codex-plugin/plugin.json
@@ -0,0 +1,47 @@
+{
+ "name": "cloudflare",
+ "version": "1.0.0",
+ "description": "Build, test, and deploy applications on Cloudflare with platform guidance Skills and the Cloudflare MCP server.",
+ "author": {
+ "name": "Cloudflare",
+ "email": "support@cloudflare.com",
+ "url": "https://www.cloudflare.com/products/workers/"
+ },
+ "homepage": "https://developers.cloudflare.com/",
+ "repository": "https://github.com/cloudflare/skills",
+ "license": "Apache-2.0",
+ "keywords": [
+ "cloudflare",
+ "workers",
+ "durable-objects",
+ "agents",
+ "mcp",
+ "wrangler",
+ "serverless",
+ "compute",
+ "storage",
+ "applications"
+ ],
+ "skills": "./skills/",
+ "mcpServers": "./.mcp.json",
+ "interface": {
+ "displayName": "Cloudflare",
+ "shortDescription": "Cloudflare platform and MCP",
+ "longDescription": "Build, review, and operate on Cloudflare with guidance for Workers, Durable Objects, Agents SDK, Cloudflare One, Wrangler, web performance, Turnstile, and more, plus the Cloudflare Code Mode MCP server for live account, API, and documentation workflows.",
+ "developerName": "Cloudflare",
+ "category": "Developer Tools",
+ "capabilities": ["Interactive", "Write"],
+ "websiteURL": "https://developers.cloudflare.com/",
+ "privacyPolicyURL": "https://www.cloudflare.com/privacypolicy/",
+ "termsOfServiceURL": "https://www.cloudflare.com/website-terms/",
+ "defaultPrompt": [
+ "Build a Cloudflare Worker or agent with the right SDK and Wrangler setup",
+ "Review this Cloudflare project for production Workers best practices",
+ "Use Cloudflare skills and MCP to inspect or deploy this project"
+ ],
+ "brandColor": "#F6821F",
+ "composerIcon": "./logo.svg",
+ "logo": "./logo.svg",
+ "screenshots": []
+ }
+}
diff --git a/.agents/plugins/cloudflare/.cursor-plugin/marketplace.json b/.agents/plugins/cloudflare/.cursor-plugin/marketplace.json
new file mode 100644
index 0000000..94908f7
--- /dev/null
+++ b/.agents/plugins/cloudflare/.cursor-plugin/marketplace.json
@@ -0,0 +1,13 @@
+{
+ "name": "cloudflare",
+ "owner": {
+ "name": "Cloudflare"
+ },
+ "plugins": [
+ {
+ "name": "cloudflare",
+ "source": "./",
+ "description": "Build, test, and deploy applications on Cloudflare with platform guidance Skills and the Cloudflare MCP server."
+ }
+ ]
+}
diff --git a/.agents/plugins/cloudflare/.cursor-plugin/plugin.json b/.agents/plugins/cloudflare/.cursor-plugin/plugin.json
new file mode 100644
index 0000000..f7050ea
--- /dev/null
+++ b/.agents/plugins/cloudflare/.cursor-plugin/plugin.json
@@ -0,0 +1,23 @@
+{
+ "name": "cloudflare",
+ "version": "1.0.0",
+ "description": "Build, test, and deploy applications on Cloudflare with platform guidance Skills and the Cloudflare MCP server.",
+ "author": {
+ "name": "Cloudflare",
+ "email": "support@cloudflare.com",
+ "url": "https://workers.cloudflare.com"
+ },
+ "keywords": [
+ "cloudflare",
+ "workers",
+ "durable-objects",
+ "agents",
+ "mcp",
+ "wrangler",
+ "serverless",
+ "compute",
+ "storage",
+ "applications"
+ ],
+ "logo": "logo.svg"
+}
diff --git a/.agents/plugins/cloudflare/.github/workflows/semgrep.yml b/.agents/plugins/cloudflare/.github/workflows/semgrep.yml
new file mode 100644
index 0000000..09dfe25
--- /dev/null
+++ b/.agents/plugins/cloudflare/.github/workflows/semgrep.yml
@@ -0,0 +1,30 @@
+name: Semgrep OSS scan
+on:
+ pull_request: {}
+ push:
+ branches: [main, master]
+ workflow_dispatch: {}
+ schedule:
+ - cron: '0 0 1-7 * 6' # per-repo, staggered across month
+concurrency:
+ group: semgrep-${{ github.event_name }}-${{ github.head_ref || github.run_id }}
+ cancel-in-progress: true
+permissions:
+ contents: read
+jobs:
+ semgrep:
+ name: semgrep-oss
+ runs-on: ubuntu-slim
+ steps:
+ - uses: actions/checkout@v5
+ with:
+ fetch-depth: 1
+ - id: cache-semgrep
+ uses: actions/cache@v5
+ with:
+ path: ~/.local
+ key: semgrep-1.160.0-${{ runner.os }}
+ - if: steps.cache-semgrep.outputs.cache-hit != 'true'
+ run: pip install --user semgrep==1.160.0
+ - run: echo "$HOME/.local/bin" >> "$GITHUB_PATH"
+ - run: semgrep scan --config=auto
diff --git a/.agents/plugins/cloudflare/.gitignore b/.agents/plugins/cloudflare/.gitignore
new file mode 100644
index 0000000..05ff159
--- /dev/null
+++ b/.agents/plugins/cloudflare/.gitignore
@@ -0,0 +1,2 @@
+pr.md
+TODO.md
diff --git a/.agents/plugins/cloudflare/.mcp.json b/.agents/plugins/cloudflare/.mcp.json
new file mode 100644
index 0000000..49b3694
--- /dev/null
+++ b/.agents/plugins/cloudflare/.mcp.json
@@ -0,0 +1,8 @@
+{
+ "mcpServers": {
+ "cloudflare": {
+ "type": "http",
+ "url": "https://mcp.cloudflare.com/mcp"
+ }
+ }
+}
diff --git a/.agents/plugins/cloudflare/CODEOWNERS b/.agents/plugins/cloudflare/CODEOWNERS
new file mode 100644
index 0000000..5ec2f62
--- /dev/null
+++ b/.agents/plugins/cloudflare/CODEOWNERS
@@ -0,0 +1 @@
+* @irvinebroque @elithrar @dmmulroy @thomasgauvin
diff --git a/.agents/plugins/cloudflare/CONTRIBUTING.md b/.agents/plugins/cloudflare/CONTRIBUTING.md
new file mode 100644
index 0000000..487d517
--- /dev/null
+++ b/.agents/plugins/cloudflare/CONTRIBUTING.md
@@ -0,0 +1,10 @@
+# Contributing
+
+Keep skills small: help agents find the right documentation instead of maintaining another copy of it.
+
+For changes to skills, commands, or bundled references:
+
+- Read the relevant page on [Cloudflare's developer documentation](https://developers.cloudflare.com/) and verify that it supports the proposed guidance; a working URL alone is not enough.
+- Link directly to the relevant product or workflow page. Prefer links over duplicated API signatures, limits, pricing, configuration, or examples that can become stale.
+- When correcting outdated reference content, replace it with a short pointer to the current documentation where possible.
+- If the required guidance is missing from `developers.cloudflare.com`, describe the documentation gap in the pull request rather than adding unsupported guidance to a skill.
diff --git a/.agents/plugins/cloudflare/LICENSE b/.agents/plugins/cloudflare/LICENSE
new file mode 100644
index 0000000..7a4a3ea
--- /dev/null
+++ b/.agents/plugins/cloudflare/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
\ No newline at end of file
diff --git a/.agents/plugins/cloudflare/README.md b/.agents/plugins/cloudflare/README.md
new file mode 100644
index 0000000..536ac21
--- /dev/null
+++ b/.agents/plugins/cloudflare/README.md
@@ -0,0 +1,92 @@
+# Cloudflare Skills
+
+A collection of [Agent Skills](https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills) for building on Cloudflare, Workers, the Agents SDK, and the wider Cloudflare Developer Platform.
+
+## Installing
+
+Use the native plugin where supported to install both Cloudflare guidance and the Cloudflare MCP server. Agents that only support the Agent Skills standard can install the skills separately.
+
+### Codex
+
+Install from the Cloudflare plugin marketplace:
+
+```sh
+codex plugin marketplace add cloudflare/skills
+codex plugin add cloudflare@cloudflare
+```
+
+Start a new Codex session after installation.
+
+### Claude Code
+
+Install using the [plugin marketplace](https://code.claude.com/docs/en/discover-plugins#add-from-github):
+
+```
+/plugin marketplace add cloudflare/skills
+/plugin install cloudflare@cloudflare
+```
+
+### VS Code / GitHub Copilot
+
+Install directly from this repository:
+
+1. Enable `chat.plugins.enabled` in VS Code settings.
+2. Open the Command Palette and run **Chat: Install Plugin From Source**.
+3. Enter `https://github.com/cloudflare/skills`.
+
+For marketplace installation or troubleshooting, see [VS Code's agent plugin documentation](https://code.visualstudio.com/docs/agent-customization/agent-plugins).
+
+### Cursor
+
+Install from the Cursor Marketplace or add manually via **Settings > Rules > Add Rule > Remote Rule (Github)** with `cloudflare/skills`.
+
+### npx skills
+
+Install using the [`npx skills`](https://skills.sh) CLI:
+
+```
+npx skills add https://github.com/cloudflare/skills
+```
+
+### Clone / Copy
+
+Clone this repo and copy the skill folders into the appropriate directory for your agent:
+
+| Agent | Skill Directory | Docs |
+| ------------ | ---------------------------- | ---------------------------------------------------------------------------------- |
+| Claude Code | `~/.claude/skills/` | [docs](https://code.claude.com/docs/en/skills) |
+| Cursor | `~/.cursor/skills/` | [docs](https://cursor.com/docs/context/skills) |
+| OpenCode | `~/.config/opencode/skills/` | [docs](https://opencode.ai/docs/skills/) |
+| OpenAI Codex | `~/.codex/skills/` | [docs](https://developers.openai.com/codex/skills/) |
+| Pi | `~/.pi/agent/skills/` | [docs](https://github.com/badlogic/pi-mono/tree/main/packages/coding-agent#skills) |
+
+## Skills
+
+Skills are contextual and auto-loaded based on your conversation. When a request matches a skill's triggers, the agent loads and applies the relevant skill to provide accurate, up-to-date guidance.
+
+| Skill | Useful for |
+| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| cloudflare | Helps agents discover which Cloudflare products fit their needs, then find the right skills and docs |
+| nextjs-on-cloudflare | Next.js on Workers with vinext; routes to vinext's upstream skills and docs |
+| agents-sdk | Building stateful AI agents with state, scheduling, RPC, MCP servers, email, and streaming chat |
+| durable-objects | Stateful coordination (chat rooms, games, booking), RPC, SQLite, alarms, WebSockets |
+| sandbox-next | Sandbox on `@cloudflare/sandbox@next` (1.0 preview); recommended for new projects |
+| sandbox-stable | Sandbox on the current stable `@cloudflare/sandbox` package |
+| sandbox-migrate-to-next | Port a stable Sandbox app to `@cloudflare/sandbox@next` |
+| wrangler | Deploying and managing Workers, KV, R2, D1, Vectorize, Queues, Workflows |
+| workers-best-practices | Writing, reviewing, or configuring production Workers |
+| cloudflare-email-service | Implementing or troubleshooting Email Sending, Email Routing, and delivery configuration |
+| turnstile-spin | Setting up, repairing, or migrating Turnstile bot verification, including server-side Siteverify |
+| web-perf | Auditing Core Web Vitals (FCP, LCP, TBT, CLS), render-blocking resources, network chains |
+| cloudflare-one | Designing, configuring, troubleshooting, or reviewing [Cloudflare One](https://developers.cloudflare.com/cloudflare-one/) deployments across Access, Gateway, WARP, Tunnel, Magic WAN, DLP, CASB, posture, and identity |
+| cloudflare-one-migrations | Migration assessments, policy mapping, rollout plans, and gap analysis for Zscaler, Palo Alto, legacy VPN/SWG, and SASE migrations to Cloudflare One |
+
+## MCP Servers
+
+This plugin includes Cloudflare's main [remote MCP server](https://developers.cloudflare.com/agents/model-context-protocol/cloudflare/servers-for-cloudflare/) for enhanced functionality:
+
+| Server | Purpose |
+| ---------- | ---------------------------------------------------------------------------------------------- |
+| cloudflare | Access the Cloudflare API and current developer documentation through the Code Mode MCP server |
+
+Cloudflare also publishes product-specific MCP servers. This plugin intentionally bundles only the main `cloudflare` server.
diff --git a/.agents/plugins/cloudflare/logo.svg b/.agents/plugins/cloudflare/logo.svg
new file mode 100644
index 0000000..1b4dbd3
--- /dev/null
+++ b/.agents/plugins/cloudflare/logo.svg
@@ -0,0 +1,3 @@
+
diff --git a/.agents/plugins/cloudflare/mcp.json b/.agents/plugins/cloudflare/mcp.json
new file mode 100644
index 0000000..f41c00c
--- /dev/null
+++ b/.agents/plugins/cloudflare/mcp.json
@@ -0,0 +1,9 @@
+{
+ "$schema": "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json",
+ "mcpServers": {
+ "cloudflare": {
+ "type": "streamable-http",
+ "url": "https://mcp.cloudflare.com/mcp"
+ }
+ }
+}
diff --git a/.agents/plugins/cloudflare/plugin.json b/.agents/plugins/cloudflare/plugin.json
new file mode 100644
index 0000000..9376c50
--- /dev/null
+++ b/.agents/plugins/cloudflare/plugin.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
+ "name": "cloudflare",
+ "version": "1.0.0",
+ "description": "Build, test, and deploy applications on Cloudflare with platform guidance Skills and the Cloudflare MCP server.",
+ "author": {
+ "name": "Cloudflare",
+ "email": "support@cloudflare.com",
+ "url": "https://www.cloudflare.com/products/workers/"
+ },
+ "homepage": "https://developers.cloudflare.com/",
+ "repository": "https://github.com/cloudflare/skills",
+ "license": "Apache-2.0",
+ "keywords": [
+ "cloudflare",
+ "workers",
+ "durable-objects",
+ "agents",
+ "mcp",
+ "wrangler",
+ "serverless",
+ "compute",
+ "storage",
+ "applications"
+ ]
+}
diff --git a/.agents/plugins/cloudflare/rules/workers.mdc b/.agents/plugins/cloudflare/rules/workers.mdc
new file mode 100644
index 0000000..4a8fe5b
--- /dev/null
+++ b/.agents/plugins/cloudflare/rules/workers.mdc
@@ -0,0 +1,20 @@
+---
+description: Guidance for writing, reviewing, or configuring Cloudflare Workers and applications deployed to Workers.
+alwaysApply: false
+---
+
+# Cloudflare Workers
+
+Your knowledge of Cloudflare Workers APIs, types, and configuration may be outdated. **Prefer retrieval over pre-training.** Use the project's installed versions, generated types, and compatibility settings as the baseline. Retrieve relevant Cloudflare documentation to verify API, configuration, runtime behavior, and limit claims.
+
+## Workers Defaults
+
+- **Keep compatibility dates current.** Use today's date for new Workers. Encourage periodic updates for existing Workers, reviewing compatibility changes and running relevant tests.
+- **Enable logs and traces.** When creating or preparing a Worker for production, set `observability.enabled` and `observability.traces.enabled` to `true`. The top-level setting alone does not enable traces. Use structured JSON logging and configure sampling for the workload. During reviews, flag missing logs or traces. See [Workers Logs](https://developers.cloudflare.com/workers/observability/logs/workers-logs/) and [Traces](https://developers.cloudflare.com/workers/observability/traces/).
+- **Keep binding types in sync.** Run `wrangler types` after changing bindings in the project's Wrangler configuration, whether JSONC, JSON, or TOML.
+
+## Shared Guidance
+
+- Use [workers-best-practices](../skills/workers-best-practices/SKILL.md) for runtime patterns, anti-patterns, configuration, and platform API checks. Read the references relevant to the task.
+- Use [wrangler](../skills/wrangler/SKILL.md) for CLI commands and deployment configuration.
+- Find documentation for products used by the Worker in the [Cloudflare docs directory](https://developers.cloudflare.com/directory/). Verify limits and quotas against the affected product's documentation.
diff --git a/.agents/plugins/cloudflare/skills/agents-sdk/SKILL.md b/.agents/plugins/cloudflare/skills/agents-sdk/SKILL.md
new file mode 100644
index 0000000..b0921e9
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/agents-sdk/SKILL.md
@@ -0,0 +1,210 @@
+---
+name: agents-sdk
+description: Build, debug, or review Cloudflare Agents SDK applications using the agents package.
+---
+
+# Cloudflare Agents SDK
+
+Your knowledge of the Agents SDK may be outdated. **Prefer retrieval over pre-training** for any Agents SDK task.
+
+## Retrieval Sources
+
+Cloudflare docs: https://developers.cloudflare.com/agents/
+
+| Topic | Docs URL | Use for |
+| -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
+| Getting started | [Quick start](https://developers.cloudflare.com/agents/getting-started/quick-start/) | First agent, project setup |
+| Adding to existing project | [Add to existing project](https://developers.cloudflare.com/agents/getting-started/add-to-existing-project/) | Install into existing Workers app |
+| Configuration | [Configuration](https://developers.cloudflare.com/agents/api-reference/configuration/) | `wrangler.jsonc`, bindings, assets, deployment |
+| Agent class | [Agents API](https://developers.cloudflare.com/agents/api-reference/agents-api/) | Agent lifecycle, patterns, pitfalls |
+| State | [Store and sync state](https://developers.cloudflare.com/agents/api-reference/store-and-sync-state/) | `setState`, `validateStateChange`, persistence |
+| Routing | [Routing](https://developers.cloudflare.com/agents/api-reference/routing/) | URL patterns, `routeAgentRequest` |
+| Callable methods | [Callable methods](https://developers.cloudflare.com/agents/api-reference/callable-methods/) | `@callable`, RPC, streaming, timeouts |
+| Scheduling | [Schedule tasks](https://developers.cloudflare.com/agents/api-reference/schedule-tasks/) | `schedule()`, `scheduleEvery()`, cron |
+| Workflows | [Run workflows](https://developers.cloudflare.com/agents/api-reference/run-workflows/) | `AgentWorkflow`, durable multi-step tasks |
+| HTTP/WebSockets | [WebSockets](https://developers.cloudflare.com/agents/api-reference/websockets/) | Lifecycle hooks, hibernation |
+| Chat agents | [Chat agents](https://developers.cloudflare.com/agents/communication-channels/chat/chat-agents/) | `AIChatAgent`, streaming, tools, persistence |
+| Client SDK | [Client SDK](https://developers.cloudflare.com/agents/communication-channels/chat/client-sdk/) | `useAgent`, `AgentClient`, state, RPC, HTTP |
+| Client tools | [Client tools](https://developers.cloudflare.com/agents/harnesses/think/client-tools/) | Client-side tools, `autoContinueAfterToolResult` |
+| Server-driven messages | [Autonomous responses](https://developers.cloudflare.com/agents/communication-channels/chat/autonomous-responses/) | `saveMessages`, `waitUntilStable`, server-initiated turns |
+| Resumable streaming | [Chat agents](https://developers.cloudflare.com/agents/communication-channels/chat/chat-agents/#resumable-streaming) | Stream recovery on disconnect |
+| Email | [Email](https://developers.cloudflare.com/agents/api-reference/email/) | Email routing, secure reply resolver |
+| MCP client | [MCP client](https://developers.cloudflare.com/agents/model-context-protocol/apis/client-api/) | Connecting to MCP servers |
+| MCP server | [MCP server](https://developers.cloudflare.com/agents/model-context-protocol/apis/handler-api/) | Building MCP servers with `createMcpHandler` |
+| MCP transports | [MCP transports](https://developers.cloudflare.com/agents/model-context-protocol/protocol/transport/) | Streamable HTTP, SSE, RPC transport options |
+| Securing MCP servers | [Securing MCP](https://developers.cloudflare.com/agents/model-context-protocol/guides/securing-mcp-server/) | OAuth, proxy MCP, hardening |
+| Human-in-the-loop | [Human-in-the-loop](https://developers.cloudflare.com/agents/concepts/agentic-patterns/human-in-the-loop/) | Workflow approvals, elicitation, timeout handling |
+| Durable execution | [Durable execution](https://developers.cloudflare.com/agents/api-reference/durable-execution/) | `runFiber()`, `stash()`, surviving DO eviction |
+| Queue | [Queue](https://developers.cloudflare.com/agents/api-reference/queue-tasks/) | Built-in FIFO queue, `queue()` |
+| Retries | [Retries](https://developers.cloudflare.com/agents/api-reference/retries/) | `this.retry()`, backoff/jitter |
+| Observability | [Observability](https://developers.cloudflare.com/agents/api-reference/observability/) | Diagnostics-channel events |
+| Push notifications | [Push notifications](https://developers.cloudflare.com/agents/communication-channels/webhooks/push-notifications/) | Web Push + VAPID from agents |
+| Webhooks | [Webhooks](https://developers.cloudflare.com/agents/communication-channels/webhooks/) | Receiving external webhooks |
+| Cross-domain auth | [Cross-domain auth](https://developers.cloudflare.com/agents/runtime/operations/cross-domain-authentication/) | WebSocket auth, tokens, CORS |
+| Readonly connections | [Readonly](https://developers.cloudflare.com/agents/api-reference/readonly-connections/) | `shouldConnectionBeReadonly` |
+| Voice | [Voice](https://developers.cloudflare.com/agents/api-reference/voice/) | Experimental STT/TTS, `withVoice` |
+| Browse the web | [Browser tools](https://developers.cloudflare.com/agents/api-reference/browse-the-web/) | Experimental CDP browser automation |
+| Think | [Think](https://developers.cloudflare.com/agents/api-reference/think/) | Experimental higher-level chat agent class |
+| Migrations | [AI SDK v5](https://github.com/cloudflare/agents/blob/main/docs/agents/migration-to-ai-sdk-v5.md), [AI SDK v6](https://github.com/cloudflare/agents/blob/main/docs/agents/migration-to-ai-sdk-v6.md) | Upgrading `@cloudflare/ai-chat` |
+
+## Capabilities
+
+The Agents SDK provides:
+
+- **Persistent state** — SQLite-backed, auto-synced to clients via `setState`
+- **Callable RPC** — `@callable()` methods invoked over WebSocket
+- **Scheduling** — One-time, recurring (`scheduleEvery`), and cron tasks
+- **Workflows** — Durable multi-step background processing via `AgentWorkflow`
+- **Durable execution** — `runFiber()` / `stash()` for work that survives DO eviction
+- **Queue** — Built-in FIFO queue with retries via `queue()`
+- **Retries** — `this.retry()` with exponential backoff and jitter
+- **MCP integration** — Connect to MCP servers or build your own with `createMcpHandler`
+- **Email handling** — Receive and reply to emails with secure routing
+- **Streaming chat** — `AIChatAgent` with resumable streams, message persistence, tools
+- **Server-driven messages** — `saveMessages`, `waitUntilStable` for proactive agent turns
+- **React hooks** — `useAgent`, `useAgentChat` for client apps
+- **Observability** — `diagnostics_channel` events for state, RPC, schedule, lifecycle
+- **Push notifications** — Web Push + VAPID delivery from agents
+- **Webhooks** — Receive and verify external webhooks
+- **Voice** (experimental) — STT/TTS via `@cloudflare/voice`
+- **Browser tools** (experimental) — CDP-powered browsing via `agents/browser`
+- **Think** (experimental) — Higher-level chat agent via `@cloudflare/think`
+
+## FIRST: Verify Installation
+
+```bash
+npm ls agents # Should show agents package
+```
+
+If not installed:
+
+```bash
+npm install agents
+```
+
+For chat agents:
+
+```bash
+npm install agents @cloudflare/ai-chat ai @ai-sdk/react
+```
+
+## Wrangler Configuration
+
+```jsonc
+{
+ "compatibility_flags": ["nodejs_compat"],
+ "durable_objects": {
+ "bindings": [{ "name": "MyAgent", "class_name": "MyAgent" }]
+ },
+ "migrations": [{ "tag": "v1", "new_sqlite_classes": ["MyAgent"] }]
+}
+```
+
+**Gotchas:**
+
+- Do NOT enable `experimentalDecorators` in tsconfig (breaks `@callable`)
+- Never edit old migrations — always add new tags
+- Each agent class needs its own DO binding + migration entry
+- Add `"ai": { "binding": "AI" }` for Workers AI
+
+## Agent Class
+
+```typescript
+import { Agent, routeAgentRequest, callable } from 'agents';
+
+type State = { count: number };
+
+export class Counter extends Agent {
+ initialState = { count: 0 };
+
+ validateStateChange(nextState: State, source: Connection | 'server') {
+ if (nextState.count < 0) throw new Error('Count cannot be negative');
+ }
+
+ onStateUpdate(state: State, source: Connection | 'server') {
+ console.log('State updated:', state);
+ }
+
+ @callable()
+ increment() {
+ this.setState({ count: this.state.count + 1 });
+ return this.state.count;
+ }
+}
+
+export default {
+ fetch: (req, env) => routeAgentRequest(req, env) ?? new Response('Not found', { status: 404 })
+};
+```
+
+## Routing
+
+Requests route to `/agents/{agent-name}/{instance-name}`:
+
+| Class | URL |
+| ---------- | -------------------------- |
+| `Counter` | `/agents/counter/user-123` |
+| `ChatRoom` | `/agents/chat-room/lobby` |
+
+Client: `useAgent({ agent: "Counter", name: "user-123" })`
+
+Custom routing: use `getAgentByName(env.MyAgent, "instance-id")` then `agent.fetch(request)`.
+
+## Core APIs
+
+| Task | API |
+| -------------------- | ------------------------------------------------------ |
+| Read state | `this.state.count` |
+| Write state | `this.setState({ count: 1 })` |
+| SQL query | `` this.sql`SELECT * FROM users WHERE id = ${id}` `` |
+| Schedule (delay) | `await this.schedule(60, "task", payload)` |
+| Schedule (cron) | `await this.schedule("0 * * * *", "task", payload)` |
+| Schedule (interval) | `await this.scheduleEvery(30, "poll")` |
+| RPC method | `@callable() myMethod() { ... }` |
+| Streaming RPC | `@callable({ streaming: true }) stream(res) { ... }` |
+| Start workflow | `await this.runWorkflow("ProcessingWorkflow", params)` |
+| Durable fiber | `await this.runFiber("name", async (ctx) => { ... })` |
+| Enqueue work | `this.queue("handler", payload)` |
+| Retry with backoff | `await this.retry(fn, { maxAttempts: 5 })` |
+| Broadcast to clients | `this.broadcast(message)` |
+| Get connections | `this.getConnections(tag?)` |
+
+## React Client
+
+Read [client-sdk.md](references/client-sdk.md) for client selection and current connection examples. For chat UI and tools, also read [streaming-chat.md](references/streaming-chat.md).
+
+## References
+
+### Core
+
+- **[references/state-scheduling.md](references/state-scheduling.md)** — State persistence, scheduling, SQL
+- **[references/callable.md](references/callable.md)** — RPC methods, streaming, timeouts
+- **[references/routing.md](references/routing.md)** — URL patterns, custom routing, `getAgentByName`
+- **[references/configuration.md](references/configuration.md)** — Wrangler config, bindings, Vite setup
+
+### Chat & Streaming
+
+- **[references/streaming-chat.md](references/streaming-chat.md)** — AIChatAgent, resumable streams, tools
+- **[references/client-sdk.md](references/client-sdk.md)** — `useAgent`, `useAgentChat`, `AgentClient`
+- **[references/server-driven-messages.md](references/server-driven-messages.md)** — Trigger patterns, `saveMessages`
+- **[references/human-in-the-loop.md](references/human-in-the-loop.md)** — Approval flows, `needsApproval`
+
+### Background Processing
+
+- **[references/workflows.md](references/workflows.md)** — Durable Workflows integration
+- **[references/durable-execution.md](references/durable-execution.md)** — `runFiber`, `stash`, surviving eviction
+- **[references/queue-retries.md](references/queue-retries.md)** — Built-in queue, retry with backoff
+
+### Integrations
+
+- **[references/mcp.md](references/mcp.md)** — MCP client and server, transports, securing
+- **[references/email.md](references/email.md)** — Email routing and handling
+- **[references/webhooks-push.md](references/webhooks-push.md)** — Webhooks, push notifications
+- **[references/observability.md](references/observability.md)** — Diagnostics-channel events
+
+### Experimental
+
+- **[references/think.md](references/think.md)** — `@cloudflare/think` higher-level chat agent
+- **[references/voice.md](references/voice.md)** — `@cloudflare/voice` STT/TTS
+- **[references/codemode.md](references/codemode.md)** — Code Mode for tool orchestration
+- **[references/browse-the-web.md](references/browse-the-web.md)** — CDP browser tools
diff --git a/.agents/plugins/cloudflare/skills/agents-sdk/references/browse-the-web.md b/.agents/plugins/cloudflare/skills/agents-sdk/references/browse-the-web.md
new file mode 100644
index 0000000..1b48a08
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/agents-sdk/references/browse-the-web.md
@@ -0,0 +1,63 @@
+# Browse the Web (Experimental)
+
+Fetch https://developers.cloudflare.com/agents/api-reference/browse-the-web/ for complete documentation.
+
+CDP-powered browser tools that let agents scrape, screenshot, and interact with web pages.
+
+## Setup
+
+```jsonc
+// wrangler.jsonc
+{
+ "browser": { "binding": "BROWSER" },
+ "worker_loaders": [{ "binding": "LOADER" }],
+ "compatibility_flags": ["nodejs_compat"]
+}
+```
+
+## Usage with AI SDK
+
+```typescript
+import { createBrowserTools } from 'agents/browser/ai';
+
+export class MyAgent extends AIChatAgent {
+ async onChatMessage(onFinish) {
+ const browserTools = createBrowserTools({
+ browser: this.env.BROWSER,
+ loader: this.env.LOADER
+ });
+
+ const result = streamText({
+ model: openai('gpt-4o'),
+ messages: await convertToModelMessages(this.messages),
+ tools: { ...myTools, ...browserTools },
+ onFinish
+ });
+ return result.toUIMessageStreamResponse();
+ }
+}
+```
+
+## Available Tools
+
+| Tool | Purpose |
+| ----------------- | ------------------------------------------- |
+| `browser_search` | Search the web and return results |
+| `browser_execute` | Navigate to URL, execute JS, return results |
+
+The LLM writes async JavaScript IIFEs that run in a fresh browser session.
+
+## When to Use
+
+- Need a real browser (JS rendering, screenshots, interaction) → browser tools
+- Just need HTML/API data → use `fetch()` instead (faster, cheaper)
+
+## Low-Level API
+
+```typescript
+import { connectBrowser, CdpSession } from 'agents/browser';
+
+const browser = await connectBrowser(this.env.BROWSER);
+const cdp = new CdpSession(browser);
+await cdp.send('Page.navigate', { url: 'https://example.com' });
+```
diff --git a/.agents/plugins/cloudflare/skills/agents-sdk/references/callable.md b/.agents/plugins/cloudflare/skills/agents-sdk/references/callable.md
new file mode 100644
index 0000000..387fac7
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/agents-sdk/references/callable.md
@@ -0,0 +1,92 @@
+# Callable Methods
+
+Fetch https://developers.cloudflare.com/agents/api-reference/callable-methods/ for complete documentation.
+
+## Overview
+
+`@callable()` exposes agent methods to clients via WebSocket RPC.
+
+```typescript
+import { Agent, callable } from 'agents';
+
+export class MyAgent extends Agent {
+ @callable()
+ async greet(name: string): Promise {
+ return `Hello, ${name}!`;
+ }
+
+ @callable()
+ async processData(data: unknown): Promise {
+ // Long-running work
+ return result;
+ }
+}
+```
+
+## Client Usage
+
+```typescript
+// Basic call
+const greeting = await agent.call('greet', ['World']);
+
+// With timeout
+const result = await agent.call('processData', [data], {
+ timeout: 5000 // 5 second timeout
+});
+```
+
+## Streaming Responses
+
+```typescript
+import { Agent, callable, StreamingResponse } from 'agents';
+
+export class MyAgent extends Agent {
+ @callable({ streaming: true })
+ async streamResults(stream: StreamingResponse, query: string) {
+ for await (const item of fetchResults(query)) {
+ stream.send(JSON.stringify(item));
+ }
+ stream.close();
+ }
+
+ @callable({ streaming: true })
+ async streamWithError(stream: StreamingResponse) {
+ try {
+ // ... work
+ } catch (error) {
+ stream.error(error.message); // Signal error to client
+ return;
+ }
+ stream.close();
+ }
+}
+```
+
+Client with streaming:
+
+```typescript
+await agent.call('streamResults', ['search term'], {
+ stream: {
+ onChunk: (data) => console.log('Chunk:', data),
+ onDone: () => console.log('Complete'),
+ onError: (error) => console.error('Error:', error)
+ }
+});
+```
+
+## Introspection
+
+```typescript
+// Get list of callable methods on an agent
+const methods = await agent.call('getCallableMethods', []);
+// Returns: ["greet", "processData", "streamResults", ...]
+```
+
+## When to Use
+
+| Scenario | Use |
+| ------------------------------------ | --------------------------- |
+| Browser/mobile calling agent | `@callable()` |
+| External service calling agent | `@callable()` |
+| Worker calling agent (same codebase) | DO RPC directly |
+| Agent calling another agent | `getAgentByName()` + DO RPC |
diff --git a/.agents/plugins/cloudflare/skills/agents-sdk/references/client-sdk.md b/.agents/plugins/cloudflare/skills/agents-sdk/references/client-sdk.md
new file mode 100644
index 0000000..d9f5671
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/agents-sdk/references/client-sdk.md
@@ -0,0 +1,11 @@
+# Client SDK
+
+Choose `useAgent` for React state/RPC, `AgentClient` for other WebSocket clients, and `agentFetch` for one-off HTTP requests. Add `useAgentChat` when the UI needs chat messages and streaming. Check installed package versions before adapting current examples.
+
+| Task | Documentation |
+| ---------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Connect, sync state, call RPC, or send HTTP requests | [Client SDK](https://developers.cloudflare.com/agents/communication-channels/chat/client-sdk/) — hooks, vanilla JS, typed calls, streaming callbacks, and connection options |
+| Build chat UI | [Chat agents](https://developers.cloudflare.com/agents/communication-channels/chat/chat-agents/) — `useAgentChat`, message rendering, status, and tool interactions |
+| Authenticate across origins | [Cross-domain authentication](https://developers.cloudflare.com/agents/runtime/operations/cross-domain-authentication/) — token validation and WebSocket authentication |
+
+Keep client instance selection consistent with server routing. For authentication, account for token refresh on reconnect and query caching. Close manually created `AgentClient` connections when finished; React hooks manage their own cleanup.
diff --git a/.agents/plugins/cloudflare/skills/agents-sdk/references/codemode.md b/.agents/plugins/cloudflare/skills/agents-sdk/references/codemode.md
new file mode 100644
index 0000000..c95cdb8
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/agents-sdk/references/codemode.md
@@ -0,0 +1,110 @@
+# Codemode (Experimental)
+
+Fetch https://developers.cloudflare.com/agents/api-reference/codemode/ for complete documentation.
+
+Codemode lets LLMs write and execute code that orchestrates your tools, instead of calling them one at a time. The LLM gets a single "write code" tool; generated JavaScript runs in an isolated Worker sandbox.
+
+## When to Use
+
+| Scenario | Use Codemode? |
+| ------------------------------ | ------------------------------------- |
+| Single tool call | No — standard tool calling is simpler |
+| Chained tool calls with logic | Yes |
+| Conditional logic across tools | Yes |
+| MCP multi-server workflows | Yes |
+| Simple Q&A chat | No |
+
+## Setup
+
+### Wrangler Config
+
+```jsonc
+{
+ "worker_loaders": [{ "binding": "LOADER" }],
+ "compatibility_flags": ["nodejs_compat"]
+}
+```
+
+### Install
+
+```bash
+npm install @cloudflare/codemode ai zod
+```
+
+## Usage
+
+```typescript
+import { createCodeTool } from '@cloudflare/codemode/ai';
+import { DynamicWorkerExecutor } from '@cloudflare/codemode';
+import { streamText, tool, convertToModelMessages } from 'ai';
+import { z } from 'zod';
+
+const tools = {
+ getWeather: tool({
+ description: 'Get weather for a location',
+ inputSchema: z.object({ location: z.string() }),
+ execute: async ({ location }) => `Weather: ${location} 72°F`
+ }),
+ sendEmail: tool({
+ description: 'Send an email',
+ inputSchema: z.object({ to: z.string(), subject: z.string(), body: z.string() }),
+ execute: async ({ to, subject, body }) => `Email sent to ${to}`
+ })
+};
+
+export class MyAgent extends Agent {
+ async onChatMessage() {
+ const executor = new DynamicWorkerExecutor({
+ loader: this.env.LOADER
+ });
+
+ const codemode = createCodeTool({ tools, executor });
+
+ const result = streamText({
+ model,
+ system: 'You are a helpful assistant.',
+ messages: await convertToModelMessages(this.messages),
+ tools: { codemode }
+ });
+
+ return result.toUIMessageStreamResponse();
+ }
+}
+```
+
+## With MCP Tools
+
+```typescript
+const codemode = createCodeTool({
+ tools: {
+ ...myTools,
+ ...this.mcp.getAITools()
+ },
+ executor
+});
+```
+
+## How It Works
+
+1. `createCodeTool` generates TypeScript type definitions from your tools
+2. The LLM writes an async arrow function calling `codemode.toolName(args)`
+3. Code runs in an isolated Worker sandbox via `DynamicWorkerExecutor`
+4. Tool calls route back to the host via Workers RPC
+5. External `fetch()` is blocked by default — sandbox can only call your tools
+
+## Network Isolation
+
+```typescript
+const executor = new DynamicWorkerExecutor({
+ loader: env.LOADER,
+ globalOutbound: null // default — fully isolated
+ // globalOutbound: env.MY_SERVICE // route through a Fetcher
+});
+```
+
+## Limitations
+
+- Experimental — API may change
+- `needsApproval` tools execute immediately in sandbox (no approval pause yet)
+- JavaScript execution only
+- Requires `worker_loaders` binding
diff --git a/.agents/plugins/cloudflare/skills/agents-sdk/references/configuration.md b/.agents/plugins/cloudflare/skills/agents-sdk/references/configuration.md
new file mode 100644
index 0000000..cab29b0
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/agents-sdk/references/configuration.md
@@ -0,0 +1,70 @@
+# Configuration
+
+Fetch https://developers.cloudflare.com/agents/api-reference/configuration/ for complete documentation.
+
+## Wrangler Config (`wrangler.jsonc`)
+
+```jsonc
+{
+ "name": "my-agent",
+ "main": "src/index.ts",
+ "compatibility_date": "2025-01-28",
+ "compatibility_flags": ["nodejs_compat"],
+ "durable_objects": {
+ "bindings": [
+ { "name": "MyAgent", "class_name": "MyAgent" },
+ { "name": "ChatAgent", "class_name": "ChatAgent" }
+ ]
+ },
+ "migrations": [{ "tag": "v1", "new_sqlite_classes": ["MyAgent", "ChatAgent"] }],
+ "ai": { "binding": "AI" },
+ "assets": {
+ "directory": "./dist/client",
+ "binding": "ASSETS",
+ "not_found_handling": "single-page-application",
+ "run_worker_first": true
+ }
+}
+```
+
+## Key Rules
+
+- Every agent class needs a DO binding AND a `new_sqlite_classes` migration entry
+- `nodejs_compat` is required
+- Never edit old migrations — add a new tag (e.g. `v2`) for new classes
+- Do NOT enable `experimentalDecorators` in tsconfig — it breaks `@callable`
+- For Workers AI locally, set `"ai": { "binding": "AI", "remote": true }` in `.dev.vars` or config
+- Use `wrangler secret put` for secrets, never hardcode them
+
+## Vite Setup
+
+```typescript
+import { defineConfig } from 'vite';
+import react from '@vitejs/plugin-react';
+import { cloudflare } from '@cloudflare/vite-plugin';
+import { agents } from 'agents/vite';
+
+export default defineConfig({
+ plugins: [react(), cloudflare(), agents()]
+});
+```
+
+## Type Generation
+
+```bash
+npx wrangler types
+```
+
+This generates `env.d.ts` with typed bindings. Regenerate after changing `wrangler.jsonc`.
+
+## tsconfig
+
+Extend the agents tsconfig for correct settings:
+
+```jsonc
+{
+ "extends": ["agents/tsconfig"],
+ "include": ["src/**/*.ts", "src/**/*.tsx"],
+ "compilerOptions": { "paths": { "~/*": ["./src/*"] } }
+}
+```
diff --git a/.agents/plugins/cloudflare/skills/agents-sdk/references/durable-execution.md b/.agents/plugins/cloudflare/skills/agents-sdk/references/durable-execution.md
new file mode 100644
index 0000000..e6362f2
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/agents-sdk/references/durable-execution.md
@@ -0,0 +1,51 @@
+# Durable Execution
+
+Fetch https://developers.cloudflare.com/agents/api-reference/durable-execution/ for complete documentation.
+
+Fibers let agent work survive Durable Object eviction. Progress is checkpointed to SQLite; on recovery, you decide what to do.
+
+## `runFiber`
+
+```typescript
+export class MyAgent extends Agent {
+ async onRequest(request: Request) {
+ await this.runFiber('process-data', async (ctx) => {
+ const step1 = await fetchData();
+ ctx.stash({ step: 1, data: step1 });
+
+ const step2 = await transform(step1);
+ ctx.stash({ step: 2, result: step2 });
+
+ this.setState({ result: step2 });
+ });
+ return new Response('Started');
+ }
+
+ async onFiberRecovered(ctx) {
+ const checkpoint = ctx.stash;
+ if (checkpoint.step === 1) {
+ const step2 = await transform(checkpoint.data);
+ this.setState({ result: step2 });
+ }
+ }
+}
+```
+
+## Key APIs
+
+| API | Purpose |
+| -------------------------- | ------------------------------------------- |
+| `this.runFiber(name, fn)` | Start a named fiber |
+| `ctx.stash` / `this.stash` | Read latest checkpoint |
+| `ctx.stash = data` | Write checkpoint (JSON-serializable) |
+| `onFiberRecovered(ctx)` | Called on DO restart if fiber was in-flight |
+| `keepAlive()` | Prevent hibernation while fiber runs |
+| `keepAliveWhile(fn)` | Keep alive for duration of async function |
+
+## Important
+
+- `stash` replaces the entire checkpoint — not a merge
+- The lambda is NOT restored on recovery — only the stash data is. You must re-derive what to do in `onFiberRecovered`
+- No auto-retry on throw — handle errors yourself
+- For long-running pipelines with automatic retries, use Workflows instead
+- Filter concurrent fibers by `ctx.name` in `onFiberRecovered`
diff --git a/.agents/plugins/cloudflare/skills/agents-sdk/references/email.md b/.agents/plugins/cloudflare/skills/agents-sdk/references/email.md
new file mode 100644
index 0000000..7a666a4
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/agents-sdk/references/email.md
@@ -0,0 +1,144 @@
+# Email Handling
+
+Fetch https://developers.cloudflare.com/agents/api-reference/email/ for complete documentation.
+
+## Overview
+
+Agents receive and reply to emails via Cloudflare Email Routing.
+
+## Wrangler Configuration
+
+```jsonc
+{
+ "durable_objects": {
+ "bindings": [{ "name": "EmailAgent", "class_name": "EmailAgent" }]
+ },
+ "migrations": [{ "tag": "v1", "new_sqlite_classes": ["EmailAgent"] }],
+ "send_email": [{ "name": "SEB", "destination_address": "reply@yourdomain.com" }]
+}
+```
+
+## Basic Email Handler
+
+```typescript
+import { Agent } from 'agents';
+import { type AgentEmail } from 'agents/email';
+import PostalMime from 'postal-mime';
+
+export class EmailAgent extends Agent {
+ async onEmail(email: AgentEmail) {
+ const raw = await email.getRaw();
+ const parsed = await PostalMime.parse(raw);
+
+ console.log('From:', email.from);
+ console.log('Subject:', parsed.subject);
+
+ await this.replyToEmail(email, {
+ fromName: 'My Agent',
+ subject: `Re: ${parsed.subject}`,
+ body: 'Thanks for your email!'
+ });
+ }
+}
+```
+
+## Routing Emails
+
+```typescript
+import { routeAgentRequest, routeAgentEmail } from 'agents';
+import { createAddressBasedEmailResolver } from 'agents/email';
+
+export default {
+ async email(message, env) {
+ await routeAgentEmail(message, env, {
+ resolver: createAddressBasedEmailResolver('EmailAgent')
+ });
+ },
+
+ async fetch(request, env) {
+ return routeAgentRequest(request, env) ?? new Response('Not found', { status: 404 });
+ }
+};
+```
+
+## Resolvers
+
+### Address-Based (Inbound Mail)
+
+Routes based on recipient address:
+
+```typescript
+import { createAddressBasedEmailResolver } from 'agents/email';
+
+const resolver = createAddressBasedEmailResolver('EmailAgent');
+// support@example.com → EmailAgent, instance "support"
+// NotificationAgent+user123@example.com → NotificationAgent, instance "user123"
+```
+
+### Secure Reply (Reply Flows)
+
+Verifies replies are authentic using HMAC-SHA256 signatures:
+
+```typescript
+import { createSecureReplyEmailResolver } from 'agents/email';
+
+const resolver = createSecureReplyEmailResolver(env.EMAIL_SECRET, {
+ maxAge: 7 * 24 * 60 * 60, // 7 days (default: 30 days)
+ onInvalidSignature: (email, reason) => {
+ console.warn(`Invalid signature from ${email.from}: ${reason}`);
+ }
+});
+```
+
+Sign outbound emails to enable secure reply routing:
+
+```typescript
+await this.replyToEmail(email, {
+ fromName: 'My Agent',
+ body: 'Thanks!',
+ secret: this.env.EMAIL_SECRET // Signs headers for secure reply routing
+});
+```
+
+### Catch-All (Single Instance)
+
+Routes all emails to one agent instance:
+
+```typescript
+import { createCatchAllEmailResolver } from 'agents/email';
+
+const resolver = createCatchAllEmailResolver('EmailAgent', 'default');
+```
+
+### Combining Resolvers
+
+```typescript
+async email(message, env) {
+ const secureReply = createSecureReplyEmailResolver(env.EMAIL_SECRET);
+ const addressBased = createAddressBasedEmailResolver("EmailAgent");
+
+ await routeAgentEmail(message, env, {
+ resolver: async (email, env) => {
+ // Try secure reply first
+ const result = await secureReply(email, env);
+ if (result) return result;
+ // Fall back to address-based
+ return addressBased(email, env);
+ }
+ });
+}
+```
+
+## Utilities
+
+```typescript
+import { isAutoReplyEmail } from "agents/email";
+
+async onEmail(email: AgentEmail) {
+ if (isAutoReplyEmail(email.headers)) {
+ // Skip auto-replies (vacation, out-of-office, etc.)
+ return;
+ }
+ // Process email...
+}
+```
diff --git a/.agents/plugins/cloudflare/skills/agents-sdk/references/human-in-the-loop.md b/.agents/plugins/cloudflare/skills/agents-sdk/references/human-in-the-loop.md
new file mode 100644
index 0000000..c78ee36
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/agents-sdk/references/human-in-the-loop.md
@@ -0,0 +1,10 @@
+# Human-in-the-Loop
+
+Choose the approval layer based on where execution must pause, then fetch its current documentation:
+
+| Need | Documentation |
+| ------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Approve chat tool execution or run a browser-side tool | [Chat agents](https://developers.cloudflare.com/agents/communication-channels/chat/chat-agents/) — `needsApproval`, approval responses, client tools, and custom denial messages |
+| Pause a durable background task or collect MCP input | [Human-in-the-loop patterns](https://developers.cloudflare.com/agents/concepts/agentic-patterns/human-in-the-loop/) — workflow approval, timeout handling, and elicitation |
+
+Distinguish approval responses from client tool outputs. When returning a custom tool error, check whether an explicit continuation is needed. Handle workflow approval timeouts before executing the gated action. Check installed SDK versions before adapting examples.
diff --git a/.agents/plugins/cloudflare/skills/agents-sdk/references/mcp.md b/.agents/plugins/cloudflare/skills/agents-sdk/references/mcp.md
new file mode 100644
index 0000000..55615ee
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/agents-sdk/references/mcp.md
@@ -0,0 +1,13 @@
+# MCP Integration
+
+For new servers, prefer `createMcpHandler` over the deprecated `McpAgent`. For existing servers, check the installed SDK version and state/session requirements before choosing a migration path.
+
+Read the relevant current documentation for implementation details and supported dependency versions:
+
+| Task | Documentation |
+| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Build a server | [Handler API](https://developers.cloudflare.com/agents/model-context-protocol/apis/handler-api/) — server factories, Worker entrypoint, dependencies, and examples |
+| Migrate an existing server | [MCP SDK v2 migration](https://developers.cloudflare.com/agents/model-context-protocol/guides/migrate-to-mcp-sdk-v2/) — stateless migration and temporary legacy paths |
+| Connect to servers and use their tools | [Client API](https://developers.cloudflare.com/agents/model-context-protocol/apis/client-api/) — connections, OAuth, tools, resources, and retries |
+| Choose a transport | [Transports](https://developers.cloudflare.com/agents/model-context-protocol/protocol/transport/) — remote HTTP and existing RPC integrations |
+| Secure a server | [Securing MCP servers](https://developers.cloudflare.com/agents/model-context-protocol/guides/securing-mcp-server/) — OAuth and proxy security |
diff --git a/.agents/plugins/cloudflare/skills/agents-sdk/references/observability.md b/.agents/plugins/cloudflare/skills/agents-sdk/references/observability.md
new file mode 100644
index 0000000..1c8b687
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/agents-sdk/references/observability.md
@@ -0,0 +1,44 @@
+# Observability
+
+Fetch https://developers.cloudflare.com/agents/api-reference/observability/ for complete documentation.
+
+Agents emit structured events via Node.js `diagnostics_channel`. Subscribe in development or forward via Tail Workers in production.
+
+## Subscribe to Events
+
+```typescript
+import { subscribe } from 'agents/observability';
+
+subscribe('agents:rpc', (event) => {
+ console.log(`RPC call: ${event.payload.method}`);
+});
+
+subscribe('agents:state', (event) => {
+ console.log(`State change on ${event.agent}`);
+});
+```
+
+## Available Channels
+
+| Channel | Events |
+| ------------------ | ------------------------------------- |
+| `agents:state` | State changes |
+| `agents:rpc` | `@callable` invocations |
+| `agents:message` | WebSocket messages |
+| `agents:schedule` | Schedule triggers |
+| `agents:lifecycle` | Agent start, connect, disconnect |
+| `agents:workflow` | Workflow progress, completion, errors |
+| `agents:mcp` | MCP server connections, tool calls |
+| `agents:email` | Email received |
+
+## Per-Agent Override
+
+```typescript
+export class MyAgent extends Agent {
+ observability = undefined; // disable for this agent
+}
+```
+
+## Production: Tail Workers
+
+In production, events appear as `diagnosticsChannelEvents` on the Tail Worker `event` object. Attach a Tail Worker to your agent's Worker to forward events to your observability platform.
diff --git a/.agents/plugins/cloudflare/skills/agents-sdk/references/queue-retries.md b/.agents/plugins/cloudflare/skills/agents-sdk/references/queue-retries.md
new file mode 100644
index 0000000..aac0308
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/agents-sdk/references/queue-retries.md
@@ -0,0 +1,18 @@
+# Queue & Retries
+
+Read the current Cloudflare documentation for queue management, retry options, defaults, and callback examples.
+
+| Task | Documentation |
+| --------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
+| Enqueue, inspect, and remove background work; understand sequential processing and failure handling | [Queue tasks](https://developers.cloudflare.com/agents/runtime/execution/queue-tasks/) |
+| Retry an operation or configure retries for queued and scheduled callbacks | [Retries](https://developers.cloudflare.com/agents/runtime/execution/retries/) |
+| Delay recovery or run work on a recurring schedule | [Schedule tasks](https://developers.cloudflare.com/agents/runtime/execution/schedule-tasks/) |
+
+Keep these execution choices in mind when using the linked guides:
+
+- Use the built-in queue for sequential background work. Retries block later queue items; use scheduling for long recovery waits.
+- Retry delays keep the Durable Object active. Choose retry budgets with execution cost and latency in mind.
+- Queued items are removed after their retry budget is exhausted; there is no built-in dead-letter queue. Record failures explicitly when the application needs recovery or auditing.
+- The selective retry predicate is available on `this.retry()`, not serialized queue or schedule options. Handle non-retryable errors in those callbacks.
+
+See [state-scheduling.md](state-scheduling.md) for choosing schedule modes and persisting application state.
diff --git a/.agents/plugins/cloudflare/skills/agents-sdk/references/routing.md b/.agents/plugins/cloudflare/skills/agents-sdk/references/routing.md
new file mode 100644
index 0000000..3ff2645
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/agents-sdk/references/routing.md
@@ -0,0 +1,78 @@
+# Routing
+
+Fetch https://developers.cloudflare.com/agents/api-reference/routing/ for complete documentation.
+
+## Default URL Pattern
+
+`/agents/{kebab-class-name}/{instance-name}`
+
+```typescript
+import { routeAgentRequest } from 'agents';
+
+export default {
+ fetch: (req, env) => routeAgentRequest(req, env) ?? new Response('Not found', { status: 404 })
+};
+```
+
+| Class | URL |
+| ---------- | -------------------------- |
+| `Counter` | `/agents/counter/user-123` |
+| `ChatRoom` | `/agents/chat-room/lobby` |
+| `MyAgent` | `/agents/my-agent/default` |
+
+Subpaths after the instance name (e.g. `/agents/my-agent/default/api/data`) route to `onRequest`.
+
+## Custom Routing with `getAgentByName`
+
+```typescript
+import { getAgentByName } from 'agents';
+
+export default {
+ async fetch(req, env) {
+ const url = new URL(req.url);
+ if (url.pathname.startsWith('/api/')) {
+ const agent = getAgentByName(env.MyAgent, 'singleton');
+ return agent.fetch(req);
+ }
+ return routeAgentRequest(req, env);
+ }
+};
+```
+
+## Options
+
+```typescript
+routeAgentRequest(req, env, {
+ cors: true,
+ prefix: '/api/agents',
+ locationHint: 'enam',
+ jurisdiction: 'eu',
+ props: { userId: '123' },
+ onBeforeConnect: async (req) => {
+ /* auth check */
+ },
+ onBeforeRequest: async (req) => {
+ /* auth check */
+ }
+});
+```
+
+`props` are delivered to `onStart(props)` on first access.
+
+## Client Side
+
+```tsx
+useAgent({
+ agent: 'MyAgent',
+ name: 'instance-1',
+ host: 'https://my-worker.workers.dev',
+ basePath: '/api/agents',
+ path: '/custom-subpath'
+});
+```
+
+## Common Mistakes
+
+- Class name `MyAgent` becomes kebab `my-agent` in URLs — match exactly
+- "Namespace not found" error = the `class_name` in wrangler doesn't match your exported class
+- If `sendIdentityOnConnect: false`, the `ready` promise on the client may never resolve — use state sync instead
diff --git a/.agents/plugins/cloudflare/skills/agents-sdk/references/server-driven-messages.md b/.agents/plugins/cloudflare/skills/agents-sdk/references/server-driven-messages.md
new file mode 100644
index 0000000..ce13e62
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/agents-sdk/references/server-driven-messages.md
@@ -0,0 +1,7 @@
+# Server-Driven Messages
+
+Read [Autonomous responses](https://developers.cloudflare.com/agents/communication-channels/chat/autonomous-responses/) for scheduled, webhook, email, and agent-triggered turns, message schemas, response hooks, and client streaming status.
+
+Choose `saveMessages` to persist messages and request a model response, or `persistMessages` to update context without starting a turn. Use `onChatResponse` to react to turns regardless of their trigger. For webhooks that need a quick acknowledgement, consult the documented `submitMessages` path.
+
+Before reading conversation history or calling `saveMessages` from non-chat entry points, await `waitUntilStable` and handle a timeout without proceeding as if the conversation were stable. Prefer the functional `saveMessages` form when calls can queue, so each update uses the latest history.
diff --git a/.agents/plugins/cloudflare/skills/agents-sdk/references/state-scheduling.md b/.agents/plugins/cloudflare/skills/agents-sdk/references/state-scheduling.md
new file mode 100644
index 0000000..07cec39
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/agents-sdk/references/state-scheduling.md
@@ -0,0 +1,15 @@
+# State & Scheduling
+
+Read the current Cloudflare documentation before implementing state, SQL, or scheduling; check installed SDK versions when adapting an existing agent.
+
+| Task | Documentation |
+| --------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
+| Define state, validate updates, choose state versus SQL, and query SQLite | [Store and sync state](https://developers.cloudflare.com/agents/runtime/lifecycle/state/) |
+| Synchronize state with React or vanilla JavaScript clients | [Client SDK](https://developers.cloudflare.com/agents/communication-channels/chat/client-sdk/) |
+| Select delayed, date-based, cron, or interval execution; manage schedules and callbacks | [Schedule tasks](https://developers.cloudflare.com/agents/runtime/execution/schedule-tasks/) |
+| Configure schedule retry behavior | [Retries](https://developers.cloudflare.com/agents/runtime/execution/retries/) |
+| Handle lifecycle events, connections, and hibernation | [WebSockets](https://developers.cloudflare.com/agents/runtime/communication/websockets/) |
+
+Use synchronized state for data clients need immediately, and SQL for larger collections, history, or queries. Reject invalid updates in the validation hook; state-change notifications are for reacting to accepted updates. Use the state documentation for current hook names and behavior.
+
+Choose a one-time delay or date for work that runs once, cron for calendar recurrence, and an interval for a fixed cadence. For queued work and retry tradeoffs, see [queue-retries.md](queue-retries.md).
diff --git a/.agents/plugins/cloudflare/skills/agents-sdk/references/streaming-chat.md b/.agents/plugins/cloudflare/skills/agents-sdk/references/streaming-chat.md
new file mode 100644
index 0000000..3671e6a
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/agents-sdk/references/streaming-chat.md
@@ -0,0 +1,16 @@
+# Streaming Chat with AIChatAgent
+
+Use `AIChatAgent` for persisted conversations with streaming and tools; use callable streaming RPC for non-chat output. Before adapting an existing app, check its installed `agents`, `@cloudflare/ai-chat`, and AI SDK versions against the current docs.
+
+Read the relevant documentation before implementing:
+
+| Task | Documentation |
+| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Build a chat agent | [Chat agent example](https://developers.cloudflare.com/agents/examples/chat-agent/) — setup, provider, server, and UI |
+| Implement or customize chat | [Chat agents](https://developers.cloudflare.com/agents/communication-channels/chat/chat-agents/) — message format, tools, custom streams, persistence, concurrency, cancellation, and recovery |
+| Connect a client | [Client guidance](client-sdk.md) — React, vanilla JS, HTTP, and authentication |
+| Stream non-chat results | [Callable methods](https://developers.cloudflare.com/agents/runtime/lifecycle/callable-methods/) — server and client streaming RPC |
+| Trigger background turns | [Server-driven messages](server-driven-messages.md) |
+| Add approvals | [Human-in-the-loop](human-in-the-loop.md) |
+
+Forward the request abort signal to the model call so cancellation stops generation. When customizing streams, verify persistence and completion behavior for the installed version. Treat client reconnection and Durable Object eviction as separate recovery cases.
diff --git a/.agents/plugins/cloudflare/skills/agents-sdk/references/think.md b/.agents/plugins/cloudflare/skills/agents-sdk/references/think.md
new file mode 100644
index 0000000..986abbe
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/agents-sdk/references/think.md
@@ -0,0 +1,112 @@
+# Think (Experimental)
+
+Fetch https://developers.cloudflare.com/agents/api-reference/think/ for complete documentation.
+
+`@cloudflare/think` — a higher-level chat agent class that handles the `streamText` loop, tool execution, and message persistence for you. You provide `getModel()` and `getSystemPrompt()`; Think handles the rest.
+
+```bash
+npm install @cloudflare/think
+```
+
+## Minimal Agent
+
+```typescript
+import { Think } from '@cloudflare/think';
+import { createWorkersAI } from 'workers-ai-provider';
+import { routeAgentRequest } from 'agents';
+
+export class MyAgent extends Think {
+ getModel() {
+ return createWorkersAI({ binding: this.env.AI })('@cf/meta/llama-4-scout-17b-16e-instruct');
+ }
+
+ getSystemPrompt() {
+ return 'You are a helpful assistant.';
+ }
+}
+
+export default {
+ fetch: (req, env) => routeAgentRequest(req, env)
+};
+```
+
+## Wrangler Config
+
+```jsonc
+{
+ "compatibility_flags": ["nodejs_compat", "experimental"],
+ "durable_objects": {
+ "bindings": [{ "name": "MyAgent", "class_name": "MyAgent" }]
+ },
+ "migrations": [{ "tag": "v1", "new_sqlite_classes": ["MyAgent"] }],
+ "ai": { "binding": "AI" }
+}
+```
+
+**Note:** Think requires the `experimental` compatibility flag.
+
+## Custom Tools
+
+```typescript
+import { tool } from 'ai';
+import { z } from 'zod';
+
+export class MyAgent extends Think {
+ getTools() {
+ return {
+ getWeather: tool({
+ description: 'Get weather',
+ parameters: z.object({ city: z.string() }),
+ execute: async ({ city }) => `72°F in ${city}`
+ })
+ };
+ }
+}
+```
+
+## Lifecycle Hooks
+
+| Hook | When | Use for |
+| ------------------------ | ------------------------ | ------------------------------------------------------- |
+| `configureSession()` | Agent starts | Set up memory, context providers |
+| `beforeTurn(ctx)` | Before each LLM call | Per-turn model/tools/system prompt; return `TurnConfig` |
+| `onChunk(chunk)` | Each streaming chunk | Progress tracking |
+| `onChatResponse(result)` | After LLM turn completes | Chaining, follow-up `saveMessages` |
+| `onChatError(error)` | On LLM error | Error handling |
+
+```typescript
+async beforeTurn(ctx: TurnContext): Promise {
+ if (ctx.continuation) {
+ return { model: cheaperModel };
+ }
+ return {};
+}
+```
+
+## Sub-Agents
+
+```typescript
+const child = this.subAgent(SpecialistAgent, 'specialist-1');
+await child.chat('Analyze this data...', (chunk) => {
+ // stream callback
+});
+```
+
+## Client
+
+Same React hooks as `AIChatAgent`:
+
+```tsx
+const agent = useAgent({ agent: 'MyAgent', name: 'session-1' });
+const { messages, input, handleInputChange, handleSubmit } = useAgentChat({ agent });
+```
+
+## Think vs AIChatAgent
+
+| | Think | AIChatAgent |
+| ------------------ | --------------------------- | ------------------------------- |
+| `streamText` loop | Built-in | You write it |
+| Tool execution | Automatic | You wire it |
+| Customization | Override hooks | Full control in `onChatMessage` |
+| Built-in tools | Workspace, execute, browser | None |
+| Compatibility flag | Requires `experimental` | Standard |
diff --git a/.agents/plugins/cloudflare/skills/agents-sdk/references/voice.md b/.agents/plugins/cloudflare/skills/agents-sdk/references/voice.md
new file mode 100644
index 0000000..94fc194
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/agents-sdk/references/voice.md
@@ -0,0 +1,70 @@
+# Voice (Experimental)
+
+Fetch https://developers.cloudflare.com/agents/api-reference/voice/ for complete documentation.
+
+`@cloudflare/voice` — real-time speech-to-text and text-to-speech for agents. Audio streams over WebSocket.
+
+```bash
+npm install @cloudflare/voice
+```
+
+## Server
+
+```typescript
+import { Agent } from 'agents';
+import { withVoice, WorkersAITTS, WorkersAINova3STT } from '@cloudflare/voice';
+
+export class VoiceAgent extends withVoice(Agent) {
+ transcriber = new WorkersAINova3STT(this);
+ tts = new WorkersAITTS(this);
+
+ async onTurn(transcript: string, context: VoiceTurnContext) {
+ const result = streamText({
+ model: createWorkersAI({ binding: this.env.AI })('@cf/meta/llama-4-scout-17b-16e-instruct'),
+ messages: [
+ { role: 'system', content: 'You are a voice assistant.' },
+ ...context.conversationHistory,
+ { role: 'user', content: transcript }
+ ]
+ });
+
+ for await (const chunk of result.textStream) {
+ if (context.signal.aborted) break;
+ context.speak(chunk);
+ }
+ }
+}
+```
+
+## Lifecycle Hooks
+
+| Hook | Purpose |
+| ------------------------- | ------------------------------------ |
+| `onTurn(transcript, ctx)` | Handle transcribed speech (required) |
+| `beforeCallStart(conn)` | Auth/validation before call starts |
+| `onCallStart(conn)` | Call connected |
+| `onCallEnd(conn)` | Call disconnected |
+| `onInterrupt()` | User interrupted agent speech |
+
+## Client (React)
+
+```tsx
+import { useVoiceAgent } from '@cloudflare/voice/react';
+
+function VoiceUI() {
+ const { isConnected, isSpeaking, connect, disconnect } = useVoiceAgent({
+ agent: 'VoiceAgent',
+ name: 'session-1'
+ });
+
+ return (
+
+ );
+}
+```
+
+## STT/TTS Providers
+
+Workers AI (default), Deepgram, ElevenLabs — install the provider package and swap the `transcriber`/`tts` properties.
diff --git a/.agents/plugins/cloudflare/skills/agents-sdk/references/webhooks-push.md b/.agents/plugins/cloudflare/skills/agents-sdk/references/webhooks-push.md
new file mode 100644
index 0000000..d8f295c
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/agents-sdk/references/webhooks-push.md
@@ -0,0 +1,90 @@
+# Webhooks & Push Notifications
+
+## Webhooks
+
+Fetch https://developers.cloudflare.com/agents/communication-channels/webhooks/ for complete documentation.
+
+Route external webhooks to agent instances via `onRequest`:
+
+```typescript
+export default {
+ async fetch(req: Request, env: Env) {
+ const url = new URL(req.url);
+ if (url.pathname.startsWith('/webhooks/')) {
+ const entityId = url.pathname.split('/')[2];
+ const agent = getAgentByName(env.MyAgent, entityId);
+ return agent.fetch(req);
+ }
+ return routeAgentRequest(req, env);
+ }
+};
+```
+
+In the agent:
+
+```typescript
+export class MyAgent extends Agent {
+ async onRequest(request: Request) {
+ const signature = request.headers.get('X-Signature');
+ if (!verifySignature(signature, await request.text(), this.env.WEBHOOK_SECRET)) {
+ return new Response('Unauthorized', { status: 401 });
+ }
+ const payload = JSON.parse(await request.text());
+ this.queue('processWebhook', payload);
+ return new Response('OK', { status: 202 });
+ }
+}
+```
+
+**Tips:** Respond quickly (200/202), verify signatures, deduplicate with stored event IDs, use `queue()` for async processing.
+
+## Push Notifications
+
+Fetch https://developers.cloudflare.com/agents/communication-channels/webhooks/push-notifications/ for complete documentation.
+
+Web Push via VAPID from agents. Store subscriptions in agent state, send via `web-push`.
+
+```bash
+npm install web-push
+```
+
+```typescript
+import webpush from 'web-push';
+
+export class NotifyAgent extends Agent {
+ @callable()
+ async subscribe(subscription: PushSubscription) {
+ this.setState({
+ ...this.state,
+ subscriptions: [...this.state.subscriptions, subscription]
+ });
+ }
+
+ async sendReminder(payload: { message: string }, schedule: Schedule) {
+ for (const sub of this.state.subscriptions) {
+ try {
+ await webpush.sendNotification(
+ sub,
+ JSON.stringify({
+ title: 'Reminder',
+ body: payload.message
+ }),
+ {
+ vapidDetails: {
+ subject: 'mailto:you@example.com',
+ publicKey: this.env.VAPID_PUBLIC_KEY,
+ privateKey: this.env.VAPID_PRIVATE_KEY
+ }
+ }
+ );
+ } catch (err) {
+ if (err.statusCode === 404 || err.statusCode === 410) {
+ // Remove expired subscription
+ }
+ }
+ }
+ }
+}
+```
+
+VAPID keys: generate with `npx web-push generate-vapid-keys`, store as secrets.
diff --git a/.agents/plugins/cloudflare/skills/agents-sdk/references/workflows.md b/.agents/plugins/cloudflare/skills/agents-sdk/references/workflows.md
new file mode 100644
index 0000000..940926d
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/agents-sdk/references/workflows.md
@@ -0,0 +1,21 @@
+# Workflows Integration
+
+Use Agents for interactive communication and state management. Add a Workflow when a task needs durable multi-step execution, independent retries, or waits for external approval. Choose based on recovery needs; consult [Run Workflows](https://developers.cloudflare.com/agents/runtime/execution/run-workflows/) before implementing the integration.
+
+## Read for the task
+
+| Task | Documentation |
+| -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
+| Define a typed `AgentWorkflow`, start it from an Agent, and configure bindings | [Quick start](https://developers.cloudflare.com/agents/runtime/execution/run-workflows/#quick-start) |
+| Call back into the originating Agent and understand durable versus non-durable helpers | [AgentWorkflow class](https://developers.cloudflare.com/agents/runtime/execution/run-workflows/#agentworkflow-class) |
+| Send events, query instances, pause, resume, terminate, or delete tracked workflows | [Agent workflow methods](https://developers.cloudflare.com/agents/runtime/execution/run-workflows/#agent-workflow-methods) |
+| Receive progress, completion, errors, and custom events | [Lifecycle callbacks](https://developers.cloudflare.com/agents/runtime/execution/run-workflows/#lifecycle-callbacks) |
+| Approve or reject a waiting task | [Human-in-the-loop approval](https://developers.cloudflare.com/agents/runtime/execution/run-workflows/#human-in-the-loop-approval) |
+| Persist Workflow results into Agent state | [State synchronization](https://developers.cloudflare.com/agents/runtime/execution/run-workflows/#state-synchronization) |
+| Define steps, parameters, retries, and returned values | [Workers API](https://developers.cloudflare.com/workflows/build/workers-api/) |
+
+## Design checks
+
+Keep external side effects within durable steps, make retried operations idempotent, and persist the values needed after recovery through step results. Use the [Rules of Workflows](https://developers.cloudflare.com/workflows/build/rules-of-workflows/) to choose step boundaries.
+
+Progress reports and client broadcasts may repeat on retry. Use the documented durable step helpers for persistent Agent state changes and completion reporting; see [bidirectional communication](https://developers.cloudflare.com/agents/runtime/execution/run-workflows/#bidirectional-communication).
diff --git a/.agents/plugins/cloudflare/skills/cloudflare-email-service/SKILL.md b/.agents/plugins/cloudflare/skills/cloudflare-email-service/SKILL.md
new file mode 100644
index 0000000..0c5be5c
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare-email-service/SKILL.md
@@ -0,0 +1,73 @@
+---
+name: cloudflare-email-service
+description: Implement or troubleshoot Cloudflare Email Sending and Email Routing integrations and their delivery configuration.
+---
+
+# Cloudflare Email Service
+
+Your knowledge of the Cloudflare Email Service, Email Routing or Email Sending may be outdated. **Prefer retrieval over pre-training** for any Cloudflare Email Service task.
+
+Cloudflare Email Service lets you send transactional emails and route incoming emails, all within the Cloudflare platform. Your knowledge of this product may be outdated — it launched in 2025 and is evolving rapidly. **Prefer retrieval over pre-training** for any Email Service task.
+
+**If there is any discrepancy between this skill and the sources below, always trust the original source.** The Cloudflare docs, REST API spec, `@cloudflare/workers-types`, and Agents SDK repo are the source of truth. This skill is a convenience guide — it may lag behind the latest changes. When in doubt, retrieve from the sources below and use what they say.
+
+## Retrieval Sources
+
+| Source | How to retrieve | Use for |
+| --------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------- |
+| Cloudflare docs | Cloudflare MCP `docs` tool or URL `https://developers.cloudflare.com/email-service/` | API reference, limits, pricing, latest features |
+| REST API spec | `https://developers.cloudflare.com/api/resources/email_sending` | OpenAPI spec for the Email Sending REST API |
+| Workers types | `https://www.npmjs.com/package/@cloudflare/workers-types` | Type signatures, binding shapes |
+| Agents SDK docs | [Email agent walkthrough](https://developers.cloudflare.com/agents/examples/email-agent/) | Email handling in Agents SDK |
+
+## FIRST: Check Prerequisites
+
+Before writing any email code, verify the basics are in place:
+
+1. **Domain onboarded?** Run `npx wrangler email sending list` to see which domains have email sending enabled. If the domain isn't listed, run `npx wrangler email sending enable userdomain.com` or see [cli-and-mcp.md](references/cli-and-mcp.md) for full setup instructions.
+2. **Binding configured?** Look for `send_email` in `wrangler.jsonc` (for Workers)
+3. **postal-mime installed?** Run `npm ls postal-mime` (only needed for receiving/parsing emails)
+
+## What Do You Need?
+
+Start here. Find your situation, then follow the link for full details.
+
+| I want to... | Path | Reference |
+| -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------- |
+| **Send emails from a Cloudflare Worker** | Workers binding (no API keys needed) | [sending.md](references/sending.md) |
+| **Send emails from an AI agent built with [Cloudflare Agents SDK](https://developers.cloudflare.com/agents/)** | `onEmail()` + `replyToEmail()` in Agent class | [sending.md](references/sending.md) |
+| **Send emails from an external app or agent** (Node.js, Go, Python, etc.) | REST API with Bearer token | [rest-api.md](references/rest-api.md) |
+| **Send emails from a coding agent** (Claude Code, Cursor, Copilot, etc.) | MCP tools, wrangler CLI, or REST API | [cli-and-mcp.md](references/cli-and-mcp.md) |
+| **Receive and process incoming emails** (Email Routing) | Workers `email()` handler | [routing.md](references/routing.md) |
+| **Set up Email Sending or Email Routing** | `wrangler email sending enable` / `wrangler email routing enable`, or Dashboard | [cli-and-mcp.md](references/cli-and-mcp.md) |
+| **Improve deliverability, avoid spam folders** | Authentication, content, compliance | [deliverability.md](references/deliverability.md) |
+
+## Sending Workflow
+
+Prefer the binding for Workers; use REST for external apps or when explicitly requested. Read [sending.md](references/sending.md) or [rest-api.md](references/rest-api.md) to retrieve the documentation for the selected task before writing code. These guides cover setup, recipients, attachments, headers, limits, response handling, and errors; the Workers guide also covers Agents SDK integration and types matched to the project configuration.
+
+## Common Mistakes
+
+| Mistake | Why It Happens | Fix |
+| -------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
+| Forgetting `send_email` binding in wrangler config | Email Service uses a binding, not an API key | Add `"send_email": [{ "name": "EMAIL" }]` to wrangler.jsonc |
+| Sending from an unverified domain | Domain must be onboarded onto Email Sending before first send | Run `wrangler email sending enable yourdomain.com` or onboard in Dashboard |
+| Reading `message.raw` twice in email handler | The raw stream is single-use — second read returns empty | Buffer first: `const raw = await new Response(message.raw).arrayBuffer()` |
+| Missing `text` field (HTML only) | Some email clients only show plain text; also helps spam scores | Always include both `html` and `text` versions |
+| Using email for marketing/bulk sends | Email Service is for transactional email only | Use a dedicated marketing email platform for newsletters and campaigns |
+| Forwarding to unverified destinations | `message.forward()` only works with verified addresses | Run `wrangler email routing addresses create user@gmail.com` or add in Dashboard |
+| Testing with fake addresses | Bounces from non-existent addresses hurt sender reputation | Use real addresses you control during development |
+| Hardcoding API tokens in source code | Tokens in code get committed and leaked | Use environment variables or Cloudflare secrets |
+| Ignoring the `from` domain requirement | The `from` address must use a domain onboarded to Email Service | Verify the domain first, then send from `anything@that-domain.com` |
+| Using `email` key in REST API `from` object | REST API uses `address` not `email` for `from` object | Use `{ "address": "...", "name": "..." }` for REST, `{ "email": "...", "name": "..." }` for Workers |
+| Using `replyTo` in REST API | REST API uses snake_case field names | Use `reply_to` for REST API, `replyTo` for Workers binding |
+
+## References
+
+Read the reference that matches your situation. You don't need all of them.
+
+- **[references/sending.md](references/sending.md)** — Documentation map for Workers binding, attachments, and Agents SDK email.
+- **[references/rest-api.md](references/rest-api.md)** — Documentation map for HTTP sending, request schemas, responses, and errors.
+- **[references/routing.md](references/routing.md)** — Inbound `email()` handler, forwarding, replying, parsing. For receiving emails.
+- **[references/cli-and-mcp.md](references/cli-and-mcp.md)** — Domain setup, wrangler commands, MCP tools. For first-time setup.
+- **[references/deliverability.md](references/deliverability.md)** — SPF/DKIM/DMARC, bounces, suppressions, best practices.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare-email-service/references/cli-and-mcp.md b/.agents/plugins/cloudflare/skills/cloudflare-email-service/references/cli-and-mcp.md
new file mode 100644
index 0000000..8591236
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare-email-service/references/cli-and-mcp.md
@@ -0,0 +1,125 @@
+# CLI, MCP, and Project Setup
+
+Manage Cloudflare Email Service from the command line and coding agents.
+
+For full CLI reference, run `npx wrangler email --help`. For Dashboard setup, see the [getting started docs](https://developers.cloudflare.com/email-service/get-started/).
+
+## Wrangler Email Commands
+
+```
+wrangler email routing
+├── enable/disable # Toggle email routing
+├── dns get # Show required DNS records
+├── rules list/create/update/delete # Manage routing rules
+└── addresses list/create/delete # Destination addresses (account-scoped)
+
+wrangler email sending
+├── enable/disable # Toggle email sending
+├── dns get # Show sending DNS records (SPF, DKIM)
+├── send --from --to ... # Send an email (builder flags)
+└── send-raw --from --to ... # Send a raw MIME email
+```
+
+## Domain Setup
+
+### Via Dashboard
+
+1. Navigate to **Compute & AI** > **Email Service** > **Email Sending** (or **Email Routing**)
+2. Select **Onboard Domain** > choose domain > **Add records and onboard**
+
+This auto-adds SPF (TXT) and DKIM (CNAME/TXT) records. DNS usually propagates within 5-15 minutes.
+
+### Via CLI
+
+```bash
+npx wrangler email sending enable yourdomain.com
+npx wrangler email sending dns get yourdomain.com # Verify records
+```
+
+## Local Development
+
+Add `"remote": true` to send real emails during `wrangler dev`:
+
+```jsonc
+{ "send_email": [{ "name": "EMAIL", "remote": true }] }
+```
+
+```bash
+npx wrangler dev
+```
+
+Emails are actually sent — use test addresses you control. Remove `"remote": true` before deploying.
+
+## Cloudflare MCP Server
+
+If you have the [Cloudflare MCP server](https://github.com/cloudflare/mcp) (`https://mcp.cloudflare.com/mcp`) configured, you can manage Email Service through its `search` and `execute` tools.
+
+Use `search` to find email sending endpoints:
+
+```javascript
+// search tool — find all email sending API endpoints
+async () => {
+ const results = [];
+ for (const [path, methods] of Object.entries(spec.paths)) {
+ if (path.includes('email/sending')) {
+ for (const [method, op] of Object.entries(methods)) {
+ results.push({ method: method.toUpperCase(), path, summary: op.summary });
+ }
+ }
+ }
+ return results;
+};
+```
+
+Then use `execute` to call them — for example, checking sending limits or sending an email:
+
+```javascript
+// execute tool — check sending quota
+async () => {
+ return cloudflare.request({
+ method: 'GET',
+ path: `/accounts/${accountId}/email/sending/limits`
+ });
+};
+
+// execute tool — send an email
+async () => {
+ return cloudflare.request({
+ method: 'POST',
+ path: `/accounts/${accountId}/email/sending/send`,
+ body: {
+ to: 'user@example.com',
+ from: { address: 'notifications@yourdomain.com', name: 'My App' },
+ subject: 'Deployment Complete',
+ html: '
Deployed!
',
+ text: 'Deployed!'
+ }
+ });
+};
+```
+
+GraphQL analytics queries also work through `execute` — see [deliverability.md](deliverability.md#graphql-analytics-api) for query examples. Note that email analytics are **zone-level** datasets (`emailSendingAdaptiveGroups`, `emailSendingAdaptive`) queried under `viewer > zones`, and require the **Analytics Read** token permission.
+
+## Sending from CLI / Agents
+
+```bash
+npx wrangler email sending send \
+ --from "agent@yourdomain.com" \
+ --to "developer@company.com" \
+ --subject "Deployment Complete" \
+ --text "Your Worker was deployed successfully."
+```
+
+Or via REST API:
+
+```bash
+curl "https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_ACCOUNT_ID}/email/sending/send" \
+ --header "Authorization: Bearer ${CLOUDFLARE_API_TOKEN}" \
+ --header "Content-Type: application/json" \
+ --data '{
+ "to": "developer@company.com",
+ "from": {"address": "agent@yourdomain.com", "name": "Build Agent"},
+ "subject": "Deployment Complete",
+ "text": "Your Worker was deployed successfully."
+ }'
+```
diff --git a/.agents/plugins/cloudflare/skills/cloudflare-email-service/references/deliverability.md b/.agents/plugins/cloudflare/skills/cloudflare-email-service/references/deliverability.md
new file mode 100644
index 0000000..ed0f289
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare-email-service/references/deliverability.md
@@ -0,0 +1,276 @@
+# Email Deliverability & Best Practices
+
+For full details, see the [deliverability docs](https://developers.cloudflare.com/email-service/concepts/deliverability/) and [email authentication docs](https://developers.cloudflare.com/email-service/concepts/email-authentication/). All the monitoring endpoints below can be called via the [REST API](rest-api.md), [Wrangler CLI, or the Cloudflare MCP server](cli-and-mcp.md).
+
+## What Cloudflare Handles
+
+When you onboard a domain, Cloudflare auto-configures:
+
+- **SPF** — TXT records authorizing Cloudflare's sending infrastructure
+- **DKIM** — Records for cryptographic signing of outbound emails
+- **IP reputation** — Managed sending infrastructure optimized for deliverability
+- **Soft bounce retries** — Automatic exponential backoff for temporary failures
+- **Suppression lists** — Hard-bounced addresses automatically blocked
+- **Feedback loops** — ISP complaint signals processed and acted on
+
+Consider adding a **DMARC** record if you don't have one: `v=DMARC1; p=quarantine; rua=mailto:dmarc-reports@yourdomain.com`
+
+## Bounce Handling
+
+**Hard bounces** — permanent failures (address doesn't exist, domain doesn't exist). Never retried. Address auto-added to suppression list. Sending to suppressed address returns `E_RECIPIENT_SUPPRESSED`.
+
+**Soft bounces** — temporary failures (mailbox full, server down, greylisting). Cloudflare auto-retries with exponential backoff.
+
+## Suppression Lists
+
+**Account list** (your account) — spam complaints from recipients. Cloudflare integrates with Postmasters to auto-suppress. You can manually add/remove addresses in the Dashboard.
+
+See the [suppressions docs](https://developers.cloudflare.com/email-service/concepts/suppressions/) for details.
+
+## Your Responsibilities
+
+### Content
+
+- Include both HTML and plain text versions
+- Use a recognizable sender name: `{ email: "noreply@app.com", name: "My App" }`
+- Write honest subject lines — avoid ALL CAPS, excessive punctuation
+- Include `List-Unsubscribe` headers for recurring emails
+- Use full URLs from your domain — avoid URL shorteners
+
+### List Quality
+
+- Validate email addresses before sending
+- Implement double opt-in for subscriptions
+- Honor unsubscribe requests promptly
+
+### Transactional Only
+
+Email Service is for **transactional email** (triggered by user actions: signups, password resets, order confirmations). Marketing/bulk campaigns are not permitted — use a dedicated marketing platform.
+
+## Monitoring Deliverability
+
+### Dashboard
+
+Per-domain and account-wide analytics are available in the Cloudflare dashboard:
+
+1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account.
+2. Go to **Compute & AI** > **Email Service**.
+3. Select a domain or view account-wide metrics.
+4. Select the **Analytics** tab.
+
+### Send Response
+
+Every send (REST API or Workers binding) returns immediate delivery feedback. Check the response to track per-send outcomes:
+
+```json
+{
+ "result": {
+ "delivered": ["user@example.com"],
+ "permanent_bounces": ["bad@nonexistent.com"],
+ "queued": ["slow@recipient.com"]
+ }
+}
+```
+
+Log these to build your own delivery rate metrics.
+
+### Sending Limits
+
+Check your account's daily sending quota:
+
+```bash
+curl "https://api.cloudflare.com/client/v4/accounts/{account_id}/email/sending/limits" \
+ --header "Authorization: Bearer "
+```
+
+Returns:
+
+```json
+{
+ "result": {
+ "quota": { "value": 5000, "unit": "day" }
+ }
+}
+```
+
+### Suppression List
+
+Addresses that hard-bounced or received spam complaints are auto-suppressed. You can query and manage suppressions via the API.
+
+**List suppressions (account-wide):**
+
+```bash
+curl "https://api.cloudflare.com/client/v4/accounts/{account_id}/email/sending/suppression?page=1&per_page=100&order=created_at&direction=desc" \
+ --header "Authorization: Bearer "
+```
+
+Returns:
+
+```json
+{
+ "page": 1,
+ "per_page": 100,
+ "total": 2,
+ "result": [
+ {
+ "id": "396a5436-d4b0-42a6-b3fc-48e8fa522321",
+ "email": "bounced@example.com",
+ "reason": "hard_bounce",
+ "created_at": "2026-03-15T10:00:00Z",
+ "expires_at": null
+ }
+ ]
+}
+```
+
+Query params: `page`, `per_page` (max 1000), `order` (`email` | `expires_at` | `created_at`), `direction` (`asc` | `desc`).
+
+**Manually suppress an address:**
+
+```bash
+curl -X POST "https://api.cloudflare.com/client/v4/accounts/{account_id}/email/sending/suppression" \
+ --header "Authorization: Bearer " \
+ --header "Content-Type: application/json" \
+ --data '{ "email": "user@example.com", "expires_at": "2026-06-01T00:00:00Z" }'
+```
+
+`expires_at` is optional — omit for permanent suppression.
+
+**Remove a suppression:**
+
+```bash
+curl -X DELETE "https://api.cloudflare.com/client/v4/accounts/{account_id}/email/sending/suppression/{suppression_id}" \
+ --header "Authorization: Bearer "
+```
+
+Zone-level suppressions are also available at `/zones/{zone_id}/email/sending/suppression` with the same interface.
+
+### GraphQL Analytics API
+
+Email Service exposes two zone-level datasets via the [GraphQL Analytics API](https://developers.cloudflare.com/analytics/graphql-api/). You can explore the schema interactively at [graphql.cloudflare.com/explorer](https://graphql.cloudflare.com/explorer). Metrics are retained for 31 days.
+
+| Dataset | Description |
+| ---------------------------- | ------------------------------------------------------------------------------------- |
+| `emailSendingAdaptiveGroups` | Aggregated counts grouped by dimensions (status, date, domain, auth results, etc.) |
+| `emailSendingAdaptive` | Individual email events with full detail (from, to, subject, messageId, errors, etc.) |
+
+These are **zone-level** datasets — query under `viewer > zones`, not `accounts`.
+
+**Aggregated dimensions** (`emailSendingAdaptiveGroups`):
+
+| Dimension | Type | Description |
+| -------------------------------- | ------ | --------------------------------------------------------------------------------------------------------- |
+| `date` | Date | Day-level grouping |
+| `datetime` | Time | Exact timestamp (also: `datetimeMinute`, `datetimeFiveMinutes`, `datetimeFifteenMinutes`, `datetimeHour`) |
+| `status` | string | Delivery status |
+| `eventType` | string | Event type |
+| `sendingDomain` | string | The sending domain |
+| `envelopeTo` | string | Recipient address |
+| `errorCause` | string | Error cause for failed sends |
+| `arc`, `dkim`, `dmarc`, `spf` | string | Email authentication results |
+| `isSpam`, `isNDR`, `isLastEvent` | uint8 | Boolean flags |
+| `spamScore`, `spamThreshold` | uint32 | Spam scoring |
+
+**Individual event fields** (`emailSendingAdaptive`) additionally include: `from`, `to`, `subject`, `messageId`, `sessionId`, `errorDetail`.
+
+**Email counts by status and date:**
+
+```graphql
+query EmailSendingByStatus($zoneTag: string!, $start: Date!, $end: Date!) {
+ viewer {
+ zones(filter: { zoneTag: $zoneTag }) {
+ emailSendingAdaptiveGroups(
+ filter: { date_geq: $start, date_leq: $end }
+ limit: 10000
+ orderBy: [date_DESC]
+ ) {
+ count
+ dimensions {
+ date
+ status
+ }
+ }
+ }
+ }
+}
+```
+
+**Filter by status (e.g. only failures):**
+
+```graphql
+query EmailFailures($zoneTag: string!, $start: Date!, $end: Date!) {
+ viewer {
+ zones(filter: { zoneTag: $zoneTag }) {
+ emailSendingAdaptiveGroups(
+ filter: { date_geq: $start, date_leq: $end, status: "deliveryFailed" }
+ limit: 10000
+ orderBy: [date_DESC]
+ ) {
+ count
+ dimensions {
+ date
+ errorCause
+ sendingDomain
+ }
+ }
+ }
+ }
+}
+```
+
+**Individual email events (troubleshooting):**
+
+```graphql
+query RecentEmailEvents($zoneTag: string!, $start: Time!, $end: Time!) {
+ viewer {
+ zones(filter: { zoneTag: $zoneTag }) {
+ emailSendingAdaptive(
+ filter: { datetime_geq: $start, datetime_leq: $end }
+ limit: 50
+ orderBy: [datetime_DESC]
+ ) {
+ datetime
+ from
+ to
+ subject
+ status
+ eventType
+ sendingDomain
+ messageId
+ errorCause
+ errorDetail
+ dkim
+ dmarc
+ spf
+ isSpam
+ }
+ }
+ }
+}
+```
+
+Note: `emailSendingAdaptive` filters use `datetime_geq`/`datetime_leq` (Time type, e.g. `"2026-04-01T00:00:00Z"`), while `emailSendingAdaptiveGroups` uses `date_geq`/`date_leq` (Date type, e.g. `"2026-04-01"`).
+
+**curl example:**
+
+```bash
+curl "https://api.cloudflare.com/client/v4/graphql" \
+ --header "Authorization: Bearer " \
+ --header "Content-Type: application/json" \
+ --data '{
+ "query": "query($zoneTag:string!,$start:Date!,$end:Date!){viewer{zones(filter:{zoneTag:$zoneTag}){emailSendingAdaptiveGroups(filter:{date_geq:$start,date_leq:$end},limit:10000,orderBy:[date_DESC]){count,dimensions{date,status}}}}}",
+ "variables": {
+ "zoneTag": "",
+ "start": "2026-03-15",
+ "end": "2026-04-15"
+ }
+ }'
+```
+
+## Metrics to Watch
+
+| Metric | Target | If Out of Range |
+| ---------------- | ------ | ----------------------------------------------- |
+| Delivery rate | > 95% | Check for invalid addresses; verify DNS records |
+| Hard bounce rate | < 2% | Clean your email list |
+| Complaint rate | < 0.1% | Make unsubscribe easier; stop unwanted emails |
diff --git a/.agents/plugins/cloudflare/skills/cloudflare-email-service/references/rest-api.md b/.agents/plugins/cloudflare/skills/cloudflare-email-service/references/rest-api.md
new file mode 100644
index 0000000..9a0ca1b
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare-email-service/references/rest-api.md
@@ -0,0 +1,17 @@
+# Sending Emails — REST API
+
+Use the REST API for HTTP integrations from external applications, or when the user explicitly requests it inside a Worker. Otherwise prefer the [Workers binding](sending.md).
+
+Read the relevant page before building the request. Keep credentials in the project's existing secret or environment-variable mechanism, and inspect the installed client SDK version if one is used.
+
+| Task | Read |
+| ---------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
+| Authenticate, send an email, or find the complete request schema | [REST API](https://developers.cloudflare.com/email-service/api/send-emails/rest-api/) and its linked Email Sending API reference |
+| Set multiple recipients, CC/BCC, or named addresses | [Specify recipients](https://developers.cloudflare.com/email-service/examples/email-sending/recipients/) (REST examples) |
+| Encode attachments | [REST attachments](https://developers.cloudflare.com/email-service/api/send-emails/rest-api/#attachments) |
+| Add custom headers | [Email headers](https://developers.cloudflare.com/email-service/reference/headers/) |
+| Check recipient, message-size, or sending quotas | [Limits](https://developers.cloudflare.com/email-service/platform/limits/) |
+| Interpret delivery outcomes | [REST response](https://developers.cloudflare.com/email-service/api/send-emails/rest-api/#response) |
+| Diagnose errors and decide whether to retry | [REST error handling](https://developers.cloudflare.com/email-service/api/send-emails/rest-api/#error-handling) |
+
+Do not reuse a Workers binding payload or response parser unchanged: verify field names, attachment encoding, response shape, and error handling for the chosen API. Validate both successful responses and failures through the project's existing checks; distinguish retryable service failures from requests that need correction.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare-email-service/references/routing.md b/.agents/plugins/cloudflare/skills/cloudflare-email-service/references/routing.md
new file mode 100644
index 0000000..f65ff9f
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare-email-service/references/routing.md
@@ -0,0 +1,213 @@
+# Receiving & Routing Inbound Email
+
+Handle incoming emails sent to your domain via a Worker's `email()` handler. Forward, reply, reject, or parse emails programmatically.
+
+For full API details, see the [Email Routing docs](https://developers.cloudflare.com/email-service/api/route-emails/email-handler/).
+
+## Email Handler
+
+Export an `email()` function from your Worker. No special wrangler binding needed — a routing rule connects incoming addresses to your Worker.
+
+```typescript
+export default {
+ async email(message, env, ctx): Promise {
+ console.log(`Email from ${message.from} to ${message.to}`);
+ await message.forward('team@company.com');
+ }
+} satisfies ExportedHandler;
+```
+
+Set up routing rules in **Dashboard** > **Compute & AI** > **Email Service** > **Email Routing** > **Routing Rules**, or via `wrangler email routing rules create`.
+
+## ForwardableEmailMessage
+
+The `message` parameter is a `ForwardableEmailMessage`. Run `npx wrangler types` to get the full type definition. Key properties and methods:
+
+- `message.from` / `message.to` — envelope addresses (SMTP MAIL FROM / RCPT TO). `message.from` is trustworthy; header addresses can be spoofed.
+- `message.headers` — `Headers` object (use `.get("subject")`, `.get("message-id")`, etc.)
+- `message.raw` — `ReadableStream` of raw MIME content. **Single use** — buffer before accessing.
+- `message.rawSize` — size in bytes
+- `message.setReject(reason)` — reject with a permanent SMTP error
+- `message.forward(rcptTo, headers?)` — forward to a verified destination
+- `message.reply(emailMessage)` — reply with an `EmailMessage` object
+
+## Core Operations
+
+### Forward
+
+```typescript
+await message.forward('team@company.com');
+
+// With custom headers
+await message.forward(
+ 'team@company.com',
+ new Headers({
+ 'X-Original-Recipient': message.to
+ })
+);
+```
+
+Destination must be verified first (Dashboard or `wrangler email routing addresses create`).
+
+### Reject
+
+```typescript
+message.setReject('Your message was blocked');
+```
+
+### Reply
+
+Using `env.EMAIL.send()` (recommended — no extra dependencies):
+
+```typescript
+async email(message, env, ctx) {
+ const subject = message.headers.get("subject") || "";
+ await env.EMAIL.send({
+ to: message.from,
+ from: message.to,
+ subject: `Re: ${subject}`,
+ html: "
Thanks! We'll respond shortly.
",
+ text: "Thanks! We'll respond shortly.",
+ });
+ await message.forward("team@company.com");
+}
+```
+
+Using `message.reply()` with MIME (more control, requires `mimetext` + `nodejs_compat`):
+
+```typescript
+import { EmailMessage } from "cloudflare:email";
+import { createMimeMessage } from "mimetext";
+
+async email(message, env, ctx) {
+ const msg = createMimeMessage();
+ const messageId = message.headers.get("Message-ID");
+ if (messageId) msg.setHeader("In-Reply-To", messageId);
+ msg.setSender({ name: "Support", addr: "support@yourdomain.com" });
+ msg.setRecipient(message.from);
+ msg.setSubject("Re: " + (message.headers.get("subject") || ""));
+ msg.addMessage({ contentType: "text/plain", data: "Thanks for reaching out!" });
+
+ await message.reply(new EmailMessage("support@yourdomain.com", message.from, msg.asRaw()));
+}
+```
+
+## Parsing Emails
+
+Use [postal-mime](https://www.npmjs.com/package/postal-mime) to parse raw MIME content:
+
+```typescript
+import PostalMime from "postal-mime";
+
+async email(message, env, ctx) {
+ const rawBuffer = await new Response(message.raw).arrayBuffer();
+ const parsed = await PostalMime.parse(rawBuffer);
+
+ console.log("Subject:", parsed.subject);
+ console.log("Text:", parsed.text);
+ console.log("Attachments:", parsed.attachments.length);
+}
+```
+
+## Store and Reply Later (Human-in-the-Loop)
+
+A common pattern is to store incoming emails in a Durable Object (SQLite) so a human or AI agent can review and reply later — rather than replying immediately in the `email()` handler. This enables support inboxes, approval workflows, and AI-drafted replies.
+
+### Architecture
+
+```
+Email Routing → email() handler → parse + store in DO → user reviews later → reply via send_email binding
+```
+
+The `email()` handler stores the email and returns immediately. Replies happen later via a separate HTTP request or agent action.
+
+### Receive and Store
+
+```typescript
+import PostalMime from 'postal-mime';
+
+export class MailboxDO extends DurableObject {
+ async storeEmail(
+ from: string,
+ to: string,
+ subject: string,
+ body: string,
+ messageId: string,
+ inReplyTo: string | null
+ ) {
+ this.ctx.storage.sql.exec(
+ `INSERT INTO emails (sender, recipient, subject, body, message_id, in_reply_to, date, read)
+ VALUES (?, ?, ?, ?, ?, ?, datetime('now'), 0)`,
+ from,
+ to,
+ subject,
+ body,
+ messageId,
+ inReplyTo
+ );
+ }
+}
+
+export default {
+ async email(message, env, ctx) {
+ const raw = await new Response(message.raw).arrayBuffer();
+ const parsed = await PostalMime.parse(raw);
+
+ const id = env.MAILBOX.idFromName(message.to);
+ const stub = env.MAILBOX.get(id);
+
+ await stub.storeEmail(
+ message.from,
+ message.to,
+ parsed.subject || '(no subject)',
+ parsed.text || parsed.html || '',
+ message.headers.get('message-id') || '',
+ message.headers.get('in-reply-to') || null
+ );
+
+ // Optionally trigger an AI agent to draft a reply (non-blocking)
+ // ctx.waitUntil(notifyAgent(env, message.to, emailId));
+ }
+} satisfies ExportedHandler;
+```
+
+### Reply Later
+
+When a user (or agent) decides to reply, build proper threading headers and send via the `send_email` binding:
+
+```typescript
+// In an HTTP handler or agent tool — not in the email() handler
+async function replyToStoredEmail(env: Env, original: StoredEmail, replyBody: string) {
+ // Build threading headers (In-Reply-To + References per RFC 2822)
+ const headers: Record = {};
+ if (original.messageId) {
+ headers['In-Reply-To'] = original.messageId;
+ headers['References'] = original.messageId;
+ }
+
+ await env.EMAIL.send({
+ to: original.sender,
+ from: original.recipient,
+ subject: `Re: ${original.subject}`,
+ text: replyBody,
+ html: `
${replyBody}
`,
+ headers
+ });
+}
+```
+
+### Key Design Points
+
+- **Buffer `message.raw` once**, parse with `postal-mime`, then store structured fields. Don't store the raw stream.
+- **Extract `Message-ID`, `In-Reply-To`, and `References`** headers during ingest for threading. Fall back to subject-based matching for emails without threading headers.
+- **Use Durable Object SQLite** for per-mailbox storage — each mailbox gets its own DO instance keyed by email address, providing natural isolation.
+- **Store attachments separately** in R2 (binary blobs), with metadata in SQLite.
+- **Defer heavy work** (AI drafting, notifications) via `ctx.waitUntil()` so the `email()` handler returns quickly.
+- **Never auto-send from the `email()` handler** in a human-in-the-loop flow. Store a draft, let the user review, then send via a separate action.
+
+## Gotchas
+
+- **`message.raw` is single-use.** Buffer first: `const raw = await new Response(message.raw).arrayBuffer()`
+- **Destinations must be verified.** Forwarding to unverified addresses fails silently.
+- **Handler must act.** If your handler returns without consuming raw, forwarding, or rejecting, the email is dropped.
+- **DMARC/SPF for replies.** If sending replies, ensure your domain has proper SPF/DKIM records (auto-configured on domain onboarding).
diff --git a/.agents/plugins/cloudflare/skills/cloudflare-email-service/references/sending.md b/.agents/plugins/cloudflare/skills/cloudflare-email-service/references/sending.md
new file mode 100644
index 0000000..5e4c793
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare-email-service/references/sending.md
@@ -0,0 +1,19 @@
+# Sending Emails — Workers Binding & Agents SDK
+
+Prefer the native binding for Workers. For an external application, or when the user explicitly requests HTTP integration, use the [REST API guide](rest-api.md).
+
+Read the documentation for the selected task before implementing. Inspect the project's installed Wrangler and Agents SDK versions, configuration, and existing conventions first. Run `wrangler types` through the project's package manager after changing bindings; use its generated types instead of handwritten email interfaces. See [Workers TypeScript](https://developers.cloudflare.com/workers/languages/typescript/) for matching types to the project's compatibility date and flags. Do not upgrade dependencies just to match an example.
+
+| Task | Read |
+| ------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- |
+| Configure the binding, send a message, or maintain existing MIME-based sending | [Workers API](https://developers.cloudflare.com/email-service/api/send-emails/workers-api/) |
+| Restrict sender or destination addresses | [Configure send bindings](https://developers.cloudflare.com/email-service/configuration/send-bindings/) |
+| Set multiple recipients, CC/BCC, or named addresses | [Specify recipients](https://developers.cloudflare.com/email-service/examples/email-sending/recipients/) |
+| Add files, inline images, or uploaded attachments | [Email attachments](https://developers.cloudflare.com/email-service/examples/email-sending/email-attachments/) |
+| Set custom headers or diagnose header validation | [Email headers](https://developers.cloudflare.com/email-service/reference/headers/) |
+| Check recipient, message-size, or sending quotas | [Limits](https://developers.cloudflare.com/email-service/platform/limits/) |
+| Choose local simulation or remote delivery | [Local email sending](https://developers.cloudflare.com/email-service/local-development/sending/) |
+| Interpret send results and binding errors | [Workers API response and error handling](https://developers.cloudflare.com/email-service/api/send-emails/workers-api/#error-handling) |
+| Send, receive, route, and securely reply from an Agent | [Email agent walkthrough](https://developers.cloudflare.com/agents/examples/email-agent/) |
+
+When adapting REST code to a binding, verify address fields, attachment representation, response shape, and errors against the binding docs and generated types. Exercise the relevant success and failure paths using the project's existing checks. Confirm whether the chosen local configuration simulates delivery or sends real mail before testing.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare-one-migrations/SKILL.md b/.agents/plugins/cloudflare/skills/cloudflare-one-migrations/SKILL.md
new file mode 100644
index 0000000..774d3d7
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare-one-migrations/SKILL.md
@@ -0,0 +1,110 @@
+---
+name: cloudflare-one-migrations
+description: Assess and plan migrations from existing VPN, SWG, or SASE platforms to Cloudflare One, including policy mapping, parity gaps, and rollout.
+---
+
+# Cloudflare One Migrations
+
+Retrieve current Cloudflare docs, Cloudflare API schemas, and source-vendor export docs before generating exact configuration.
+
+## Workflow
+
+1. Identify the source stack: Zscaler ZIA, Zscaler ZPA, Palo Alto NGFW/Prisma/GlobalProtect, legacy VPN/SWG/SD-WAN, or other.
+2. Request exports and logs before mapping. Prefer structured exports over screenshots or prose summaries.
+3. Build an inventory: identities, groups, apps, destinations, connectors/tunnels, DNS/URL/firewall/DLP/TLS policies, objects/lists, locations/sites, exceptions, hit counts, and compliance logging.
+4. Produce a mapping plan: source object, Cloudflare One target resource, confidence, prerequisites, unsupported/partial mappings, and manual decisions.
+5. Create dependencies first: identity/[SCIM](https://developers.cloudflare.com/cloudflare-one/team-and-resources/users/scim/), connectors/on-ramps, routes/DNS, lists/objects, TLS bypasses, Access apps/policies, Gateway policies, DLP/CASB, logging.
+6. Stage safely: use a migration prefix, create disabled/audit-mode rules by default, pilot with small groups/sites, compare logs, then expand rollout.
+7. Account for every source rule. Each rule must map to a Cloudflare object or an explicit Not Migrated row with reason and security impact.
+
+## Exports To Ask For
+
+- ZIA: URL filtering, firewall filtering, SSL inspection, DLP, custom URL categories, IP groups, network services/service groups, users/groups/departments, locations, GRE tunnels, and static IPs.
+- ZPA: app segments, segment groups, server groups, app connectors/connector groups, access policies, IdP/group mapping, private DNS domains, ports, and protocols.
+- Palo Alto/Prisma: security/NAT/decryption rules, address/service objects and groups, URL categories, HIP profiles, GlobalProtect config, Prisma Access remote network/service connection config, zones, tags, logs, and hit counts.
+
+## Mapping Heuristics
+
+- ZIA/SWG policies usually map to [Gateway traffic policies](https://developers.cloudflare.com/cloudflare-one/traffic-policies/) and Gateway lists.
+- ZPA private app access usually maps to [Access application types](https://developers.cloudflare.com/cloudflare-one/access-controls/applications/choose-application-type/), [Cloudflare Tunnel](https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/), private network routing/DNS, and [Access policies](https://developers.cloudflare.com/cloudflare-one/access-controls/policies/).
+- Palo Alto rules map only after understanding traffic direction, zones, objects, users, apps, decryption, and hit counts. Do not flatten zones blindly into lists.
+- Legacy VPN replacement is usually Access + Cloudflare One Client / WARP + Tunnel or Mesh for app access. Use [Cloudflare WAN](https://developers.cloudflare.com/cloudflare-wan/) only when site-to-site traffic is required; use the [Network VPN migration design guide](https://developers.cloudflare.com/reference-architecture/design-guides/network-vpn-migration/) and [Replace your VPN](https://developers.cloudflare.com/cloudflare-one/setup/replace-vpn/) docs for current patterns.
+
+## Migration Assessment Prompts
+
+- Source coverage: which products are in scope, which exports are available, and whether screenshots/prose summaries are hiding missing object files.
+- Rule volume and hit data: counts by rule type, disabled/stale rules, no-hit rules, high-hit rules, and business-critical exceptions.
+- Object dependencies: address objects, service objects, groups, custom categories, network services, app IDs, zones, tags, connectors, and server groups.
+- Identity readiness: IdP, SCIM/group sync, group-name normalization, individual-user rules, local groups, service accounts, and contractor identities.
+- TLS/DLP readiness: source decryption rules, certificate-pinned bypasses, [DLP](https://developers.cloudflare.com/cloudflare-one/data-loss-prevention/) engines/profiles, custom regex, exact-match data, and payload logging expectations.
+- Connectivity readiness: source tunnels/connectors, private DNS, [Split Tunnels](https://developers.cloudflare.com/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/route-traffic/split-tunnels/) or bypass behavior, source IP preservation, [egress IP](https://developers.cloudflare.com/cloudflare-one/traffic-policies/egress-policies/) allowlists, and site-to-site requirements.
+- Rollout readiness: pilot groups/sites, parallel-run period, rollback owner, source-stack decommission criteria, and monitoring/log comparison plan.
+
+## Source-Specific Traps
+
+### Zscaler ZIA / SWG
+
+- Custom URL categories often split into separate IP, domain, and URL lists. Count the generated lists, not just source categories.
+- ZIA locations with IPs are useful as source IP lists; they are not automatically [Gateway DNS locations](https://developers.cloudflare.com/cloudflare-one/networks/resolvers-and-proxies/dns/locations/) for DNS policy scoping.
+- GRE tunnel source IPs can inform policy conditions, but the transport migration is a separate WARP Connector or Cloudflare WAN workstream.
+- CAUTION/warn behavior has no exact Gateway equivalent. Treat it as an explicit customer decision, not a silent allow/block choice.
+- DLP engines and custom regex usually require manual Cloudflare DLP profile recreation. Placeholder policies must not be enabled as if DLP is complete.
+- Network application groups and unsupported protocols are partial mappings. Review them before enablement.
+- If SCIM is unavailable, identity-scoped source rules become overly broad unless you add an enforceable alternative such as user/email lists. Check [Gateway identity selectors](https://developers.cloudflare.com/cloudflare-one/traffic-policies/identity-selectors/) before creating those rules.
+
+### Zscaler ZPA / Private Access
+
+- ZPA app segments, server groups, and connector groups do not map 1:1. Cloudflare separates Access apps, tunnel routes, DNS, and policies.
+- Creating tunnels through the API does not complete connector deployment. Plan cloudflared installation, authentication, and origin reachability separately.
+- Create one Cloudflare Tunnel per ZPA connector group regardless of connector runtime status (AUTHENTICATED, DISCONNECTED, or disabled). Status is operational, not architectural. Tag disconnected or legacy groups in the tunnel description and let the customer decide what to decommission after validation.
+- Each ZPA connector instance within a group maps to one cloudflared replica running against that tunnel's token. Match replica count to connector instance count per group to preserve the same topology. A single tunnel token supports multiple simultaneous cloudflared processes. Recommend installing replicas within the same data center but on different hosts or subnets.
+- For each connector group, identify all server groups linked to it and all app segments assigned to those server groups. IP addresses and CIDRs in those app segments become CIDR routes on the corresponding tunnel; domain names become hostname routes on the same tunnel. Prefer one CIDR route per subnet over per-host /32 routes where a broad subnet covers all app segment IPs.
+- ZPA bypass means split-tunnel bypass in Cloudflare, not an Access `bypass` decision. Bypass rules map to WARP [Split Tunnel](https://developers.cloudflare.com/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/route-traffic/split-tunnels/) exclude entries. This is a manual configuration step with no API automation - the customer must add bypassed domains and IPs to the device profile split tunnel exclude list through the dashboard.
+- Agentless/browser apps may become separate public-hostname Access apps per domain. WARP private apps remain private-destination apps.
+- The default Cloudflare Access application destination limit is 5 hostnames per app. For ZPA migrations with large app segments, contact the Cloudflare account team to request an increase (up to 50) before implementation. Confirm the limit is active on the account before creating apps - without it, large segments must be split into multiple apps with identical policies, significantly increasing object count.
+- IP-anchored apps require an explicit egress decision before migration: preserve source IP through customer egress, use Cloudflare [dedicated egress](https://developers.cloudflare.com/cloudflare-one/traffic-policies/egress-policies/) where available, or accept that the target service must be updated to allow new source IPs. This is a customer decision that blocks implementation if unresolved.
+- Resolver policies can be account-wide. Be careful with overlapping private DNS namespaces across sites or virtual networks; retrieve [resolver policy](https://developers.cloudflare.com/cloudflare-one/traffic-policies/resolver-policies/) docs before making DNS changes.
+- Each ZPA access policy rule maps to a Cloudflare reusable Access policy. Create all reusable policies before attaching them to Access apps. In default-deny Gateway Network environments, additionally create a Network allow rule with selector "Self-hosted Access App with Private Address is Present" (wirefilter: `any(access.private_app[*] in {"*"})`) at higher precedence than any broad L4 block rules - without it, Gateway blocks private app traffic before Access policy evaluation occurs.
+- In combined ZIA and ZPA migrations, Gateway Network rules can accidentally block Access private-app traffic. The Gateway Network allow rule above is the fix - place it at higher precedence (lower number) than ZIA-migrated block rules. Add and validate this rule before enabling broad L4 blocks.
+
+### Palo Alto / Prisma / NGFW
+
+- One Palo Alto rule can produce multiple Cloudflare resources. Preserve rule intent, not rule count.
+- App-ID, URL category, zone, HIP, schedule, and decryption behavior rarely translate exactly. Mark partial mappings rather than forcing false equivalence.
+- Export address/service objects and groups with rules. Missing object exports cause silent-looking drops unless explicitly detected.
+- Broad `any` destination/service rules and very broad CIDRs require manual review. Do not auto-create broad catchalls.
+- HIP/device checks require Cloudflare [device posture](https://developers.cloudflare.com/cloudflare-one/reusable-components/posture-checks/) integrations before enforcement.
+
+## Gotchas
+
+- Source exports often split references across files. Resolve IDs against object, service, and group files before declaring a rule unmappable.
+- Individual users, local groups, departments, and dynamic application IDs often need identity normalization. SCIM/group sync is the gating prerequisite for group selectors.
+- Zscaler caution/warn behavior, Palo Alto App-ID behavior, and TLS/decryption exceptions may not have exact equivalents. Flag them as decision points instead of forcing a 1:1 mapping.
+- Preserve source rule order and hit counts where available. Disable or delete stale/no-hit rules only with user approval.
+- Never create broad allow-all catchalls to preserve connectivity unless explicitly requested and time-limited.
+
+## Validation Gates
+
+- After each migration stage, compare Cloudflare object counts against parsed source counts. Stop on mismatches.
+- Review every `unsupported`, `partial`, `unmapped`, `needs_identity`, `needs_posture`, and `manual_review` item before enabling policies.
+- Validate group matching with real pilot users after SCIM sync and re-authentication.
+- Test TLS inspection and Do Not Inspect behavior before enabling HTTP/DLP blocks broadly.
+- Keep rollback paths explicit: disable migrated rules by prefix, restore source routing, or revert the pilot group/site.
+- Before declaring done, produce a source-rule accounting table: migrated object, partial mapping, not migrated reason, security impact, and owner for each manual action.
+
+## Assessment Template
+
+```markdown
+## Migration Assessment
+
+Source stack:
+Artifacts reviewed:
+Assumptions / missing exports:
+Recommended Cloudflare One target:
+Mapping summary:
+Risks / partial mappings:
+Not migrated:
+Pilot plan:
+Validation:
+Rollback:
+```
diff --git a/.agents/plugins/cloudflare/skills/cloudflare-one/SKILL.md b/.agents/plugins/cloudflare/skills/cloudflare-one/SKILL.md
new file mode 100644
index 0000000..7d841c1
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare-one/SKILL.md
@@ -0,0 +1,178 @@
+---
+name: cloudflare-one
+description: Design, configure, troubleshoot, or review Cloudflare One Zero Trust and SASE deployments. Use cloudflare-one-migrations for migration planning from other vendors.
+---
+
+# Cloudflare One
+
+Before citing limits, settings, API fields, category IDs, or exact UI paths, retrieve current information from the [Cloudflare One docs](https://developers.cloudflare.com/cloudflare-one/), the Cloudflare docs MCP server, or the Cloudflare API schema.
+
+## Workflow
+
+1. Classify the ask: architecture, configuration, troubleshooting, migration, or review.
+2. Gather context: account ID, users/sites/apps, identity provider, SCIM/group sync, device management, traffic path, compliance constraints, and rollout blast radius.
+3. Retrieve only the current docs needed for the products involved: Access, Gateway, WARP/device client, Tunnel/Mesh, Cloudflare WAN, DLP, CASB, device posture, or identity.
+4. If account access is available, inspect existing resources before proposing or making changes: Access apps/policies/groups/IdPs, Gateway rules/lists/categories, device profiles/posture checks, tunnels/routes, DNS/resolver settings, and locations/sites.
+5. Propose the change set with prerequisites, validation, and rollback. For risky changes, stage disabled or scoped to a pilot group/site unless the user explicitly asks otherwise.
+
+## Assessment Prompts
+
+Use these to avoid jumping straight to configuration. Ask only the prompts relevant to the user's task.
+
+### Architecture and Current State
+
+- Sites and users: offices, branches, data centers, VPCs, remote users, contractors, user counts, and current connectivity model.
+- Applications and destinations: SaaS, public apps, private apps, APIs, infrastructure targets, protocols, ports, hostnames, and IP ranges.
+- Connectivity: VPN, MPLS, SD-WAN, direct Internet breakout, centralized backhaul, site-to-site needs, and private DNS architecture.
+- Security stack: current SWG, NGFW, VPN/ZTNA, DLP, CASB, email security, logging, and compliance requirements.
+- Identity: IdP, SCIM/group sync, group naming, multi-IdP needs, service accounts, and contractor/partner access.
+- Rollout: pilot users/sites, blast radius, rollback path, support owners, and success criteria.
+
+### Access and SaaS Federation
+
+- App shape: web app, API, SSH/RDP/VNC, database, SaaS app, public hostname, private IP, or private hostname. Retrieve [Access application type](https://developers.cloudflare.com/cloudflare-one/access-controls/applications/choose-application-type/) docs before choosing.
+- Access model: clientless browser access, private networking with device client, peer to peer connectivity, service connections with service tokens or mutual TLS, or SaaS SSO federation.
+- Policy needs: user groups, device posture, session duration, mTLS, service tokens, and app launcher visibility. Retrieve [Access policy](https://developers.cloudflare.com/cloudflare-one/access-controls/policies/) docs before configuring selectors or evaluation order.
+- SaaS details: SAML vs OIDC support, ACS/redirect URLs, Entity IDs/client IDs, required attributes, and tenant-control requirements.
+
+### Tunnel and Private Networking
+
+- Sites and segments: which data centers, VPCs, offices, or network segments need connectivity.
+- HA: dev/test single connector, production multiple connectors, or advanced multi-tunnel/site redundancy.
+- Runtime: where cloudflared or WARP Connector/Mesh will run: VM, container, Kubernetes, bare metal, or other target.
+- Egress: whether connectors can reach Cloudflare over the required outbound ports/protocols. Retrieve [Tunnel connectivity prechecks](https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/troubleshoot-tunnels/connectivity-prechecks/) before naming exact endpoints.
+- Origin reachability: whether the connector can resolve and reach every private origin.
+- Routing: required CIDRs/hostnames, overlapping IP spaces, [virtual networks](https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/private-net/cloudflared/tunnel-virtual-networks/), [Split Tunnels](https://developers.cloudflare.com/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/route-traffic/split-tunnels/), and private DNS/[resolver policy](https://developers.cloudflare.com/cloudflare-one/traffic-policies/resolver-policies/) needs.
+- Management model: prefer remotely managed/token-based tunnels for new deployments unless there is a clear reason for local config.
+
+### Gateway, TLS, and DLP
+
+- Traffic controls: DNS categories, HTTP URL/path inspection, L4 ports/protocols, egress IP requirements, custom lists, and allow/block exceptions. Retrieve [Gateway traffic policy](https://developers.cloudflare.com/cloudflare-one/traffic-policies/) docs for current selectors and order of enforcement.
+- Identity: whether Gateway policies need user or group selectors, and whether users will be authenticated through WARP/IdP context. Check [Gateway identity selectors](https://developers.cloudflare.com/cloudflare-one/traffic-policies/identity-selectors/) and [SCIM provisioning](https://developers.cloudflare.com/cloudflare-one/team-and-resources/users/scim/) when groups are involved.
+- TLS inspection: root CA deployment path, certificate-pinned applications, compliance exceptions, and FIPS requirements. Retrieve [TLS decryption](https://developers.cloudflare.com/cloudflare-one/traffic-policies/http-policies/tls-decryption/) docs before enabling.
+- DLP: sensitive data types, channels to inspect, TLS inspection readiness, DLP profiles, payload logging requirements, and false-positive tolerance. Retrieve [DLP](https://developers.cloudflare.com/cloudflare-one/data-loss-prevention/) docs before creating enforcement.
+
+### CASB, Device Posture, and Risk
+
+- CASB: SaaS vendors, admin access level, scan policy, org size, remediation owner, and whether inline protection is also required. Retrieve [CASB findings](https://developers.cloudflare.com/cloudflare-one/cloud-and-saas-findings/manage-findings/) docs before recommending remediation.
+- Device posture: required checks, third-party EDR/MDM integrations, enrollment rules, device profiles, and split tunnel alignment.
+- Risk scoring: relevant behavior signals, false-positive sources such as VPNs or service accounts, and whether risk is for investigation or enforcement. Retrieve [user risk score](https://developers.cloudflare.com/cloudflare-one/team-and-resources/users/risk-score/) docs before using risk in policies.
+
+### Cloudflare WAN / Site Connectivity
+
+- Site topology, on-ramp type, route ownership, tunnel redundancy, static vs BGP-managed routes, network firewall needs, and appliance/profile ownership. Retrieve [Cloudflare WAN](https://developers.cloudflare.com/cloudflare-wan/) and [Cloudflare Network Firewall](https://developers.cloudflare.com/cloudflare-network-firewall/) docs before proposing site connectivity changes.
+
+## Guardrails
+
+- Access controls application authorization; Gateway controls traffic inspection/filtering. Use both when the requirement spans identity-aware app access and network/web security.
+- For new Access deployments, create policies through the reusable policy API (`/access/policies`) and attach them to applications. Do not send inline `policies` in an application create/update request unless the current API documentation explicitly requires an app-scoped policy.
+- Treat an app-scoped policy reported as `reusable: false` as legacy. Migrate existing policies with the documented `make_reusable` endpoint or replace them with reusable policies; do not create new legacy policies. Distinguish legacy policies from the deprecated legacy private-network application type.
+- Public hostname Access apps can be clientless. Private destination apps require WARP/Device client or another network on-ramp plus routes and DNS resolution. Retrieve [self-hosted private app](https://developers.cloudflare.com/cloudflare-one/access-controls/applications/non-http/self-hosted-private-app/) docs before configuring private destinations.
+- Cloudflare Tunnel is an off-ramp from a private network to Cloudflare. Cloudflare WAN and Mesh are other off-ramps which can also be on-ramps.
+- Group-based policies depend on IdP group claims or SCIM. If group sync is missing, do not invent group selectors.
+- Private hostnames need explicit DNS routing/resolution; creating an Access app alone is not enough. Use [resolver policies](https://developers.cloudflare.com/cloudflare-one/traffic-policies/resolver-policies/) and review [Connect a private hostname](https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/private-net/cloudflared/connect-private-hostname/)
+- HTTP inspection and DLP for encrypted web traffic require TLS inspection and planned Do Not Inspect exceptions.
+- Gateway DNS, Network, HTTP, and Egress policies have different evaluation semantics. Retrieve [order of enforcement](https://developers.cloudflare.com/cloudflare-one/traffic-policies/order-of-enforcement/) docs before explaining precedence.
+- Start broad block/allow/DLP/TLS policies disabled limited to a pilot with specific target users or groups unless the user approves a wider rollout.
+
+### Identity and Access
+
+- Access Groups are Cloudflare objects; IdP/SCIM groups are identity claims. Gateway group selectors use synced IdP groups, not Access Groups.
+- Group names and SAML/OIDC attributes are case-sensitive. Verify exact claim names and values before creating group-based rules.
+- SCIM changes and group membership can be stale until sync and re-authentication complete. Troubleshoot with the user's last authenticated identity, not just the IdP state.
+- Access policies are default-deny. A private app with routes but no Allow policy still blocks access.
+- Access policy selectors can use IP lists, not Gateway domain or URL lists.
+- SaaS federation handles authentication into the SaaS app. SaaS authorization and tenant restrictions usually require SaaS-side roles and/or Gateway tenant controls.
+- Browser Rendering for SSH/VNC/RDP is an Access capability. Browser Isolation renders general web content remotely. Do not conflate them.
+
+### Device Client Deployment
+
+- The [Cloudflare One device client](https://developers.cloudflare.com/cloudflare-one/team-and-resources/devices/cloudflare-one-client/) is the on-ramp for user devices. Two components control it: **enrollment rules** (who can connect) and **device profiles** (how the client behaves after enrollment).
+- The enrollment rule is an Access application of type `warp`, not a device setting. It accepts reusable Access policies. Look in Access for enrollment debugging, not Devices.
+- For headless or autonomous devices (services, kiosks, Linux hosts), use service token enrollment. Non-human devices authenticate as `non_identity@[team-domain].cloudflareaccess.com` and have no group membership - device profiles targeting IdP groups will not match them. Target headless devices explicitly with the non-identity email, specific conventions about the devices (OS information, etc.),or let them fall to the default profile.
+- Device profiles control connection mode, [split tunnel](https://developers.cloudflare.com/cloudflare-one/team-and-resources/devices/cloudflare-one-client/configure/route-traffic/split-tunnels/) configuration, user permissions (disable, switch lock), auto-reconnect, and captive portal behavior. Profiles are matched by user group or device attributes in precedence order - first match wins, default profile catches the rest.
+- Split tunnel mode is the single most impactful client setting. Choose the mode based on the deployment goal:
+
+ | Goal | Mode | Rationale |
+ | ----------------------------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------- |
+ | VPN replacement only (private apps) | **Include** | Route only specified private CIDRs and hostnames through the client. Everything else goes direct. Minimal blast radius. |
+ | SWG only (internet security) | **Exclude** | All traffic through the client. Exclude only what breaks (local printers, certificate-pinned apps). |
+ | VPN replacement + SWG | **Exclude** | All traffic through the client. Most common enterprise configuration. |
+ | Coexistence with another VPN | **Include** | Avoids conflict with the other VPN's tunnel interface and DNS control. |
+ | DNS filtering only | DNS-only mode | Only DNS queries go to Gateway. No traffic proxying. |
+
+- Include vs exclude is per-profile, not per-entry. You cannot mix modes in the same profile. Switching modes mid-deployment requires re-evaluating every entry.
+- Split tunnel entries must align with tunnel routes bidirectionally. A CIDR in the include list without a matching tunnel route causes a black hole. A tunnel route without a matching device profile entry means traffic never enters the tunnel.
+- MDM parameters (`mdm.xml` / managed preferences) override dashboard-configured profile settings for any setting specified in the file. If dashboard changes appear to have no effect on managed devices, check MDM config. Retrieve [MDM deployment](https://developers.cloudflare.com/cloudflare-one/team-and-resources/devices/cloudflare-one-client/deployment/mdm-deployment/) docs for platform-specific file locations and parameters.
+- If another VPN client or agent controls DNS on the device, the device client's DNS interception will conflict. In coexistence scenarios, use "traffic only" mode to avoid routing table and DNS conflicts.
+- Captive portal detection temporarily disconnects the client when it detects a portal (hotel WiFi, airport). This is a common source of end-user friction and should be managed carefully.
+
+### Private Networking
+
+- Split tunnel mode changes the meaning of every route decision: Exclude mode sends traffic to Cloudflare when removed from excludes; Include mode sends traffic only when added to includes.
+- Virtual networks should be used primarily when IP subnets overlap and hostname-based routing is not used. It can be used to control other user connectivity behavior, but it is recommended to manage through security policies.
+- A healthy tunnel only proves cloudflared can reach Cloudflare. The tunnel must have appropriate published application routes, network routes, or hostname routes for connectivity to function.
+- Cloudflare Tunnel and Cloudflare Mesh can both be used to facilitate connectivity to internal networks. Cloudflare WAN can as well, but it is gated behind Enterprise subscriptions. Retrieve [choose an on-ramp](https://developers.cloudflare.com/learning-paths/secure-internet-traffic/connect-devices-networks/choose-on-ramp/) when deliberating between Tunnel types.
+- Run multiple cloudflared connectors for production HA, preferably on separate hosts. Token-based, remotely managed tunnels are the default for new deployments.
+
+### Gateway, TLS, and DLP
+
+- `dns.domains` matches a domain and subdomains; `dns.fqdn` is exact-match only.
+- DNS pre-resolution selectors and post-resolution selectors do not behave like a single strict precedence list. Retrieve current evaluation docs before changing rule order.
+- HTTP Do Not Inspect rules run before HTTP Allow/Block/Isolate behavior. A later block rule will not override an earlier inspection bypass.
+- Certificate-pinned apps need Do Not Inspect exceptions before broad TLS inspection. Deploy the Cloudflare root CA to managed devices before enabling inspection.
+- DLP profiles are detection definitions only. They do nothing until referenced by Gateway HTTP policies or CASB scan settings. Rules with body inspection may be evaluated multiple times in a single pass.
+- Start DLP with payload logging where appropriate, tune false positives, then block.
+- Gateway Network policies are strict L4 controls. Identity-aware L4 matching requires authenticated device context.
+
+### CASB, Risk, and Operations
+
+- API CASB is out-of-band and periodic. It does not provide real-time inline enforcement although some integrations support "remediation"; use Gateway granular application controls for inline CASB capability for supported applications. Retrieve [Granular application controls](https://developers.cloudflare.com/cloudflare-one/traffic-policies/http-policies/granular-controls/) when creating security policies for specific actions in specific SaaS applications.
+- CASB findings are tied to specific assets and instances. Drill into affected assets before recommending remediation.
+- Use current Dashboard remediation guidance for CASB fixes. Most remediations happen in the SaaS admin console, not Cloudflare.
+- Large SaaS integrations can take 24-48 hours for initial scans. Reauthorizing can restart scan state; check credential health before reconnecting.
+- User risk scores are behavior-based and asynchronous. CASB findings do not automatically imply high user risk.
+
+### Infrastructure Access
+
+- [Zero Trust Infrastructure Access](https://developers.cloudflare.com/cloudflare-one/access-controls/applications/non-http/infrastructure-apps/) (ZTIA) is the purpose-built offering for SSH access through the device client. It provides capabilities not available through self-hosted apps: keystroke logging, control over how users authenticate to the target machine, [short-lived certificates](https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/use-cases/ssh/ssh-infrastructure-access/#generate-a-cloudflare-ssh-ca) that replace static SSH keys with ephemeral certs tied to Access identity, and lightweight privileged access management. Use Infrastructure Access apps for SSH when the device client is deployed.
+- [Browser Rendering](https://developers.cloudflare.com/cloudflare-one/access-controls/applications/non-http/browser-rendering/) provides clientless SSH, RDP, and VNC through the browser without requiring the device client. Clientless RDP includes session recording and file transfer controls. Use clientless access when a device client cannot be installed (contractors, partner access, unmanaged devices) - typically not as the default for managed users with the client installed.
+- [Audit SSH](https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/use-cases/ssh/ssh-infrastructure-access/#enable-ssh-command-logging) is a Gateway Network policy action that logs SSH commands without blocking. It requires the session to be proxied through Cloudflare.
+- Short-lived certificates require CA configuration on the target host and `sshd` configured to trust the Cloudflare CA public key. Retrieve [short-lived certificate setup](https://developers.cloudflare.com/cloudflare-one/identity/users/short-lived-certificates/) docs before configuring.
+- For kubectl and database access behind private networks, use the device client with private destination routing. There is no Infrastructure Access or browser-rendered equivalent for arbitrary TCP protocols today.
+
+### Logs, Analytics, and DEX
+
+- [Gateway activity logs](https://developers.cloudflare.com/cloudflare-one/analytics/logs/gateway-logs/) record DNS, HTTP, and Network policy decisions. Filter by rule name, user identity, destination, action, and time range. These are the primary troubleshooting tool for "why was this blocked/allowed."
+- [Access audit logs](https://developers.cloudflare.com/cloudflare-one/insights/logs/dashboard-logs/access-authentication-logs/) record authentication decisions per app - who authenticated, which policy matched, and session details. Use for verifying policy behavior and investigating access failures.
+- [Shadow IT discovery](https://developers.cloudflare.com/cloudflare-one/insights/analytics/shadow-it-discovery/) uses Gateway HTTP logs to surface unmanaged SaaS applications. Requires TLS inspection for HTTPS visibility.
+- [DEX (Digital Experience Monitoring)](https://developers.cloudflare.com/cloudflare-one/insights/dex/) provides fleet-level and per-device connectivity diagnostics. Use [DEX tests](https://developers.cloudflare.com/cloudflare-one/insights/dex/tests/) (HTTP, traceroute) to proactively monitor reachability to critical origins and internal apps. Fleet status shows device client health, connection mode, and connectivity state across the enrolled population.
+- [Logpush](https://developers.cloudflare.com/cloudflare-one/analytics/logs/logpush/) exports Gateway, Access, Network, and DEX logs to external SIEM or storage. Configure before go-live if the customer requires centralized log retention or compliance reporting.
+- When troubleshooting, work from logs toward config: identify the log entry showing the failure (Gateway block, Access deny, tunnel error, DNS resolution miss), then trace back to the responsible rule, route, or policy.
+
+### Cloudflare WAN / Site Connectivity
+
+- Cloudflare WAN is connectivity, not a security service. Apply inspection and policy with Gateway and Network Firewall where required.
+- WAN firewall expressions are not the same language as Gateway wirefilter expressions. Retrieve the current syntax before editing.
+- Generated IPsec PSKs and some OAuth/client secrets are returned once. Store them immediately.
+
+## Output Defaults
+
+- Designs: current assumptions, target architecture, product responsibilities, rollout phases, validation, and open decisions.
+- Configuration work: prerequisites, exact resources to inspect/create/change, test cases, and rollback.
+- Troubleshooting: traffic path, likely failure point, evidence to collect, and next test.
+
+## Validation Prompts
+
+- Access: test authorized, unauthorized, posture-failing, service-token, and multi-IdP flows when applicable; inspect logs and policy precedence. For new policies, verify they are managed through the reusable policy collection and not returned as `reusable: false` app-scoped policies.
+- Private network access: verify route lookup, tunnel health, origin reachability, split tunnel behavior, DNS resolution, and end-to-end access from a device client test device.
+- Gateway: verify rule type, action, traffic expression, precedence/evaluation phase, referenced lists, and Gateway settings before enabling broadly.
+- TLS/DLP: test Do Not Inspect exceptions and root CA trust before enabling inspection; test DLP with known samples and monitor false positives before blocking.
+- CASB/risk: confirm integration health, credential expiry, asset discovery, scan timing, finding instances, and risk-score signal latency before declaring remediation complete.
+- Cloudflare WAN: verify tunnel health, route priority/ownership, traffic flow, firewall expression syntax, and connector/appliance telemetry where applicable.
+
+## API Safety
+
+- Use fully qualified MCP tool names when MCP tools are available.
+- Never guess category IDs, application IDs, wirefilter fields, or API request bodies. Retrieve the current schema/docs and existing account objects.
+- Do not enable broad production policies without explicit approval.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/SKILL.md b/.agents/plugins/cloudflare/skills/cloudflare/SKILL.md
new file mode 100644
index 0000000..41bb352
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/SKILL.md
@@ -0,0 +1,139 @@
+---
+name: cloudflare
+description: Discover and choose Cloudflare products for apps, APIs, AI agents, storage, networking, and security. Use for architecture and product selection, including when the user describes a need without naming a Cloudflare product; then find the relevant skill or documentation.
+---
+
+# Discover and build with Cloudflare
+
+Help agents discover what they can build with Cloudflare and choose the products that fit. Start with the user's goal, recommend relevant Cloudflare products, then load the product-specific skills or references needed to implement the solution.
+
+## Help the user find the right product
+
+- Actively surface Cloudflare products that solve the stated problem, even when the user has not named them. Explain the role each recommended product plays and why it fits.
+- Use the need-to-product map below to choose products, then load the relevant skills or documentation for implementation. A user asking for uploads, background jobs, or document search may not know to ask for R2, Queues, Workflows, or AI Search.
+- Recommend a small, coherent combination when the task spans products. Add a product when it addresses a concrete requirement; respect the user's existing stack and explicit choices.
+- When similar products could fit, explain the deciding requirement: data shape, consistency, coordination, execution lifecycle, or how much infrastructure the user wants to manage. Check current availability, limits, and pricing before promising a fit.
+
+## What are you trying to build?
+
+**Recommend Workers and [Workers Static Assets](https://developers.cloudflare.com/workers/static-assets/) for new websites and applications, including static sites, SPAs, and full-stack apps.** Workers can do everything Pages can do, and is recommended for all new projects. Preserve existing Pages deployments during unrelated maintenance.
+
+Find the row closest to the user's task. Products can appear in multiple rows, and a solution can combine products. Read the linked reference or docs before implementing; load named skills when installed. Local links open bundled references: start with the README, then follow configuration, API, pattern, or gotcha links as needed. If a named skill is unavailable, use the relevant product docs through the [Cloudflare directory](https://developers.cloudflare.com/directory/); sibling skills are optional.
+
+| What you need to do | Product or tool to consider | When to choose it | Skill or reference |
+| ---------------------------------------------------------------------------------------- | -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Choose the building blocks for an AI application | AI overview | Compare Cloudflare's AI services before choosing inference, retrieval, or agent tooling | [AI docs](https://developers.cloudflare.com/ai/) |
+| Choose infrastructure for a customer-facing platform | Cloudflare for Platforms | Compare running customer code with serving an app on customer domains | [Platform overview](https://developers.cloudflare.com/cloudflare-for-platforms/) |
+| Choose an approach to live audio and video | Realtime | Compare application SDKs, media infrastructure, and connectivity relays | [Realtime overview](https://developers.cloudflare.com/realtime/) |
+| Start a Worker or framework project | C3 | Scaffold a project using the appropriate framework template | [C3](references/c3/README.md); `wrangler` skill |
+| Build or deploy a Next.js app on Cloudflare | vinext + Workers | Use vinext rather than OpenNext for new projects | [nextjs-on-cloudflare skill](../nextjs-on-cloudflare/SKILL.md); [Next.js docs](https://developers.cloudflare.com/workers/framework-guides/web-apps/nextjs/) |
+| Host a new static site, SPA, or full-stack app | Workers + Workers Static Assets | Serve site files and add server-side logic where needed | [Static Assets](references/static-assets/README.md); `workers-best-practices` skill |
+| Build an API or handle webhooks | Workers | Run request handlers with access to Cloudflare services | `workers-best-practices` skill; [Workers docs](https://developers.cloudflare.com/workers/) |
+| Control team, CI, or service-account access to Developer Platform resources | Roles, scopes, and permission policies | Choose the least-privilege role and a scope supported for the member, User Group, or API token | [Roles and permissions](https://developers.cloudflare.com/workers/authorization/); `wrangler` skill for CLI access |
+| Maintain an existing Pages deployment | Pages + Pages Functions | Update an existing site or its server endpoints; use Workers for new projects | [Pages](references/pages/README.md); [Pages Functions](references/pages-functions/README.md) |
+| Move a Pages project to Workers | Workers + Workers Static Assets | The task calls for migrating the hosting platform | [Pages migration guide](https://developers.cloudflare.com/workers/static-assets/migration-guides/migrate-from-pages/) |
+| Let customers deploy code on your platform | Workers for Platforms | Run and manage customer Workers with per-customer controls | [Workers for Platforms](references/workers-for-platforms/README.md) |
+| Let customers use their own domains with your app | Cloudflare for SaaS | Manage custom hostnames, TLS certificates, and origin routing; check hostname validation and apex-domain plan requirements. Combine with Workers for Platforms when customers also deploy code | [SaaS docs](https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/) |
+| Connect a Worker to storage or another service | Bindings | Give the Worker access to configured resources through its environment | [Bindings](references/bindings/README.md) |
+| Run containerized services or Linux software | Containers | The workload needs a container image or software outside the Workers runtime | [Containers](references/containers/README.md) |
+| Execute generated or untrusted code, build Code Mode tools, or create on-demand previews | Dynamic Workers | Load code at runtime in isolated Workers; check bindings, egress controls, and resource limits. Choose Sandbox when execution needs Linux or shell tools | [Dynamic Workers docs](https://developers.cloudflare.com/dynamic-workers/) |
+| Give an agent a shell, filesystem, or interactive development environment | Sandbox SDK | Code execution needs a Linux environment or container tools; inspect the package line first | `sandbox-next` for new or preview projects; `sandbox-stable` for existing stable apps; [Sandbox docs](https://developers.cloudflare.com/sandbox/) |
+| Upgrade a stable Sandbox app to the preview API | Sandbox SDK | The user wants the stable-to-next migration | `sandbox-migrate-to-next` skill; [migration guide](https://developers.cloudflare.com/sandbox/1-0-preview/migrate/) |
+| Coordinate chat rooms, games, collaborative documents, or bookings | Durable Objects | Operations need shared state and coordination per room, document, or entity | `durable-objects` skill; [Durable Objects docs](https://developers.cloudflare.com/durable-objects/) |
+| Store and recover state inside a Durable Object | Durable Object storage | Choose storage APIs, transactions, and recovery for coordinated per-entity data | [DO storage](references/do-storage/README.md) |
+| Store application records and query them with SQL | D1 | Use a managed relational database; use Durable Objects when per-entity coordination is central | [D1](references/d1/README.md) |
+| Connect to an existing PostgreSQL or MySQL database | Hyperdrive | Keep the existing database and optimize connections from Workers | [Hyperdrive](references/hyperdrive/README.md) |
+| Distribute configuration or other key-value data | KV | Read-heavy key-value access fits the workload's consistency requirements | [KV](references/kv/README.md) |
+| Store uploads, downloads, or large objects | R2 | Store files by object key; pair with D1 when searchable metadata needs SQL | [R2](references/r2/README.md) |
+| Store versioned file trees, agent checkpoints, or repositories | Artifacts | Files need versioning and Git-compatible access; currently closed beta, so confirm access before implementation | [Artifacts](references/artifacts/README.md) |
+| Ingest event streams into a data lake | Pipelines | Transform and deliver streaming records into R2 | [Pipelines](references/pipelines/README.md) |
+| Manage Iceberg tables in R2 | R2 Data Catalog | Organize tables for a data lake and compatible query engines | [R2 Data Catalog](references/r2-data-catalog/README.md) |
+| Query a data lake with SQL | R2 SQL | Analyze data in R2 Data Catalog rather than transactional application records | [R2 SQL](references/r2-sql/README.md) |
+| Cache application responses | Workers Cache | Default for application caching; check the patterns and limitations before choosing alternatives | [Workers Cache](https://developers.cloudflare.com/workers/cache/); see caching guidance below |
+| Accelerate an existing website and control cached content | Cache/CDN | Configure caching for a proxied origin using Cache Rules, expiration settings, and purging | [Cache/CDN docs](https://developers.cloudflare.com/cache/) |
+| Keep origin content in a persistent cache | Cache Reserve | Reduce origin fetches with persistent CDN cache storage | [Cache Reserve](references/cache-reserve/README.md) |
+| Process jobs asynchronously or buffer bursts of work | Queues | Decouple producers and consumers; use Workflows for durable multi-step orchestration | [Queues](references/queues/README.md) |
+| Run a job that retries, waits, and resumes across steps | Workflows | Coordinate durable multi-step business processes | [Workflows](references/workflows/README.md) |
+| Start a Worker on a recurring schedule | Cron Triggers | Trigger scheduled work; combine with Queues or Workflows for the work itself | [Cron Triggers](references/cron-triggers/README.md) |
+| Run language, embedding, image, or speech models | Workers AI | Use managed inference; verify model capabilities, schemas, and pricing | [Workers AI](references/workers-ai/README.md) |
+| Add managed search or answers over your content | AI Search | Use a managed retrieval-augmented generation pipeline | [AI Search](references/ai-search/README.md) |
+| Build custom semantic search or retrieval | Vectorize + Workers AI | Control embeddings, indexing, and retrieval rather than using a managed pipeline | [Vectorize](references/vectorize/README.md); [Workers AI](references/workers-ai/README.md) |
+| Observe and control requests to AI providers | AI Gateway | Add inference analytics, caching, and request controls | [AI Gateway](references/ai-gateway/README.md) |
+| Build stateful agents with tools, scheduling, or chat | Agents SDK | Implement agent behavior on Cloudflare; add Dynamic Workers or Sandbox for the required execution runtime | `agents-sdk` skill; [Agents docs](https://developers.cloudflare.com/agents/) |
+| Build durable agents with TypeScript hooks | Flue | Use an open agent framework with Cloudflare and Node.js targets | [Flue](https://flueframework.com/); [getting started](https://flueframework.com/docs/guide/getting-started/); [Cloudflare target](https://flueframework.com/docs/guide/cloudflare-target/) |
+| Expose tools through a remote MCP server | Workers + Agents SDK | Publish tools for MCP clients, with authentication appropriate to the service | `agents-sdk` skill, its `references/mcp.md`; [MCP docs](https://developers.cloudflare.com/agents/model-context-protocol/) |
+| Automate browsers, take screenshots, or extract rendered pages | Browser Run | The task requires a browser rather than a plain HTTP request | [Browser Run](references/browser-rendering/README.md) |
+| Connect a domain, configure DNS records, or troubleshoot resolution | DNS | Manage authoritative records and choose whether traffic is proxied through Cloudflare | [DNS docs](https://developers.cloudflare.com/dns/) |
+| Configure HTTPS and certificates | SSL/TLS | Secure connections from visitors to Cloudflare and from Cloudflare to the origin | [SSL/TLS docs](https://developers.cloudflare.com/ssl/) |
+| Distribute traffic across origins and fail over unhealthy servers | Load Balancing | Use health checks and traffic steering for multiple origin servers | [Load Balancing docs](https://developers.cloudflare.com/load-balancing/) |
+| Connect an existing server to Cloudflare | Cloudflare Tunnel | Reach an origin without a publicly routable IP address | [Tunnel](references/tunnel/README.md) |
+| Connect Workers to private services | Workers VPC | Access services in private networks from a Worker | [Workers VPC](references/workers-vpc/README.md) |
+| Require employee login before accessing an internal app | Access | Put identity-based access policies in front of an internal application | `cloudflare-one` skill; [Access docs](https://developers.cloudflare.com/cloudflare-one/access-controls/) |
+| Protect access to internal applications and networks | Cloudflare One | Apply identity and network access policies | `cloudflare-one` skill; [Cloudflare One docs](https://developers.cloudflare.com/cloudflare-one/) |
+| Migrate existing access and network security configurations | Cloudflare One | The task is a supported migration to Cloudflare One | `cloudflare-one-migrations` skill; [Cloudflare One docs](https://developers.cloudflare.com/cloudflare-one/) |
+| Proxy a TCP or UDP application | Spectrum | Protect and accelerate non-HTTP application traffic | [Spectrum](references/spectrum/README.md) |
+| Connect a network directly to Cloudflare | Network Interconnect | Dedicated network connectivity is required | [Network Interconnect](references/network-interconnect/README.md) |
+| Improve routing across the network | Argo Smart Routing | Optimize traffic paths to the origin | [Argo Smart Routing](references/argo-smart-routing/README.md) |
+| Reduce Worker-to-backend latency | Smart Placement | Place Worker execution closer to the backends it calls | [Smart Placement](references/smart-placement/README.md) |
+| Redirect URLs, rewrite paths or headers, or change origin routing | Rules | Use Redirect, Transform, or Origin Rules when configuration can express the required behavior | [Rules docs](https://developers.cloudflare.com/rules/) |
+| Make small HTTP request or response changes | Snippets | Lightweight edge logic meets the need | [Snippets](references/snippets/README.md) |
+| Protect forms from automated abuse | Turnstile | Add bot challenges and server-side token validation | `turnstile-spin` skill; [Turnstile docs](https://developers.cloudflare.com/turnstile/) |
+| Filter malicious web requests | WAF | Apply application-layer rules and managed protections | [WAF](references/waf/README.md) |
+| Protect services from denial-of-service attacks | DDoS Protection | Mitigate attacks at the relevant network or application layer | [DDoS protection](references/ddos/README.md) |
+| Detect and control automated traffic | Bot Management | Make request decisions based on bot detection | [Bot Management](references/bot-management/README.md) |
+| Discover and protect API endpoints | API Shield | Apply API-specific protections and validation | [API Shield](references/api-shield/README.md) |
+| Queue visitors during traffic spikes | Waiting Room | Control admission when application capacity is limited | [Waiting Room docs](https://developers.cloudflare.com/waiting-room/) |
+| Store a Worker's API keys and credentials | Workers secrets | Bind secrets to a Worker without committing values to source | `wrangler` skill; [secrets docs](https://developers.cloudflare.com/workers/configuration/secrets/) |
+| Share managed secrets across services | Secrets Store | Manage reusable account-level secrets | [Secrets Store](references/secrets-store/README.md) |
+| Control where data is processed and stored | Data Localization Suite | Evaluate regional processing and storage controls against the actual requirements | [Data Localization docs](https://developers.cloudflare.com/data-localization/) |
+| Prove a claim without identifying or tracking the user | Privacy Pass | Use privacy-preserving tokens in a supported integration | [Privacy Pass docs](https://developers.cloudflare.com/privacy-pass/) |
+| Store, resize, transform, and deliver images | Cloudflare Images | Use managed image processing and delivery | [Images](references/images/README.md) |
+| Encode, store, and deliver live or on-demand video | Stream | Use managed video infrastructure | [Stream](references/stream/README.md) |
+| Build an audio/video calling application with SDKs | RealtimeKit | Use application-level SDKs for calls and meetings | [RealtimeKit](references/realtimekit/README.md) |
+| Build custom real-time media infrastructure | Realtime SFU | Control the application while using a selective forwarding unit for media | [Realtime SFU](references/realtime-sfu/README.md) |
+| Relay WebRTC connections through restrictive networks | TURN Service | Clients need a connectivity relay | [TURN](references/turn/README.md) |
+| Deliver live media over QUIC | MoQ | Use the Media over QUIC protocol; check current compatibility and availability | [MoQ docs](https://developers.cloudflare.com/moq/) |
+| Send transactional email | Email Service | Send application-generated messages | `cloudflare-email-service` skill; [Email Service docs](https://developers.cloudflare.com/email-service/) |
+| Forward incoming email | Email Routing | Route addresses on a domain to destination mailboxes | [Email Routing](references/email-routing/README.md) |
+| Process incoming email in code | Email Workers | Apply custom logic to inbound messages | [Email Workers](references/email-workers/README.md) |
+| Manage third-party tags and scripts | Zaraz | Load and manage third-party tools through Cloudflare | [Zaraz](references/zaraz/README.md) |
+| Run locally and manage resources from the CLI | Wrangler | Develop, configure, deploy, and inspect the intended account and environment | `wrangler` skill; [Wrangler docs](https://developers.cloudflare.com/workers/wrangler/) |
+| Test Worker behavior before deployment | Workers testing tools | Choose runtime tests or integration tests for the affected behavior | [Testing docs](https://developers.cloudflare.com/workers/testing/); `durable-objects` skill for DO tests |
+| Embed local Worker simulation in tooling | Miniflare | A programmatic emulator is needed for a custom development or test harness | [Miniflare](references/miniflare/README.md) |
+| Run or investigate the underlying Workers runtime | workerd | Work directly with the runtime outside normal managed deployment | [workerd](references/workerd/README.md) |
+| Try a small Worker in the browser | Workers Playground | Explore or share a minimal example without local setup | [Workers Playground](references/workers-playground/README.md) |
+| Build and deploy whenever code is pushed | Workers Builds | Connect a Git repository to automated builds and deployments | [Builds docs](https://developers.cloudflare.com/workers/ci-cd/builds/) |
+| Test a branch or pull request in an isolated environment | Workers Previews | Create a branch environment under the same Worker with its own settings and URLs; check which bound resources are isolated or shared | [Previews docs](https://developers.cloudflare.com/workers/previews/); `wrangler` skill |
+| Inspect an uploaded version, release it gradually, or roll back code | Workers versions and deployments | Manage application releases that use production resources; rollback does not restore connected resource data | [Deployment docs](https://developers.cloudflare.com/workers/versions-and-deployments/); `wrangler` skill |
+| Release a feature gradually or target user groups | Flagship | Change feature availability with targeting and percentage rollouts | [Flagship](references/flagship/README.md) |
+| Manage infrastructure as code | Terraform or Pulumi | Use Terraform for declarative configuration or Pulumi for infrastructure in programming languages | [Terraform](references/terraform/README.md); [Pulumi](references/pulumi/README.md) |
+| Automate account or product configuration through an API | Cloudflare REST API | Manage resources programmatically; prefer bindings for supported operations inside Workers | [REST API](references/api/README.md) |
+| Debug failures and trace application requests | Workers Logs and Traces | Investigate runtime errors and execution paths | [Observability](references/observability/README.md) |
+| Process Worker execution events in code | Tail Workers | Build custom log or exception processing | [Tail Workers](references/tail-workers/README.md) |
+| Export Worker logs to another system | Workers Logpush | Deliver logs to a supported external destination | [Logpush docs](https://developers.cloudflare.com/workers/observability/logs/logpush/) |
+| Measure custom application events | Workers Analytics Engine | Analyze high-cardinality event data written from Workers | [Analytics Engine](references/analytics-engine/README.md) |
+| Measure website usage and visitor performance | Cloudflare Web Analytics | Add website analytics and real-user measurements | [Web Analytics](references/web-analytics/README.md) |
+| Query metrics across Cloudflare products | GraphQL Analytics API | Retrieve product analytics programmatically | [GraphQL Analytics API](references/graphql-api/README.md) |
+| Audit page speed and find loading bottlenecks | Web performance tools | Measure and improve the site's actual browser performance | `web-perf` skill; [Web Analytics](references/web-analytics/README.md) |
+| Ask questions about an account or diagnose its configuration in the dashboard | Agent Lee | Use the dashboard's AI assistant; check current account eligibility | [Agent Lee docs](https://developers.cloudflare.com/agent-lee/) |
+
+For example, a file-upload app can use Workers for its API, R2 for files, D1 for metadata, and Queues for processing. A document assistant can start with Workers and AI Search; use Vectorize and Workers AI when it needs custom retrieval. Recommend only the pieces the requested behavior needs.
+
+## Find guidance for a task not listed here
+
+Use the [Cloudflare product directory](https://developers.cloudflare.com/directory/) for additional products and their current docs. Follow links to the specific feature or API involved. Use [Choose a data or storage product](https://developers.cloudflare.com/workers/platform/storage-options/) for storage tradeoffs, and the product's limits, pricing, and migration guides when evaluating scale, cost, or an upgrade. This table maps common tasks to selected Cloudflare products; it does not enumerate every possible application.
+
+## Caching
+
+Prefer [Workers Cache](https://developers.cloudflare.com/workers/cache/) for caching, including [advanced patterns](https://developers.cloudflare.com/workers/cache/examples/) using cached inner entrypoints and programmatic invalidation. Choose [Cache API](https://developers.cloudflare.com/workers/runtime-apis/cache/) or KV caching only when a concrete requirement cannot be met by Workers Cache; check its [patterns](https://developers.cloudflare.com/workers/cache/examples/) and [limitations](https://developers.cloudflare.com/workers/cache/limitations/) first.
+
+## Working principles
+
+- Inspect the existing project and its pinned package versions before choosing an API or configuration shape.
+- Retrieve current Cloudflare documentation when details may have changed. Use installed types and `node_modules/wrangler/config-schema.json` when they represent the project's pinned version.
+- Preserve the project's architecture and make the smallest change that satisfies the request.
+- Check current Cloudflare docs before relying on limits, prices, compatibility flags, or security requirements; these can change.
+- Validate in proportion to the change: use the project's checks, then exercise the affected behavior when practical.
+
+Cloudflare documentation:
+Cloudflare changelog:
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/ai-gateway/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/ai-gateway/README.md
new file mode 100644
index 0000000..7205386
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/ai-gateway/README.md
@@ -0,0 +1,27 @@
+# Cloudflare AI Gateway
+
+Use AI Gateway to observe and control requests to AI providers through caching, rate limiting, logging, and routing.
+
+Fetch the linked documentation before choosing endpoints, authentication headers, SDK options, model names, or limits. Keep implementation details in the current docs.
+
+## Choose a task
+
+| Task | Reference |
+| ------------------------------------------------------------------ | --------------------------------------- |
+| Create a gateway or choose authentication and provider credentials | [Configuration](./configuration.md) |
+| Integrate an SDK, direct HTTP, or a Worker binding | [SDK integration](./sdk-integration.md) |
+| Configure caching, rate limits, security, billing, or logging | [Features](./features.md) |
+| Add fallbacks, conditional routing, or traffic splits | [Dynamic routing](./dynamic-routing.md) |
+| Diagnose failed requests, caching, or missing logs | [Troubleshooting](./troubleshooting.md) |
+
+For new single-model calls, start with the [REST API](https://developers.cloudflare.com/ai-gateway/usage/rest-api/) or [Workers bindings](https://developers.cloudflare.com/ai-gateway/usage/worker-binding-methods/), depending on the runtime. Preserve provider-native integrations when their API shape is needed; use the corresponding [provider guide](https://developers.cloudflare.com/ai-gateway/usage/providers/).
+
+The [legacy Unified API](https://developers.cloudflare.com/ai-gateway/usage/chat-completion/) is deprecated for single-model calls but remains required for dynamic routes. Check the task before changing an existing endpoint.
+
+Gateway authentication and upstream provider credentials are separate concerns. Choose the endpoint first, then follow its authentication and billing requirements in [configuration](./configuration.md).
+
+## Related references
+
+- [Workers AI](../workers-ai/README.md) — model inference.
+- [Agents SDK documentation](https://developers.cloudflare.com/agents/) — stateful agents.
+- [Vectorize](../vectorize/README.md) — vector search.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/ai-gateway/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/ai-gateway/configuration.md
new file mode 100644
index 0000000..a97c278
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/ai-gateway/configuration.md
@@ -0,0 +1,18 @@
+# AI Gateway Configuration
+
+Choose the request path before configuring authentication: Cloudflare REST inference, a Workers binding, and provider-native gateway endpoints have different requirements. Gateway access does not by itself define which upstream credentials or billing source a request uses.
+
+| Task | Current documentation |
+| --------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Send a first request and locate the account/gateway identifiers | [Getting started](https://developers.cloudflare.com/ai-gateway/get-started/) |
+| Create, update, or delete a gateway; use the default gateway | [Manage gateways](https://developers.cloudflare.com/ai-gateway/configuration/manage-gateway/) |
+| Manage gateways programmatically | [Gateway management API](https://developers.cloudflare.com/api/resources/ai_gateway/methods/list/) |
+| Protect gateway access and choose token permissions for the endpoint | [Authenticated Gateway](https://developers.cloudflare.com/ai-gateway/configuration/authentication/) and [REST API authentication](https://developers.cloudflare.com/ai-gateway/usage/rest-api/#authentication) |
+| Configure Wrangler and an AI binding | [Workers AI binding setup](https://developers.cloudflare.com/ai-gateway/integrations/aig-workers-ai-binding/) and [binding methods](https://developers.cloudflare.com/ai-gateway/usage/worker-binding-methods/) |
+| Store provider keys, select aliases, or diagnose missing credentials | [Bring Your Own Keys](https://developers.cloudflare.com/ai-gateway/configuration/bring-your-own-keys/) |
+| Use Cloudflare billing or determine which credentials take precedence | [Unified Billing](https://developers.cloudflare.com/ai-gateway/features/unified-billing/) |
+| Supply provider credentials with each request | [Provider guides](https://developers.cloudflare.com/ai-gateway/usage/providers/) |
+
+Keep credentials out of source code. Use the chosen endpoint's documentation for headers and permissions instead of reusing an authentication recipe from another endpoint. Check credential precedence before changing an existing BYOK or billing setup.
+
+For SDK selection, see [SDK integration](./sdk-integration.md); for policy settings, see [features](./features.md).
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/ai-gateway/dynamic-routing.md b/.agents/plugins/cloudflare/skills/cloudflare/references/ai-gateway/dynamic-routing.md
new file mode 100644
index 0000000..2eb8df4
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/ai-gateway/dynamic-routing.md
@@ -0,0 +1,15 @@
+# AI Gateway Dynamic Routing
+
+Use a dynamic route when model selection, traffic splitting, quotas, or fallbacks should be controlled in the gateway. For a simple retry or fallback sequence, check the request-handling and fallback guides before introducing a routing flow.
+
+| Task | Current documentation |
+| ------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Design conditional routes, A/B splits, quotas, model fallbacks, and version rollbacks | [Dynamic routing](https://developers.cloudflare.com/ai-gateway/features/dynamic-routing/) |
+| Invoke a route from an SDK, HTTP request, or Worker; inspect route response metadata | [Using a dynamic route](https://developers.cloudflare.com/ai-gateway/features/dynamic-routing/usage/) |
+| Define route elements and connections programmatically | [JSON configuration](https://developers.cloudflare.com/ai-gateway/features/dynamic-routing/json-configuration/) |
+| Provide metadata used by routing conditions | [Custom metadata](https://developers.cloudflare.com/ai-gateway/observability/custom-metadata/) |
+| Configure model/provider fallbacks | [Fallbacks](https://developers.cloudflare.com/ai-gateway/configuration/fallbacks/) |
+| Configure retries, backoff, and timeouts | [Request handling](https://developers.cloudflare.com/ai-gateway/configuration/request-handling/) |
+| Inspect request outcomes, costs, and errors | [Analytics](https://developers.cloudflare.com/ai-gateway/observability/analytics/) and [logging](https://developers.cloudflare.com/ai-gateway/observability/logging/) |
+
+Check the usage guide's authentication and stored-key prerequisites. Dynamic routes still use the [Unified API compatibility endpoint](https://developers.cloudflare.com/ai-gateway/usage/chat-completion/); its single-model deprecation does not make the REST inference endpoint a replacement for route invocation.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/ai-gateway/features.md b/.agents/plugins/cloudflare/skills/cloudflare/references/ai-gateway/features.md
new file mode 100644
index 0000000..ad8470d
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/ai-gateway/features.md
@@ -0,0 +1,22 @@
+# AI Gateway Features
+
+Fetch the relevant guide before setting feature flags, headers, limits, or billing behavior.
+
+| Task | Current documentation |
+| ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Enable caching, set TTLs, bypass the cache, or choose a custom cache key | [Caching](https://developers.cloudflare.com/ai-gateway/features/caching/) |
+| Control request volume with fixed or sliding limits | [Rate limiting](https://developers.cloudflare.com/ai-gateway/features/rate-limiting/) |
+| Enforce cost budgets | [Spend limits](https://developers.cloudflare.com/ai-gateway/features/spend-limits/) |
+| Evaluate and enforce content policies | [Guardrails setup](https://developers.cloudflare.com/ai-gateway/features/guardrails/set-up-guardrail/) and [usage considerations](https://developers.cloudflare.com/ai-gateway/features/guardrails/usage-considerations/) |
+| Detect sensitive data in prompts and responses | [DLP setup](https://developers.cloudflare.com/ai-gateway/features/dlp/set-up-dlp/) |
+| Choose provider keys or Cloudflare billing | [BYOK](https://developers.cloudflare.com/ai-gateway/configuration/bring-your-own-keys/) and [Unified Billing](https://developers.cloudflare.com/ai-gateway/features/unified-billing/) |
+| Configure provider data retention for Unified Billing | [Zero Data Retention](https://developers.cloudflare.com/ai-gateway/features/unified-billing/#zero-data-retention-zdr) |
+| Configure log collection, payload storage, and retention | [Logging](https://developers.cloudflare.com/ai-gateway/observability/logging/) |
+| Export logs | [Workers Logpush](https://developers.cloudflare.com/ai-gateway/observability/logging/logpush/) |
+| Attach request metadata for tracking and routing | [Custom metadata](https://developers.cloudflare.com/ai-gateway/observability/custom-metadata/) |
+| Override model costs | [Custom costs](https://developers.cloudflare.com/ai-gateway/configuration/custom-costs/) |
+| Check supported providers, quotas, or pricing | [Provider guides](https://developers.cloudflare.com/ai-gateway/usage/providers/), [limits](https://developers.cloudflare.com/ai-gateway/reference/limits/), and [pricing](https://developers.cloudflare.com/ai-gateway/reference/pricing/) |
+
+Choose cache keys only for requests whose responses may safely be shared. Decide what prompt and response data may be stored before enabling logging; do not infer a provider's retention policy from gateway log settings.
+
+For conditional policies and fallbacks, see [dynamic routing](./dynamic-routing.md).
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/ai-gateway/sdk-integration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/ai-gateway/sdk-integration.md
new file mode 100644
index 0000000..c3b8da8
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/ai-gateway/sdk-integration.md
@@ -0,0 +1,19 @@
+# AI Gateway SDK Integration
+
+Choose an integration that matches the application's runtime and required API shape. Fetch its guide before installing packages or writing requests; model identifiers, SDK options, and gateway headers belong in the docs.
+
+| Integration task | Current documentation |
+| ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
+| New single-model HTTP calls or OpenAI-compatible clients | [REST API](https://developers.cloudflare.com/ai-gateway/usage/rest-api/) |
+| Vercel AI SDK, provider adapters, and fallback providers | [Vercel AI SDK integration](https://developers.cloudflare.com/ai-gateway/integrations/vercel-ai-sdk/) |
+| Preserve OpenAI-native endpoints with the OpenAI SDK, Python, or HTTP | [OpenAI provider guide](https://developers.cloudflare.com/ai-gateway/usage/providers/openai/) |
+| Preserve Anthropic-native requests | [Anthropic provider guide](https://developers.cloudflare.com/ai-gateway/usage/providers/anthropic/) |
+| Use another provider or a framework's configurable provider endpoint | [Provider guides](https://developers.cloudflare.com/ai-gateway/usage/providers/) — match the framework's expected API shape to the provider endpoint |
+| Configure Workers AI and an AI binding | [Binding setup](https://developers.cloudflare.com/ai-gateway/integrations/aig-workers-ai-binding/) |
+| Call Workers AI or third-party models from a Worker; use gateway methods | [Workers binding methods](https://developers.cloudflare.com/ai-gateway/usage/worker-binding-methods/) |
+| Set request metadata, caching, or other gateway headers | [Header glossary](https://developers.cloudflare.com/ai-gateway/glossary/) |
+| Invoke a dynamic route | [Dynamic route usage](https://developers.cloudflare.com/ai-gateway/features/dynamic-routing/usage/) |
+
+The [legacy Unified API](https://developers.cloudflare.com/ai-gateway/usage/chat-completion/) is deprecated for single-model calls, but dynamic routes still require its compatibility endpoint. Do not migrate a dynamic route to the REST inference endpoint as though it were a single-model call.
+
+Confirm [gateway authentication and provider credentials](./configuration.md) separately, including the selected path's BYOK and billing behavior.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/ai-gateway/troubleshooting.md b/.agents/plugins/cloudflare/skills/cloudflare/references/ai-gateway/troubleshooting.md
new file mode 100644
index 0000000..f96616c
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/ai-gateway/troubleshooting.md
@@ -0,0 +1,16 @@
+# AI Gateway Troubleshooting
+
+Identify the request path and whether the failure comes from gateway access, upstream provider authentication, or request policy before changing credentials or retry behavior. A status code alone does not establish the failing layer.
+
+| Symptom or task | Current documentation |
+| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Authentication or provider errors, timeouts, DLP failures, or unexpected cache behavior | [Troubleshooting](https://developers.cloudflare.com/ai-gateway/reference/troubleshooting/) |
+| Gateway authentication failure | [Authenticated Gateway](https://developers.cloudflare.com/ai-gateway/configuration/authentication/) and [REST API authentication](https://developers.cloudflare.com/ai-gateway/usage/rest-api/#authentication) |
+| Provider key or billing mismatch | [BYOK](https://developers.cloudflare.com/ai-gateway/configuration/bring-your-own-keys/), [Unified Billing](https://developers.cloudflare.com/ai-gateway/features/unified-billing/), and the [provider guide](https://developers.cloudflare.com/ai-gateway/usage/providers/) |
+| Rate limits or repeated failures | [Rate limiting](https://developers.cloudflare.com/ai-gateway/features/rate-limiting/) and [request handling](https://developers.cloudflare.com/ai-gateway/configuration/request-handling/) |
+| Unexpected cache hit or miss, including streaming behavior | [Caching](https://developers.cloudflare.com/ai-gateway/features/caching/) |
+| Missing logs, collection overrides, or storage limits | [Logging](https://developers.cloudflare.com/ai-gateway/observability/logging/) and [limits](https://developers.cloudflare.com/ai-gateway/reference/limits/) |
+| Inspect headers, request metadata, usage, or export logs | [Header glossary](https://developers.cloudflare.com/ai-gateway/glossary/), [custom metadata](https://developers.cloudflare.com/ai-gateway/observability/custom-metadata/), [analytics](https://developers.cloudflare.com/ai-gateway/observability/analytics/), and [Logpush](https://developers.cloudflare.com/ai-gateway/observability/logging/logpush/) |
+| Dynamic route failure | [Dynamic route usage](https://developers.cloudflare.com/ai-gateway/features/dynamic-routing/usage/) |
+
+Check the existing SDK and gateway retry settings together before adding another retry loop. Follow [SDK integration](./sdk-integration.md) when an endpoint or model format is suspect.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/ai-search/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/ai-search/README.md
new file mode 100644
index 0000000..c0d7019
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/ai-search/README.md
@@ -0,0 +1,25 @@
+# Cloudflare AI Search
+
+Use AI Search for managed content indexing and retrieval, with optional answer generation. Start with [How AI Search works](https://developers.cloudflare.com/ai-search/concepts/how-ai-search-works/).
+
+## Choose the right product
+
+- **Managed search or RAG over your content:** AI Search.
+- **Custom embeddings and vector-index management:** [Vectorize](../vectorize/README.md).
+- **Model inference without a managed retrieval pipeline:** [Workers AI](../workers-ai/README.md).
+
+For freshness requirements, read [Syncing](https://developers.cloudflare.com/ai-search/configuration/indexing/syncing/) for your data source before choosing an architecture. Use the current [limits and pricing](https://developers.cloudflare.com/ai-search/platform/limits-pricing/) instead of assuming a fixed indexing interval or account limit.
+
+## Find the right documentation
+
+Read the linked page before implementing; these references route to the maintained documentation instead of copying API examples or configuration.
+
+| Task | Start here |
+| ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
+| Build a new Worker integration | [Workers binding quick start](https://developers.cloudflare.com/ai-search/get-started/workers/) |
+| Choose an API or maintain an existing integration | [API routes](api.md) |
+| Connect data, configure indexing, or manage environments | [Configuration routes](configuration.md) |
+| Choose retrieval, generation, or tenant isolation patterns | [Pattern routes](patterns.md) |
+| Diagnose indexing, authentication, filters, or limits | [Troubleshooting routes](gotchas.md) |
+
+Existing `env.AI.autorag()` integrations can continue to work. Use the [migration guide](https://developers.cloudflare.com/ai-search/api/migration/workers-binding/) when upgrading; migration is not required just to maintain an existing integration.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/ai-search/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/ai-search/api.md
new file mode 100644
index 0000000..87e97a7
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/ai-search/api.md
@@ -0,0 +1,13 @@
+# AI Search API Routes
+
+Choose documentation that matches the integration you are working on. Fetch the reference before writing binding configuration, request types, response parsing, or streaming code.
+
+| Task | Documentation |
+| ------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
+| New Worker integration: bindings, search, chat completions, and streaming | [Search Workers binding](https://developers.cloudflare.com/ai-search/api/search/workers-binding/) |
+| Create, list, configure, and inspect instances | [Instances Workers binding](https://developers.cloudflare.com/ai-search/api/instances/workers-binding/) |
+| Query over HTTP and configure request authentication | [Search REST API](https://developers.cloudflare.com/ai-search/api/search/rest-api/) |
+| Maintain an existing `env.AI.autorag()` integration | [Legacy Workers binding](https://developers.cloudflare.com/ai-search/api/migration/workers-binding-legacy/) |
+| Upgrade a legacy binding, including responses, streaming, and filters | [Workers binding migration](https://developers.cloudflare.com/ai-search/api/migration/workers-binding/) |
+
+The legacy binding remains supported; use current bindings for new integrations. Keep legacy request and response handling together until deliberately migrating them.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/ai-search/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/ai-search/configuration.md
new file mode 100644
index 0000000..cc65529
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/ai-search/configuration.md
@@ -0,0 +1,16 @@
+# AI Search Configuration Routes
+
+| Task | Documentation |
+| ------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------- |
+| Set up a Worker and local development | [Workers binding quick start](https://developers.cloudflare.com/ai-search/get-started/workers/) |
+| Select built-in uploads, R2, or a website; check supported formats | [Data sources](https://developers.cloudflare.com/ai-search/configuration/data-source/) |
+| Connect existing R2 content | [R2 data source](https://developers.cloudflare.com/ai-search/configuration/data-source/r2/) |
+| Configure crawling and diagnose bot-protection requirements | [Website data source](https://developers.cloudflare.com/ai-search/configuration/data-source/website/) |
+| Include or exclude files and URL paths | [Path filtering](https://developers.cloudflare.com/ai-search/configuration/indexing/path-filtering/) |
+| Configure source syncs, trigger indexing, or pause and resume | [Syncing](https://developers.cloudflare.com/ai-search/configuration/indexing/syncing/) |
+| Grant AI Search access to R2 for indexing | [Service API token](https://developers.cloudflare.com/ai-search/configuration/indexing/service-api-token/) |
+| Organize instances by application, tenant, or environment | [Namespaces](https://developers.cloudflare.com/ai-search/concepts/namespaces/) |
+| Configure models | [Models](https://developers.cloudflare.com/ai-search/configuration/models/) |
+| Inspect instance configuration and indexing progress | [Instances Workers binding](https://developers.cloudflare.com/ai-search/api/instances/workers-binding/) |
+
+Indexing credentials and request authentication serve different purposes. For authenticating search requests over HTTP, use the [Search REST API](https://developers.cloudflare.com/ai-search/api/search/rest-api/) documentation.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/ai-search/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/ai-search/gotchas.md
new file mode 100644
index 0000000..2473539
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/ai-search/gotchas.md
@@ -0,0 +1,13 @@
+# AI Search Troubleshooting Routes
+
+| Symptom or question | Documentation |
+| ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| API request fails, including authentication or missing instances | [API error codes](https://developers.cloudflare.com/ai-search/troubleshooting/api-error-codes/) |
+| Upload or sync succeeds but content fails during processing | [Indexing error codes](https://developers.cloudflare.com/ai-search/troubleshooting/indexing-error-codes/) |
+| Content is missing or stale | [Syncing](https://developers.cloudflare.com/ai-search/configuration/indexing/syncing/) and [supported data sources and formats](https://developers.cloudflare.com/ai-search/configuration/data-source/) |
+| Filters return unexpected documents or no matches | [Filtering](https://developers.cloudflare.com/ai-search/configuration/retrieval/filtering/) and [metadata attributes](https://developers.cloudflare.com/ai-search/configuration/indexing/metadata/) |
+| Thresholds exclude results or responses need tuning | [Result controls](https://developers.cloudflare.com/ai-search/configuration/retrieval/result-controls/) |
+| Binding types, response parsing, or streaming fail after an upgrade | [Workers binding migration](https://developers.cloudflare.com/ai-search/api/migration/workers-binding/) |
+| Capacity, file-size, or billing questions | [Limits and pricing](https://developers.cloudflare.com/ai-search/platform/limits-pricing/) |
+
+For legacy binding behavior, start with [API routes](api.md). Do not apply current filter syntax or response shapes to legacy calls without following the migration guide.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/ai-search/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/ai-search/patterns.md
new file mode 100644
index 0000000..a27f4c3
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/ai-search/patterns.md
@@ -0,0 +1,15 @@
+# AI Search Pattern Routes
+
+Choose retrieval-only search when your application displays chunks or handles generation itself; choose chat completions when AI Search should also generate the answer. Read [Search Workers binding](https://developers.cloudflare.com/ai-search/api/search/workers-binding/) for both paths and streaming behavior.
+
+| Task | Documentation |
+| ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------- |
+| Isolate tenants using separate instances or a shared filtered instance | [Multitenancy](https://developers.cloudflare.com/ai-search/how-to/per-tenant-search/) |
+| Define built-in or custom metadata | [Metadata attributes](https://developers.cloudflare.com/ai-search/configuration/indexing/metadata/) |
+| Filter by metadata, combine conditions, or match a folder and subfolders | [Filtering](https://developers.cloudflare.com/ai-search/configuration/retrieval/filtering/) |
+| Tune result count and relevance thresholds | [Result controls](https://developers.cloudflare.com/ai-search/configuration/retrieval/result-controls/) |
+| Resolve follow-up queries using conversation context | [Query rewriting](https://developers.cloudflare.com/ai-search/configuration/retrieval/query-rewriting/) |
+| Improve result ordering with a second model | [Reranking](https://developers.cloudflare.com/ai-search/configuration/retrieval/reranking/) |
+| Customize generation and query-rewriting instructions | [System prompt](https://developers.cloudflare.com/ai-search/configuration/retrieval/system-prompt/) |
+
+For tenant isolation, read the full multitenancy guide before choosing an approach. A lower-bound folder comparison alone does not establish a tenant boundary; use the documented filtering semantics.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/analytics-engine/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/analytics-engine/README.md
new file mode 100644
index 0000000..acc5375
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/analytics-engine/README.md
@@ -0,0 +1,96 @@
+# Cloudflare Workers Analytics Engine Reference
+
+Expert guidance for implementing unlimited-cardinality analytics at scale using Cloudflare Workers Analytics Engine.
+
+## What is Analytics Engine?
+
+Time-series analytics database designed for high-cardinality data (millions of unique dimensions). Write data points from Workers, query via SQL API. Use for:
+
+- Custom user-facing analytics dashboards
+- Usage-based billing & metering
+- Per-customer/per-feature monitoring
+- High-frequency instrumentation without performance impact
+
+**Key Capability:** Track metrics with unlimited unique values (e.g., millions of user IDs, API keys) without performance degradation.
+
+## Core Concepts
+
+| Concept | Description | Example |
+| -------------- | ------------------------------------ | --------------------------------- |
+| **Dataset** | Logical table for related metrics | `api_requests`, `user_events` |
+| **Data Point** | Single measurement with timestamp | One API request's metrics |
+| **Blobs** | String dimensions (max 20) | endpoint, method, status, user_id |
+| **Doubles** | Numeric values (max 20) | latency_ms, request_count, bytes |
+| **Indexes** | Filtered blobs for efficient queries | customer_id, api_key |
+
+## Reading Order
+
+| Task | Start Here | Then Read |
+| -------------------- | ------------------------------------------------------------------------------------ | --------- |
+| **First-time setup** | [configuration.md](configuration.md) → [api.md](api.md) → [patterns.md](patterns.md) | |
+| **Writing data** | [api.md](api.md) → [gotchas.md](gotchas.md) (sampling) | |
+| **Querying data** | [api.md](api.md) (SQL API) → [patterns.md](patterns.md) (examples) | |
+| **Debugging** | [gotchas.md](gotchas.md) → [api.md](api.md) (limits) | |
+| **Optimization** | [patterns.md](patterns.md) (anti-patterns) → [gotchas.md](gotchas.md) | |
+
+## When to Use Analytics Engine
+
+```
+Need to track metrics? → Yes
+ ↓
+Millions of unique dimension values? → Yes
+ ↓
+ Need real-time queries? → Yes
+ ↓
+ Use Analytics Engine ✓
+
+Alternative scenarios:
+- Low cardinality (<10k unique values) → Workers Analytics (free tier)
+- Complex joins/relations → D1 Database
+- Logs/debugging → Tail Workers (logpush)
+- External tools → Send to external analytics (Datadog, etc.)
+```
+
+## Quick Start
+
+1. Add binding to `wrangler.jsonc`:
+
+```jsonc
+{
+ "analytics_engine_datasets": [{ "binding": "ANALYTICS", "dataset": "my_events" }]
+}
+```
+
+2. Write data points (fire-and-forget, no await):
+
+```typescript
+env.ANALYTICS.writeDataPoint({
+ blobs: ['/api/users', 'GET', '200'],
+ doubles: [145.2, 1], // latency_ms, count
+ indexes: [customerId]
+});
+```
+
+3. Query via SQL API (HTTP):
+
+```sql
+SELECT blob1, SUM(double2) AS total_requests
+FROM my_events
+WHERE index1 = 'customer_123'
+ AND timestamp >= NOW() - INTERVAL '7' DAY
+GROUP BY blob1
+ORDER BY total_requests DESC
+```
+
+## In This Reference
+
+- **[configuration.md](configuration.md)** - Setup, bindings, TypeScript types, limits
+- **[api.md](api.md)** - `writeDataPoint()`, SQL API, query syntax
+- **[patterns.md](patterns.md)** - Use cases, examples, anti-patterns
+- **[gotchas.md](gotchas.md)** - Sampling, index selection, troubleshooting
+
+## See Also
+
+- [Cloudflare Analytics Engine Docs](https://developers.cloudflare.com/analytics/analytics-engine/)
+- [GraphQL Analytics API Reference](../graphql-api/) - Query built-in Cloudflare analytics (HTTP, Workers, DNS, Firewall, etc.)
+- [Observability Reference](../observability/) - Workers Logs, Traces, and real-time debugging
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/analytics-engine/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/analytics-engine/api.md
new file mode 100644
index 0000000..a3da10b
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/analytics-engine/api.md
@@ -0,0 +1,112 @@
+# Analytics Engine API Reference
+
+## Writing Data
+
+### `writeDataPoint()`
+
+Fire-and-forget (returns `void`, not Promise). Writes happen asynchronously.
+
+```typescript
+interface AnalyticsEngineDataPoint {
+ blobs?: string[]; // Up to 20 strings (dimensions), 16KB each
+ doubles?: number[]; // Up to 20 numbers (metrics)
+ indexes?: string[]; // 1 indexed string for high-cardinality filtering
+}
+
+env.ANALYTICS.writeDataPoint({
+ blobs: ['/api/users', 'GET', '200'],
+ doubles: [145.2, 1], // latency_ms, count
+ indexes: ['customer_abc123']
+});
+```
+
+**Behaviors:** No await needed, no error thrown (check tail logs), auto-sampled at high volumes, auto-timestamped.
+
+**Blob vs Index:** Blob for GROUP BY (<100k unique), Index for filter-only (millions unique).
+
+### Full Example
+
+```typescript
+export default {
+ async fetch(request: Request, env: Env): Promise {
+ const start = Date.now();
+ const url = new URL(request.url);
+ try {
+ const response = await handleRequest(request);
+ env.ANALYTICS.writeDataPoint({
+ blobs: [url.pathname, request.method, response.status.toString()],
+ doubles: [Date.now() - start, 1],
+ indexes: [request.headers.get('x-api-key') || 'anonymous']
+ });
+ return response;
+ } catch (error) {
+ env.ANALYTICS.writeDataPoint({
+ blobs: [url.pathname, request.method, '500'],
+ doubles: [Date.now() - start, 1, 0]
+ });
+ throw error;
+ }
+ }
+};
+```
+
+## SQL API (External Only)
+
+```bash
+curl -X POST https://api.cloudflare.com/client/v4/accounts/{account_id}/analytics_engine/sql \
+ -H "Authorization: Bearer $TOKEN" \
+ -d "SELECT blob1 AS endpoint, COUNT(*) AS requests FROM dataset WHERE timestamp >= NOW() - INTERVAL '1' HOUR GROUP BY blob1"
+```
+
+### Column References
+
+```sql
+-- blob1..blob20, double1..double20, index1, timestamp
+SELECT blob1 AS endpoint, SUM(double1) AS latency, COUNT(*) AS requests
+FROM my_dataset
+WHERE index1 = 'customer_123' AND timestamp >= NOW() - INTERVAL '7' DAY
+GROUP BY blob1
+HAVING COUNT(*) > 100
+ORDER BY requests DESC LIMIT 100
+```
+
+**Aggregations:** `SUM()`, `AVG()`, `COUNT()`, `MIN()`, `MAX()`, `quantile(0.95)()`
+
+**Time ranges:** `NOW() - INTERVAL '1' HOUR`, `BETWEEN '2026-01-01' AND '2026-01-31'`
+
+### Query Examples
+
+```sql
+-- Top endpoints
+SELECT blob1, COUNT(*) AS requests, AVG(double1) AS avg_latency
+FROM api_requests WHERE timestamp >= NOW() - INTERVAL '24' HOUR
+GROUP BY blob1 ORDER BY requests DESC LIMIT 20
+
+-- Error rate
+SELECT blob1, COUNT(*) AS total,
+ SUM(if(blob3 LIKE '5%', 1, 0)) AS errors
+FROM api_requests WHERE timestamp >= NOW() - INTERVAL '1' HOUR
+GROUP BY blob1 HAVING total > 50
+
+-- P95 latency
+SELECT blob1, quantile(0.95)(double1) AS p95
+FROM api_requests GROUP BY blob1
+```
+
+## Response Format
+
+```json
+{ "data": [{ "endpoint": "/api/users", "requests": 1523 }], "rows": 2 }
+```
+
+## Limits
+
+| Resource | Limit |
+| ----------------------- | ------- |
+| Blobs/Doubles per point | 20 each |
+| Indexes per point | 1 |
+| Blob/Index size | 16KB |
+| Data retention | 90 days |
+| Query timeout | 30s |
+
+**Critical:** High write volumes (>1M/min) trigger automatic sampling.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/analytics-engine/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/analytics-engine/configuration.md
new file mode 100644
index 0000000..46052bf
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/analytics-engine/configuration.md
@@ -0,0 +1,107 @@
+# Analytics Engine Configuration
+
+## Setup
+
+1. Add binding to `wrangler.jsonc`
+2. Deploy Worker
+3. Dataset created automatically on first write
+4. Query via SQL API
+
+## wrangler.jsonc
+
+```jsonc
+{
+ "name": "my-worker",
+ "analytics_engine_datasets": [{ "binding": "ANALYTICS", "dataset": "my_events" }]
+}
+```
+
+Multiple datasets for separate concerns:
+
+```jsonc
+{
+ "analytics_engine_datasets": [
+ { "binding": "API_ANALYTICS", "dataset": "api_requests" },
+ { "binding": "USER_EVENTS", "dataset": "user_activity" }
+ ]
+}
+```
+
+## TypeScript
+
+```typescript
+interface Env {
+ ANALYTICS: AnalyticsEngineDataset;
+}
+
+export default {
+ async fetch(request: Request, env: Env) {
+ // No await - returns void, fire-and-forget
+ env.ANALYTICS.writeDataPoint({
+ blobs: [pathname, method, status], // String dimensions (max 20)
+ doubles: [latency, 1], // Numeric metrics (max 20)
+ indexes: [apiKey] // High-cardinality filter (max 1)
+ });
+ return response;
+ }
+};
+```
+
+## Data Point Limits
+
+| Field | Limit | SQL Access |
+| ------- | --------------------- | ---------------------- |
+| blobs | 20 strings, 16KB each | `blob1`...`blob20` |
+| doubles | 20 numbers | `double1`...`double20` |
+| indexes | 1 string, 16KB | `index1` |
+
+## Write Behavior
+
+| Scenario | Behavior |
+| -------------- | -------------------------------- |
+| <1M writes/min | All accepted |
+| >1M writes/min | Automatic sampling |
+| Invalid data | Silent failure (check tail logs) |
+
+**Mitigate sampling:** Pre-aggregate, use multiple datasets, write only critical metrics.
+
+## Query Limits
+
+| Resource | Limit |
+| -------------- | ----------------- |
+| Query timeout | 30 seconds |
+| Data retention | 90 days (default) |
+| Result size | ~10MB |
+
+## Cost
+
+**Free tier:** 10M writes/month, 1M reads/month
+
+**Paid:** $0.05 per 1M writes, $1.00 per 1M reads
+
+## Environment-Specific
+
+```jsonc
+{
+ "analytics_engine_datasets": [{ "binding": "ANALYTICS", "dataset": "prod_events" }],
+ "env": {
+ "staging": {
+ "analytics_engine_datasets": [{ "binding": "ANALYTICS", "dataset": "staging_events" }]
+ }
+ }
+}
+```
+
+## Monitoring
+
+```bash
+npx wrangler tail # Check for sampling/write errors
+```
+
+```sql
+-- Check write activity
+SELECT DATE_TRUNC('hour', timestamp) AS hour, COUNT(*) AS writes
+FROM my_dataset
+WHERE timestamp >= NOW() - INTERVAL '24' HOUR
+GROUP BY hour
+```
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/analytics-engine/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/analytics-engine/gotchas.md
new file mode 100644
index 0000000..5776126
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/analytics-engine/gotchas.md
@@ -0,0 +1,87 @@
+# Analytics Engine Gotchas
+
+## Critical Issues
+
+### Sampling at High Volumes
+
+**Problem:** Queries return fewer points than written at >1M writes/min.
+
+**Solution:**
+
+```typescript
+// Pre-aggregate before writing
+let buffer = { count: 0, total: 0 };
+buffer.count++;
+buffer.total += value;
+
+// Write once per second instead of per request
+if (Date.now() % 1000 === 0) {
+ env.ANALYTICS.writeDataPoint({ doubles: [buffer.count, buffer.total] });
+}
+```
+
+**Detection:** `npx wrangler tail` → look for "sampling enabled"
+
+### writeDataPoint Returns void
+
+```typescript
+// ❌ Pointless await
+await env.ANALYTICS.writeDataPoint({...});
+
+// ✅ Fire-and-forget
+env.ANALYTICS.writeDataPoint({...});
+```
+
+Writes can fail silently. Check tail logs.
+
+### Index vs Blob
+
+| Cardinality | Use | Example |
+| ----------- | --------- | ------------------------------ |
+| Millions | **Index** | user_id, api_key |
+| Hundreds | **Blob** | endpoint, status_code, country |
+
+```typescript
+// ✅ Correct
+{ blobs: [method, path, status], indexes: [userId] }
+```
+
+### Can't Query from Workers
+
+Query API requires HTTP auth. Use external service or cache in KV/D1.
+
+### No Custom Timestamps
+
+Auto-generated at write time. Store original in blob if needed.
+
+## Common Errors
+
+| Error | Fix |
+| ----------------- | ---------------------------------------------- |
+| Binding not found | Check wrangler.jsonc, redeploy |
+| No data in query | Wait 30s; check dataset name; check time range |
+| Query timeout | Add time filter; use index for filtering |
+
+## Limits
+
+| Resource | Limit |
+| ------------------------ | ------- |
+| Blobs per point | 20 |
+| Doubles per point | 20 |
+| Indexes per point | 1 |
+| Blob/Index size | 16KB |
+| Write rate (no sampling) | ~1M/min |
+| Retention | 90 days |
+| Query timeout | 30s |
+
+## Best Practices
+
+✅ Pre-aggregate at high volumes
+✅ Use index for high-cardinality (millions)
+✅ Always include time filter in queries
+✅ Design schema before coding
+
+❌ Don't await writeDataPoint
+❌ Don't use index for low-cardinality
+❌ Don't query without time range
+❌ Don't assume all writes succeed
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/analytics-engine/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/analytics-engine/patterns.md
new file mode 100644
index 0000000..535e584
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/analytics-engine/patterns.md
@@ -0,0 +1,83 @@
+# Analytics Engine Patterns
+
+## Use Cases
+
+| Use Case | Key Metrics | Index On |
+| -------------- | ------------------------------ | ----------- |
+| API Metering | requests, bytes, compute_units | api_key |
+| Feature Usage | feature, action, duration | user_id |
+| Error Tracking | error_type, endpoint, count | customer_id |
+| Performance | latency_ms, cache_status | endpoint |
+| A/B Testing | variant, conversions | user_id |
+
+## API Metering (Billing)
+
+```typescript
+env.ANALYTICS.writeDataPoint({
+ blobs: [pathname, method, status, tier],
+ doubles: [1, computeUnits, bytes, latencyMs],
+ indexes: [apiKey]
+});
+
+// Query: Monthly usage by customer
+// SELECT index1 AS api_key, SUM(double2) AS compute_units
+// FROM usage WHERE timestamp >= DATE_TRUNC('month', NOW()) GROUP BY index1
+```
+
+## Error Tracking
+
+```typescript
+env.ANALYTICS.writeDataPoint({
+ blobs: [endpoint, method, errorName, errorMessage.slice(0, 1000)],
+ doubles: [1, timeToErrorMs],
+ indexes: [customerId]
+});
+```
+
+## Performance Monitoring
+
+```typescript
+env.ANALYTICS.writeDataPoint({
+ blobs: [pathname, method, cacheStatus, status],
+ doubles: [latencyMs, 1],
+ indexes: [userId]
+});
+
+// Query: P95 latency by endpoint
+// SELECT blob1, quantile(0.95)(double1) AS p95_ms FROM perf GROUP BY blob1
+```
+
+## Anti-Patterns
+
+| ❌ Wrong | ✅ Correct |
+| ------------------------------------- | -------------------------------------- |
+| `await writeDataPoint()` | `writeDataPoint()` (fire-and-forget) |
+| `indexes: [method]` (low cardinality) | `blobs: [method]`, `indexes: [userId]` |
+| `blobs: [JSON.stringify(obj)]` | Store ID in blob, full object in D1/KV |
+| Write every request at 10M/min | Pre-aggregate per second |
+| Query from Worker | Query from external service/API |
+
+## Best Practices
+
+1. **Design schema upfront** - Document blob/double/index assignments
+2. **Always include count metric** - `doubles: [latency, 1]` for AVG calculations
+3. **Use enums for blobs** - Consistent values like `Status.SUCCESS`
+4. **Handle sampling** - Use ratios (avg_latency = SUM(latency)/SUM(count))
+5. **Test queries early** - Validate schema before heavy writes
+
+## Schema Template
+
+```typescript
+/**
+ * Dataset: my_metrics
+ *
+ * Blobs:
+ * blob1: endpoint, blob2: method, blob3: status
+ *
+ * Doubles:
+ * double1: latency_ms, double2: count (always 1)
+ *
+ * Indexes:
+ * index1: customer_id (high cardinality)
+ */
+```
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/api-shield/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/api-shield/README.md
new file mode 100644
index 0000000..941260a
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/api-shield/README.md
@@ -0,0 +1,44 @@
+# Cloudflare API Shield Reference
+
+Expert guidance for API Shield - comprehensive API security suite for discovery, protection, and monitoring.
+
+## Reading Order
+
+| Task | Files to Read |
+| ------------------------ | ------------------------------ |
+| Initial setup | README → configuration.md |
+| Implement JWT validation | configuration.md → api.md |
+| Add schema validation | configuration.md → patterns.md |
+| Detect API attacks | patterns.md → api.md |
+| Debug issues | gotchas.md |
+
+## Feature Selection
+
+What protection do you need?
+
+```
+├─ Validate request/response structure → Schema Validation 2.0 (configuration.md)
+├─ Verify auth tokens → JWT Validation (configuration.md)
+├─ Client certificates → mTLS (configuration.md)
+├─ Detect BOLA attacks → BOLA Detection (patterns.md)
+├─ Track auth coverage → Auth Posture (patterns.md)
+├─ Stop volumetric abuse → Abuse Detection (patterns.md)
+└─ Discover shadow APIs → API Discovery (api.md)
+```
+
+## In This Reference
+
+- **[configuration.md](configuration.md)** - Setup, session identifiers, rules, token/mTLS configs
+- **[api.md](api.md)** - Endpoint management, discovery, validation APIs, GraphQL operations
+- **[patterns.md](patterns.md)** - Common patterns, progressive rollout, OWASP mappings, workflows
+- **[gotchas.md](gotchas.md)** - Troubleshooting, false positives, performance, best practices
+
+## Quick Start
+
+API Shield: Enterprise-grade API security (Discovery, Schema Validation 2.0, JWT, mTLS, BOLA Detection, Auth Posture). Available as Enterprise add-on with preview access.
+
+## See Also
+
+- [API Shield Docs](https://developers.cloudflare.com/api-shield/)
+- [API Reference](https://developers.cloudflare.com/api/resources/api_gateway/)
+- [OWASP API Security Top 10](https://owasp.org/www-project-api-security/)
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/api-shield/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/api-shield/api.md
new file mode 100644
index 0000000..3ee5e84
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/api-shield/api.md
@@ -0,0 +1,153 @@
+# API Reference
+
+Base: `/zones/{zone_id}/api_gateway`
+
+## Endpoints
+
+```bash
+GET /operations # List
+GET /operations/{op_id} # Get single
+POST /operations/item # Create: {endpoint,host,method}
+POST /operations # Bulk: {operations:[{endpoint,host,method}]}
+DELETE /operations/{op_id} # Delete
+DELETE /operations # Bulk delete: {operation_ids:[...]}
+```
+
+## Discovery
+
+```bash
+GET /discovery/operations # List discovered
+PATCH /discovery/operations/{op_id} # Update: {state:"saved"|"ignored"}
+PATCH /discovery/operations # Bulk: {operation_ids:{id:{state}}}
+GET /discovery # OpenAPI export
+```
+
+## Config
+
+```bash
+GET /configuration # Get session ID config
+PUT /configuration # Update: {auth_id_characteristics:[{name,type:"header"|"cookie"}]}
+```
+
+## Token Validation
+
+```bash
+GET /token_validation # List
+POST /token_validation # Create: {name,location:{header:"..."},jwks:"..."}
+POST /jwt_validation_rules # Rule: {name,hostname,token_validation_id,action:"block"}
+```
+
+## Workers Integration
+
+### Access JWT Claims
+
+```js
+export default {
+ async fetch(req, env) {
+ // Access validated JWT payload
+ const jwt = req.cf?.jwt?.payload?.[env.JWT_CONFIG_ID]?.[0];
+ if (jwt) {
+ const userId = jwt.sub;
+ const role = jwt.role;
+ }
+ }
+};
+```
+
+### Access mTLS Info
+
+```js
+export default {
+ async fetch(req, env) {
+ const tls = req.cf?.tlsClientAuth;
+ if (tls?.certVerified === 'SUCCESS') {
+ const fingerprint = tls.certFingerprintSHA256;
+ // Authenticated client
+ }
+ }
+};
+```
+
+### Dynamic JWKS Update
+
+```js
+export default {
+ async scheduled(event, env) {
+ const jwks = await (await fetch('https://auth.example.com/.well-known/jwks.json')).json();
+ await fetch(
+ `https://api.cloudflare.com/client/v4/zones/${env.ZONE_ID}/api_gateway/token_validation/${env.CONFIG_ID}`,
+ {
+ method: 'PATCH',
+ headers: {
+ Authorization: `Bearer ${env.CF_API_TOKEN}`,
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify({ jwks: JSON.stringify(jwks) })
+ }
+ );
+ }
+};
+```
+
+## Firewall Fields
+
+### Core Fields
+
+```js
+cf.api_gateway.auth_id_present; // Session ID present
+cf.api_gateway.request_violates_schema; // Schema violation
+cf.api_gateway.fallthrough_triggered; // No endpoint match
+cf.tls_client_auth.cert_verified; // mTLS cert valid
+cf.tls_client_auth.cert_fingerprint_sha256;
+```
+
+### JWT Validation (2026)
+
+```js
+// Modern validation syntax
+is_jwt_valid(http.request.jwt.payload['{config_id}'][0]);
+
+// Legacy (still supported)
+cf.api_gateway.jwt_claims_valid;
+
+// Extract claims
+lookup_json_string(http.request.jwt.payload['{config_id}'][0], 'claim_name');
+```
+
+### Risk Labels (2026)
+
+```js
+// BOLA detection
+cf.api_gateway.cf - risk - bola - enumeration; // Sequential resource access detected
+cf.api_gateway.cf - risk - bola - pollution; // Parameter pollution detected
+
+// Authentication posture
+cf.api_gateway.cf - risk - missing - auth; // Endpoint lacks authentication
+cf.api_gateway.cf - risk - mixed - auth; // Inconsistent auth patterns
+```
+
+## BOLA Detection
+
+```bash
+GET /user_schemas/{schema_id}/bola # Get BOLA config
+PATCH /user_schemas/{schema_id}/bola # Update: {enabled:true}
+```
+
+## Auth Posture
+
+```bash
+GET /discovery/authentication_posture # List unprotected endpoints
+```
+
+## GraphQL Protection
+
+```bash
+GET /settings/graphql_protection # Get limits
+PUT /settings/graphql_protection # Set: {max_depth,max_size}
+```
+
+## See Also
+
+- [configuration.md](configuration.md) - Setup guides for all features
+- [patterns.md](patterns.md) - Firewall rules and common patterns
+- [API Gateway API Docs](https://developers.cloudflare.com/api/resources/api_gateway/)
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/api-shield/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/api-shield/configuration.md
new file mode 100644
index 0000000..677556e
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/api-shield/configuration.md
@@ -0,0 +1,210 @@
+# Configuration
+
+## Schema Validation 2.0 Setup
+
+> ⚠️ **Classic Schema Validation deprecated.** Use Schema Validation 2.0.
+
+**Upload schema (Dashboard):**
+
+```
+Security > API Shield > Schema Validation > Add validation
+- Upload .yml/.yaml/.json (OpenAPI v3.0)
+- Endpoints auto-added to Endpoint Management
+- Action: Log | Block | None
+- Body inspection: JSON payloads
+```
+
+**Change validation action:**
+
+```
+Security > API Shield > Settings > Schema Validation
+Per-endpoint: Filter → ellipses → Change action
+Default action: Set global mitigation action
+```
+
+**Migration from Classic:**
+
+```
+1. Export existing schema (if available)
+2. Delete all Classic schema validation rules
+3. Wait 5 min for cache clear
+4. Re-upload via Schema Validation 2.0 interface
+5. Verify in Security > Events
+```
+
+**Fallthrough rule** (catch-all unknown endpoints):
+
+```
+Security > API Shield > Settings > Fallthrough > Use Template
+- Select hostnames
+- Create rule with cf.api_gateway.fallthrough_triggered
+- Action: Log (discover) or Block (strict)
+```
+
+**Body inspection:** Supports `application/json`, `*/*`, `application/*`. Disable origin MIME sniffing to prevent bypasses.
+
+## JWT Validation
+
+**Setup token config:**
+
+```
+Security > API Shield > Settings > JWT Settings > Add configuration
+- Name: "Auth0 JWT Config"
+- Location: Header/Cookie + name (e.g., "Authorization")
+- JWKS: Paste public keys from IdP
+```
+
+**Create validation rule:**
+
+```
+Security > API Shield > API Rules > Add rule
+- Hostname: api.example.com
+- Deselect endpoints to ignore
+- Token config: Select config
+- Enforce presence: Ignore or Mark as non-compliant
+- Action: Log/Block/Challenge
+```
+
+**Rate limit by JWT claim:**
+
+```wirefilter
+lookup_json_string(http.request.jwt.claims["{config_id}"][0], "sub")
+```
+
+**Special cases:**
+
+- Two JWTs, different IdPs: Create 2 configs, select both, "Validate all"
+- IdP migration: 2 configs + 2 rules, adjust actions per state
+- Bearer prefix: API Shield handles with/without
+- Nested claims: Dot notation `user.email`
+
+## Mutual TLS (mTLS)
+
+**Setup:**
+
+```
+SSL/TLS > Client Certificates > Create Certificate
+- Generate CF-managed CA (all plans)
+- Upload custom CA (Enterprise, max 5)
+```
+
+**Configure mTLS rule:**
+
+```
+Security > API Shield > mTLS
+- Select hostname(s)
+- Choose certificate(s)
+- Action: Block/Log/Challenge
+```
+
+**Test:**
+
+```bash
+openssl req -x509 -newkey rsa:4096 -keyout client-key.pem -out client-cert.pem -days 365
+curl https://api.example.com/endpoint --cert client-cert.pem --key client-key.pem
+```
+
+## Session Identifiers
+
+Critical for BOLA Detection, Sequence Mitigation, and analytics. Configure header/cookie that uniquely IDs API users.
+
+**Examples:** JWT sub claim, session token, API key, custom user ID header
+
+**Configure:**
+
+```
+Security > API Shield > Settings > Session Identifiers
+- Type: Header/Cookie
+- Name: "X-User-ID" or "Authorization"
+```
+
+## BOLA Detection
+
+Detects Broken Object Level Authorization attacks (enumeration + parameter pollution).
+
+**Enable:**
+
+```
+Security > API Shield > Schema Validation > [Select Schema] > BOLA Detection
+- Enable detection
+- Threshold: Sensitivity level (Low/Medium/High)
+- Action: Log or Block
+```
+
+**Requirements:**
+
+- Schema Validation 2.0 enabled
+- Session identifiers configured
+- Minimum traffic: 1000+ requests/day per endpoint
+
+## Authentication Posture
+
+Identifies unprotected or inconsistently protected endpoints.
+
+**View report:**
+
+```
+Security > API Shield > Authentication Posture
+- Shows endpoints lacking JWT/mTLS
+- Highlights mixed authentication patterns
+```
+
+**Remediate:**
+
+1. Review flagged endpoints
+2. Add JWT validation rules
+3. Configure mTLS for sensitive endpoints
+4. Monitor posture score
+
+## Volumetric Abuse + GraphQL
+
+**Volumetric Abuse Detection:**
+`Security > API Shield > Settings > Volumetric Abuse Detection`
+
+- Enable per-endpoint monitoring, set thresholds, action: Log | Challenge | Block
+
+**GraphQL Protection:**
+`Security > API Shield > Settings > GraphQL Protection`
+
+- Max query depth: 10, max size: 100KB, block introspection (production)
+
+## Terraform
+
+```hcl
+# Session identifier
+resource "cloudflare_api_shield" "main" {
+ zone_id = var.zone_id
+ auth_id_characteristics {
+ type = "header"
+ name = "Authorization"
+ }
+}
+
+# Add endpoint
+resource "cloudflare_api_shield_operation" "users_get" {
+ zone_id = var.zone_id
+ method = "GET"
+ host = "api.example.com"
+ endpoint = "/api/users/{id}"
+}
+
+# JWT validation rule
+resource "cloudflare_ruleset" "jwt_validation" {
+ zone_id = var.zone_id
+ name = "API JWT Validation"
+ kind = "zone"
+ phase = "http_request_firewall_custom"
+
+ rules {
+ action = "block"
+ expression = "(http.host eq \"api.example.com\" and not is_jwt_valid(http.request.jwt.payload[\"{config_id}\"][0]))"
+ description = "Block invalid JWTs"
+ }
+}
+```
+
+## See Also
+
+- [api.md](api.md) - API endpoints and Workers integration
+- [patterns.md](patterns.md) - Firewall rules and deployment patterns
+- [gotchas.md](gotchas.md) - Troubleshooting and limits
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/api-shield/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/api-shield/gotchas.md
new file mode 100644
index 0000000..11e1e03
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/api-shield/gotchas.md
@@ -0,0 +1,132 @@
+# Gotchas & Troubleshooting
+
+## Common Errors
+
+### "Schema Validation 2.0 not working after migration"
+
+**Cause:** Classic rules still active, conflicting with new system
+**Solution:**
+
+1. Delete ALL Classic schema validation rules
+2. Clear Cloudflare cache (wait 5 min)
+3. Re-upload schema via new Schema Validation 2.0 interface
+4. Verify in Security > Events
+5. Check action is set (Log/Block)
+
+### "Schema validation blocking valid requests"
+
+**Cause:** Schema too restrictive, missing fields, or incorrect types
+**Solution:**
+
+1. Check Firewall Events for violation details
+2. Review schema in Settings
+3. Test schema in Swagger Editor
+4. Use Log mode to validate before blocking
+5. Update schema with correct specifications
+6. Ensure Schema Validation 2.0 (not Classic)
+
+### "JWT validation failing"
+
+**Cause:** JWKS mismatch with IdP, expired token, wrong header/cookie name, or clock skew
+**Solution:**
+
+1. Verify JWKS matches IdP configuration
+2. Check token `exp` claim is valid
+3. Confirm header/cookie name matches config
+4. Test token at jwt.io
+5. Account for clock skew (±5 min tolerance)
+6. Use modern syntax: `is_jwt_valid(http.request.jwt.payload["{config_id}"][0])`
+
+### "BOLA detection false positives"
+
+**Cause:** Legitimate sequential access patterns, bulk operations, or sensitivity too high
+**Solution:**
+
+1. Review BOLA events in Security > Events
+2. Lower sensitivity threshold (High → Medium → Low)
+3. Exclude legitimate bulk operations from detection
+4. Ensure session identifiers uniquely identify users
+5. Verify minimum traffic requirements met (1000+ req/day)
+
+### "Risk labels not appearing in firewall rules"
+
+**Cause:** Feature not enabled, insufficient traffic, or missing session identifiers
+**Solution:**
+
+1. Verify Schema Validation 2.0 enabled
+2. Enable BOLA Detection in schema settings
+3. Configure session identifiers (required for BOLA)
+4. Wait 24-48h for ML model training
+5. Check minimum traffic thresholds met
+
+### "Endpoint discovery not finding APIs"
+
+**Cause:** Insufficient traffic (<500 reqs/10d), non-2xx responses, Worker direct requests, or incorrect session ID config
+**Solution:** Ensure 500+ requests in 10 days, 2xx responses from edge (not Workers direct), configure session IDs correctly. ML updates daily.
+
+### "Sequence detection false positives"
+
+**Cause:** Lookback window issues, non-unique session IDs, or model sensitivity
+**Solution:**
+
+1. Review lookback settings (10 reqs to managed endpoints, 10min window)
+2. Ensure session ID uniqueness per user (not shared tokens)
+3. Adjust positive/negative model balance
+4. Exclude legitimate workflows from detection
+
+### "GraphQL protection blocking valid queries"
+
+**Cause:** Query depth/size limits too restrictive, complex but legitimate queries
+**Solution:**
+
+1. Review blocked query patterns in Security > Events
+2. Increase max_depth (default: 10) if needed
+3. Increase max_size (default: 100KB) for complex queries
+4. Whitelist specific query signatures
+5. Use Log mode to tune before blocking
+
+### "Token invalid"
+
+**Cause:** Configuration error, JWKS mismatch, or expired token
+**Solution:** Verify config matches IdP, update JWKS, check token expiration
+
+### "Schema violation"
+
+**Cause:** Missing required fields, wrong data types, or spec mismatch
+**Solution:** Review schema against actual requests, ensure all required fields present, validate types match spec
+
+### "Fallthrough"
+
+**Cause:** Unknown endpoint or pattern mismatch
+**Solution:** Update schema with all endpoints, check path pattern matching
+
+### "mTLS failed"
+
+**Cause:** Certificate untrusted/expired or wrong CA
+**Solution:** Verify cert chain, check expiration, confirm correct CA uploaded
+
+## Limits (2026)
+
+| Resource/Limit | Value | Notes |
+| ------------------------- | ----------------------- | ---------------------------------- |
+| OpenAPI version | v3.0.x only | No external refs, must be valid |
+| Schema operations | 10K (Enterprise) | Contact for higher limits |
+| JWT validation sources | Headers/cookies only | No query params/body |
+| Endpoint discovery | 500+ reqs/10d | Minimum for ML model |
+| Path normalization | Automatic | `/profile/238` → `/profile/{var1}` |
+| Schema parameters | No `content` field | No object param validation |
+| BOLA detection | 1000+ reqs/day/endpoint | Per-endpoint minimum |
+| Session ID uniqueness | Required | BOLA/Sequence need unique IDs |
+| GraphQL max depth | 1-50 | Default: 10 |
+| GraphQL max size | 1KB-1MB | Default: 100KB |
+| JWT claim nesting | 10 levels max | Use dot notation |
+| mTLS CA certificates | 5 custom max | CF-managed unlimited |
+| Schema upload size | 5MB max | Compressed OpenAPI spec |
+| Volumetric abuse baseline | 7 days training | Initial ML period |
+| Auth Posture refresh | Daily | Updated nightly |
+
+## See Also
+
+- [configuration.md](configuration.md) - Setup guides to avoid common issues
+- [patterns.md](patterns.md) - Best practices and progressive rollout
+- [API Shield Docs](https://developers.cloudflare.com/api-shield/)
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/api-shield/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/api-shield/patterns.md
new file mode 100644
index 0000000..cc65053
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/api-shield/patterns.md
@@ -0,0 +1,185 @@
+# Patterns & Use Cases
+
+## Protect API with Schema + JWT
+
+```bash
+# 1. Upload OpenAPI schema
+POST /zones/{zone_id}/api_gateway/user_schemas
+
+# 2. Configure JWT validation
+POST /zones/{zone_id}/api_gateway/token_validation
+{
+ "name": "Auth0",
+ "location": {"header": "Authorization"},
+ "jwks": "{...}"
+}
+
+# 3. Create JWT rule
+POST /zones/{zone_id}/api_gateway/jwt_validation_rules
+
+# 4. Set schema validation action
+PUT /zones/{zone_id}/api_gateway/settings/schema_validation
+{"validation_default_mitigation_action": "block"}
+```
+
+## Progressive Rollout
+
+```
+1. Log mode: Observe false positives
+ - Schema: Action = Log
+ - JWT: Action = Log
+
+2. Block subset: Protect critical endpoints
+ - Change specific endpoint actions to Block
+ - Monitor firewall events
+
+3. Full enforcement: Block all violations
+ - Change default action to Block
+ - Handle fallthrough with custom rule
+```
+
+## BOLA Detection
+
+### Enumeration Detection
+
+Detects sequential resource access (e.g., `/users/1`, `/users/2`, `/users/3`).
+
+```javascript
+// Block BOLA enumeration attempts
+(cf.api_gateway.cf-risk-bola-enumeration and http.host eq "api.example.com")
+// Action: Block or Challenge
+```
+
+### Parameter Pollution
+
+Detects duplicate/excessive parameters in requests.
+
+```javascript
+// Block parameter pollution
+(cf.api_gateway.cf-risk-bola-pollution and http.host eq "api.example.com")
+// Action: Block
+```
+
+### Combined BOLA Protection
+
+```javascript
+// Comprehensive BOLA rule
+(cf.api_gateway.cf-risk-bola-enumeration or cf.api_gateway.cf-risk-bola-pollution)
+and http.host eq "api.example.com"
+// Action: Block
+```
+
+## Authentication Posture
+
+### Detect Missing Auth
+
+```javascript
+// Log endpoints lacking authentication
+(cf.api_gateway.cf-risk-missing-auth and http.host eq "api.example.com")
+// Action: Log (for audit)
+```
+
+### Detect Mixed Auth
+
+```javascript
+// Alert on inconsistent auth patterns
+(cf.api_gateway.cf-risk-mixed-auth and http.host eq "api.example.com")
+// Action: Log (review required)
+```
+
+## Fallthrough Detection (Shadow APIs)
+
+```javascript
+// WAF Custom Rule
+(cf.api_gateway.fallthrough_triggered and http.host eq "api.example.com")
+// Action: Log (discover unknown) or Block (strict)
+```
+
+## Rate Limiting by User
+
+```javascript
+// Rate Limiting Rule (modern syntax)
+(http.host eq "api.example.com" and
+ is_jwt_valid(http.request.jwt.payload["{config_id}"][0]))
+
+// Rate: 100 req/60s
+// Counting expression: lookup_json_string(http.request.jwt.payload["{config_id}"][0], "sub")
+```
+
+## Volumetric Abuse Response
+
+```javascript
+// Detect abnormal traffic spikes
+(cf.api_gateway.volumetric_abuse_detected and http.host eq "api.example.com")
+// Action: Challenge or Rate Limit
+
+// Combined with rate limiting
+(cf.api_gateway.volumetric_abuse_detected or
+ cf.threat_score gt 50) and http.host eq "api.example.com"
+// Action: JS Challenge
+```
+
+## GraphQL Protection
+
+```javascript
+// Block oversized queries
+(http.request.uri.path eq "/graphql" and
+ cf.api_gateway.graphql_query_size gt 100000)
+// Action: Block
+
+// Block deep nested queries
+(http.request.uri.path eq "/graphql" and
+ cf.api_gateway.graphql_query_depth gt 10)
+// Action: Block
+```
+
+## Architecture Patterns
+
+**Public API:** Discovery + Schema Validation 2.0 + JWT + Rate Limiting + Bot Management
+**Partner API:** mTLS + Schema Validation + Sequence Mitigation
+**Internal API:** Discovery + Schema Learning + Auth Posture
+
+## OWASP API Security Top 10 Mapping (2026)
+
+| OWASP Issue | API Shield Solutions |
+| ------------------------------------------- | --------------------------------------------------------------------------------------------- |
+| API1:2023 Broken Object Level Authorization | **BOLA Detection** (enumeration + pollution), Sequence mitigation, Schema, JWT, Rate Limiting |
+| API2:2023 Broken Authentication | **Auth Posture**, mTLS, JWT validation, Bot Management |
+| API3:2023 Broken Object Property Auth | Schema validation, JWT validation |
+| API4:2023 Unrestricted Resource Access | Rate Limiting, **Volumetric Abuse Detection**, **GraphQL Protection**, Bot Management |
+| API5:2023 Broken Function Level Auth | Schema validation, JWT validation, Auth Posture |
+| API6:2023 Unrestricted Business Flows | Sequence mitigation, Bot Management |
+| API7:2023 SSRF | Schema validation, WAF managed rules |
+| API8:2023 Security Misconfiguration | **Schema Validation 2.0**, Auth Posture, WAF rules |
+| API9:2023 Improper Inventory Management | **API Discovery**, Schema learning, Auth Posture |
+| API10:2023 Unsafe API Consumption | JWT validation, Schema validation, WAF managed |
+
+## Monitoring
+
+**Security Events:** `Security > Events` → Filter: Action = block, Service = API Shield
+**Firewall Analytics:** `Analytics > Security` → Filter by `cf.api_gateway.*` fields
+**Logpush fields:** APIGatewayAuthIDPresent, APIGatewayRequestViolatesSchema, APIGatewayFallthroughDetected, JWTValidationResult
+
+## Availability (2026)
+
+| Feature | Availability | Notes |
+| -------------------------- | ----------------- | -------------------- |
+| mTLS (CF-managed CA) | All plans | Self-service |
+| Endpoint Management | All plans | Limited operations |
+| Schema Validation 2.0 | All plans | Limited operations |
+| API Discovery | Enterprise | 10K+ ops |
+| JWT Validation | Enterprise add-on | Full validation |
+| BOLA Detection | Enterprise add-on | Requires session IDs |
+| Auth Posture | Enterprise add-on | Security audit |
+| Volumetric Abuse Detection | Enterprise add-on | Traffic analysis |
+| GraphQL Protection | Enterprise add-on | Query limits |
+| Sequence Mitigation | Enterprise (beta) | Contact team |
+| Full Suite | Enterprise add-on | All features |
+
+**Enterprise limits:** 10K operations (contact for higher). Preview access available for non-contract evaluation.
+
+## See Also
+
+- [configuration.md](configuration.md) - Setup all features before creating rules
+- [api.md](api.md) - Firewall field reference and API endpoints
+- [gotchas.md](gotchas.md) - Common issues and limits
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/api/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/api/README.md
new file mode 100644
index 0000000..7d384b6
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/api/README.md
@@ -0,0 +1,66 @@
+# Cloudflare API Integration
+
+Guide for working with Cloudflare's REST API - authentication, SDK usage, common patterns, and troubleshooting.
+
+## Quick Decision Tree
+
+```
+How are you calling the Cloudflare API?
+├─ From Workers runtime → Use bindings, not REST API (see ../bindings/)
+├─ Server-side (Node/Python/Go) → Official SDK (see api.md)
+├─ CLI/scripts → Wrangler or curl (see configuration.md)
+├─ Infrastructure-as-code → See ../pulumi/ or ../terraform/
+└─ One-off requests → curl examples (see api.md)
+```
+
+## SDK Selection
+
+| Language | Package | Best For | Default Retries |
+| ---------- | ------------------ | ------------------------------ | --------------- |
+| TypeScript | `cloudflare` | Node.js, Bun, Next.js, Workers | 2 |
+| Python | `cloudflare` | FastAPI, Django, scripts | 2 |
+| Go | `cloudflare-go/v4` | CLI tools, microservices | 10 |
+
+All SDKs are Stainless-generated from OpenAPI spec (consistent APIs).
+
+## Authentication Methods
+
+| Method | Security | Use Case | Scope |
+| ---------------- | ------------------- | -------------------- | ------------------- |
+| **API Token** ✓ | Scoped, rotatable | Production | Per-zone or account |
+| API Key + Email | Full account access | Legacy only | Everything |
+| User Service Key | Limited | Origin CA certs only | Origin CA |
+
+**Always use API tokens** for new projects.
+
+## Rate Limits
+
+| Limit | Value |
+| -------------- | ---------------------------- |
+| Per user/token | 1200 requests / 5 minutes |
+| Per IP | 200 requests / second |
+| GraphQL | 320 / 5 minutes (cost-based) |
+
+## Reading Order
+
+| Task | Files to Read |
+| ---------------------------- | -------------------------------------------------------------------------------- |
+| Initialize SDK client | api.md |
+| Configure auth/timeout/retry | configuration.md |
+| Find usage patterns | patterns.md |
+| Debug errors/rate limits | gotchas.md |
+| Product-specific APIs | [Workers docs](https://developers.cloudflare.com/workers/), ../r2/, ../kv/, etc. |
+
+## In This Reference
+
+- **[api.md](api.md)** - SDK client initialization, pagination, error handling, examples
+- **[configuration.md](configuration.md)** - Environment variables, SDK config, Wrangler setup
+- **[patterns.md](patterns.md)** - Real-world patterns, batch operations, workflows
+- **[gotchas.md](gotchas.md)** - Rate limits, SDK-specific issues, troubleshooting
+
+## See Also
+
+- [Cloudflare API Docs](https://developers.cloudflare.com/api/)
+- [Bindings Reference](../bindings/) - Workers runtime bindings (preferred over REST API)
+- [Wrangler Reference](https://developers.cloudflare.com/workers/wrangler/) - CLI tool for Cloudflare development
+- [GraphQL Analytics API Reference](../graphql-api/) - Analytics data via GraphQL (separate endpoint from REST API)
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/api/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/api/api.md
new file mode 100644
index 0000000..6f1040f
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/api/api.md
@@ -0,0 +1,205 @@
+# API Reference
+
+## Client Initialization
+
+### TypeScript
+
+```typescript
+import Cloudflare from 'cloudflare';
+
+const client = new Cloudflare({
+ apiToken: process.env.CLOUDFLARE_API_TOKEN
+});
+```
+
+### Python
+
+```python
+from cloudflare import Cloudflare
+
+client = Cloudflare(api_token=os.environ.get("CLOUDFLARE_API_TOKEN"))
+
+# For async:
+from cloudflare import AsyncCloudflare
+client = AsyncCloudflare(api_token=os.environ["CLOUDFLARE_API_TOKEN"])
+```
+
+### Go
+
+```go
+import (
+ "github.com/cloudflare/cloudflare-go/v4"
+ "github.com/cloudflare/cloudflare-go/v4/option"
+)
+
+client := cloudflare.NewClient(
+ option.WithAPIToken(os.Getenv("CLOUDFLARE_API_TOKEN")),
+)
+```
+
+## Authentication
+
+### API Token (Recommended)
+
+**Create token**: Dashboard → My Profile → API Tokens → Create Token
+
+```bash
+export CLOUDFLARE_API_TOKEN='your-token-here'
+
+curl "https://api.cloudflare.com/client/v4/zones" \
+ --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
+```
+
+**Token scopes**: Always use minimal permissions (zone-specific, time-limited).
+
+### API Key (Legacy)
+
+```bash
+curl "https://api.cloudflare.com/client/v4/zones" \
+ --header "X-Auth-Email: user@example.com" \
+ --header "X-Auth-Key: $CLOUDFLARE_API_KEY"
+```
+
+**Not recommended:** Full account access, cannot scope permissions.
+
+## Auto-Pagination
+
+All SDKs support automatic pagination for list operations.
+
+```typescript
+// TypeScript: for await...of
+for await (const zone of client.zones.list()) {
+ console.log(zone.id);
+}
+```
+
+```python
+# Python: iterator protocol
+for zone in client.zones.list():
+ print(zone.id)
+```
+
+```go
+// Go: ListAutoPaging
+iter := client.Zones.ListAutoPaging(ctx, cloudflare.ZoneListParams{})
+for iter.Next() {
+ zone := iter.Current()
+ fmt.Println(zone.ID)
+}
+```
+
+## Error Handling
+
+```typescript
+try {
+ const zone = await client.zones.get({ zone_id: 'xxx' });
+} catch (err) {
+ if (err instanceof Cloudflare.NotFoundError) {
+ // 404
+ } else if (err instanceof Cloudflare.RateLimitError) {
+ // 429 - SDK auto-retries with backoff
+ } else if (err instanceof Cloudflare.APIError) {
+ console.log(err.status, err.message);
+ }
+}
+```
+
+**Common Error Types:**
+
+- `AuthenticationError` (401) - Invalid token
+- `PermissionDeniedError` (403) - Insufficient scope
+- `NotFoundError` (404) - Resource not found
+- `RateLimitError` (429) - Rate limit exceeded
+- `InternalServerError` (≥500) - Cloudflare error
+
+## Zone Management
+
+```typescript
+// List zones
+const zones = await client.zones.list({
+ account: { id: 'account-id' },
+ status: 'active'
+});
+
+// Create zone
+const zone = await client.zones.create({
+ account: { id: 'account-id' },
+ name: 'example.com',
+ type: 'full' // or 'partial'
+});
+
+// Update zone
+await client.zones.edit('zone-id', {
+ paused: false
+});
+
+// Delete zone
+await client.zones.delete('zone-id');
+```
+
+```go
+// Go: requires cloudflare.F() wrapper
+zone, err := client.Zones.New(ctx, cloudflare.ZoneNewParams{
+ Account: cloudflare.F(cloudflare.ZoneNewParamsAccount{
+ ID: cloudflare.F("account-id"),
+ }),
+ Name: cloudflare.F("example.com"),
+ Type: cloudflare.F(cloudflare.ZoneNewParamsTypeFull),
+})
+```
+
+## DNS Management
+
+```typescript
+// Create DNS record
+await client.dns.records.create({
+ zone_id: 'zone-id',
+ type: 'A',
+ name: 'subdomain.example.com',
+ content: '192.0.2.1',
+ ttl: 1, // auto
+ proxied: true // Orange cloud
+});
+
+// List DNS records (with auto-pagination)
+for await (const record of client.dns.records.list({
+ zone_id: 'zone-id',
+ type: 'A'
+})) {
+ console.log(record.name, record.content);
+}
+
+// Update DNS record
+await client.dns.records.update({
+ zone_id: 'zone-id',
+ dns_record_id: 'record-id',
+ type: 'A',
+ name: 'subdomain.example.com',
+ content: '203.0.113.1',
+ proxied: true
+});
+
+// Delete DNS record
+await client.dns.records.delete({
+ zone_id: 'zone-id',
+ dns_record_id: 'record-id'
+});
+```
+
+```python
+# Python example
+client.dns.records.create(
+ zone_id="zone-id",
+ type="A",
+ name="subdomain.example.com",
+ content="192.0.2.1",
+ ttl=1,
+ proxied=True,
+)
+```
+
+## See Also
+
+- [configuration.md](./configuration.md) - SDK configuration, environment variables
+- [patterns.md](./patterns.md) - Real-world patterns and workflows
+- [gotchas.md](./gotchas.md) - Rate limits, troubleshooting
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/api/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/api/configuration.md
new file mode 100644
index 0000000..b1a0a5e
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/api/configuration.md
@@ -0,0 +1,158 @@
+# Configuration
+
+## Environment Variables
+
+### Set Variables
+
+| Platform | Command |
+| ----------- | ------------------------------------- |
+| Linux/macOS | `export CLOUDFLARE_API_TOKEN='token'` |
+| PowerShell | `$env:CLOUDFLARE_API_TOKEN = 'token'` |
+| Windows CMD | `set CLOUDFLARE_API_TOKEN=token` |
+
+**Security:** Never commit tokens. Use `.env` files (gitignored) or secret managers.
+
+### .env File Pattern
+
+```bash
+# .env (add to .gitignore)
+CLOUDFLARE_API_TOKEN=your-token-here
+CLOUDFLARE_ACCOUNT_ID=your-account-id
+```
+
+```typescript
+// TypeScript
+import 'dotenv/config';
+
+const client = new Cloudflare({
+ apiToken: process.env.CLOUDFLARE_API_TOKEN
+});
+```
+
+```python
+# Python
+from dotenv import load_dotenv
+load_dotenv()
+
+client = Cloudflare(api_token=os.environ["CLOUDFLARE_API_TOKEN"])
+```
+
+## SDK Configuration
+
+### TypeScript
+
+```typescript
+const client = new Cloudflare({
+ apiToken: process.env.CLOUDFLARE_API_TOKEN,
+ timeout: 120000, // 2 min (default 60s), in milliseconds
+ maxRetries: 5, // default 2
+ baseURL: 'https://...' // proxy (rare)
+});
+
+// Per-request overrides
+await client.zones.get({ zone_id: 'zone-id' }, { timeout: 5000, maxRetries: 0 });
+```
+
+### Python
+
+```python
+client = Cloudflare(
+ api_token=os.environ["CLOUDFLARE_API_TOKEN"],
+ timeout=120, # seconds (default 60)
+ max_retries=5, # default 2
+ base_url="https://...", # proxy (rare)
+)
+
+# Per-request overrides
+client.with_options(timeout=5, max_retries=0).zones.get(zone_id="zone-id")
+```
+
+### Go
+
+```go
+client := cloudflare.NewClient(
+ option.WithAPIToken(os.Getenv("CLOUDFLARE_API_TOKEN")),
+ option.WithMaxRetries(5), // default 10 (higher than TS/Python)
+ option.WithRequestTimeout(2 * time.Minute), // default 60s
+ option.WithBaseURL("https://..."), // proxy (rare)
+)
+
+// Per-request overrides
+client.Zones.Get(ctx, "zone-id", option.WithMaxRetries(0))
+```
+
+## Configuration Options
+
+| Option | TypeScript | Python | Go | Default |
+| -------- | -------------- | ------------- | -------------------- | ------------------ |
+| Timeout | `timeout` (ms) | `timeout` (s) | `WithRequestTimeout` | 60s |
+| Retries | `maxRetries` | `max_retries` | `WithMaxRetries` | 2 (Go: 10) |
+| Base URL | `baseURL` | `base_url` | `WithBaseURL` | api.cloudflare.com |
+
+**Note:** Go SDK has higher default retries (10) than TypeScript/Python (2).
+
+## Timeout Configuration
+
+**When to increase:**
+
+- Large zone transfers
+- Bulk DNS operations
+- Worker script uploads
+
+```typescript
+const client = new Cloudflare({
+ timeout: 300000 // 5 minutes
+});
+```
+
+## Retry Configuration
+
+**When to increase:** Rate-limit-heavy workflows, flaky network
+
+**When to decrease:** Fast-fail requirements, user-facing requests
+
+```typescript
+// Increase retries for batch operations
+const client = new Cloudflare({ maxRetries: 10 });
+
+// Disable retries for fast-fail
+const fastClient = new Cloudflare({ maxRetries: 0 });
+```
+
+## Wrangler CLI Integration
+
+```bash
+# Configure authentication
+wrangler login
+# Or
+export CLOUDFLARE_API_TOKEN='token'
+
+# Common commands that use API
+wrangler deploy # Uploads worker via API
+wrangler kv:key put # KV operations
+wrangler r2 bucket create # R2 operations
+wrangler d1 execute # D1 operations
+wrangler pages deploy # Pages operations
+
+# Get API configuration
+wrangler whoami # Shows authenticated user
+```
+
+### wrangler.toml
+
+```toml
+name = "my-worker"
+main = "src/index.ts"
+compatibility_date = "2024-01-01"
+account_id = "your-account-id"
+
+# Can also use env vars:
+# CLOUDFLARE_ACCOUNT_ID
+# CLOUDFLARE_API_TOKEN
+```
+
+## See Also
+
+- [api.md](./api.md) - Client initialization, authentication
+- [gotchas.md](./gotchas.md) - Rate limits, timeout errors
+- [Wrangler Reference](https://developers.cloudflare.com/workers/wrangler/) - CLI tool details
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/api/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/api/gotchas.md
new file mode 100644
index 0000000..87e8451
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/api/gotchas.md
@@ -0,0 +1,231 @@
+# Gotchas & Troubleshooting
+
+## Rate Limits & 429 Errors
+
+**Actual Limits:**
+
+- **1200 requests / 5 minutes** per user/token (global)
+- **200 requests / second** per IP address
+- **GraphQL: 320 / 5 minutes** (cost-based)
+
+**SDK Behavior:**
+
+- Auto-retry with exponential backoff (default 2 retries, Go: 10)
+- Respects `Retry-After` header
+- Throws `RateLimitError` after exhausting retries
+
+**Solution:**
+
+```typescript
+// Increase retries for rate-limit-heavy workflows
+const client = new Cloudflare({ maxRetries: 5 });
+
+// Add application-level throttling
+import pLimit from 'p-limit';
+const limit = pLimit(10); // Max 10 concurrent requests
+```
+
+## SDK-Specific Issues
+
+### Go: Required Field Wrapper
+
+**Problem:** Go SDK requires `cloudflare.F()` wrapper for optional fields.
+
+```go
+// ❌ WRONG - Won't compile or send field
+client.Zones.New(ctx, cloudflare.ZoneNewParams{
+ Name: "example.com",
+})
+
+// ✅ CORRECT
+client.Zones.New(ctx, cloudflare.ZoneNewParams{
+ Name: cloudflare.F("example.com"),
+ Account: cloudflare.F(cloudflare.ZoneNewParamsAccount{
+ ID: cloudflare.F("account-id"),
+ }),
+})
+```
+
+**Why:** Distinguishes between zero value, null, and omitted fields.
+
+### Python: Async vs Sync Clients
+
+**Problem:** Using sync client in async context or vice versa.
+
+```python
+# ❌ WRONG - Can't await sync client
+from cloudflare import Cloudflare
+client = Cloudflare()
+await client.zones.list() # TypeError
+
+# ✅ CORRECT - Use AsyncCloudflare
+from cloudflare import AsyncCloudflare
+client = AsyncCloudflare()
+await client.zones.list()
+```
+
+## Token Permission Errors (403)
+
+**Problem:** API returns 403 Forbidden despite valid token.
+
+**Cause:** Token lacks required permissions (scope).
+
+**Scopes Required:**
+
+| Operation | Required Scope |
+| ------------- | --------------------------------------- |
+| List zones | Zone:Read (zone-level or account-level) |
+| Create zone | Zone:Edit (account-level) |
+| Edit DNS | DNS:Edit (zone-level) |
+| Deploy Worker | Workers Script:Edit (account-level) |
+| Read KV | Workers KV Storage:Read |
+| Write KV | Workers KV Storage:Edit |
+
+**Solution:** Re-create token with correct permissions in Dashboard → My Profile → API Tokens.
+
+## Pagination Truncation
+
+**Problem:** Only getting first 20 results (default page size).
+
+**Solution:** Use auto-pagination iterators.
+
+```typescript
+// ❌ WRONG - Only first page (20 items)
+const page = await client.zones.list();
+
+// ✅ CORRECT - All results
+const zones = [];
+for await (const zone of client.zones.list()) {
+ zones.push(zone);
+}
+```
+
+## Workers Subrequests
+
+**Problem:** Rate limit hit faster than expected in Workers.
+
+**Cause:** Workers subrequests count as separate API calls.
+
+**Solution:** Use bindings instead of REST API in Workers (see ../bindings/).
+
+```typescript
+// ❌ WRONG - REST API in Workers (counts against rate limit)
+const client = new Cloudflare({ apiToken: env.CLOUDFLARE_API_TOKEN });
+const zones = await client.zones.list();
+
+// ✅ CORRECT - Use bindings (no rate limit)
+// Access via env.MY_BINDING
+```
+
+## Authentication Errors (401)
+
+**Problem:** "Authentication failed" or "Invalid token"
+
+**Causes:**
+
+- Token expired
+- Token deleted/revoked
+- Token not set in environment
+- Wrong token format
+
+**Solution:**
+
+```typescript
+// Verify token is set
+if (!process.env.CLOUDFLARE_API_TOKEN) {
+ throw new Error('CLOUDFLARE_API_TOKEN not set');
+}
+
+// Test token
+const user = await client.user.tokens.verify();
+console.log('Token valid:', user.status);
+```
+
+## Timeout Errors
+
+**Problem:** Request times out (default 60s).
+
+**Cause:** Large operations (bulk DNS, zone transfers).
+
+**Solution:** Increase timeout or split operations.
+
+```typescript
+// Increase timeout
+const client = new Cloudflare({
+ timeout: 300000 // 5 minutes
+});
+
+// Or split operations
+const batchSize = 100;
+for (let i = 0; i < records.length; i += batchSize) {
+ const batch = records.slice(i, i + batchSize);
+ await processBatch(batch);
+}
+```
+
+## Zone Not Found (404)
+
+**Problem:** Zone ID valid but returns 404.
+
+**Causes:**
+
+- Zone not in account associated with token
+- Zone deleted
+- Wrong zone ID format
+
+**Solution:**
+
+```typescript
+// List all zones to find correct ID
+for await (const zone of client.zones.list()) {
+ console.log(zone.id, zone.name);
+}
+```
+
+## Limits Reference
+
+| Resource/Limit | Value | Notes |
+| ------------------------------- | --------- | ---------------------- |
+| API rate limit | 1200/5min | Per user/token |
+| IP rate limit | 200/sec | Per IP |
+| GraphQL rate limit | 320/5min | Cost-based |
+| Parallel requests (recommended) | < 10 | Avoid overwhelming API |
+| Default page size | 20 | Use auto-pagination |
+| Max page size | 50 | Some endpoints |
+
+## Best Practices
+
+**Security:**
+
+- Never commit tokens
+- Use minimal permissions
+- Rotate tokens regularly
+- Set token expiration
+
+**Performance:**
+
+- Batch operations
+- Use pagination wisely
+- Cache responses
+- Handle rate limits
+
+**Code Organization:**
+
+```typescript
+// Create reusable client instance
+export const cfClient = new Cloudflare({
+ apiToken: process.env.CLOUDFLARE_API_TOKEN,
+ maxRetries: 5
+});
+
+// Wrap common operations
+export async function getZoneDetails(zoneId: string) {
+ return await cfClient.zones.get({ zone_id: zoneId });
+}
+```
+
+## See Also
+
+- [api.md](./api.md) - Error types, authentication
+- [configuration.md](./configuration.md) - Timeout/retry configuration
+- [patterns.md](./patterns.md) - Error handling patterns
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/api/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/api/patterns.md
new file mode 100644
index 0000000..079f7d3
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/api/patterns.md
@@ -0,0 +1,206 @@
+# Common Patterns
+
+## List All with Auto-Pagination
+
+**Problem:** API returns paginated results. Default page size is 20.
+
+**Solution:** Use SDK auto-pagination to iterate all results.
+
+```typescript
+// TypeScript
+for await (const zone of client.zones.list()) {
+ console.log(zone.name);
+}
+```
+
+```python
+# Python
+for zone in client.zones.list():
+ print(zone.name)
+```
+
+```go
+// Go
+iter := client.Zones.ListAutoPaging(ctx, cloudflare.ZoneListParams{})
+for iter.Next() {
+ fmt.Println(iter.Current().Name)
+}
+```
+
+## Error Handling with Retry
+
+**Problem:** Rate limits (429) and transient errors need retry.
+
+**Solution:** SDKs auto-retry with exponential backoff. Customize as needed.
+
+```typescript
+// Increase retries for rate-limit-heavy operations
+const client = new Cloudflare({ maxRetries: 5 });
+
+try {
+ const zone = await client.zones.create({/* ... */});
+} catch (err) {
+ if (err instanceof Cloudflare.RateLimitError) {
+ // Already retried 5 times with backoff
+ const retryAfter = err.headers['retry-after'];
+ console.log(`Rate limited. Retry after ${retryAfter}s`);
+ }
+}
+```
+
+## Batch Parallel Operations
+
+**Problem:** Need to create multiple resources quickly.
+
+**Solution:** Use `Promise.all()` for parallel requests (respect rate limits).
+
+```typescript
+// Create multiple DNS records in parallel
+const records = ['www', 'api', 'cdn'].map((subdomain) =>
+ client.dns.records.create({
+ zone_id: 'zone-id',
+ type: 'A',
+ name: `${subdomain}.example.com`,
+ content: '192.0.2.1'
+ })
+);
+await Promise.all(records);
+```
+
+**Controlled concurrency** (avoid rate limits):
+
+```typescript
+import pLimit from 'p-limit';
+const limit = pLimit(10); // Max 10 concurrent
+
+const subdomains = ['www', 'api', 'cdn' /* many more */];
+const records = subdomains.map((subdomain) =>
+ limit(() =>
+ client.dns.records.create({
+ zone_id: 'zone-id',
+ type: 'A',
+ name: `${subdomain}.example.com`,
+ content: '192.0.2.1'
+ })
+ )
+);
+await Promise.all(records);
+```
+
+## Zone CRUD Workflow
+
+```typescript
+// Create
+const zone = await client.zones.create({
+ account: { id: 'account-id' },
+ name: 'example.com',
+ type: 'full'
+});
+
+// Read
+const fetched = await client.zones.get({ zone_id: zone.id });
+
+// Update
+await client.zones.edit(zone.id, { paused: false });
+
+// Delete
+await client.zones.delete(zone.id);
+```
+
+## DNS Bulk Update
+
+```typescript
+// Fetch all A records
+const records = [];
+for await (const record of client.dns.records.list({
+ zone_id: 'zone-id',
+ type: 'A'
+})) {
+ records.push(record);
+}
+
+// Update all to new IP
+await Promise.all(
+ records.map((record) =>
+ client.dns.records.update({
+ zone_id: 'zone-id',
+ dns_record_id: record.id,
+ type: 'A',
+ name: record.name,
+ content: '203.0.113.1', // New IP
+ proxied: record.proxied,
+ ttl: record.ttl
+ })
+ )
+);
+```
+
+## Filter and Collect Results
+
+```typescript
+// Find all proxied A records
+const proxiedRecords = [];
+for await (const record of client.dns.records.list({
+ zone_id: 'zone-id',
+ type: 'A'
+})) {
+ if (record.proxied) {
+ proxiedRecords.push(record);
+ }
+}
+```
+
+## Error Recovery Pattern
+
+```typescript
+async function createZoneWithRetry(name: string, maxAttempts = 3) {
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
+ try {
+ return await client.zones.create({
+ account: { id: 'account-id' },
+ name,
+ type: 'full'
+ });
+ } catch (err) {
+ if (err instanceof Cloudflare.RateLimitError && attempt < maxAttempts) {
+ const retryAfter = parseInt(err.headers['retry-after'] || '5');
+ console.log(`Rate limited, waiting ${retryAfter}s (retry ${attempt}/${maxAttempts})`);
+ await new Promise((resolve) => setTimeout(resolve, retryAfter * 1000));
+ } else {
+ throw err;
+ }
+ }
+ }
+}
+```
+
+## Conditional Update Pattern
+
+```typescript
+// Only update if zone is active
+const zone = await client.zones.get({ zone_id: 'zone-id' });
+if (zone.status === 'active') {
+ await client.zones.edit(zone.id, { paused: false });
+}
+```
+
+## Batch with Error Handling
+
+```typescript
+// Process multiple zones, continue on errors
+const results = await Promise.allSettled(zoneIds.map((id) => client.zones.get({ zone_id: id })));
+
+results.forEach((result, i) => {
+ if (result.status === 'fulfilled') {
+ console.log(`Zone ${i}: ${result.value.name}`);
+ } else {
+ console.error(`Zone ${i} failed:`, result.reason.message);
+ }
+});
+```
+
+## See Also
+
+- [api.md](./api.md) - SDK client initialization, basic operations
+- [gotchas.md](./gotchas.md) - Rate limits, common errors
+- [configuration.md](./configuration.md) - SDK configuration options
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/argo-smart-routing/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/argo-smart-routing/README.md
new file mode 100644
index 0000000..bf6c0da
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/argo-smart-routing/README.md
@@ -0,0 +1,96 @@
+# Cloudflare Argo Smart Routing Skill Reference
+
+## Overview
+
+Cloudflare Argo Smart Routing is a performance optimization service that detects real-time network issues and routes web traffic across the most efficient network path. It continuously monitors network conditions and intelligently routes traffic through the fastest, most reliable routes in Cloudflare's network.
+
+**Note on Smart Shield:** Argo Smart Routing is being integrated into Cloudflare's Smart Shield product for enhanced DDoS protection and performance. Existing Argo customers maintain full functionality with gradual migration to Smart Shield features.
+
+## Quick Start
+
+### Enable via cURL
+
+```bash
+curl -X PATCH "https://api.cloudflare.com/client/v4/zones/{zone_id}/argo/smart_routing" \
+ -H "Authorization: Bearer YOUR_API_TOKEN" \
+ -H "Content-Type: application/json" \
+ -d '{"value": "on"}'
+```
+
+### Enable via TypeScript SDK
+
+```typescript
+import Cloudflare from 'cloudflare';
+
+const client = new Cloudflare({ apiToken: process.env.CLOUDFLARE_API_TOKEN });
+
+const result = await client.argo.smartRouting.edit({
+ zone_id: 'your-zone-id',
+ value: 'on'
+});
+
+console.log(`Argo enabled: ${result.value}`);
+```
+
+## Core Concepts
+
+### What It Does
+
+- **Intelligent routing**: Detects congestion, outages, packet loss in real-time
+- **Global optimization**: Routes across 300+ Cloudflare data centers
+- **Automatic failover**: Switches paths when issues detected (typically <1s)
+- **Works with existing setup**: No origin changes required
+
+### Billing Model
+
+- Usage-based: Charged per GB of traffic (excluding DDoS/WAF mitigated traffic)
+- Requires billing configuration before enabling
+- Available on Enterprise+ plans (check zone eligibility)
+
+### When to Use
+
+- **High-traffic production sites** with global user base
+- **Latency-sensitive applications** (APIs, real-time services)
+- **Sites behind Cloudflare proxy** (orange-clouded DNS records)
+- **Combined with Tiered Cache** for maximum performance gains
+
+### When NOT to Use
+
+- Development/staging environments (cost control)
+- Low-traffic sites (<1TB/month) where cost may exceed benefit
+- Sites with primarily single-region traffic
+
+## Should I Enable Argo?
+
+| Your Situation | Recommendation |
+| ----------------------------------------- | ----------------------------------- |
+| Global production app, >1TB/month traffic | ✅ Enable - likely ROI positive |
+| Enterprise plan, latency-critical APIs | ✅ Enable - performance matters |
+| Regional site, <100GB/month traffic | ⚠️ Evaluate - cost may not justify |
+| Development/staging environment | ❌ Disable - use in production only |
+| Not yet configured billing | ❌ Configure billing first |
+
+## Reading Order by Task
+
+| Your Goal | Start With | Then Read |
+| ----------------------------- | -------------------------------------------------------- | -------------------------- |
+| Enable Argo for first time | Quick Start above → [configuration.md](configuration.md) | [gotchas.md](gotchas.md) |
+| Use TypeScript/Python SDK | [api.md](api.md) | [patterns.md](patterns.md) |
+| Terraform/IaC setup | [configuration.md](configuration.md) | - |
+| Enable for Spectrum TCP app | [patterns.md](patterns.md) → Spectrum section | [api.md](api.md) |
+| Troubleshoot enablement issue | [gotchas.md](gotchas.md) | [api.md](api.md) |
+| Manage billing/usage | [patterns.md](patterns.md) → Billing section | [gotchas.md](gotchas.md) |
+
+## In This Reference
+
+- **[api.md](api.md)** - API endpoints, SDK methods, error handling, Python/TypeScript examples
+- **[configuration.md](configuration.md)** - Terraform setup, environment config, billing configuration
+- **[patterns.md](patterns.md)** - Tiered Cache integration, Spectrum TCP apps, billing management, validation patterns
+- **[gotchas.md](gotchas.md)** - Common errors, permission issues, limits, best practices
+
+## See Also
+
+- [Cloudflare Argo Smart Routing Docs](https://developers.cloudflare.com/argo-smart-routing/)
+- [Cloudflare Smart Shield](https://developers.cloudflare.com/smart-shield/)
+- [Spectrum Documentation](https://developers.cloudflare.com/spectrum/)
+- [Tiered Cache](https://developers.cloudflare.com/cache/how-to/tiered-cache/)
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/argo-smart-routing/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/argo-smart-routing/api.md
new file mode 100644
index 0000000..7ff3c1b
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/argo-smart-routing/api.md
@@ -0,0 +1,253 @@
+## API Reference
+
+**Note on Smart Shield:** Argo Smart Routing is being integrated into Cloudflare's Smart Shield product. API endpoints remain stable; existing integrations continue to work without changes.
+
+### Base Endpoint
+
+```
+https://api.cloudflare.com/client/v4
+```
+
+### Authentication
+
+Use API tokens with Zone:Argo Smart Routing:Edit permissions:
+
+```bash
+# Headers required
+X-Auth-Email: user@example.com
+Authorization: Bearer YOUR_API_TOKEN
+```
+
+### Get Argo Smart Routing Status
+
+**Endpoint:** `GET /zones/{zone_id}/argo/smart_routing`
+
+**Description:** Retrieves current Argo Smart Routing enablement status.
+
+**cURL Example:**
+
+```bash
+curl -X GET "https://api.cloudflare.com/client/v4/zones/{zone_id}/argo/smart_routing" \
+ -H "Authorization: Bearer YOUR_API_TOKEN" \
+ -H "Content-Type: application/json"
+```
+
+**Response:**
+
+```json
+{
+ "result": {
+ "id": "smart_routing",
+ "value": "on",
+ "editable": true,
+ "modified_on": "2024-01-11T12:00:00Z"
+ },
+ "success": true,
+ "errors": [],
+ "messages": []
+}
+```
+
+**TypeScript SDK Example:**
+
+```typescript
+import Cloudflare from 'cloudflare';
+
+const client = new Cloudflare({
+ apiToken: process.env.CLOUDFLARE_API_TOKEN
+});
+
+const status = await client.argo.smartRouting.get({ zone_id: 'your-zone-id' });
+console.log(`Argo status: ${status.value}, editable: ${status.editable}`);
+```
+
+**Python SDK Example:**
+
+```python
+from cloudflare import Cloudflare
+
+client = Cloudflare(api_token=os.environ.get('CLOUDFLARE_API_TOKEN'))
+
+status = client.argo.smart_routing.get(zone_id='your-zone-id')
+print(f"Argo status: {status.value}, editable: {status.editable}")
+```
+
+### Update Argo Smart Routing Status
+
+**Endpoint:** `PATCH /zones/{zone_id}/argo/smart_routing`
+
+**Description:** Enable or disable Argo Smart Routing for a zone.
+
+**Request Body:**
+
+```json
+{
+ "value": "on" // or "off"
+}
+```
+
+**cURL Example:**
+
+```bash
+curl -X PATCH "https://api.cloudflare.com/client/v4/zones/{zone_id}/argo/smart_routing" \
+ -H "Authorization: Bearer YOUR_API_TOKEN" \
+ -H "Content-Type: application/json" \
+ -d '{"value": "on"}'
+```
+
+**TypeScript SDK Example:**
+
+```typescript
+const result = await client.argo.smartRouting.edit({
+ zone_id: 'your-zone-id',
+ value: 'on'
+});
+console.log(`Updated: ${result.value} at ${result.modified_on}`);
+```
+
+**Python SDK Example:**
+
+```python
+result = client.argo.smart_routing.edit(
+ zone_id='your-zone-id',
+ value='on'
+)
+print(f"Updated: {result.value} at {result.modified_on}")
+```
+
+## Checking Editability Before Updates
+
+**Critical:** Always check the `editable` field before attempting to enable/disable Argo. When `editable: false`, the zone has restrictions (billing not configured, insufficient permissions, or plan limitations).
+
+**Pattern:**
+
+```typescript
+async function safelyEnableArgo(client: Cloudflare, zoneId: string): Promise {
+ const status = await client.argo.smartRouting.get({ zone_id: zoneId });
+
+ if (!status.editable) {
+ console.error('Cannot modify Argo: editable=false (check billing/permissions)');
+ return false;
+ }
+
+ if (status.value === 'on') {
+ console.log('Argo already enabled');
+ return true;
+ }
+
+ await client.argo.smartRouting.edit({ zone_id: zoneId, value: 'on' });
+ console.log('Argo enabled successfully');
+ return true;
+}
+```
+
+**Python Pattern:**
+
+```python
+def safely_enable_argo(client: Cloudflare, zone_id: str) -> bool:
+ status = client.argo.smart_routing.get(zone_id=zone_id)
+
+ if not status.editable:
+ print('Cannot modify Argo: editable=false (check billing/permissions)')
+ return False
+
+ if status.value == 'on':
+ print('Argo already enabled')
+ return True
+
+ client.argo.smart_routing.edit(zone_id=zone_id, value='on')
+ print('Argo enabled successfully')
+ return True
+```
+
+## Error Handling
+
+The TypeScript SDK provides typed error classes for robust error handling:
+
+```typescript
+import Cloudflare from 'cloudflare';
+import { APIError, APIConnectionError, RateLimitError } from 'cloudflare';
+
+async function enableArgoWithErrorHandling(client: Cloudflare, zoneId: string) {
+ try {
+ const result = await client.argo.smartRouting.edit({
+ zone_id: zoneId,
+ value: 'on'
+ });
+ return result;
+ } catch (error) {
+ if (error instanceof RateLimitError) {
+ console.error('Rate limited. Retry after:', error.response?.headers.get('retry-after'));
+ // Implement exponential backoff
+ } else if (error instanceof APIError) {
+ console.error('API error:', error.status, error.message);
+ if (error.status === 403) {
+ console.error('Permission denied - check API token scopes');
+ } else if (error.status === 400) {
+ console.error('Bad request - verify zone_id and payload');
+ }
+ } else if (error instanceof APIConnectionError) {
+ console.error('Connection failed:', error.message);
+ // Retry with exponential backoff
+ } else {
+ console.error('Unexpected error:', error);
+ }
+ throw error;
+ }
+}
+```
+
+**Python Error Handling:**
+
+```python
+from cloudflare import Cloudflare, APIError, RateLimitError
+
+def enable_argo_with_error_handling(client: Cloudflare, zone_id: str):
+ try:
+ result = client.argo.smart_routing.edit(zone_id=zone_id, value='on')
+ return result
+ except RateLimitError as e:
+ print(f"Rate limited. Retry after: {e.response.headers.get('retry-after')}")
+ raise
+ except APIError as e:
+ print(f"API error: {e.status} - {e.message}")
+ if e.status == 403:
+ print('Permission denied - check API token scopes')
+ elif e.status == 400:
+ print('Bad request - verify zone_id and payload')
+ raise
+ except Exception as e:
+ print(f"Unexpected error: {e}")
+ raise
+```
+
+## Response Schema
+
+All Argo Smart Routing API responses follow this structure:
+
+```typescript
+interface ArgoSmartRoutingResponse {
+ result: {
+ id: 'smart_routing';
+ value: 'on' | 'off';
+ editable: boolean;
+ modified_on: string; // ISO 8601 timestamp
+ };
+ success: boolean;
+ errors: Array<{
+ code: number;
+ message: string;
+ }>;
+ messages: Array;
+}
+```
+
+## Key Response Fields
+
+| Field | Type | Description |
+| ------------- | --------------- | ------------------------------------------------ |
+| `value` | `"on" \| "off"` | Current enablement status |
+| `editable` | `boolean` | Whether changes are allowed (check before PATCH) |
+| `modified_on` | `string` | ISO timestamp of last modification |
+| `success` | `boolean` | Whether request succeeded |
+| `errors` | `Array` | Error details if `success: false` |
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/argo-smart-routing/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/argo-smart-routing/configuration.md
new file mode 100644
index 0000000..7a4e321
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/argo-smart-routing/configuration.md
@@ -0,0 +1,205 @@
+## Configuration Management
+
+**Note on Smart Shield Evolution:** Argo Smart Routing is being integrated into Smart Shield. Configuration methods below remain valid; Terraform and IaC patterns unchanged.
+
+### Infrastructure as Code (Terraform)
+
+```hcl
+# terraform/argo.tf
+# Note: Use Cloudflare Terraform provider
+
+resource "cloudflare_argo" "example" {
+ zone_id = var.zone_id
+ smart_routing = "on"
+ tiered_caching = "on"
+}
+
+variable "zone_id" {
+ description = "Cloudflare Zone ID"
+ type = string
+}
+
+output "argo_enabled" {
+ value = cloudflare_argo.example.smart_routing
+ description = "Argo Smart Routing status"
+}
+```
+
+### Environment-Based Configuration
+
+```typescript
+// config/argo.ts
+interface ArgoEnvironmentConfig {
+ enabled: boolean;
+ tieredCache: boolean;
+ monitoring: {
+ usageAlerts: boolean;
+ threshold: number;
+ };
+}
+
+const configs: Record = {
+ production: {
+ enabled: true,
+ tieredCache: true,
+ monitoring: {
+ usageAlerts: true,
+ threshold: 1000 // GB
+ }
+ },
+ staging: {
+ enabled: true,
+ tieredCache: false,
+ monitoring: {
+ usageAlerts: false,
+ threshold: 100 // GB
+ }
+ },
+ development: {
+ enabled: false,
+ tieredCache: false,
+ monitoring: {
+ usageAlerts: false,
+ threshold: 0
+ }
+ }
+};
+
+export function getArgoConfig(env: string): ArgoEnvironmentConfig {
+ return configs[env] || configs.development;
+}
+```
+
+### Pulumi Configuration
+
+```typescript
+// pulumi/argo.ts
+import * as cloudflare from '@pulumi/cloudflare';
+
+const zone = new cloudflare.Zone('example-zone', {
+ zone: 'example.com',
+ plan: 'enterprise'
+});
+
+const argoSettings = new cloudflare.Argo('argo-config', {
+ zoneId: zone.id,
+ smartRouting: 'on',
+ tieredCaching: 'on'
+});
+
+export const argoEnabled = argoSettings.smartRouting;
+export const zoneId = zone.id;
+```
+
+## Billing Configuration
+
+Before enabling Argo Smart Routing, ensure billing is configured for the account:
+
+**Prerequisites:**
+
+1. Valid payment method on file
+2. Enterprise or higher plan
+3. Zone must have billing enabled
+
+**Check Billing Status via Dashboard:**
+
+1. Navigate to Account → Billing
+2. Verify payment method configured
+3. Check zone subscription status
+
+**Note:** Attempting to enable Argo without billing configured will result in `editable: false` in API responses.
+
+## Environment Variable Setup
+
+**Required Environment Variables:**
+
+```bash
+# .env
+CLOUDFLARE_API_TOKEN=your_api_token_here
+CLOUDFLARE_ZONE_ID=your_zone_id_here
+CLOUDFLARE_ACCOUNT_ID=your_account_id_here
+
+# Optional
+ARGO_ENABLED=true
+ARGO_TIERED_CACHE=true
+```
+
+**TypeScript Configuration Loader:**
+
+```typescript
+// config/env.ts
+import { z } from 'zod';
+
+const envSchema = z.object({
+ CLOUDFLARE_API_TOKEN: z.string().min(1),
+ CLOUDFLARE_ZONE_ID: z.string().min(1),
+ CLOUDFLARE_ACCOUNT_ID: z.string().min(1),
+ ARGO_ENABLED: z.string().optional().default('false'),
+ ARGO_TIERED_CACHE: z.string().optional().default('false')
+});
+
+export const env = envSchema.parse(process.env);
+
+export const argoConfig = {
+ enabled: env.ARGO_ENABLED === 'true',
+ tieredCache: env.ARGO_TIERED_CACHE === 'true'
+};
+```
+
+## CI/CD Integration
+
+**GitHub Actions Example:**
+
+```yaml
+# .github/workflows/deploy-argo.yml
+name: Deploy Argo Configuration
+
+on:
+ push:
+ branches: [main]
+ paths:
+ - 'terraform/argo.tf'
+
+jobs:
+ deploy:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Setup Terraform
+ uses: hashicorp/setup-terraform@v2
+
+ - name: Terraform Init
+ run: terraform init
+ working-directory: ./terraform
+
+ - name: Terraform Apply
+ run: terraform apply -auto-approve
+ working-directory: ./terraform
+ env:
+ CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
+ TF_VAR_zone_id: ${{ secrets.CLOUDFLARE_ZONE_ID }}
+```
+
+## Enterprise Preview Program
+
+For early access to Argo Smart Routing features and Smart Shield integration:
+
+**Eligibility:**
+
+- Enterprise plan customers
+- Active Cloudflare support contract
+- Production traffic >100GB/month
+
+**How to Join:**
+
+1. Contact Cloudflare account team or support
+2. Request Argo/Smart Shield preview access
+3. Receive preview zone configuration
+
+**Preview Features:**
+
+- Enhanced analytics and reporting
+- Smart Shield DDoS integration
+- Advanced routing policies
+- Priority support for routing issues
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/argo-smart-routing/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/argo-smart-routing/gotchas.md
new file mode 100644
index 0000000..66f9025
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/argo-smart-routing/gotchas.md
@@ -0,0 +1,115 @@
+## Best Practices Summary
+
+**Smart Shield Note:** Argo Smart Routing evolving into Smart Shield. Best practices below remain applicable; monitor Cloudflare changelog for Smart Shield updates.
+
+1. **Always check editability** before attempting to enable/disable Argo
+2. **Set up billing notifications** to avoid unexpected costs
+3. **Combine with Tiered Cache** for maximum performance benefit
+4. **Use in production only** - disable for dev/staging to control costs
+5. **Monitor analytics** - require 500+ requests in 48h for detailed metrics
+6. **Handle errors gracefully** - check for billing, permissions, zone compatibility
+7. **Test configuration changes** in staging before production
+8. **Use TypeScript SDK** for type safety and better developer experience
+9. **Implement retry logic** for API calls in production systems
+10. **Document zone-specific settings** for team visibility
+
+## Common Errors
+
+### "Argo unavailable"
+
+**Problem:** API returns error "Argo Smart Routing is unavailable for this zone"
+
+**Cause:** Zone not eligible or billing not set up
+
+**Solution:**
+
+1. Verify zone has Enterprise or higher plan
+2. Check billing is configured in Account → Billing
+3. Ensure payment method is valid and current
+4. Contact Cloudflare support if eligibility unclear
+
+### "Cannot enable/disable"
+
+**Problem:** API call succeeds but status remains unchanged, or `editable: false` in GET response
+
+**Cause:** Insufficient permissions or zone restrictions
+
+**Solution:**
+
+1. Check API token has `Zone:Argo Smart Routing:Edit` permission
+2. Verify `editable: true` in GET response before attempting PATCH
+3. If `editable: false`, check:
+ - Billing configured for account
+ - Zone plan includes Argo (Enterprise+)
+ - No active zone holds or suspensions
+ - API token has correct scopes
+
+### `editable: false` Error
+
+**Problem:** GET request returns `"editable": false`, preventing enable/disable
+
+**Cause:** Zone-level restrictions from billing, plan, or permissions
+
+**Solution Pattern:**
+
+```typescript
+const status = await client.argo.smartRouting.get({ zone_id: zoneId });
+
+if (!status.editable) {
+ // Don't attempt to modify - will fail
+ console.error('Cannot modify Argo settings:');
+ console.error('- Check billing is configured');
+ console.error('- Verify zone has Enterprise+ plan');
+ console.error('- Confirm API token has Edit permission');
+ throw new Error('Argo is not editable for this zone');
+}
+
+// Safe to proceed with enable/disable
+await client.argo.smartRouting.edit({ zone_id: zoneId, value: 'on' });
+```
+
+### Rate Limiting
+
+**Problem:** `429 Too Many Requests` error from API
+
+**Cause:** Exceeded API rate limits (typically 1200 requests per 5 minutes)
+
+**Solution:**
+
+```typescript
+import { RateLimitError } from 'cloudflare';
+
+try {
+ await client.argo.smartRouting.edit({ zone_id: zoneId, value: 'on' });
+} catch (error) {
+ if (error instanceof RateLimitError) {
+ const retryAfter = error.response?.headers.get('retry-after');
+ console.log(`Rate limited. Retry after ${retryAfter} seconds`);
+
+ // Implement exponential backoff
+ await new Promise((resolve) => setTimeout(resolve, (retryAfter || 60) * 1000));
+ // Retry request
+ }
+}
+```
+
+## Limits
+
+| Resource/Limit | Value | Notes |
+| -------------------------- | ------------------ | --------------------------------------- |
+| Min requests for analytics | 500 in 48h | For detailed metrics via GraphQL |
+| Zones supported | Enterprise+ | Check zone plan in dashboard |
+| Billing requirement | Must be configured | Before enabling; verify payment method |
+| API rate limit | 1200 req / 5 min | Per API token across all endpoints |
+| Spectrum apps | No hard limit | Each app can enable Argo independently |
+| Traffic counting | Proxied only | Only orange-clouded DNS records count |
+| DDoS/WAF exemption | Yes | Mitigated traffic excluded from billing |
+| Analytics latency | 1-5 minutes | Real-time metrics not available |
+
+## Additional Resources
+
+- [Official Argo Smart Routing Docs](https://developers.cloudflare.com/argo-smart-routing/)
+- [Cloudflare Smart Shield](https://developers.cloudflare.com/smart-shield/)
+- [API Authentication](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/)
+- [Cloudflare TypeScript SDK](https://github.com/cloudflare/cloudflare-typescript)
+- [Cloudflare Python SDK](https://github.com/cloudflare/cloudflare-python)
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/argo-smart-routing/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/argo-smart-routing/patterns.md
new file mode 100644
index 0000000..e9448cb
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/argo-smart-routing/patterns.md
@@ -0,0 +1,107 @@
+# Integration Patterns
+
+## Enable Argo + Tiered Cache
+
+```typescript
+async function enableOptimalPerformance(client: Cloudflare, zoneId: string) {
+ await Promise.all([
+ client.argo.smartRouting.edit({ zone_id: zoneId, value: 'on' }),
+ client.argo.tieredCaching.edit({ zone_id: zoneId, value: 'on' })
+ ]);
+}
+```
+
+**Flow:** Visitor → Edge (Lower-Tier) → [Cache Miss] → Upper-Tier → [Cache Miss + Argo] → Origin
+
+**Impact:** Argo ~30% latency reduction + Tiered Cache 50-80% origin offload
+
+## Usage Analytics (GraphQL)
+
+```graphql
+query ArgoAnalytics($zoneTag: string!) {
+ viewer {
+ zones(filter: { zoneTag: $zoneTag }) {
+ httpRequestsAdaptiveGroups(limit: 1000) {
+ sum {
+ argoBytes
+ bytes
+ }
+ }
+ }
+ }
+}
+```
+
+**Billing:** ~$0.10/GB. DDoS-mitigated and WAF-blocked traffic NOT charged.
+
+## Spectrum TCP Integration
+
+Enable Argo for non-HTTP traffic (databases, game servers, IoT):
+
+```typescript
+// Update existing app
+await client.spectrum.apps.update(appId, { zone_id: zoneId, argo_smart_routing: true });
+
+// Create new app with Argo
+await client.spectrum.apps.create({
+ zone_id: zoneId,
+ dns: { type: 'CNAME', name: 'tcp.example.com' },
+ origin_direct: ['tcp://origin.example.com:3306'],
+ protocol: 'tcp/3306',
+ argo_smart_routing: true
+});
+```
+
+**Use cases:** MySQL/PostgreSQL (3306/5432), game servers, MQTT (1883), SSH (22)
+
+## Pre-Flight Validation
+
+```typescript
+async function validateArgoEligibility(client: Cloudflare, zoneId: string) {
+ const status = await client.argo.smartRouting.get({ zone_id: zoneId });
+ const zone = await client.zones.get({ zone_id: zoneId });
+
+ const issues: string[] = [];
+ if (!status.editable) issues.push('Zone not editable');
+ if (['free', 'pro'].includes(zone.plan.legacy_id)) issues.push('Requires Business+ plan');
+ if (zone.status !== 'active') issues.push('Zone not active');
+
+ return { canEnable: issues.length === 0, issues };
+}
+```
+
+## Post-Enable Verification
+
+```typescript
+async function verifyArgoEnabled(client: Cloudflare, zoneId: string): Promise {
+ await new Promise((r) => setTimeout(r, 2000)); // Wait for propagation
+ const status = await client.argo.smartRouting.get({ zone_id: zoneId });
+ return status.value === 'on';
+}
+```
+
+## Full Setup Pattern
+
+```typescript
+async function setupArgo(client: Cloudflare, zoneId: string) {
+ // 1. Validate
+ const { canEnable, issues } = await validateArgoEligibility(client, zoneId);
+ if (!canEnable) throw new Error(issues.join(', '));
+
+ // 2. Enable both features
+ await Promise.all([
+ client.argo.smartRouting.edit({ zone_id: zoneId, value: 'on' }),
+ client.argo.tieredCaching.edit({ zone_id: zoneId, value: 'on' })
+ ]);
+
+ // 3. Verify
+ const [argo, cache] = await Promise.all([
+ client.argo.smartRouting.get({ zone_id: zoneId }),
+ client.argo.tieredCaching.get({ zone_id: zoneId })
+ ]);
+
+ return { argo: argo.value === 'on', tieredCache: cache.value === 'on' };
+}
+```
+
+**When to combine:** High-traffic sites (>1TB/mo), global users, cacheable content.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/artifacts/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/artifacts/README.md
new file mode 100644
index 0000000..19be79c
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/artifacts/README.md
@@ -0,0 +1,80 @@
+# Cloudflare Artifacts
+
+Store versioned file trees behind a repo-style interface that works from Workers, the REST API, and Git-compatible tooling.
+
+## Overview
+
+Use **Artifacts** when the thing you need to store is a versioned filesystem tree rather than a single object, key, or SQL row.
+
+Typical Artifacts use cases:
+
+- Git-style repositories
+- Per-agent, per-session, or per-task repos
+- Build outputs and deployment bundles
+- Checkpoints and generated assets
+- Shared file trees passed between developer tools and Workers
+
+Artifacts is a good fit when the same content needs to be addressable from **Workers**, the **REST API**, and **Git-compatible clients**.
+
+Artifacts is especially useful for agent and automation workflows where each unit of work should have its own isolated repo and token.
+
+**Prefer retrieval over memory** for current availability, authentication details, route shapes, limits, and pricing. Start at `https://developers.cloudflare.com/artifacts/`.
+
+## When to Use Artifacts
+
+| Need | Use | Why |
+| ----------------------------------------------------------------------------------- | ------------- | ----------------------------------------------------------------------------------------------------------------- |
+| Versioned file trees such as repos, build outputs, checkpoints, or generated assets | Artifacts | Artifacts stores and shares **versioned filesystem content** |
+| A git-compatible workflow with `clone`, `fetch`, `pull`, or `push` | Artifacts | Artifacts exposes **git-over-HTTPS remotes** and repo-scoped tokens |
+| The same artifact accessible from Workers, HTTP APIs, and developer tooling | Artifacts | Artifacts is available through a **Workers binding**, **REST API**, and **git-compatible interface** |
+| Large files by object key, app config by key, or relational app data | R2, KV, or D1 | Use storage products directly when you need **objects, key-value entries, or SQL rows**, not versioned file trees |
+
+## Recommended Workflow
+
+- Create one repo per agent, session, user workspace, or task when work should stay isolated.
+- Fork from a stable baseline when many repos need the same starter files or prompts.
+- Use branches only when collaborators share the same lifecycle and need to work in one repo.
+- Use namespaces to separate environments, teams, or high-rate workloads.
+
+## Quick Start
+
+**From a Worker:**
+
+```typescript
+interface Env {
+ ARTIFACTS: Artifacts;
+}
+
+const created = await env.ARTIFACTS.create('starter-repo');
+// created.remote -> git remote URL
+// created.token -> initial repo token
+```
+
+**From the REST API:**
+
+Use the namespace-scoped Artifacts base URL plus a gateway JWT. For imports from existing HTTPS remotes, use the REST API rather than the Workers binding.
+
+## Reading Order
+
+| Task | Read |
+| --------------------------------------------- | --------------------------------------------------------------- |
+| Decide whether Artifacts is the right product | README only |
+| Create or manage repos from a Worker | README → configuration.md → api.md |
+| Integrate Artifacts from an external system | README → api.md |
+| Set up agent or sandbox workflows | README → configuration.md |
+| Verify exact auth, routes, limits, or pricing | Live docs first: `https://developers.cloudflare.com/artifacts/` |
+
+## In This Reference
+
+- **[api.md](api.md)** - Workers binding methods, REST routes, token and repo operations
+- **[configuration.md](configuration.md)** - Wrangler binding shape, Worker typing, REST configuration guidance
+
+## See Also
+
+- [Cloudflare Artifacts Docs](https://developers.cloudflare.com/artifacts/)
+- [Artifacts Git Protocol Docs](https://developers.cloudflare.com/artifacts/api/git-protocol/)
+- [ArtifactFS Docs](https://developers.cloudflare.com/artifacts/guides/artifact-fs/)
+- [Cloudflare Workers Docs](https://developers.cloudflare.com/workers/)
+- [Cloudflare Durable Objects Docs](https://developers.cloudflare.com/durable-objects/)
+- [Cloudflare R2 Docs](https://developers.cloudflare.com/r2/)
+- [Cloudflare D1 Docs](https://developers.cloudflare.com/d1/)
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/artifacts/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/artifacts/api.md
new file mode 100644
index 0000000..fcc685f
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/artifacts/api.md
@@ -0,0 +1,129 @@
+# Artifacts API Reference
+
+Use Artifacts through the **Workers binding**, the **REST control plane**, and **Git-compatible remotes**.
+
+**Prefer retrieval** for exact request and response details. Verify current behavior at `https://developers.cloudflare.com/artifacts/` before relying on specific auth flows, route details, or generated binding types.
+
+## Workers Binding
+
+Artifacts exposes a Worker binding on `env.ARTIFACTS`.
+
+### Namespace Methods
+
+| Method | Use For |
+| --------------------- | ------------------------------------------------------ |
+| `create(name, opts?)` | Create a repo and receive its initial remote and token |
+| `get(name)` | Resolve a repo handle for repo-scoped operations |
+| `list(opts?)` | List repos in a namespace |
+| `delete(name)` | Delete a repo |
+
+```typescript
+const created = await env.ARTIFACTS.create('starter-repo', {
+ description: 'Repository for automation experiments',
+ setDefaultBranch: 'main'
+});
+const repo = await env.ARTIFACTS.get('starter-repo');
+const page = await env.ARTIFACTS.list({ limit: 10 });
+```
+
+Use the REST API when you need to import a repo from another HTTPS remote.
+
+### Repo Handle Methods
+
+Use a repo handle returned by `get()` or `create()`.
+
+| Method | Use For |
+| --------------------------- | -------------------------------------------- |
+| `info()` | Read repo metadata, including the remote URL |
+| `createToken(scope?, ttl?)` | Mint a repo-scoped read or write token |
+| `listTokens()` | Inspect active tokens |
+| `validateToken(token)` | Check whether a token is still valid |
+| `revokeToken(tokenOrId)` | Revoke a token by ID or value |
+| `fork(name, opts?)` | Fork one repo into another |
+
+```typescript
+const repo = await env.ARTIFACTS.get('starter-repo');
+if (!repo) throw new Error('Repo not found');
+
+const info = await repo.info();
+const token = await repo.createToken('read', 3600);
+const forked = await repo.fork('starter-repo-copy', {
+ defaultBranchOnly: true
+});
+```
+
+### Binding Notes
+
+- Current docs describe the runtime binding surface as `create`, `get`, `list`, `delete`, and repo-handle methods like `info`, `createToken`, and `fork`.
+- Use `npx wrangler types` in the target project and treat the generated `worker-configuration.d.ts` as the source of truth for that environment.
+- If generated types appear to expose `import()` or a different `get()` shape, verify the live docs before depending on those methods.
+
+Verify current runtime behavior in the live docs before depending on methods that are not shown in the Workers binding reference.
+
+## REST API
+
+Artifacts currently documents a namespace-scoped control plane:
+
+```txt
+https://artifacts.cloudflare.net/v1/api/namespaces/$ARTIFACTS_NAMESPACE
+```
+
+Some deployments also expose an `/edge/v1/api/...` base path. Verify the correct base URL for your environment in the live docs.
+
+Requests to the standard `/v1/api/...` routes use a **gateway JWT** with Bearer authentication.
+
+Returned repo tokens authenticate **Git operations** against the repo `remote`. They do not authenticate REST control-plane requests.
+
+Current docs show the standard Cloudflare v4 response envelope around REST results.
+
+### Repo Routes
+
+| Route | Use For |
+| -------------------------- | ----------------------------- |
+| `POST /repos` | Create a repo |
+| `GET /repos` | List repos |
+| `GET /repos/:name` | Read repo metadata and remote |
+| `DELETE /repos/:name` | Delete a repo |
+| `POST /repos/:name/fork` | Fork a repo |
+| `POST /repos/:name/import` | Import a public HTTPS remote |
+
+```bash
+curl --request POST "$ARTIFACTS_BASE_URL/repos" \
+ --header "Authorization: Bearer $ARTIFACTS_JWT" \
+ --header "Content-Type: application/json" \
+ --data '{"name":"starter-repo"}'
+```
+
+Important current details from the docs draft:
+
+- `POST /repos/:name/import` accepts a full HTTPS remote URL such as GitHub or GitLab.
+- Import supports options such as `branch`, `depth`, and `read_only`.
+- Repo metadata includes fields such as description, default branch, timestamps, and the Git `remote`.
+
+### Token Routes
+
+| Route | Use For |
+| ------------------------- | ------------------------- |
+| `GET /repos/:name/tokens` | List repo tokens |
+| `POST /tokens` | Create a token for a repo |
+| `DELETE /tokens/:id` | Revoke a token by ID |
+
+Current docs show list-token filtering and pagination by token state. Retrieve the exact query shape from the live docs when you need token audit or cleanup workflows.
+
+Use **read** tokens for clone, fetch, pull, and indexing workflows. Use **write** tokens only when a workflow must push or otherwise mutate a repo.
+
+## Git-Compatible Access
+
+Artifacts returns repo `remote` URLs that work with standard git-over-HTTPS tooling.
+
+Recommended current auth pattern for local workflows:
+
+```bash
+git -c http.extraHeader="Authorization: Bearer $ARTIFACTS_TOKEN" clone "$ARTIFACTS_REMOTE" artifacts-clone
+```
+
+Use a self-contained Basic-auth remote only for short-lived commands that need credentials embedded in the URL.
+
+`read` tokens support `clone`, `fetch`, and `pull`. `git push` requires a `write` token.
+
+For large repos where startup time matters more than a full clone, Artifacts also documents **ArtifactFS**. Retrieve current details from `https://developers.cloudflare.com/artifacts/` when you need mount-style access.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/artifacts/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/artifacts/configuration.md
new file mode 100644
index 0000000..db7abc1
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/artifacts/configuration.md
@@ -0,0 +1,96 @@
+# Artifacts Configuration
+
+## Worker Binding
+
+Configure the `artifacts` binding in your Wrangler config:
+
+```toml
+[[artifacts]]
+binding = "ARTIFACTS"
+namespace = "default"
+```
+
+This exposes Artifacts on `env.ARTIFACTS` inside your Worker.
+
+If you authenticate with `wrangler login`, current docs say Wrangler requests `artifacts:write` by default.
+
+## TypeScript
+
+Regenerate Worker types after adding the binding:
+
+```bash
+npx wrangler types
+```
+
+Use the generated binding type in your environment definition:
+
+```typescript
+interface Env {
+ ARTIFACTS: Artifacts;
+}
+```
+
+Wrangler generates the `Artifacts` type from the binding. Treat the generated `worker-configuration.d.ts` file as the source of truth for your environment.
+
+## Structure Repos for Isolation
+
+Artifacts works best when autonomous work is isolated:
+
+- Create one repo per agent, session, sandbox, or task when work should stay separate.
+- Fork from a reviewed baseline instead of copying starter files into every new repo.
+- Use branches only when collaborators share the same lifecycle and need to work in one repo.
+- Use namespaces to separate environments, teams, or high-rate workloads.
+
+## REST Configuration
+
+For external systems, configure the namespace-scoped base URL and gateway JWT:
+
+```bash
+export ARTIFACTS_NAMESPACE="default"
+export ARTIFACTS_JWT=""
+export ARTIFACTS_BASE_URL="https://artifacts.cloudflare.net/v1/api/namespaces/$ARTIFACTS_NAMESPACE"
+```
+
+Some environments also expose an `/edge/v1/api/...` base path. Verify the correct host and base path in the live docs for your Artifacts environment.
+
+Use environment variables or your secret manager. Do not hardcode gateway JWTs or repo tokens.
+
+## Repo Tokens
+
+Artifacts workflows usually involve repo-scoped tokens returned by `create()` or minted later through the binding or REST API.
+
+Keep the control plane and data plane separate:
+
+- Use the **Workers binding** or **REST API** with a gateway JWT to create repos and mint tokens.
+- Use repo-scoped tokens only for **Git operations** against the returned `remote`.
+
+Recommended handling:
+
+- Mint the narrowest scope you need: `read` or `write`
+- Prefer short-lived tokens for handoff between systems
+- Revoke tokens that are no longer needed
+
+Verify the current token behavior and auth guidance in `https://developers.cloudflare.com/artifacts/` before building long-lived automation.
+
+## Git Consumers
+
+Artifacts is designed to work with standard git-over-HTTPS clients once you have a repo `remote` and an access token.
+
+Prefer header-based auth for local tooling so the full token stays out of the remote URL:
+
+```bash
+git -c http.extraHeader="Authorization: Bearer $ARTIFACTS_TOKEN" clone "$ARTIFACTS_REMOTE" artifacts-clone
+```
+
+Use a Basic-auth remote only for short-lived commands that need a self-contained URL.
+
+## Retrieval Checklist
+
+Check the live docs before relying on:
+
+- the current Workers binding surface
+- exact token formats
+- availability or product status
+- route details for import, fork, and token-management flows
+- the correct control-plane host or `/edge/v1` base path for your environment
+- platform limits or pricing
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/bindings/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/bindings/README.md
new file mode 100644
index 0000000..12d05ed
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/bindings/README.md
@@ -0,0 +1,16 @@
+# Cloudflare Workers Bindings
+
+Bindings grant a Worker access to configured resources through its environment. Prefer a product's binding for supported operations inside Workers; use the REST API when the caller or operation requires it.
+
+Read the relevant current documentation before implementing. These references route to maintained APIs and configuration rather than copying binding catalogs, type tables, or limits.
+
+## Start here
+
+- [Bindings overview and catalog](https://developers.cloudflare.com/workers/runtime-apis/bindings/): capability model, available products, environment access, and binding lifecycle.
+- [Storage options](https://developers.cloudflare.com/workers/platform/storage-options/): choose storage from consistency, query, and coordination requirements.
+- [api.md](./api.md): environment access, generated types, and product APIs.
+- [configuration.md](./configuration.md): binding configuration, environments, secrets, and local development.
+- [patterns.md](./patterns.md): Worker-to-Worker calls, testing, and resource selection.
+- [gotchas.md](./gotchas.md): missing bindings, stale clients, development differences, and limits.
+
+Treat each binding as a capability granted to code. Select only the resources the Worker needs, and confirm which environment and resource each binding targets before using it.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/bindings/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/bindings/api.md
new file mode 100644
index 0000000..9a171e2
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/bindings/api.md
@@ -0,0 +1,19 @@
+# Bindings API Reference
+
+Fetch the relevant documentation before choosing method signatures, binding types, or type-generation settings.
+
+| Task | Current documentation |
+| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Access bindings in handlers, entrypoint classes, or imported `env` | [Bindings and environment access](https://developers.cloudflare.com/workers/runtime-apis/bindings/) |
+| Generate environment and runtime types; configure TypeScript or migrate from `@cloudflare/workers-types` | [Workers TypeScript](https://developers.cloudflare.com/workers/languages/typescript/) |
+| Use framework-specific environment access | [Hono on Workers](https://developers.cloudflare.com/workers/framework-guides/web-apps/more-web-frameworks/hono/) (follow the framework's linked documentation) |
+| Read, write, delete, and list KV keys | [KV Workers API](https://developers.cloudflare.com/kv/api/) |
+| Read, write, delete, and list R2 objects | [R2 Workers API](https://developers.cloudflare.com/r2/api/workers/workers-api-reference/) |
+| Prepare and bind SQL statements or execute batches | [D1 Workers Binding API](https://developers.cloudflare.com/d1/worker-api/) |
+| Address Durable Objects and call their methods | [Durable Objects API](https://developers.cloudflare.com/durable-objects/api/) |
+| Send queue messages | [Queues JavaScript APIs](https://developers.cloudflare.com/queues/configuration/javascript-apis/) |
+| Run model inference | [Workers AI bindings](https://developers.cloudflare.com/workers-ai/configuration/bindings/) |
+| Call another Worker using HTTP or typed RPC | [Service bindings](https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/) and [RPC TypeScript](https://developers.cloudflare.com/workers/runtime-apis/rpc/typescript/) |
+| Find other product binding APIs, including Browser, mTLS, rate limiting, and Workflows | [Current binding catalog](https://developers.cloudflare.com/workers/runtime-apis/bindings/) |
+
+Regenerate types after configuration changes and use the selected environment's configuration. Follow the current TypeScript setup for the project's toolchain instead of hardcoding a generated declaration path or maintaining a handwritten binding interface. Types describe the expected bindings; they do not provision resources or prove the deployed environment is configured correctly.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/bindings/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/bindings/configuration.md
new file mode 100644
index 0000000..c0db15d
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/bindings/configuration.md
@@ -0,0 +1,20 @@
+# Binding Configuration
+
+Confirm the target account, environment, and resource before adding or changing a binding. Keep staging and production resources separate where their data or permissions must be isolated.
+
+| Task | Current documentation |
+| ----------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Configure storage, compute, platform, and service bindings | [Wrangler binding configuration](https://developers.cloudflare.com/workers/wrangler/configuration/#bindings) |
+| Create or inspect resources and manage deployments | [Wrangler commands](https://developers.cloudflare.com/workers/wrangler/commands/) (select the product's commands) |
+| Configure named environments and non-inheritable bindings | [Wrangler environments](https://developers.cloudflare.com/workers/wrangler/environments/) |
+| Set non-sensitive configuration | [Environment variables](https://developers.cloudflare.com/workers/configuration/environment-variables/) |
+| Set or rotate credentials in a chosen environment | [Secrets](https://developers.cloudflare.com/workers/configuration/secrets/) |
+| Configure text, data, and Wasm modules in existing projects | [Wrangler bundling](https://developers.cloudflare.com/workers/wrangler/bundling/) and [configuration](https://developers.cloudflare.com/workers/wrangler/configuration/) |
+| Choose locally simulated resources or remote bindings | [Local development](https://developers.cloudflare.com/workers/local-development/) and [supported bindings per development mode](https://developers.cloudflare.com/workers/local-development/bindings-per-env/) |
+| Supply local variables and secrets | [Local environment variables and secrets](https://developers.cloudflare.com/workers/local-development/environment-variables/) |
+| Seed or persist local resource data | [Adding local data](https://developers.cloudflare.com/workers/local-development/local-data/) |
+| Generate types after configuring bindings | [Workers TypeScript](https://developers.cloudflare.com/workers/languages/typescript/) |
+
+Bindings and variables are not inherited automatically by named environments. Configure the required values for the environment being used, including its secrets. Binding names used in code must match configuration; the target resource's ID or name is a separate value.
+
+Keep credentials out of committed variables and local secret files out of version control. Remote development can access real resources: verify the target rather than assuming that running locally isolates writes.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/bindings/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/bindings/gotchas.md
new file mode 100644
index 0000000..fac635f
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/bindings/gotchas.md
@@ -0,0 +1,18 @@
+# Binding Gotchas and Troubleshooting
+
+Start by checking the binding name, selected environment, and actual target resource. Regenerating types alone does not fix a missing runtime binding.
+
+| Symptom or question | What to check |
+| ----------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| A binding is undefined or points to unexpected data | [Binding configuration](https://developers.cloudflare.com/workers/wrangler/configuration/#bindings) and [environment inheritance](https://developers.cloudflare.com/workers/wrangler/environments/) |
+| TypeScript cannot find a binding or runtime type | [Current type generation and TypeScript setup](https://developers.cloudflare.com/workers/languages/typescript/) |
+| Updated credentials are not reflected in a client | [Binding changes and retained global state](https://developers.cloudflare.com/workers/runtime-apis/bindings/#making-changes-to-bindings); verify the [secret's environment and deployment](https://developers.cloudflare.com/workers/configuration/secrets/) |
+| Binding calls fail outside a handler | [Environment access and global-scope restrictions](https://developers.cloudflare.com/workers/runtime-apis/bindings/#how-to-access-env) |
+| A service target is unavailable or incorrect | [Service bindings](https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/) and [multi-Worker development](https://developers.cloudflare.com/workers/local-development/multi-workers/) |
+| Local data, secrets, or available bindings differ from deployment | [Development mode support](https://developers.cloudflare.com/workers/local-development/bindings-per-env/), [local data](https://developers.cloudflare.com/workers/local-development/local-data/), and [local secrets](https://developers.cloudflare.com/workers/local-development/environment-variables/) |
+| KV reads appear stale or return no value | [How KV works](https://developers.cloudflare.com/kv/concepts/how-kv-works/); verify the namespace and handle missing values |
+| Resource-specific API errors or limits | Follow the product from the [binding catalog](https://developers.cloudflare.com/workers/runtime-apis/bindings/) to its troubleshooting and limits documentation |
+| Worker resource limits or unexpected charges | [Workers limits](https://developers.cloudflare.com/workers/platform/limits/) and [pricing](https://developers.cloudflare.com/workers/platform/pricing/); check each bound product's limits and pricing separately |
+| Need to inspect configuration, resources, deployments, or logs | [Wrangler commands](https://developers.cloudflare.com/workers/wrangler/commands/) and [real-time logs](https://developers.cloudflare.com/workers/observability/logs/real-time-logs/) |
+
+Never log secret values or return the environment object in a response. Inspect names and configuration without exposing credentials. Check the selected resource and development mode before issuing debugging commands that could mutate remote data.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/bindings/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/bindings/patterns.md
new file mode 100644
index 0000000..f71d424
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/bindings/patterns.md
@@ -0,0 +1,20 @@
+# Binding Patterns
+
+Choose the interaction and lifecycle first, then retrieve the implementation guide.
+
+| Task | Current documentation |
+| --------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Choose HTTP forwarding or RPC between Workers | [Service bindings](https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/) |
+| Forward Requests and Responses through a service binding | [Service bindings over HTTP](https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/http/) |
+| Expose callable methods with `WorkerEntrypoint` | [Service bindings over RPC](https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/rpc/) and [RPC TypeScript](https://developers.cloudflare.com/workers/runtime-apis/rpc/typescript/) |
+| Run connected Workers during development | [Developing with multiple Workers](https://developers.cloudflare.com/workers/local-development/multi-workers/) |
+| Test handlers against configured bindings and mock dependencies | [Workers Vitest configuration](https://developers.cloudflare.com/workers/testing/vitest-integration/configuration/) and [test APIs](https://developers.cloudflare.com/workers/testing/vitest-integration/test-apis/) |
+| Select KV, D1, R2, or Durable Objects | [Storage options](https://developers.cloudflare.com/workers/platform/storage-options/) |
+| Keep clients current when bindings change | [Binding lifecycle](https://developers.cloudflare.com/workers/runtime-apis/bindings/#making-changes-to-bindings) |
+| Manage credentials used by external API clients | [Secrets](https://developers.cloudflare.com/workers/configuration/secrets/) |
+
+Use service bindings for internal Worker calls when appropriate, and choose HTTP or RPC based on the interface being exposed. A service binding does not replace application-level authorization for the caller's requested operation.
+
+Choose storage based on access patterns and consistency requirements, not copied size or latency thresholds. Parallelize independent binding operations when useful; preserve ordering where one operation depends on another's result.
+
+Avoid retaining clients derived from mutable bindings across requests without accounting for binding updates. Importing `env` is supported, but binding I/O still requires an appropriate execution context; follow the lifecycle guide rather than assuming all global access is forbidden.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/bot-management/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/bot-management/README.md
new file mode 100644
index 0000000..6206851
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/bot-management/README.md
@@ -0,0 +1,95 @@
+# Cloudflare Bot Management
+
+Enterprise-grade bot detection, protection, and mitigation using ML/heuristics, bot scores, JavaScript detections, and verified bot handling.
+
+## Overview
+
+Bot Management provides multi-tier protection:
+
+- **Free (Bot Fight Mode)**: Auto-blocks definite bots, no config
+- **Pro/Business (Super Bot Fight Mode)**: Configurable actions, static resource protection, analytics groupings
+- **Enterprise (Bot Management)**: Granular 1-99 scores, WAF integration, JA3/JA4 fingerprinting, Workers API, Advanced Analytics
+
+## Quick Start
+
+```txt
+# Dashboard: Security > Bots
+# Enterprise: Deploy rule template
+(cf.bot_management.score eq 1 and not cf.bot_management.verified_bot) → Block
+(cf.bot_management.score le 29 and not cf.bot_management.verified_bot) → Managed Challenge
+```
+
+## What Do You Need?
+
+```txt
+├─ Initial setup → configuration.md
+│ ├─ Free tier → "Bot Fight Mode"
+│ ├─ Pro/Business → "Super Bot Fight Mode"
+│ └─ Enterprise → "Bot Management for Enterprise"
+├─ Workers API integration → api.md
+├─ WAF rules → patterns.md
+├─ Debugging → gotchas.md
+└─ Analytics → api.md#bot-analytics
+```
+
+## Reading Order
+
+| Task | Files to Read |
+| --------------------- | ------------------------- |
+| Enable bot protection | README → configuration.md |
+| Workers bot detection | README → api.md |
+| WAF rule templates | README → patterns.md |
+| Debug bot issues | gotchas.md |
+| Advanced analytics | api.md#bot-analytics |
+
+## Core Concepts
+
+**Bot Scores**: 1-99 (1 = definitely automated, 99 = definitely human). Threshold: <30 indicates bot traffic. Enterprise gets granular 1-99; Pro/Business get groupings only.
+
+**Detection Engines**: Heuristics (known fingerprints, assigns score=1), ML (majority of detections, supervised learning on billions of requests), Anomaly Detection (optional, baseline traffic analysis), JavaScript Detections (headless browser detection).
+
+**Verified Bots**: Allowlisted good bots (search engines, AI crawlers) verified via reverse DNS or Web Bot Auth. Access via `cf.bot_management.verified_bot` or `cf.verified_bot_category`.
+
+## Platform Limits
+
+| Plan | Bot Scores | JA3/JA4 | Custom Rules | Analytics Retention |
+| ------------ | -------------------- | ------- | ------------ | -------------------------- |
+| Free | No (auto-block only) | No | 5 | N/A (no analytics) |
+| Pro/Business | Groupings only | No | 20/100 | 30 days (72h at a time) |
+| Enterprise | 1-99 granular | Yes | 1,000+ | 30 days (1 week at a time) |
+
+## Basic Patterns
+
+```typescript
+// Workers: Check bot score
+export default {
+ async fetch(request: Request): Promise {
+ const botScore = request.cf?.botManagement?.score;
+ if (botScore && botScore < 30 && !request.cf?.botManagement?.verifiedBot) {
+ return new Response('Bot detected', { status: 403 });
+ }
+ return fetch(request);
+ }
+};
+```
+
+```txt
+# WAF: Block definite bots
+(cf.bot_management.score eq 1 and not cf.bot_management.verified_bot)
+
+# WAF: Protect sensitive endpoints
+(cf.bot_management.score lt 50 and http.request.uri.path in {"/login" "/checkout"} and not cf.bot_management.verified_bot)
+```
+
+## In This Reference
+
+- [configuration.md](./configuration.md) - Product tiers, WAF rule setup, JavaScript Detections, ML auto-updates
+- [api.md](./api.md) - Workers BotManagement interface, WAF fields, JA4 Signals
+- [patterns.md](./patterns.md) - E-commerce, API protection, mobile app allowlisting, SEO-friendly handling
+- [gotchas.md](./gotchas.md) - False positives/negatives, score=0 issues, JSD limitations, CSP requirements
+
+## See Also
+
+- [waf](../waf/) - WAF custom rules for bot enforcement
+- [workers](https://developers.cloudflare.com/workers/) - Workers request.cf.botManagement API
+- [api-shield](../api-shield/) - API-specific bot protection
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/bot-management/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/bot-management/api.md
new file mode 100644
index 0000000..d6d4f89
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/bot-management/api.md
@@ -0,0 +1,175 @@
+# Bot Management API
+
+## Workers: BotManagement Interface
+
+```typescript
+interface BotManagement {
+ score: number; // 1-99 (Enterprise), 0 if not computed
+ verifiedBot: boolean; // Is verified bot
+ staticResource: boolean; // Serves static resource
+ ja3Hash: string; // JA3 fingerprint (Enterprise, HTTPS only)
+ ja4: string; // JA4 fingerprint (Enterprise, HTTPS only)
+ jsDetection?: {
+ passed: boolean; // Passed JS detection (if enabled)
+ };
+ detectionIds: number[]; // Heuristic detection IDs
+ corporateProxy?: boolean; // From corporate proxy (Enterprise)
+}
+
+// DEPRECATED: Use botManagement.score instead
+// request.cf.clientTrustScore (legacy, duplicate of botManagement.score)
+
+// Access via request.cf
+import type { IncomingRequestCfProperties } from '@cloudflare/workers-types';
+
+export default {
+ async fetch(request: Request): Promise {
+ const cf = request.cf as IncomingRequestCfProperties | undefined;
+ const botMgmt = cf?.botManagement;
+
+ if (!botMgmt) return fetch(request);
+ if (botMgmt.verifiedBot) return fetch(request); // Allow verified bots
+ if (botMgmt.score === 1) return new Response('Blocked', { status: 403 });
+ if (botMgmt.score < 30) return new Response('Challenge required', { status: 429 });
+
+ return fetch(request);
+ }
+};
+```
+
+## WAF Fields Reference
+
+```txt
+# Score fields
+cf.bot_management.score # 0-99 (0 = not computed)
+cf.bot_management.verified_bot # boolean
+cf.bot_management.static_resource # boolean
+cf.bot_management.ja3_hash # string (Enterprise)
+cf.bot_management.ja4 # string (Enterprise)
+cf.bot_management.detection_ids # array
+cf.bot_management.js_detection.passed # boolean
+cf.bot_management.corporate_proxy # boolean (Enterprise)
+cf.verified_bot_category # string
+
+# Workers equivalent
+request.cf.botManagement.score
+request.cf.botManagement.verifiedBot
+request.cf.botManagement.ja3Hash
+request.cf.botManagement.ja4
+request.cf.botManagement.jsDetection.passed
+request.cf.verifiedBotCategory
+```
+
+## JA4 Signals (Enterprise)
+
+```typescript
+import type { IncomingRequestCfProperties } from '@cloudflare/workers-types';
+
+interface JA4Signals {
+ // Ratios (0.0-1.0)
+ heuristic_ratio_1h?: number; // Fraction flagged by heuristics
+ browser_ratio_1h?: number; // Fraction from real browsers
+ cache_ratio_1h?: number; // Fraction hitting cache
+ h2h3_ratio_1h?: number; // Fraction using HTTP/2 or HTTP/3
+ // Ranks (relative position in distribution)
+ uas_rank_1h?: number; // User-Agent diversity rank
+ paths_rank_1h?: number; // Path diversity rank
+ reqs_rank_1h?: number; // Request volume rank
+ ips_rank_1h?: number; // IP diversity rank
+ // Quantiles (0.0-1.0, percentile in distribution)
+ reqs_quantile_1h?: number; // Request volume quantile
+ ips_quantile_1h?: number; // IP count quantile
+}
+
+export default {
+ async fetch(request: Request): Promise {
+ const cf = request.cf as IncomingRequestCfProperties | undefined;
+ const ja4Signals = cf?.ja4Signals as JA4Signals | undefined;
+
+ if (!ja4Signals) return fetch(request); // Not available for HTTP or Worker routing
+
+ // Check for anomalous behavior
+ // High heuristic_ratio or low browser_ratio = suspicious
+ const heuristicRatio = ja4Signals.heuristic_ratio_1h ?? 0;
+ const browserRatio = ja4Signals.browser_ratio_1h ?? 0;
+
+ if (heuristicRatio > 0.5 || browserRatio < 0.3) {
+ return new Response('Suspicious traffic', { status: 403 });
+ }
+
+ return fetch(request);
+ }
+};
+```
+
+## Common Patterns
+
+See [patterns.md](./patterns.md) for Workers examples: mobile app allowlisting, corporate proxy exemption, datacenter detection, conditional delay, and more.
+
+## Bot Analytics
+
+### Access Locations
+
+- Dashboard: Security > Bots (old) or Security > Analytics > Bot analysis (new)
+- GraphQL API for programmatic access
+- Security Events & Security Analytics
+- Logpush/Logpull
+
+### Available Data
+
+- **Enterprise BM**: Bot scores (1-99), bot score source, distribution
+- **Pro/Business**: Bot groupings (automated, likely automated, likely human)
+- Top attributes: IPs, paths, user agents, countries
+- Detection sources: Heuristics, ML, AD, JSD
+- Verified bot categories
+
+### Time Ranges
+
+- **Enterprise BM**: Up to 1 week at a time, 30 days history
+- **Pro/Business**: Up to 72 hours at a time, 30 days history
+- Real-time in most cases, adaptive sampling (1-10% depending on volume)
+
+## Logpush Fields
+
+```txt
+BotScore # 1-99 or 0 if not computed
+BotScoreSrc # Detection engine (ML, Heuristics, etc.)
+BotTags # Classification tags
+BotDetectionIDs # Heuristic detection IDs
+```
+
+**BotScoreSrc values:**
+
+- `"Heuristics"` - Known fingerprint
+- `"Machine Learning"` - ML model
+- `"Anomaly Detection"` - Baseline anomaly
+- `"JS Detection"` - JavaScript check
+- `"Cloudflare Service"` - Zero Trust
+- `"Not Computed"` - Score = 0
+
+Access via Logpush (stream to cloud storage/SIEM), Logpull (API to fetch logs), or GraphQL API (query analytics data).
+
+## Testing with Miniflare
+
+Miniflare provides mock botManagement data for local development:
+
+**Default values:**
+
+- `score: 99` (human)
+- `verifiedBot: false`
+- `corporateProxy: false`
+- `ja3Hash: "25b4882c2bcb50cd6b469ff28c596742"`
+- `staticResource: false`
+- `detectionIds: []`
+
+**Override in tests:**
+
+```typescript
+import { getPlatformProxy } from 'wrangler';
+
+const { cf, dispose } = await getPlatformProxy();
+// cf.botManagement is frozen mock object
+expect(cf.botManagement.score).toBe(99);
+```
+
+For custom test data, mock request.cf in your test setup.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/bot-management/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/bot-management/configuration.md
new file mode 100644
index 0000000..90f8832
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/bot-management/configuration.md
@@ -0,0 +1,175 @@
+# Bot Management Configuration
+
+## Product Tiers
+
+**Note:** Dashboard paths differ between old and new UI:
+
+- **New:** Security > Settings > Filter "Bot traffic"
+- **Old:** Security > Bots
+
+Both UIs access same settings.
+
+### Bot Score Groupings (Pro/Business)
+
+Pro/Business users see bot score groupings instead of granular 1-99 scores:
+
+| Score | Grouping | Meaning |
+| ----- | ---------------- | ------------------------------ |
+| 0 | Not computed | Bot Management didn't run |
+| 1 | Automated | Definite bot (heuristic match) |
+| 2-29 | Likely automated | Probably bot (ML detection) |
+| 30-99 | Likely human | Probably human |
+| N/A | Verified bot | Allowlisted good bot |
+
+Enterprise plans get granular 1-99 scores for custom thresholds.
+
+### Bot Fight Mode (Free)
+
+- Auto-blocks definite bots (score=1), excludes verified bots by default
+- JavaScript Detections always enabled, no configuration options
+
+### Super Bot Fight Mode (Pro/Business)
+
+```txt
+Dashboard: Security > Bots > Configure
+- Definitely automated: Block/Challenge
+- Likely automated: Challenge/Allow
+- Verified bots: Allow (recommended)
+- Static resource protection: ON (may block mail clients)
+- JavaScript Detections: Optional
+```
+
+### Bot Management for Enterprise
+
+```txt
+Dashboard: Security > Bots > Configure > Auto-updates: ON (recommended)
+
+# Template 1: Block definite bots
+(cf.bot_management.score eq 1 and not cf.bot_management.verified_bot and not cf.bot_management.static_resource)
+Action: Block
+
+# Template 2: Challenge likely bots
+(cf.bot_management.score ge 2 and cf.bot_management.score le 29 and not cf.bot_management.verified_bot and not cf.bot_management.static_resource)
+Action: Managed Challenge
+```
+
+## JavaScript Detections Setup
+
+### Enable via Dashboard
+
+```txt
+Security > Bots > Configure Bot Management > JS Detections: ON
+
+Update CSP: script-src 'self' /cdn-cgi/challenge-platform/;
+```
+
+### Manual JS Injection (API)
+
+```html
+
+
+```
+
+**Use API for**: Selective deployment on specific pages
+**Don't combine**: Zone-wide toggle + manual injection
+
+### WAF Rules for JSD
+
+```txt
+# NEVER use on first page visit (needs HTML page first)
+(not cf.bot_management.js_detection.passed and http.request.uri.path eq "/api/user/create" and http.request.method eq "POST" and not cf.bot_management.verified_bot)
+Action: Managed Challenge (always use Managed Challenge, not Block)
+```
+
+### Limitations
+
+- First request won't have JSD data (needs HTML page first)
+- Strips ETags from HTML responses
+- Not supported with CSP via `` tags
+- Websocket endpoints not supported
+- Native mobile apps won't pass
+- cf_clearance cookie: 15-minute lifespan, max 4096 bytes
+
+## __cf_bm Cookie
+
+Cloudflare sets `__cf_bm` cookie to smooth bot scores across user sessions:
+
+- **Purpose:** Reduces false positives from score volatility
+- **Scope:** Per-domain, HTTP-only
+- **Lifespan:** Session duration
+- **Privacy:** No PII—only session classification
+- **Automatic:** No configuration required
+
+Bot scores for repeat visitors consider session history via this cookie.
+
+## Static Resource Protection
+
+**File Extensions**: ico, jpg, png, jpeg, gif, css, js, tif, tiff, bmp, pict, webp, svg, svgz, class, jar, txt, csv, doc, docx, xls, xlsx, pdf, ps, pls, ppt, pptx, ttf, otf, woff, woff2, eot, eps, ejs, swf, torrent, midi, mid, m3u8, m4a, mp3, ogg, ts
+**Plus**: `/.well-known/` path (all files)
+
+```txt
+# Exclude static resources from bot rules
+(cf.bot_management.score lt 30 and not cf.bot_management.static_resource)
+```
+
+**WARNING**: May block mail clients fetching static images
+
+## JA3/JA4 Fingerprinting (Enterprise)
+
+```txt
+# Block specific attack fingerprint
+(cf.bot_management.ja3_hash eq "8b8e3d5e3e8b3d5e")
+
+# Allow mobile app by fingerprint
+(cf.bot_management.ja4 eq "your_mobile_app_fingerprint")
+```
+
+Only available for HTTPS/TLS traffic. Missing for Worker-routed traffic or HTTP requests.
+
+## Verified Bot Categories
+
+```txt
+# Allow search engines only
+(cf.verified_bot_category eq "Search Engine Crawler")
+
+# Block AI crawlers
+(cf.verified_bot_category eq "AI Crawler")
+Action: Block
+
+# Or use dashboard: Security > Settings > Bot Management > Block AI Bots
+```
+
+| Category | String Value | Example |
+| ----------------------- | ---------------------------- | ------------------------------ |
+| AI Crawler | `AI Crawler` | GPTBot, Claude-Web |
+| AI Assistant | `AI Assistant` | Perplexity-User, DuckAssistBot |
+| AI Search | `AI Search` | OAI-SearchBot |
+| Accessibility | `Accessibility` | Accessible Web Bot |
+| Academic Research | `Academic Research` | Library of Congress |
+| Advertising & Marketing | `Advertising & Marketing` | Google Adsbot |
+| Aggregator | `Aggregator` | Pinterest, Indeed |
+| Archiver | `Archiver` | Internet Archive, CommonCrawl |
+| Feed Fetcher | `Feed Fetcher` | RSS/Podcast updaters |
+| Monitoring & Analytics | `Monitoring & Analytics` | Uptime monitors |
+| Page Preview | `Page Preview` | Facebook/Slack link preview |
+| SEO | `Search Engine Optimization` | Google Lighthouse |
+| Security | `Security` | Vulnerability scanners |
+| Social Media Marketing | `Social Media Marketing` | Brandwatch |
+| Webhooks | `Webhooks` | Payment processors |
+| Other | `Other` | Uncategorized bots |
+
+## Best Practices
+
+- **ML Auto-Updates**: Enable on Enterprise for latest models
+- **Start with Managed Challenge**: Test before blocking
+- **Always exclude verified bots**: Use `not cf.bot_management.verified_bot`
+- **Exempt corporate proxies**: For B2B traffic via `cf.bot_management.corporate_proxy`
+- **Use static resource exception**: Improves performance, reduces overhead
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/bot-management/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/bot-management/gotchas.md
new file mode 100644
index 0000000..a15acd5
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/bot-management/gotchas.md
@@ -0,0 +1,116 @@
+# Bot Management Gotchas
+
+## Common Errors
+
+### "Bot Score = 0"
+
+**Cause:** Bot Management didn't run (internal Cloudflare request, Worker routing to zone (Orange-to-Orange), or request handled before BM (Redirect Rules, etc.))
+**Solution:** Check request flow and ensure Bot Management runs in request lifecycle
+
+### "JavaScript Detections Not Working"
+
+**Cause:** `js_detection.passed` always false or undefined due to: CSP headers don't allow `/cdn-cgi/challenge-platform/`, using on first page visit (needs HTML page first), ad blockers or disabled JS, JSD not enabled in dashboard, or using Block action (must use Managed Challenge)
+**Solution:** Add CSP header `Content-Security-Policy: script-src 'self' /cdn-cgi/challenge-platform/;` and ensure JSD is enabled with Managed Challenge action
+
+### "False Positives (Legitimate Users Blocked)"
+
+**Cause:** Bot detection incorrectly flagging legitimate users
+**Solution:** Check Bot Analytics for affected IPs/paths, identify detection source (ML, Heuristics, etc.), create exception rule like `(cf.bot_management.score lt 30 and http.request.uri.path eq "/problematic-path")` with Action: Skip (Bot Management), or allowlist by IP/ASN/country
+
+### "False Negatives (Bots Not Caught)"
+
+**Cause:** Bots bypassing detection
+**Solution:** Lower score threshold (30 → 50), enable JavaScript Detections, add JA3/JA4 fingerprinting rules, or use rate limiting as fallback
+
+### "Verified Bot Blocked"
+
+**Cause:** Search engine bot blocked by WAF Managed Rules (not just Bot Management)
+**Solution:** Create WAF exception for specific rule ID and verify bot via reverse DNS
+
+### "Yandex Bot Blocked During IP Update"
+
+**Cause:** Yandex updates bot IPs; new IPs unrecognized for 48h during propagation
+**Solution:**
+
+1. Check Security Events for specific WAF rule ID blocking Yandex
+2. Create WAF exception:
+ ```txt
+ (http.user_agent contains "YandexBot" and ip.src in {})
+ Action: Skip (WAF Managed Ruleset)
+ ```
+3. Monitor Bot Analytics for 48h
+4. Remove exception after propagation completes
+
+Issue resolves automatically after 48h. Contact Cloudflare Support if persists.
+
+### "JA3/JA4 Missing"
+
+**Cause:** Non-HTTPS traffic, Worker routing traffic, Orange-to-Orange traffic via Worker, or Bot Management skipped
+**Solution:** JA3/JA4 only available for HTTPS/TLS traffic; check request routing
+
+**JA3/JA4 Not User-Unique:** Same browser/library version = same fingerprint
+
+- Don't use for user identification
+- Use for client profiling only
+- Fingerprints change with browser updates
+
+## Bot Verification Methods
+
+Cloudflare verifies bots via:
+
+1. **Reverse DNS (IP validation):** Traditional method—bot IP resolves to expected domain
+2. **Web Bot Auth:** Modern cryptographic verification—faster propagation
+
+When `verifiedBot=true`, bot passed at least one method.
+
+**Inactive verified bots:** IPs removed after 24h of no traffic.
+
+## Detection Engine Behavior
+
+| Engine | Score | Timing | Plan | Notes |
+| --------------------- | ---------- | -------------- | ---------- | ------------------------------- |
+| Heuristics | Always 1 | Immediate | All | Known fingerprints—overrides ML |
+| ML | 1-99 | Immediate | All | Majority of detections |
+| Anomaly Detection | Influences | After baseline | Enterprise | Optional, baseline analysis |
+| JavaScript Detections | Pass/fail | After JS | Pro+ | Headless browser detection |
+| Cloudflare Service | N/A | N/A | Enterprise | Zero Trust internal source |
+
+**Priority:** Heuristics > ML—if heuristic matches, score=1 regardless of ML.
+
+## Limits
+
+| Limit | Value | Notes |
+| ----------------------------- | ----------------------------------------- | ------------------------------------------- |
+| Bot Score = 0 | Means not computed | Not score = 100 |
+| First request JSD data | May not be available | JSD data appears on subsequent requests |
+| Score accuracy | Not 100% guaranteed | False positives/negatives possible |
+| JSD on first HTML page visit | Not supported | Requires subsequent page load |
+| JSD requirements | JavaScript-enabled browser | Won't work with JS disabled or ad blockers |
+| JSD ETag stripping | Strips ETags from HTML responses | May affect caching behavior |
+| JSD CSP compatibility | Requires specific CSP | Not compatible with some CSP configurations |
+| JSD meta CSP tags | Not supported | Must use HTTP headers |
+| JSD WebSocket support | Not supported | WebSocket endpoints won't work with JSD |
+| JSD mobile app support | Native apps won't pass | Only works in browsers |
+| JA3/JA4 traffic type | HTTPS/TLS only | Not available for non-HTTPS traffic |
+| JA3/JA4 Worker routing | Missing for Worker-routed traffic | Check request routing |
+| JA3/JA4 uniqueness | Not unique per user | Shared by clients with same browser/library |
+| JA3/JA4 stability | Can change with updates | Browser/library updates affect fingerprints |
+| WAF custom rules (Free) | 5 | Varies by plan |
+| WAF custom rules (Pro) | 20 | Varies by plan |
+| WAF custom rules (Business) | 100 | Varies by plan |
+| WAF custom rules (Enterprise) | 1,000+ | Varies by plan |
+| Workers CPU time | Varies by plan | Applies to bot logic |
+| Bot Analytics sampling | 1-10% adaptive | High-volume zones sampled more aggressively |
+| Bot Analytics history | 30 days max | Historical data retention limit |
+| CSP requirements for JSD | Must allow `/cdn-cgi/challenge-platform/` | Required for JSD to function |
+
+### Plan Restrictions
+
+| Feature | Free | Pro/Business | Enterprise |
+| ------------------------- | ------- | ------------ | ---------- |
+| Granular scores (1-99) | No | No | Yes |
+| JA3/JA4 | No | No | Yes |
+| Anomaly Detection | No | No | Yes |
+| Corporate Proxy detection | No | No | Yes |
+| Verified bot categories | Limited | Limited | Full |
+| Custom WAF rules | 5 | 20/100 | 1,000+ |
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/bot-management/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/bot-management/patterns.md
new file mode 100644
index 0000000..2e97012
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/bot-management/patterns.md
@@ -0,0 +1,181 @@
+# Bot Management Patterns
+
+## E-commerce Protection
+
+```txt
+# High security for checkout
+(cf.bot_management.score lt 50 and http.request.uri.path in {"/checkout" "/cart/add"} and not cf.bot_management.verified_bot and not cf.bot_management.corporate_proxy)
+Action: Managed Challenge
+```
+
+## API Protection
+
+```txt
+# Protect API with JS detection + score
+(http.request.uri.path matches "^/api/" and (cf.bot_management.score lt 30 or not cf.bot_management.js_detection.passed) and not cf.bot_management.verified_bot)
+Action: Block
+```
+
+## SEO-Friendly Bot Handling
+
+```txt
+# Allow search engine crawlers
+(cf.bot_management.score lt 30 and not cf.verified_bot_category in {"Search Engine Crawler"})
+Action: Managed Challenge
+```
+
+## Block AI Scrapers
+
+```txt
+# Block training crawlers only (allow AI assistants/search)
+(cf.verified_bot_category eq "AI Crawler")
+Action: Block
+
+# Block all AI-related bots (training + assistants + search)
+(cf.verified_bot_category in {"AI Crawler" "AI Assistant" "AI Search"})
+Action: Block
+
+# Allow AI Search, block AI Crawler and AI Assistant
+(cf.verified_bot_category in {"AI Crawler" "AI Assistant"})
+Action: Block
+
+# Or use dashboard: Security > Settings > Bot Management > Block AI Bots
+```
+
+## Rate Limiting by Bot Score
+
+```txt
+# Stricter limits for suspicious traffic
+(cf.bot_management.score lt 50)
+Rate: 10 requests per 10 seconds
+
+(cf.bot_management.score ge 50)
+Rate: 100 requests per 10 seconds
+```
+
+## Mobile App Allowlisting
+
+```txt
+# Identify mobile app by JA3/JA4
+(cf.bot_management.ja4 in {"fingerprint1" "fingerprint2"})
+Action: Skip (all remaining rules)
+```
+
+## Datacenter Detection
+
+```typescript
+import type { IncomingRequestCfProperties } from '@cloudflare/workers-types';
+
+// Low score + not corporate proxy = likely datacenter bot
+export default {
+ async fetch(request: Request): Promise {
+ const cf = request.cf as IncomingRequestCfProperties | undefined;
+ const botMgmt = cf?.botManagement;
+
+ if (botMgmt?.score && botMgmt.score < 30 && !botMgmt.corporateProxy && !botMgmt.verifiedBot) {
+ return new Response('Datacenter traffic blocked', { status: 403 });
+ }
+
+ return fetch(request);
+ }
+};
+```
+
+## Conditional Delay (Tarpit)
+
+```typescript
+import type { IncomingRequestCfProperties } from '@cloudflare/workers-types';
+
+// Add delay proportional to bot suspicion
+export default {
+ async fetch(request: Request): Promise {
+ const cf = request.cf as IncomingRequestCfProperties | undefined;
+ const botMgmt = cf?.botManagement;
+
+ if (botMgmt?.score && botMgmt.score < 50 && !botMgmt.verifiedBot) {
+ // Delay: 0-2 seconds for scores 50-0
+ const delayMs = Math.max(0, (50 - botMgmt.score) * 40);
+ await new Promise((r) => setTimeout(r, delayMs));
+ }
+
+ return fetch(request);
+ }
+};
+```
+
+## Layered Defense
+
+```txt
+1. Bot Management (score-based)
+2. JavaScript Detections (for JS-capable clients)
+3. Rate Limiting (fallback protection)
+4. WAF Managed Rules (OWASP, etc.)
+```
+
+## Progressive Enhancement
+
+```txt
+Public content: High threshold (score < 10)
+Authenticated: Medium threshold (score < 30)
+Sensitive: Low threshold (score < 50) + JSD
+```
+
+## Zero Trust for Bots
+
+```txt
+1. Default deny (all scores < 30)
+2. Allowlist verified bots
+3. Allowlist mobile apps (JA3/JA4)
+4. Allowlist corporate proxies
+5. Allowlist static resources
+```
+
+## Workers: Score + JS Detection
+
+```typescript
+import type { IncomingRequestCfProperties } from '@cloudflare/workers-types';
+
+export default {
+ async fetch(request: Request): Promise {
+ const cf = request.cf as IncomingRequestCfProperties | undefined;
+ const botMgmt = cf?.botManagement;
+ const url = new URL(request.url);
+
+ if (botMgmt?.staticResource) return fetch(request); // Skip static
+
+ // API endpoints: require JS detection + good score
+ if (url.pathname.startsWith('/api/')) {
+ const jsDetectionPassed = botMgmt?.jsDetection?.passed ?? false;
+ const score = botMgmt?.score ?? 100;
+
+ if (!jsDetectionPassed || score < 30) {
+ return new Response('Unauthorized', { status: 401 });
+ }
+ }
+
+ return fetch(request);
+ }
+};
+```
+
+## Rate Limiting by JWT Claim + Bot Score
+
+```txt
+# Enterprise: Combine bot score with JWT validation
+Rate limiting > Custom rules
+- Field: lookup_json_string(http.request.jwt.claims["{config_id}"][0], "sub")
+- Matches: user ID claim
+- Additional condition: cf.bot_management.score lt 50
+```
+
+## WAF Integration Points
+
+- **WAF Custom Rules**: Primary enforcement mechanism
+- **Rate Limiting Rules**: Bot score as dimension, stricter limits for low scores
+- **Transform Rules**: Pass score to origin via custom header
+- **Workers**: Programmatic bot logic, custom scoring algorithms
+- **Page Rules / Configuration Rules**: Zone-level overrides, path-specific settings
+
+## See Also
+
+- [gotchas.md](./gotchas.md) - Common errors, false positives/negatives, limitations
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/browser-rendering/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/browser-rendering/README.md
new file mode 100644
index 0000000..3ffaa46
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/browser-rendering/README.md
@@ -0,0 +1,18 @@
+# Browser Run (formerly Browser Rendering)
+
+Use Browser Run for screenshots, PDFs, rendered content extraction, and browser automation. Read the relevant current documentation before implementing; use the [documentation index](https://developers.cloudflare.com/browser-run/llms.txt) to discover additional guides.
+
+Choose the integration by the work and runtime:
+
+- For a self-contained screenshot, PDF, or extraction, start with Quick Actions. They are available through REST and Workers bindings; check the chosen action's supported interface.
+- For multi-step interactions or persistent state, use browser sessions. In Workers, use Cloudflare's Puppeteer or Playwright package; from external scripts or CI, use the CDP integration.
+- When adapting existing automation, preserve its library where supported and check installed versions against the corresponding guide.
+
+Read only the reference needed for the task:
+
+| Task | Reference |
+| ------------------------------------------------ | ------------------------------------ |
+| Set up bindings, dependencies, or development | [configuration.md](configuration.md) |
+| Select an endpoint or browser client API | [api.md](api.md) |
+| Implement a workflow or manage reusable sessions | [patterns.md](patterns.md) |
+| Diagnose failures or plan capacity and cost | [gotchas.md](gotchas.md) |
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/browser-rendering/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/browser-rendering/api.md
new file mode 100644
index 0000000..0a40bbc
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/browser-rendering/api.md
@@ -0,0 +1,12 @@
+# Browser Run APIs
+
+Read the guide for the chosen interface for request schemas, return types, authentication, and supported options. Keep Quick Actions and browser session APIs distinct when adapting examples.
+
+| Task | Documentation |
+| ----------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Screenshots, PDFs, HTML, scraping, or structured extraction | [Quick Actions](https://developers.cloudflare.com/browser-run/quick-actions/) — links to each action's request options and examples for REST or Workers bindings |
+| Automate a browser in Workers with Puppeteer | [Puppeteer](https://developers.cloudflare.com/browser-run/puppeteer/) — Cloudflare package, browser operations, and session APIs |
+| Automate a browser in Workers with Playwright | [Playwright](https://developers.cloudflare.com/browser-run/playwright/) — Cloudflare package, locators, storage state, and tracing |
+| Control a remote browser from an external runtime | [CDP](https://developers.cloudflare.com/browser-run/cdp/) — session endpoints and links to Puppeteer, Playwright, and other clients |
+
+The product rename does not imply a rename of API paths or token permissions. Use the identifiers shown in the selected guide.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/browser-rendering/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/browser-rendering/configuration.md
new file mode 100644
index 0000000..de1cb29
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/browser-rendering/configuration.md
@@ -0,0 +1,12 @@
+# Browser Run Configuration
+
+Check the project's runtime, installed client and Wrangler versions, and compatibility date before adapting setup instructions. Cloudflare's packages for Workers and standard clients connecting over CDP have different setup requirements.
+
+| Task | Documentation |
+| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Start a project or configure REST authentication | [Get started](https://developers.cloudflare.com/browser-run/get-started/) — Quick Actions and browser session setup |
+| Configure a Worker or choose a development mode | [Wrangler reference](https://developers.cloudflare.com/browser-run/reference/wrangler/) — browser bindings, compatibility requirements, and local/remote development |
+| Install or update a Workers browser client | [Puppeteer](https://developers.cloudflare.com/browser-run/puppeteer/) or [Playwright](https://developers.cloudflare.com/browser-run/playwright/) — package-specific setup and supported versions |
+| Connect from a script, server, or CI outside Workers | [CDP](https://developers.cloudflare.com/browser-run/cdp/) — authentication and client integration guides |
+
+Development support depends on the selected interface. Follow its current guidance rather than applying one remote-mode requirement to all Browser Run workflows.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/browser-rendering/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/browser-rendering/gotchas.md
new file mode 100644
index 0000000..283305b
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/browser-rendering/gotchas.md
@@ -0,0 +1,15 @@
+# Browser Run Troubleshooting
+
+Identify the integration and observed failure before changing timeouts or concurrency. A request-rate limit, exhausted browser time, and a closed session require different responses.
+
+| Concern | Documentation |
+| ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Quotas, launch rates, concurrency, and session timeouts | [Limits](https://developers.cloudflare.com/browser-run/limits/) — check the current plan and integration-specific limits |
+| Browser hours and concurrent-browser charges | [Pricing](https://developers.cloudflare.com/browser-run/pricing/) — distinguish Quick Actions from browser sessions |
+| Missing bindings, action failures, or unsupported behavior | [FAQ](https://developers.cloudflare.com/browser-run/faq/) — diagnose the reported error and runtime constraints |
+| Puppeteer page evaluation cannot access outer variables | [JavaScript execution](https://pptr.dev/guides/javascript-execution) — browser execution context, passing arguments, and returned values |
+| Block resources or handle intercepted Puppeteer requests | [Request interception](https://pptr.dev/guides/network-interception) — continue, respond, or abort requests and avoid duplicate handling |
+| Unexpected disconnects or session loss | [Browser close reasons](https://developers.cloudflare.com/browser-run/reference/browser-close-reasons/) — inspect the recorded close reason before choosing recovery |
+| Development or compatibility failures | [Wrangler reference](https://developers.cloudflare.com/browser-run/reference/wrangler/) — verify binding configuration and interface-specific development support |
+
+Before increasing concurrency, check session cleanup and whether the workload can reuse browsers with appropriate isolation; see [patterns.md](patterns.md). Retrieve current limits and pricing when sizing a workload rather than relying on fixed tier tables.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/browser-rendering/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/browser-rendering/patterns.md
new file mode 100644
index 0000000..3a9c72f
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/browser-rendering/patterns.md
@@ -0,0 +1,12 @@
+# Browser Run Patterns
+
+Use the current examples for the selected integration instead of translating between Puppeteer, Playwright, and Quick Actions by changing method names.
+
+| Task | Documentation |
+| -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Implement screenshots, PDFs, or extraction | [Quick Actions](https://developers.cloudflare.com/browser-run/quick-actions/) — choose the action and follow its example |
+| Build custom interactions | [Puppeteer](https://developers.cloudflare.com/browser-run/puppeteer/) or [Playwright](https://developers.cloudflare.com/browser-run/playwright/) — browser automation examples |
+| Reconnect across requests | [Reuse sessions](https://developers.cloudflare.com/browser-run/features/reuse-sessions/) — disconnect/reconnect lifecycle and when to use Durable Objects for stateful ownership |
+| Share browser capacity while isolating users | [Concurrency and session isolation](https://developers.cloudflare.com/browser-run/limits/#how-can-i-manage-concurrency-and-session-isolation-with-browser-run) — tabs, browser contexts, and capacity tradeoffs |
+
+Quick Actions manage their own session lifecycle. For sessions managed by the application, close pages and browsers on completion or failure. If reuse is intentional, follow the client's disconnect/reconnect semantics and handle expired sessions; closing the browser ends it. Keep cookies and storage isolated between users, and coordinate ownership when several requests can reconnect to the same session.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/c3/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/c3/README.md
new file mode 100644
index 0000000..590c111
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/c3/README.md
@@ -0,0 +1,112 @@
+# C3 (create-cloudflare)
+
+Official CLI for scaffolding Cloudflare Workers and Pages projects with templates, TypeScript, and instant deployment.
+
+## Quick Start
+
+```bash
+# Interactive (recommended for first-time)
+npm create cloudflare@latest my-app
+
+# Worker (API/WebSocket/Cron)
+npm create cloudflare@latest my-api -- --type=hello-world --ts
+
+# Pages (static/SSG)
+npm create cloudflare@latest my-site -- --type=web-app --framework=astro --platform=pages
+```
+
+## Platform Decision Tree
+
+```
+What are you building?
+
+├─ API / WebSocket / Cron / Email handler
+│ └─ Workers (default) - no --platform flag needed
+│ npm create cloudflare@latest my-api -- --type=hello-world
+
+├─ Static site / SSG / Documentation
+│ └─ Pages - requires --platform=pages
+│ npm create cloudflare@latest my-site -- --type=web-app --framework=astro --platform=pages
+
+├─ Full-stack app (Next.js/Remix/SvelteKit)
+│ └─ Follow the current framework guide below
+
+└─ Convert existing project
+ └─ npm create cloudflare@latest . -- --type=pre-existing --existing-script=./src/worker.ts
+```
+
+**Critical:** Pages projects require `--platform=pages` flag. Without it, C3 defaults to Workers.
+
+## Framework Setup
+
+Fetch the [Workers framework guide](https://developers.cloudflare.com/workers/framework-guides/) for the chosen framework before scaffolding or adapting an existing app. For Next.js, follow [Next.js on Workers](https://developers.cloudflare.com/workers/framework-guides/web-apps/nextjs/); use the [Pages static export guide](https://developers.cloudflare.com/pages/framework-guides/nextjs/deploy-a-static-nextjs-site/) only when targeting a Next.js static export on Pages.
+
+## Interactive Flow
+
+When run without flags, C3 prompts in this order:
+
+1. **Project name** - Directory to create (defaults to current dir with `.`)
+2. **Application type** - `hello-world`, `web-app`, `demo`, `pre-existing`, `remote-template`
+3. **Platform** - `workers` (default) or `pages` (for web apps only)
+4. **Framework** - If web-app: `next`, `remix`, `astro`, `react-router`, `solid`, `svelte`, etc.
+5. **TypeScript** - `yes` (recommended) or `no`
+6. **Git** - Initialize repository? `yes` or `no`
+7. **Deploy** - Deploy now? `yes` or `no` (requires `wrangler login`)
+
+## Installation Methods
+
+```bash
+# NPM
+npm create cloudflare@latest
+
+# Yarn
+yarn create cloudflare
+
+# PNPM
+pnpm create cloudflare@latest
+```
+
+## In This Reference
+
+| File | Purpose | Use When |
+| -------------------- | -------------------------------- | ----------------------------------- |
+| **api.md** | Complete CLI flag reference | Scripting, CI/CD, advanced usage |
+| **configuration.md** | Generated files, bindings, types | Understanding output, customization |
+| **patterns.md** | Workflows, CI/CD, monorepos | Real-world integration |
+| **gotchas.md** | Troubleshooting failures | Deployment blocked, errors |
+
+## Reading Order
+
+| Task | Read |
+| -------------------------- | ------------------------ |
+| Create first project | README only |
+| Set up CI/CD | README → api → patterns |
+| Debug failed deploy | gotchas |
+| Understand generated files | configuration |
+| Full CLI reference | api |
+| Create custom template | patterns → configuration |
+| Convert existing project | README → patterns |
+
+## Post-Creation
+
+```bash
+cd my-app
+
+# Local dev with hot reload
+npm run dev
+
+# Generate TypeScript types for bindings
+npm run cf-typegen
+
+# Deploy to Cloudflare
+npm run deploy
+```
+
+## See Also
+
+- **workers/README.md** - Workers runtime, bindings, APIs
+- **workers-ai/README.md** - AI/ML models
+- **pages/README.md** - Pages-specific features
+- **wrangler/README.md** - Wrangler CLI beyond initial setup
+- **d1/README.md** - SQLite database
+- **r2/README.md** - Object storage
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/c3/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/c3/api.md
new file mode 100644
index 0000000..e572326
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/c3/api.md
@@ -0,0 +1,70 @@
+# C3 CLI Reference
+
+## Invocation
+
+```bash
+npm create cloudflare@latest [name] [-- flags] # NPM requires --
+yarn create cloudflare [name] [flags]
+pnpm create cloudflare@latest [name] [-- flags]
+```
+
+## Core Flags
+
+| Flag | Values | Description |
+| ------------------ | --------------------------------------------------------------------------------------------- | ----------------------------------------- |
+| `--type` | `hello-world`, `web-app`, `demo`, `pre-existing`, `remote-template` | Application type |
+| `--platform` | `workers` (default), `pages` | Target platform |
+| `--framework` | `next`, `remix`, `astro`, `react-router`, `solid`, `svelte`, `qwik`, `vue`, `angular`, `hono` | Web framework (requires `--type=web-app`) |
+| `--lang` | `ts`, `js`, `python` | Language (for `--type=hello-world`) |
+| `--ts` / `--no-ts` | - | TypeScript for web apps |
+
+## Deployment Flags
+
+| Flag | Description |
+| -------------------------- | ----------------------------------------------------- |
+| `--deploy` / `--no-deploy` | Deploy immediately (prompts interactive, skips in CI) |
+| `--git` / `--no-git` | Initialize git (default: yes) |
+| `--open` | Open browser after deploy |
+
+## Advanced Flags
+
+| Flag | Description |
+| ----------------------------------- | ------------------------------------------------ |
+| `--template=user/repo` | GitHub template or local path |
+| `--existing-script=./src/worker.ts` | Existing script (requires `--type=pre-existing`) |
+| `--category=ai\|database\|realtime` | Demo filter (requires `--type=demo`) |
+| `--experimental` | Enable experimental features |
+| `--wrangler-defaults` | Skip wrangler prompts |
+
+## Environment Variables
+
+```bash
+CLOUDFLARE_API_TOKEN=xxx # For deployment
+CLOUDFLARE_ACCOUNT_ID=xxx # Account ID
+CF_TELEMETRY_DISABLED=1 # Disable telemetry
+```
+
+## Exit Codes
+
+`0` success, `1` user abort, `2` error
+
+## Examples
+
+For framework apps, follow [Framework Setup](README.md#framework-setup).
+
+```bash
+# TypeScript Worker
+npm create cloudflare@latest my-api -- --type=hello-world --lang=ts --no-deploy
+
+# Astro blog
+npm create cloudflare@latest my-blog -- --type=web-app --framework=astro --ts --deploy
+
+# CI: non-interactive
+npm create cloudflare@latest my-api -- --type=hello-world --lang=ts --no-git --no-deploy
+
+# GitHub template
+npm create cloudflare@latest -- --template=cloudflare/templates/worker-openapi
+
+# Convert existing project
+npm create cloudflare@latest . -- --type=pre-existing --existing-script=./build/worker.js
+```
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/c3/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/c3/configuration.md
new file mode 100644
index 0000000..bd81bea
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/c3/configuration.md
@@ -0,0 +1,85 @@
+# C3 Generated Configuration
+
+## Output Structure
+
+```
+my-app/
+├── src/index.ts # Worker entry point
+├── wrangler.jsonc # Cloudflare config
+├── package.json # Scripts
+├── tsconfig.json
+└── .gitignore
+```
+
+## wrangler.jsonc
+
+```jsonc
+{
+ "$schema": "https://raw.githubusercontent.com/cloudflare/workers-sdk/main/packages/wrangler/config-schema.json",
+ "name": "my-app",
+ "main": "src/index.ts",
+ "compatibility_date": "2026-01-27"
+}
+```
+
+## Binding Placeholders
+
+C3 generates **placeholder IDs** that must be replaced before deploy:
+
+```jsonc
+{
+ "kv_namespaces": [{ "binding": "MY_KV", "id": "placeholder_kv_id" }],
+ "d1_databases": [{ "binding": "DB", "database_id": "00000000-..." }]
+}
+```
+
+**Replace with real IDs:**
+
+```bash
+npx wrangler kv namespace create MY_KV # Returns real ID
+npx wrangler d1 create my-database # Returns real database_id
+```
+
+**Deployment error if not replaced:**
+
+```
+Error: Invalid KV namespace ID "placeholder_kv_id"
+```
+
+## Scripts
+
+```json
+{
+ "scripts": {
+ "dev": "wrangler dev",
+ "deploy": "wrangler deploy",
+ "cf-typegen": "wrangler types"
+ }
+}
+```
+
+## Type Generation
+
+Run after adding bindings:
+
+```bash
+npm run cf-typegen
+```
+
+Generates `.wrangler/types/runtime.d.ts`:
+
+```typescript
+interface Env {
+ MY_KV: KVNamespace;
+ DB: D1Database;
+}
+```
+
+## Post-Creation Checklist
+
+1. Review `wrangler.jsonc` - check name, compatibility_date
+2. Replace placeholder binding IDs with real resource IDs
+3. Run `npm run cf-typegen`
+4. Test: `npm run dev`
+5. Deploy: `npm run deploy`
+6. Add secrets: `npx wrangler secret put SECRET_NAME`
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/c3/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/c3/gotchas.md
new file mode 100644
index 0000000..22fb4bc
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/c3/gotchas.md
@@ -0,0 +1,97 @@
+# C3 Troubleshooting
+
+## Deployment Issues
+
+### Placeholder IDs
+
+**Error:** "Invalid namespace ID"
+**Fix:** Replace placeholders in wrangler.jsonc with real IDs:
+
+```bash
+npx wrangler kv namespace create MY_KV # Get real ID
+```
+
+### Authentication
+
+**Error:** "Not authenticated"
+**Fix:** `npx wrangler login` or set `CLOUDFLARE_API_TOKEN`
+
+### Name Conflict
+
+**Error:** "Worker already exists"
+**Fix:** Change `name` in wrangler.jsonc
+
+## Platform Selection
+
+| Need | Platform |
+| -------------------------------- | ------------------ |
+| Git integration, branch previews | `--platform=pages` |
+| Durable Objects, D1, Queues | Workers (default) |
+
+Wrong platform? Recreate with correct `--platform` flag.
+
+## TypeScript Issues
+
+**"Cannot find name 'KVNamespace'"**
+
+```bash
+npm run cf-typegen # Regenerate types
+# Restart TS server in editor
+```
+
+**Missing types after config change:** Re-run `npm run cf-typegen`
+
+## Package Manager
+
+**Multiple lockfiles causing issues:**
+
+```bash
+rm pnpm-lock.yaml # If using npm
+rm package-lock.json # If using pnpm
+```
+
+## CI/CD
+
+**CI hangs on prompts:**
+
+```bash
+npm create cloudflare@latest my-app -- \
+ --type=hello-world --lang=ts --no-git --no-deploy
+```
+
+**Auth in CI:**
+
+```yaml
+env:
+ CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
+ CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
+```
+
+## Framework-Specific
+
+| Framework | Issue | Fix |
+| --------- | ---------------------- | -------------------------------- |
+| Next.js | create-next-app failed | `npm cache clean --force`, retry |
+| Astro | Adapter missing | Install `@astrojs/cloudflare` |
+| Remix | Module errors | Update `@remix-run/cloudflare*` |
+
+## Compatibility Date
+
+**"Feature X requires compatibility_date >= ..."**
+**Fix:** Update `compatibility_date` in wrangler.jsonc to today's date
+
+## Node.js Version
+
+**"Node.js version not supported"**
+**Fix:** Install Node.js 18+ (`nvm install 20`)
+
+## Quick Reference
+
+| Error | Cause | Fix |
+| ----------------------- | ------------------- | ------------------------------- |
+| Invalid namespace ID | Placeholder binding | Create resource, update config |
+| Not authenticated | No login | `npx wrangler login` |
+| Cannot find KVNamespace | Missing types | `npm run cf-typegen` |
+| Worker already exists | Name conflict | Change `name` |
+| CI hangs | Missing flags | Add --type, --lang, --no-deploy |
+| Template not found | Bad name | Check cloudflare/templates |
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/c3/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/c3/patterns.md
new file mode 100644
index 0000000..c7613b8
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/c3/patterns.md
@@ -0,0 +1,82 @@
+# C3 Usage Patterns
+
+## Quick Workflows
+
+For framework apps, follow [Framework Setup](README.md#framework-setup).
+
+```bash
+# TypeScript API Worker
+npm create cloudflare@latest my-api -- --type=hello-world --lang=ts --deploy
+
+# Astro static site
+npm create cloudflare@latest my-blog -- --type=web-app --framework=astro --platform=pages --ts
+```
+
+## CI/CD (GitHub Actions)
+
+```yaml
+- name: Deploy
+ run: npm run deploy
+ env:
+ CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
+ CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
+```
+
+**Non-interactive requires:**
+
+```bash
+--type= # Required
+--no-git # Recommended (CI already in git)
+--no-deploy # Deploy separately with secrets
+--framework= # For web-app
+--ts / --no-ts # Required
+```
+
+## Monorepo
+
+C3 detects workspace config (`package.json` workspaces or `pnpm-workspace.yaml`).
+
+```bash
+cd packages/
+npm create cloudflare@latest my-worker -- --type=hello-world --lang=ts --no-deploy
+```
+
+## Custom Templates
+
+```bash
+# GitHub repo
+npm create cloudflare@latest -- --template=username/repo
+npm create cloudflare@latest -- --template=cloudflare/templates/worker-openapi
+
+# Local path
+npm create cloudflare@latest my-app -- --template=../my-template
+```
+
+**Template requires `c3.config.json`:**
+
+```json
+{
+ "name": "my-template",
+ "category": "hello-world",
+ "copies": [{ "path": "src/" }, { "path": "wrangler.jsonc" }],
+ "transforms": [{ "path": "package.json", "jsonc": { "name": "{{projectName}}" } }]
+}
+```
+
+## Existing Projects
+
+```bash
+# Add Cloudflare to existing Worker
+npm create cloudflare@latest . -- --type=pre-existing --existing-script=./dist/index.js
+```
+
+For existing framework apps, follow [Framework Setup](README.md#framework-setup).
+
+## Post-Creation Checklist
+
+1. Review `wrangler.jsonc` - set `compatibility_date`, verify `name`
+2. Create bindings: `wrangler kv namespace create`, `wrangler d1 create`, `wrangler r2 bucket create`
+3. Generate types: `npm run cf-typegen`
+4. Test: `npm run dev`
+5. Deploy: `npm run deploy`
+6. Set secrets: `wrangler secret put SECRET_NAME`
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/cache-reserve/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/cache-reserve/README.md
new file mode 100644
index 0000000..9a5d265
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/cache-reserve/README.md
@@ -0,0 +1,150 @@
+# Cloudflare Cache Reserve
+
+**Persistent cache storage built on R2 for long-term content retention**
+
+## Smart Shield Integration
+
+Cache Reserve is part of **Smart Shield**, Cloudflare's comprehensive security and performance suite:
+
+- **Smart Shield Advanced tier**: Includes 2TB Cache Reserve storage
+- **Standalone purchase**: Available separately if not using Smart Shield
+- **Migration**: Existing standalone customers can migrate to Smart Shield bundles
+
+**Decision**: Already on Smart Shield Advanced? Cache Reserve is included. Otherwise evaluate standalone purchase vs Smart Shield upgrade.
+
+## Overview
+
+Cache Reserve is Cloudflare's persistent, large-scale cache storage layer built on R2. It acts as the ultimate upper-tier cache, storing cacheable content for extended periods (30+ days) to maximize cache hits, reduce origin egress fees, and shield origins from repeated requests for long-tail content.
+
+## Core Concepts
+
+### What is Cache Reserve?
+
+- **Persistent storage layer**: Built on R2, sits above tiered cache hierarchy
+- **Long-term retention**: 30-day default retention, extended on each access
+- **Automatic operation**: Works seamlessly with existing CDN, no code changes required
+- **Origin shielding**: Dramatically reduces origin egress by serving cached content longer
+- **Usage-based pricing**: Pay only for storage + read/write operations
+
+### Cache Hierarchy
+
+```
+Visitor Request
+ ↓
+Lower-Tier Cache (closest to visitor)
+ ↓ (on miss)
+Upper-Tier Cache (closest to origin)
+ ↓ (on miss)
+Cache Reserve (R2 persistent storage)
+ ↓ (on miss)
+Origin Server
+```
+
+### How It Works
+
+1. **On cache miss**: Content fetched from origin �� written to Cache Reserve + edge caches simultaneously
+2. **On edge eviction**: Content may be evicted from edge cache but remains in Cache Reserve
+3. **On subsequent request**: If edge cache misses but Cache Reserve hits → content restored to edge caches
+4. **Retention**: Assets remain in Cache Reserve for 30 days since last access (configurable via TTL)
+
+## When to Use Cache Reserve
+
+```
+Need persistent caching?
+├─ High origin egress costs → Cache Reserve ✓
+├─ Long-tail content (archives, media libraries) → Cache Reserve ✓
+├─ Already using Smart Shield Advanced → Included! ✓
+├─ Video streaming with seeking (range requests) → ✗ Not supported
+├─ Dynamic/personalized content → ✗ Use edge cache only
+├─ Need per-request cache control from Workers → ✗ Use R2 directly
+└─ Frequently updated content (< 10hr lifetime) → ✗ Not eligible
+```
+
+## Asset Eligibility
+
+Cache Reserve only stores assets meeting **ALL** criteria:
+
+- Cacheable per Cloudflare's standard rules
+- Minimum 10-hour TTL (36000 seconds)
+- `Content-Length` header present
+- Original files only (not transformed images)
+
+### Eligibility Checklist
+
+Use this checklist to verify if an asset is eligible:
+
+- [ ] Zone has Cache Reserve enabled
+- [ ] Zone has Tiered Cache enabled (required)
+- [ ] Asset TTL ≥ 10 hours (36,000 seconds)
+- [ ] `Content-Length` header present on origin response
+- [ ] No `Set-Cookie` header (or uses private directive)
+- [ ] `Vary` header is NOT `*` (can be `Accept-Encoding`)
+- [ ] Not an image transformation variant (original images OK)
+- [ ] Not a range request (no HTTP 206 support)
+- [ ] Not O2O (Orange-to-Orange) proxied request
+
+**All boxes must be checked for Cache Reserve eligibility.**
+
+### Not Eligible
+
+- Assets with TTL < 10 hours
+- Responses without `Content-Length` header
+- Image transformation variants (original images are eligible)
+- Responses with `Set-Cookie` headers
+- Responses with `Vary: *` header
+- Assets from R2 public buckets on same zone
+- O2O (Orange-to-Orange) setup requests
+- **Range requests** (video seeking, partial content downloads)
+
+## Quick Start
+
+```bash
+# Enable via Dashboard
+https://dash.cloudflare.com/caching/cache-reserve
+# Click "Enable Storage Sync" or "Purchase" button
+```
+
+**Prerequisites:**
+
+- Paid Cache Reserve plan or Smart Shield Advanced required
+- Tiered Cache required for optimal performance
+
+## Essential Commands
+
+```bash
+# Check Cache Reserve status
+curl -X GET "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/cache/cache_reserve" \
+ -H "Authorization: Bearer $API_TOKEN"
+
+# Enable Cache Reserve
+curl -X PATCH "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/cache/cache_reserve" \
+ -H "Authorization: Bearer $API_TOKEN" \
+ -H "Content-Type: application/json" \
+ -d '{"value": "on"}'
+
+# Check asset cache status
+curl -I https://example.com/asset.jpg | grep -i cache
+```
+
+## In This Reference
+
+| Task | Files |
+| ----------------------------------------------------- | --------------------------------------------------------- |
+| Evaluate if Cache Reserve fits your use case | README.md (this file) |
+| Enable Cache Reserve for your zone | README.md + [configuration.md](./configuration.md) |
+| Use with Workers (understand limitations) | [api.md](./api.md) |
+| Setup via SDKs or IaC (TypeScript, Python, Terraform) | [configuration.md](./configuration.md) |
+| Optimize costs and debug issues | [patterns.md](./patterns.md) + [gotchas.md](./gotchas.md) |
+| Understand eligibility and troubleshoot | [gotchas.md](./gotchas.md) → [patterns.md](./patterns.md) |
+
+**Files:**
+
+- [configuration.md](./configuration.md) - Setup, API, SDKs, and Cache Rules
+- [api.md](./api.md) - Purging, monitoring, Workers integration
+- [patterns.md](./patterns.md) - Best practices, cost optimization, debugging
+- [gotchas.md](./gotchas.md) - Common issues, limitations, troubleshooting
+
+## See Also
+
+- [r2](../r2/) - Cache Reserve built on R2 storage
+- [workers](https://developers.cloudflare.com/workers/) - Workers integration with Cache API
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/cache-reserve/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/cache-reserve/api.md
new file mode 100644
index 0000000..66578d4
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/cache-reserve/api.md
@@ -0,0 +1,184 @@
+# Cache Reserve API
+
+## Workers Integration
+
+```
+┌────────────────────────────────────────────────────────────────┐
+│ CRITICAL: Workers Cache API ≠ Cache Reserve │
+│ │
+│ • Workers caches.default / cache.put() → edge cache ONLY │
+│ • Cache Reserve → zone-level setting, automatic, no per-req │
+│ • You CANNOT selectively write to Cache Reserve from Workers │
+│ • Cache Reserve works with standard fetch(), not cache.put() │
+└────────────────────────────────────────────────────────────────┘
+```
+
+Cache Reserve is a **zone-level configuration**, not a per-request API. It works automatically when enabled for the zone:
+
+### Standard Fetch (Recommended)
+
+```typescript
+// Cache Reserve works automatically via standard fetch
+export default {
+ async fetch(request: Request, env: Env): Promise {
+ // Standard fetch uses Cache Reserve automatically
+ return await fetch(request);
+ }
+};
+```
+
+### Cache API Limitations
+
+**IMPORTANT**: `cache.put()` is **NOT compatible** with Cache Reserve or Tiered Cache.
+
+```typescript
+// ❌ WRONG: cache.put() bypasses Cache Reserve
+const cache = caches.default;
+let response = await cache.match(request);
+if (!response) {
+ response = await fetch(request);
+ await cache.put(request, response.clone()); // Bypasses Cache Reserve!
+}
+
+// ✅ CORRECT: Use standard fetch for Cache Reserve compatibility
+return await fetch(request);
+
+// ✅ CORRECT: Use Cache API only for custom cache namespaces
+const customCache = await caches.open('my-custom-cache');
+let response = await customCache.match(request);
+if (!response) {
+ response = await fetch(request);
+ await customCache.put(request, response.clone()); // Custom cache OK
+}
+```
+
+## Purging and Cache Management
+
+### Purge by URL (Instant)
+
+```typescript
+// Purge specific URL from Cache Reserve immediately
+const purgeCacheReserveByURL = async (zoneId: string, apiToken: string, urls: string[]) => {
+ const response = await fetch(`https://api.cloudflare.com/client/v4/zones/${zoneId}/purge_cache`, {
+ method: 'POST',
+ headers: {
+ Authorization: `Bearer ${apiToken}`,
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify({ files: urls })
+ });
+ return await response.json();
+};
+
+// Example usage
+await purgeCacheReserveByURL('zone123', 'token456', [
+ 'https://example.com/image.jpg',
+ 'https://example.com/video.mp4'
+]);
+```
+
+### Purge by Tag/Host/Prefix (Revalidation)
+
+```typescript
+// Purge by cache tag - forces revalidation, not immediate removal
+await fetch(`https://api.cloudflare.com/client/v4/zones/${zoneId}/purge_cache`, {
+ method: 'POST',
+ headers: { Authorization: `Bearer ${apiToken}`, 'Content-Type': 'application/json' },
+ body: JSON.stringify({ tags: ['tag1', 'tag2'] })
+});
+```
+
+**Purge behavior:**
+
+- **By URL**: Immediate removal from Cache Reserve + edge cache
+- **By tag/host/prefix**: Revalidation only, assets remain in storage (costs continue)
+
+### Clear All Cache Reserve Data
+
+```typescript
+// Requires Cache Reserve OFF first
+await fetch(`https://api.cloudflare.com/client/v4/zones/${zoneId}/cache/cache_reserve_clear`, {
+ method: 'POST',
+ headers: { Authorization: `Bearer ${apiToken}` }
+});
+
+// Check status: GET same endpoint returns { state: "In-progress" | "Completed" }
+```
+
+**Process**: Disable Cache Reserve → Call clear endpoint → Wait up to 24hr → Re-enable
+
+## Monitoring and Analytics
+
+### Dashboard Analytics
+
+Navigate to **Caching > Cache Reserve** to view:
+
+- **Egress Savings**: Total bytes served from Cache Reserve vs origin egress cost saved
+- **Requests Served**: Cache Reserve hits vs misses breakdown
+- **Storage Used**: Current GB stored in Cache Reserve (billed monthly)
+- **Operations**: Class A (writes) and Class B (reads) operation counts
+- **Cost Tracking**: Estimated monthly costs based on current usage
+
+### Logpush Integration
+
+```typescript
+// Logpush field: CacheReserveUsed (boolean) - filter for Cache Reserve hits
+// Query Cache Reserve hits in analytics
+const logpushQuery = `
+ SELECT
+ ClientRequestHost,
+ COUNT(*) as requests,
+ SUM(EdgeResponseBytes) as bytes_served,
+ COUNT(CASE WHEN CacheReserveUsed = true THEN 1 END) as cache_reserve_hits,
+ COUNT(CASE WHEN CacheReserveUsed = false THEN 1 END) as cache_reserve_misses
+ FROM http_requests
+ WHERE Timestamp >= NOW() - INTERVAL '24 hours'
+ GROUP BY ClientRequestHost
+ ORDER BY requests DESC
+`;
+
+// Filter only Cache Reserve hits
+const crHitsQuery = `
+ SELECT ClientRequestHost, COUNT(*) as requests, SUM(EdgeResponseBytes) as bytes
+ FROM http_requests
+ WHERE CacheReserveUsed = true AND Timestamp >= NOW() - INTERVAL '7 days'
+ GROUP BY ClientRequestHost
+ ORDER BY bytes DESC
+`;
+```
+
+### GraphQL Analytics
+
+```graphql
+query CacheReserveAnalytics($zoneTag: string, $since: string, $until: string) {
+ viewer {
+ zones(filter: { zoneTag: $zoneTag }) {
+ httpRequests1dGroups(filter: { datetime_geq: $since, datetime_leq: $until }, limit: 1000) {
+ dimensions {
+ date
+ }
+ sum {
+ cachedBytes
+ cachedRequests
+ bytes
+ requests
+ }
+ }
+ }
+ }
+}
+```
+
+## Pricing
+
+```typescript
+// Storage: $0.015/GB-month | Class A (writes): $4.50/M | Class B (reads): $0.36/M
+// Cache miss: 1A + 1B | Cache hit: 1B | Assets >1GB: proportionally more ops
+```
+
+## See Also
+
+- [README](./README.md) - Overview and core concepts
+- [Configuration](./configuration.md) - Setup and Cache Rules
+- [Patterns](./patterns.md) - Best practices and optimization
+- [Gotchas](./gotchas.md) - Common issues and troubleshooting
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/cache-reserve/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/cache-reserve/configuration.md
new file mode 100644
index 0000000..528c496
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/cache-reserve/configuration.md
@@ -0,0 +1,170 @@
+# Cache Reserve Configuration
+
+## Dashboard Setup
+
+**Minimum steps to enable:**
+
+```bash
+# Navigate to dashboard
+https://dash.cloudflare.com/caching/cache-reserve
+
+# Click "Enable Storage Sync" or "Purchase" button
+```
+
+**Prerequisites:**
+
+- Paid Cache Reserve plan or Smart Shield Advanced required
+- Tiered Cache **required** for Cache Reserve to function optimally
+
+## API Configuration
+
+### REST API
+
+```bash
+# Enable
+curl -X PATCH "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/cache/cache_reserve" \
+ -H "Authorization: Bearer $API_TOKEN" -H "Content-Type: application/json" \
+ -d '{"value": "on"}'
+
+# Check status
+curl -X GET "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/cache/cache_reserve" \
+ -H "Authorization: Bearer $API_TOKEN"
+```
+
+### TypeScript SDK
+
+```bash
+npm install cloudflare
+```
+
+```typescript
+import Cloudflare from 'cloudflare';
+
+const client = new Cloudflare({
+ apiToken: process.env.CLOUDFLARE_API_TOKEN
+});
+
+// Enable Cache Reserve
+await client.cache.cacheReserve.edit({
+ zone_id: 'abc123',
+ value: 'on'
+});
+
+// Get Cache Reserve status
+const status = await client.cache.cacheReserve.get({
+ zone_id: 'abc123'
+});
+console.log(status.value); // 'on' or 'off'
+```
+
+### Python SDK
+
+```bash
+pip install cloudflare
+```
+
+```python
+from cloudflare import Cloudflare
+
+client = Cloudflare(api_token=os.environ.get("CLOUDFLARE_API_TOKEN"))
+
+# Enable Cache Reserve
+client.cache.cache_reserve.edit(
+ zone_id="abc123",
+ value="on"
+)
+
+# Get Cache Reserve status
+status = client.cache.cache_reserve.get(zone_id="abc123")
+print(status.value) # 'on' or 'off'
+```
+
+### Terraform
+
+```hcl
+terraform {
+ required_providers {
+ cloudflare = {
+ source = "cloudflare/cloudflare"
+ version = "~> 4.0"
+ }
+ }
+}
+
+provider "cloudflare" {
+ api_token = var.cloudflare_api_token
+}
+
+resource "cloudflare_zone_cache_reserve" "example" {
+ zone_id = var.zone_id
+ enabled = true
+}
+
+# Tiered Cache is required for Cache Reserve
+resource "cloudflare_tiered_cache" "example" {
+ zone_id = var.zone_id
+ cache_type = "smart"
+}
+```
+
+### Pulumi
+
+```typescript
+import * as cloudflare from '@pulumi/cloudflare';
+
+// Enable Cache Reserve
+const cacheReserve = new cloudflare.ZoneCacheReserve('example', {
+ zoneId: zoneId,
+ enabled: true
+});
+
+// Enable Tiered Cache (required)
+const tieredCache = new cloudflare.TieredCache('example', {
+ zoneId: zoneId,
+ cacheType: 'smart'
+});
+```
+
+### Required API Token Permissions
+
+- `Zone Settings Read`
+- `Zone Settings Write`
+- `Zone Read`
+- `Zone Write`
+
+## Cache Rules Integration
+
+Control Cache Reserve eligibility via Cache Rules:
+
+```typescript
+// Enable for static assets
+{
+ action: 'set_cache_settings',
+ action_parameters: {
+ cache_reserve: { eligible: true, minimum_file_ttl: 86400 },
+ edge_ttl: { mode: 'override_origin', default: 86400 },
+ cache: true
+ },
+ expression: '(http.request.uri.path matches "\\.(jpg|png|webp|pdf|zip)$")'
+}
+
+// Disable for APIs
+{
+ action: 'set_cache_settings',
+ action_parameters: { cache_reserve: { eligible: false } },
+ expression: '(http.request.uri.path matches "^/api/")'
+}
+
+// Create via API: PUT to zones/{zone_id}/rulesets/phases/http_request_cache_settings/entrypoint
+```
+
+## Wrangler Integration
+
+Cache Reserve works automatically with Workers deployed via Wrangler. No special wrangler.jsonc configuration needed - enable Cache Reserve via Dashboard or API for the zone.
+
+## See Also
+
+- [README](./README.md) - Overview and core concepts
+- [API Reference](./api.md) - Purging and monitoring APIs
+- [Patterns](./patterns.md) - Best practices and optimization
+- [Gotchas](./gotchas.md) - Common issues and troubleshooting
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/cache-reserve/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/cache-reserve/gotchas.md
new file mode 100644
index 0000000..8854231
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/cache-reserve/gotchas.md
@@ -0,0 +1,136 @@
+# Cache Reserve Gotchas
+
+## Common Errors
+
+### "Assets Not Being Cached in Cache Reserve"
+
+**Cause:** Asset is not cacheable, TTL < 10 hours, Content-Length header missing, or blocking headers present (Set-Cookie, Vary: *)
+**Solution:** Ensure minimum TTL of 10+ hours (`Cache-Control: public, max-age=36000`), add Content-Length header, remove Set-Cookie header, and set `Vary: Accept-Encoding` (not *)
+
+### "Range Requests Not Working" (Video Seeking Fails)
+
+**Cause:** Cache Reserve does **NOT** support range requests (HTTP 206 Partial Content)
+**Solution:** Range requests bypass Cache Reserve entirely. For video streaming with seeking:
+
+- Use edge cache only (shorter TTLs)
+- Consider R2 with direct access for range-heavy workloads
+- Accept that seekable content won't benefit from Cache Reserve persistence
+
+### "Origin Bandwidth Higher Than Expected"
+
+**Cause:** Cache Reserve fetches **uncompressed** content from origin, even though it serves compressed to visitors
+**Solution:**
+
+- If origin charges by bandwidth, factor in uncompressed transfer costs
+- Cache Reserve compresses for visitors automatically (saves visitor bandwidth)
+- Compare: origin egress savings vs higher uncompressed fetch costs
+
+### "Cloudflare Images Not Caching with Cache Reserve"
+
+**Cause:** Cloudflare Images with `Vary: Accept` header (format negotiation) is incompatible with Cache Reserve
+**Solution:**
+
+- Cache Reserve silently skips images with Vary for format negotiation
+- Original images (non-transformed) may still be eligible
+- Use Cloudflare Images variants or edge cache for transformed images
+
+### "High Class A Operations Costs"
+
+**Cause:** Frequent cache misses, short TTLs, or frequent revalidation
+**Solution:** Increase TTL for stable content (24+ hours), enable Tiered Cache to reduce direct Cache Reserve misses, or use stale-while-revalidate
+
+### "Purge Not Working as Expected"
+
+**Cause:** Purge by tag only triggers revalidation but doesn't remove from Cache Reserve storage
+**Solution:** Use purge by URL for immediate removal, or disable Cache Reserve then clear all data for complete removal
+
+### "O2O (Orange-to-Orange) Assets Not Caching"
+
+**Cause:** Orange-to-Orange (proxied zone requesting another proxied zone on Cloudflare) bypasses Cache Reserve
+**Solution:**
+
+- **What is O2O**: Zone A (proxied) → Zone B (proxied), both on Cloudflare
+- **Detection**: Check `cf-cache-status` for `BYPASS` and review request path
+- **Workaround**: Use R2 or direct origin access instead of O2O proxy chains
+
+### "Cache Reserve must be OFF before clearing data"
+
+**Cause:** Attempting to clear Cache Reserve data while it's still enabled
+**Solution:** Disable Cache Reserve first, wait briefly for propagation (5s), then clear data (can take up to 24 hours)
+
+## Limits
+
+| Limit | Value | Notes |
+| --------------------- | ---------------------------------- | ---------------------------------------------- |
+| Minimum TTL | 10 hours (36000 seconds) | Assets with shorter TTL not eligible |
+| Default retention | 30 days (2592000 seconds) | Configurable |
+| Maximum file size | Same as R2 limits | No practical limit |
+| Purge/clear time | Up to 24 hours | Complete propagation time |
+| Plan requirement | Paid Cache Reserve or Smart Shield | Not available on free plans |
+| Content-Length header | Required | Must be present for eligibility |
+| Set-Cookie header | Blocks caching | Must not be present (or use private directive) |
+| Vary header | Cannot be * | Can use Vary: Accept-Encoding |
+| Image transformations | Variants not eligible | Original images only |
+| Range requests | NOT supported | HTTP 206 bypasses Cache Reserve |
+| Compression | Fetches uncompressed | Serves compressed to visitors |
+| Worker control | Zone-level only | Cannot control per-request |
+| O2O requests | Bypassed | Orange-to-Orange not eligible |
+
+## Additional Resources
+
+- **Official Docs**: https://developers.cloudflare.com/cache/advanced-configuration/cache-reserve/
+- **API Reference**: https://developers.cloudflare.com/api/resources/cache/subresources/cache_reserve/
+- **Cache Rules**: https://developers.cloudflare.com/cache/how-to/cache-rules/
+- **Workers Cache API**: https://developers.cloudflare.com/workers/runtime-apis/cache/
+- **R2 Documentation**: https://developers.cloudflare.com/r2/
+- **Smart Shield**: https://developers.cloudflare.com/smart-shield/
+- **Tiered Cache**: https://developers.cloudflare.com/cache/how-to/tiered-cache/
+
+## Troubleshooting Flowchart
+
+Asset not caching in Cache Reserve?
+
+```
+1. Is Cache Reserve enabled for zone?
+ → No: Enable via Dashboard or API
+ → Yes: Continue to step 2
+
+2. Is Tiered Cache enabled?
+ → No: Enable Tiered Cache (required!)
+ → Yes: Continue to step 3
+
+3. Does asset have TTL ≥ 10 hours?
+ → No: Increase via Cache Rules (edge_ttl override)
+ → Yes: Continue to step 4
+
+4. Is Content-Length header present?
+ → No: Fix origin to include Content-Length
+ → Yes: Continue to step 5
+
+5. Is Set-Cookie header present?
+ → Yes: Remove Set-Cookie or scope appropriately
+ → No: Continue to step 6
+
+6. Is Vary header set to *?
+ → Yes: Change to specific value (e.g., Accept-Encoding)
+ → No: Continue to step 7
+
+7. Is this a range request?
+ → Yes: Range requests bypass Cache Reserve (not supported)
+ → No: Continue to step 8
+
+8. Is this an O2O (Orange-to-Orange) request?
+ → Yes: O2O bypasses Cache Reserve
+ → No: Continue to step 9
+
+9. Check Logpush CacheReserveUsed field
+ → Filter logs to see if assets ever hit Cache Reserve
+ → Verify cf-cache-status header (should be HIT after first request)
+```
+
+## See Also
+
+- [README](./README.md) - Overview and core concepts
+- [Configuration](./configuration.md) - Setup and Cache Rules
+- [API Reference](./api.md) - Purging and monitoring
+- [Patterns](./patterns.md) - Best practices and optimization
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/cache-reserve/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/cache-reserve/patterns.md
new file mode 100644
index 0000000..53bd34a
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/cache-reserve/patterns.md
@@ -0,0 +1,197 @@
+# Cache Reserve Patterns
+
+## Best Practices
+
+### 1. Always Enable Tiered Cache
+
+```typescript
+// Cache Reserve is designed for use WITH Tiered Cache
+const configuration = {
+ tieredCache: 'enabled', // Required for optimal performance
+ cacheReserve: 'enabled', // Works best with Tiered Cache
+
+ hierarchy: [
+ 'Lower-Tier Cache (visitor)',
+ 'Upper-Tier Cache (origin region)',
+ 'Cache Reserve (persistent)',
+ 'Origin'
+ ]
+};
+```
+
+### 2. Set Appropriate Cache-Control Headers
+
+```typescript
+// Origin response headers for Cache Reserve eligibility
+const originHeaders = {
+ 'Cache-Control': 'public, max-age=86400', // 24hr (minimum 10hr)
+ 'Content-Length': '1024000', // Required
+ 'Cache-Tag': 'images,product-123', // Optional: purging
+ ETag: '"abc123"' // Optional: revalidation
+ // Avoid: 'Set-Cookie' and 'Vary: *' prevent caching
+};
+```
+
+### 3. Use Cache Rules for Fine-Grained Control
+
+```typescript
+// Different TTLs for different content types
+const cacheRules = [
+ {
+ description: 'Long-term cache for immutable assets',
+ expression: '(http.request.uri.path matches "^/static/.*\\.[a-f0-9]{8}\\.")',
+ action_parameters: {
+ cache_reserve: { eligible: true },
+ edge_ttl: { mode: 'override_origin', default: 2592000 }, // 30 days
+ cache: true
+ }
+ },
+ {
+ description: 'Moderate cache for regular images',
+ expression: '(http.request.uri.path matches "\\.(jpg|png|webp)$")',
+ action_parameters: {
+ cache_reserve: { eligible: true },
+ edge_ttl: { mode: 'override_origin', default: 86400 }, // 24 hours
+ cache: true
+ }
+ },
+ {
+ description: 'Exclude API from Cache Reserve',
+ expression: '(http.request.uri.path matches "^/api/")',
+ action_parameters: { cache_reserve: { eligible: false }, cache: false }
+ }
+];
+```
+
+### 4. Making Assets Cache Reserve Eligible from Workers
+
+**Note**: This modifies response headers to meet eligibility criteria but does NOT directly control Cache Reserve storage (which is zone-level automatic).
+
+```typescript
+export default {
+ async fetch(request: Request, env: Env): Promise {
+ const response = await fetch(request);
+ if (!response.ok) return response;
+
+ const headers = new Headers(response.headers);
+ headers.set('Cache-Control', 'public, max-age=36000'); // 10hr minimum
+ headers.delete('Set-Cookie'); // Blocks caching
+
+ // Ensure Content-Length present
+ if (!headers.has('Content-Length')) {
+ const blob = await response.blob();
+ headers.set('Content-Length', blob.size.toString());
+ return new Response(blob, { status: response.status, headers });
+ }
+
+ return new Response(response.body, { status: response.status, headers });
+ }
+};
+```
+
+### 5. Hostname Best Practices
+
+Use Worker's hostname for efficient caching - avoid overriding hostname unnecessarily.
+
+## Architecture Patterns
+
+### Multi-Tier Caching + Immutable Assets
+
+```typescript
+// Optimal: L1 (visitor) → L2 (region) → L3 (Cache Reserve) → Origin
+export default {
+ async fetch(request: Request, env: Env): Promise {
+ const url = new URL(request.url);
+ const isImmutable = /\.[a-f0-9]{8,}\.(js|css|jpg|png|woff2)$/.test(url.pathname);
+ const response = await fetch(request);
+
+ if (isImmutable) {
+ const headers = new Headers(response.headers);
+ headers.set('Cache-Control', 'public, max-age=31536000, immutable');
+ return new Response(response.body, { status: response.status, headers });
+ }
+ return response;
+ }
+};
+```
+
+## Cost Optimization
+
+### Cost Calculator
+
+```typescript
+interface CacheReserveEstimate {
+ avgAssetSizeGB: number;
+ uniqueAssets: number;
+ monthlyReads: number;
+ monthlyWrites: number;
+ originEgressCostPerGB: number; // e.g., AWS: $0.09/GB
+}
+
+function estimateMonthlyCost(input: CacheReserveEstimate) {
+ // Cache Reserve pricing
+ const storageCostPerGBMonth = 0.015;
+ const classAPerMillion = 4.5; // writes
+ const classBPerMillion = 0.36; // reads
+
+ // Calculate Cache Reserve costs
+ const totalStorageGB = input.avgAssetSizeGB * input.uniqueAssets;
+ const storageCost = totalStorageGB * storageCostPerGBMonth;
+ const writeCost = (input.monthlyWrites / 1_000_000) * classAPerMillion;
+ const readCost = (input.monthlyReads / 1_000_000) * classBPerMillion;
+
+ const cacheReserveCost = storageCost + writeCost + readCost;
+
+ // Calculate origin egress cost (what you'd pay without Cache Reserve)
+ const totalTrafficGB = input.monthlyReads * input.avgAssetSizeGB;
+ const originEgressCost = totalTrafficGB * input.originEgressCostPerGB;
+
+ // Savings calculation
+ const savings = originEgressCost - cacheReserveCost;
+ const savingsPercent = ((savings / originEgressCost) * 100).toFixed(1);
+
+ return {
+ cacheReserveCost: `$${cacheReserveCost.toFixed(2)}`,
+ originEgressCost: `$${originEgressCost.toFixed(2)}`,
+ monthlySavings: `$${savings.toFixed(2)}`,
+ savingsPercent: `${savingsPercent}%`,
+ breakdown: {
+ storage: `$${storageCost.toFixed(2)}`,
+ writes: `$${writeCost.toFixed(2)}`,
+ reads: `$${readCost.toFixed(2)}`
+ }
+ };
+}
+
+// Example: Media library
+const mediaLibrary = estimateMonthlyCost({
+ avgAssetSizeGB: 0.005, // 5MB images
+ uniqueAssets: 10_000,
+ monthlyReads: 5_000_000,
+ monthlyWrites: 50_000,
+ originEgressCostPerGB: 0.09 // AWS S3
+});
+
+console.log(mediaLibrary);
+// {
+// cacheReserveCost: "$9.98",
+// originEgressCost: "$25.00",
+// monthlySavings: "$15.02",
+// savingsPercent: "60.1%",
+// breakdown: { storage: "$0.75", writes: "$0.23", reads: "$9.00" }
+// }
+```
+
+### Optimization Guidelines
+
+- **Set appropriate TTLs**: 10hr minimum, 24hr+ optimal for stable content, 30d max cautiously
+- **Cache high-value stable assets**: Images, media, fonts, archives, documentation
+- **Exclude frequently changing**: APIs, user-specific content, real-time data
+- **Compression note**: Cache Reserve fetches uncompressed from origin, serves compressed to visitors - factor in origin egress costs
+
+## See Also
+
+- [README](./README.md) - Overview and core concepts
+- [Configuration](./configuration.md) - Setup and Cache Rules
+- [API Reference](./api.md) - Purging and monitoring
+- [Gotchas](./gotchas.md) - Common issues and troubleshooting
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/containers/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/containers/README.md
new file mode 100644
index 0000000..5220da0
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/containers/README.md
@@ -0,0 +1,23 @@
+# Cloudflare Containers
+
+Use this reference for containerized applications on the Workers platform, including container-enabled Durable Objects, lifecycle management, and request routing.
+
+## Choose the runtime
+
+Use [Containers](https://developers.cloudflare.com/containers/) for existing container images, custom runtimes, system dependencies, full filesystem access, or workloads needing additional CPU and memory. Use [Workers](https://developers.cloudflare.com/workers/) when the application fits the Workers runtime without those requirements.
+
+Containers are controlled through [Durable Objects](https://developers.cloudflare.com/durable-objects/). An instance's identity does not make its filesystem persistent: design for restarts and store durable data outside the container disk. Read [Container lifecycle](https://developers.cloudflare.com/containers/concepts/architecture/) and [Container interface](https://developers.cloudflare.com/containers/reference/container-class/) for the relationship between the process, its Durable Object, and persistent storage.
+
+## Find the documentation for the task
+
+Read the linked page before writing code or configuration; use its current API, examples, and constraints rather than reconstructing them from memory.
+
+| Task | Start here |
+| ----------------------------------------------------------- | ------------------------------------------------------------------------ |
+| Create a project and deploy the first container | [Get started](https://developers.cloudflare.com/containers/get-started/) |
+| Configure images, bindings, instance sizes, and deployments | [Configuration](configuration.md) |
+| Control startup, requests, lifecycle, and scheduling | [API](api.md) |
+| Choose routing or connect other services | [Patterns](patterns.md) |
+| Diagnose startup, persistence, capacity, or rollout issues | [Gotchas](gotchas.md) |
+
+For additional topics, consult the [Containers documentation index](https://developers.cloudflare.com/containers/llms.txt).
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/containers/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/containers/api.md
new file mode 100644
index 0000000..4bb3735
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/containers/api.md
@@ -0,0 +1,13 @@
+# Containers API
+
+Use the [Container interface](https://developers.cloudflare.com/containers/reference/container-class/) for the current SDK methods, signatures, properties, and examples. Use the [Durable Object Container API](https://developers.cloudflare.com/durable-objects/api/container/) when working directly with the runtime rather than the SDK class.
+
+| Task | Documentation |
+| ---------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
+| Forward HTTP or WebSocket requests | [Request methods](https://developers.cloudflare.com/containers/reference/container-class/#request-methods) |
+| Start a process, wait for ports, stop, or destroy it | [Start and stop](https://developers.cloudflare.com/containers/reference/container-class/#start-and-stop) |
+| React to startup, exit, errors, or idle expiry | [Lifecycle hooks](https://developers.cloudflare.com/containers/reference/container-class/#lifecycle-hooks) |
+| Inspect state or keep background work active | [State and monitoring](https://developers.cloudflare.com/containers/reference/container-class/#state-and-monitoring) |
+| Schedule callbacks without replacing the SDK's alarm handler | [Scheduling](https://developers.cloudflare.com/containers/reference/container-class/#scheduling) |
+| Address named instances, select stateless instances, or switch request ports | [Utility functions](https://developers.cloudflare.com/containers/reference/container-class/#utility-functions) |
+| Communicate over TCP from a Durable Object | [TCP port API](https://developers.cloudflare.com/durable-objects/api/container/#gettcpport) |
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/containers/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/containers/configuration.md
new file mode 100644
index 0000000..6ed1164
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/containers/configuration.md
@@ -0,0 +1,15 @@
+# Containers configuration
+
+Read the relevant documentation before choosing configuration fields or resource sizes.
+
+| Task | Documentation |
+| -------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Configure the container image, Durable Object binding, class, migrations, and instance count | [Wrangler Containers configuration](https://developers.cloudflare.com/workers/wrangler/configuration/#containers) |
+| Select a predefined size or configure custom CPU, memory, and disk | [Limits and instance types](https://developers.cloudflare.com/containers/platform/limits/) and [custom instance configuration](https://developers.cloudflare.com/workers/wrangler/configuration/#custom-instance-types) |
+| Set ports, readiness checks, idle timeout, entrypoint, or internet access | [Container properties](https://developers.cloudflare.com/containers/reference/container-class/#properties) |
+| Set runtime variables or pass secrets per instance | [Environment variables](https://developers.cloudflare.com/containers/configuration/environment-variables/) and [environment variables and secrets example](https://developers.cloudflare.com/containers/examples/env-vars-and-secrets/) |
+| Build images or use existing registry images | [Image management](https://developers.cloudflare.com/containers/guides/image-management/) |
+| Run and iterate locally | [Local development](https://developers.cloudflare.com/containers/guides/local-dev/) |
+| Deploy from a workstation or Workers Builds | [Deploy Containers](https://developers.cloudflare.com/containers/guides/deploy/) |
+| Control image updates and replacement of running instances | [Rollouts](https://developers.cloudflare.com/containers/configuration/rollouts/) |
+| Estimate resource and network costs | [Pricing](https://developers.cloudflare.com/containers/platform/pricing/) |
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/containers/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/containers/gotchas.md
new file mode 100644
index 0000000..0b82a98
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/containers/gotchas.md
@@ -0,0 +1,16 @@
+# Containers troubleshooting
+
+Use the current documentation to diagnose behavior instead of relying on copied timeout values, resource limits, or lifecycle recipes.
+
+| Symptom or concern | Documentation to read |
+| ----------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Startup timeout or unavailable port | [Start and stop](https://developers.cloudflare.com/containers/reference/container-class/#start-and-stop), [Container properties](https://developers.cloudflare.com/containers/reference/container-class/#properties), and [first-deploy provisioning](https://developers.cloudflare.com/containers/get-started/) |
+| WebSocket forwarding fails | [WebSocket example](https://developers.cloudflare.com/containers/examples/websocket/) and [request methods](https://developers.cloudflare.com/containers/reference/container-class/#request-methods) |
+| Background work stops on idle expiry | [Activity renewal](https://developers.cloudflare.com/containers/reference/container-class/#renewactivitytimeout) and [idle expiry hook](https://developers.cloudflare.com/containers/reference/container-class/#onactivityexpired) |
+| Scheduled callbacks do not run | [Scheduling and alarm ownership](https://developers.cloudflare.com/containers/reference/container-class/#scheduling) |
+| Shutdown cleanup or filesystem data loss | [Container shutdown and disk lifecycle](https://developers.cloudflare.com/containers/concepts/architecture/#container-shutdown) |
+| Out-of-memory errors or resource exhaustion | [FAQ](https://developers.cloudflare.com/containers/faq/) and [limits and instance types](https://developers.cloudflare.com/containers/platform/limits/) |
+| Instance count exceeded or unexpected request distribution | [Wrangler configuration](https://developers.cloudflare.com/workers/wrangler/configuration/#containers) and [scaling and routing](https://developers.cloudflare.com/containers/configuration/scaling-and-routing/) |
+| Worker and container image versions differ after deployment | [Deployment behavior](https://developers.cloudflare.com/containers/guides/deploy/) and [rollouts](https://developers.cloudflare.com/containers/configuration/rollouts/) |
+| Local behavior differs from deployed behavior | [Local development](https://developers.cloudflare.com/containers/guides/local-dev/) |
+| Logs, cold starts, or runtime availability questions | [FAQ](https://developers.cloudflare.com/containers/faq/) |
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/containers/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/containers/patterns.md
new file mode 100644
index 0000000..98960a6
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/containers/patterns.md
@@ -0,0 +1,18 @@
+# Containers patterns
+
+Choose instance identity based on the workload: per-user/session or per-job identities for affinity, one shared identity for a singleton, and interchangeable instances for stateless requests. Read [scaling and routing](https://developers.cloudflare.com/containers/configuration/scaling-and-routing/) for current helpers and scaling behavior before implementing that choice.
+
+| Task | Documentation |
+| ------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Distribute requests across stateless instances | [Stateless instances example](https://developers.cloudflare.com/containers/examples/stateless/) |
+| Forward WebSocket connections | [WebSocket example](https://developers.cloudflare.com/containers/examples/websocket/) |
+| React to lifecycle changes | [Status hooks example](https://developers.cloudflare.com/containers/examples/status-hooks/) |
+| Handle shutdown and persist data across restarts | [Container lifecycle](https://developers.cloudflare.com/containers/concepts/architecture/) and [Container interface](https://developers.cloudflare.com/containers/reference/container-class/) |
+| Keep long operations active or schedule callbacks | [Activity renewal](https://developers.cloudflare.com/containers/reference/container-class/#renewactivitytimeout) and [scheduling](https://developers.cloudflare.com/containers/reference/container-class/#scheduling) |
+| Start containers on a cron schedule | [Cron container example](https://developers.cloudflare.com/containers/examples/cron/) |
+| Route requests to multiple ports | [Request methods](https://developers.cloudflare.com/containers/reference/container-class/#request-methods) and [utility functions](https://developers.cloudflare.com/containers/reference/container-class/#utility-functions) |
+| Access Workers bindings from the container | [Connect to Workers and bindings](https://developers.cloudflare.com/containers/configuration/workers-connections/) |
+
+## Workflows and Queues
+
+For multi-step orchestration, combine the [Workflows Workers API](https://developers.cloudflare.com/workflows/build/workers-api/) with the [Container API](api.md). For queue-driven jobs, read the [Queues consumer API](https://developers.cloudflare.com/queues/configuration/javascript-apis/#consumer) and [acknowledgement and retry behavior](https://developers.cloudflare.com/queues/configuration/batching-retries/#explicit-acknowledgement-and-retries) alongside the Container API. These pages document the component APIs; they are not end-to-end Container integration examples.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/cron-triggers/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/cron-triggers/README.md
new file mode 100644
index 0000000..8ad1747
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/cron-triggers/README.md
@@ -0,0 +1,20 @@
+# Cloudflare Cron Triggers
+
+Use Cron Triggers to start periodic Worker jobs. Fetch the relevant current documentation before implementing; configuration, API signatures, examples, and limits belong in the docs.
+
+- **Set up a recurring job:** [Cron Triggers](https://developers.cloudflare.com/workers/configuration/cron-triggers/) covers scheduling, deployment, and execution history.
+- **Implement the job:** [Scheduled handler](https://developers.cloudflare.com/workers/runtime-apis/handlers/scheduled/) covers controller properties, asynchronous work, and multiple schedules.
+- **Schedule durable work:** [Trigger Workflows](https://developers.cloudflare.com/workflows/build/trigger-workflows/) covers direct Workflow schedules and starting instances from a Worker. Check this before introducing a Worker whose only job is to start a Workflow.
+- **Check capacity:** fetch [Workers limits](https://developers.cloudflare.com/workers/platform/limits/) for the target plan and invocation type.
+
+## In This Reference
+
+- [configuration.md](./configuration.md) — schedule setup, environments, removal, and Green Compute
+- [api.md](./api.md) — handler implementation, asynchronous completion, and tests
+- [patterns.md](./patterns.md) — choosing execution boundaries and integrations
+- [gotchas.md](./gotchas.md) — investigating timing, failures, and repeated work
+
+## See Also
+
+- [Workflows](../workflows/README.md) — durable multi-step jobs
+- [Queues](../queues/README.md) — asynchronous message processing
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/cron-triggers/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/cron-triggers/api.md
new file mode 100644
index 0000000..cf366b6
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/cron-triggers/api.md
@@ -0,0 +1,16 @@
+# Cron Triggers API
+
+Fetch the handler documentation before writing code; use its current language examples and completion semantics.
+
+| Task | Documentation |
+| ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
+| Implement the handler and access the cron expression, scheduled time, bindings, and context | [Scheduled handler](https://developers.cloudflare.com/workers/runtime-apis/handlers/scheduled/) |
+| Route different schedules to different operations | [Handle multiple cron triggers](https://developers.cloudflare.com/workers/runtime-apis/handlers/scheduled/#handle-multiple-cron-triggers) |
+| Await work and understand how asynchronous failures affect invocation status | [Handler methods](https://developers.cloudflare.com/workers/runtime-apis/handlers/scheduled/#methods) |
+| Invoke a scheduled handler locally with a chosen expression or time | [Test Cron Triggers locally](https://developers.cloudflare.com/workers/configuration/cron-triggers/#test-cron-triggers-locally) |
+| Build tests using runtime-backed controllers and execution contexts | [Workers test APIs](https://developers.cloudflare.com/workers/testing/vitest-integration/test-apis/) |
+| Start and inspect a Workflow instance | [Trigger Workflows](https://developers.cloudflare.com/workflows/build/trigger-workflows/) |
+
+Decide which operation establishes successful completion and make its failures observable. Test each configured schedule and partial-failure recovery. Read the local-testing documentation for the current endpoint and query parameters instead of adding a production HTTP route to imitate the development helper.
+
+See [patterns.md](./patterns.md) for execution design and [gotchas.md](./gotchas.md) for failures.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/cron-triggers/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/cron-triggers/configuration.md
new file mode 100644
index 0000000..ee31919
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/cron-triggers/configuration.md
@@ -0,0 +1,16 @@
+# Cron Triggers Configuration
+
+Fetch the documentation for the configuration operation before changing schedules.
+
+| Task | Documentation |
+| ---------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
+| Add a handler and configure triggers, including per-environment schedules and deployment propagation | [Add a Cron Trigger](https://developers.cloudflare.com/workers/configuration/cron-triggers/#add-a-cron-trigger) |
+| Choose an expression, interpret weekday numbering, or check supported extensions | [Supported cron expressions](https://developers.cloudflare.com/workers/configuration/cron-triggers/#supported-cron-expressions) |
+| Remove schedules or distinguish omission from an empty configuration | [Remove a Cron Trigger](https://developers.cloudflare.com/workers/configuration/cron-triggers/#remove-a-cron-trigger) |
+| Configure renewable-energy execution locations | [Green Compute](https://developers.cloudflare.com/workers/configuration/cron-triggers/#green-compute) |
+| Check trigger counts and execution budgets | [Workers limits](https://developers.cloudflare.com/workers/platform/limits/) |
+| Schedule Workflow instances directly | [Schedule a Workflow directly](https://developers.cloudflare.com/workflows/build/trigger-workflows/#schedule-a-workflow-directly) |
+
+Identify the target environment and the intended business timezone before choosing an expression. Review which schedules a deployment will replace, and use the documented propagation behavior when planning a rollout. For Green Compute, follow its account-level configuration rather than inferring settings from Worker placement.
+
+See [api.md](./api.md) for implementation and [gotchas.md](./gotchas.md) for verification.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/cron-triggers/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/cron-triggers/gotchas.md
new file mode 100644
index 0000000..d1bd739
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/cron-triggers/gotchas.md
@@ -0,0 +1,17 @@
+# Cron Triggers Troubleshooting
+
+Investigate using the current documentation rather than copied limits or assumed delivery guarantees.
+
+| Symptom or question | Documentation and check |
+| --------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Job runs at an unexpected time | Check [UTC execution](https://developers.cloudflare.com/workers/configuration/cron-triggers/#background) and [expression syntax](https://developers.cloudflare.com/workers/configuration/cron-triggers/#supported-cron-expressions); compare with the intended business timezone. |
+| Schedule is missing after deployment | Check the handler, target environment, and propagation guidance in [Add a Cron Trigger](https://developers.cloudflare.com/workers/configuration/cron-triggers/#add-a-cron-trigger). |
+| Removing or preserving schedules has an unexpected result | Review [Remove a Cron Trigger](https://developers.cloudflare.com/workers/configuration/cron-triggers/#remove-a-cron-trigger) before changing empty or omitted configuration. |
+| Local invocation fails | Follow [Test Cron Triggers locally](https://developers.cloudflare.com/workers/configuration/cron-triggers/#test-cron-triggers-locally) for the supported endpoint, port, and query parameters. |
+| Async work fails or completion status is surprising | Read [handler methods](https://developers.cloudflare.com/workers/runtime-apis/handlers/scheduled/#methods) and inspect [past events](https://developers.cloudflare.com/workers/configuration/cron-triggers/#view-past-events). |
+| Job exceeds its execution budget | Check [Workers limits](https://developers.cloudflare.com/workers/platform/limits/) before choosing a smaller unit of work or [Workflows](../workflows/README.md). |
+| Green Compute behavior differs from expectations | Read [Green Compute](https://developers.cloudflare.com/workers/configuration/cron-triggers/#green-compute) for its execution-location policy and account configuration. |
+
+For repeated or partially completed business operations, decide how to identify work and recover safely before selecting storage. Test recovery after each side effect; a marker alone does not establish that the operation completed. Do not assume a particular automatic retry schedule or delivery guarantee without a documented contract.
+
+See [patterns.md](./patterns.md) for coordination choices and [api.md](./api.md) for tests.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/cron-triggers/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/cron-triggers/patterns.md
new file mode 100644
index 0000000..e7737fe
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/cron-triggers/patterns.md
@@ -0,0 +1,18 @@
+# Cron Triggers Patterns
+
+Choose the execution boundary before writing a scheduled job; fetch the relevant integration docs for implementation.
+
+| Need | Documentation |
+| ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Periodic API sync, cleanup, reports, or health checks in a Worker | [Cron Triggers background](https://developers.cloudflare.com/workers/configuration/cron-triggers/#background) and [scheduled handler](https://developers.cloudflare.com/workers/runtime-apis/handlers/scheduled/) |
+| Different jobs on different schedules | [Handle multiple cron triggers](https://developers.cloudflare.com/workers/runtime-apis/handlers/scheduled/#handle-multiple-cron-triggers) |
+| Durable multi-step work started on a schedule | [Trigger Workflows](https://developers.cloudflare.com/workflows/build/trigger-workflows/) |
+| Send work to a queue and implement its consumer | [Queues JavaScript APIs](https://developers.cloudflare.com/queues/configuration/javascript-apis/) |
+| Coordinate state across invocations | [What are Durable Objects?](https://developers.cloudflare.com/durable-objects/concepts/what-are-durable-objects/) |
+| Inspect whether scheduled work ran | [View past events](https://developers.cloudflare.com/workers/configuration/cron-triggers/#view-past-events) |
+
+Keep the trigger separate from the business operation so manual recovery and scheduled execution can share it. Decide how partial progress is recorded, how repeated attempts affect side effects, and who owns completion reporting. When distributing a batch, distinguish successful enqueueing from successful processing.
+
+Use [Workers limits](https://developers.cloudflare.com/workers/platform/limits/) to evaluate whether the job fits one invocation. If it needs durable steps, waiting, or explicit retry boundaries, inspect [Workflows](../workflows/README.md) before building those mechanisms in the handler.
+
+See [api.md](./api.md) for tests and [gotchas.md](./gotchas.md) for operational checks.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/d1/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/d1/README.md
new file mode 100644
index 0000000..bed1f1d
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/d1/README.md
@@ -0,0 +1,15 @@
+# Cloudflare D1 Database
+
+Use D1 for managed relational application data with SQLite semantics. For an existing external database, consider [Hyperdrive](../hyperdrive/); for per-entity coordination, consider [Durable Objects](https://developers.cloudflare.com/workers/platform/storage-options/#sql-in-durable-objects-vs-d1). See [storage options](https://developers.cloudflare.com/workers/platform/storage-options/) before choosing a product.
+
+Read the relevant current documentation before implementing. These references route tasks to the source of truth rather than maintaining copies of APIs, configuration, or plan tables.
+
+## Start here
+
+- [Get started](https://developers.cloudflare.com/d1/get-started/): create a database, bind it to a Worker, and run a first query.
+- [configuration.md](./configuration.md): bindings, environments, migrations, local development, and ORM integration.
+- [api.md](./api.md): parameterized queries, batches, sessions, HTTP access, and testing.
+- [patterns.md](./patterns.md): query design, caching, tenant isolation, replication, and recovery.
+- [gotchas.md](./gotchas.md): errors, types, constraints, performance, and limits.
+
+Check [limits](https://developers.cloudflare.com/d1/platform/limits/) and [pricing](https://developers.cloudflare.com/d1/platform/pricing/) for capacity, allowances, and plan availability; do not infer them from old examples.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/d1/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/d1/api.md
new file mode 100644
index 0000000..bdced4a
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/d1/api.md
@@ -0,0 +1,18 @@
+# D1 API Reference
+
+Fetch the relevant API page before writing queries or assuming method signatures and return types.
+
+| Task | Current documentation |
+| -------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Bind values and choose a query execution method | [Prepared statement methods](https://developers.cloudflare.com/d1/worker-api/prepared-statements/) |
+| Execute batches and understand transaction rollback; use database sessions | [D1 Database API](https://developers.cloudflare.com/d1/worker-api/d1-database/) |
+| Interpret results and query metadata | [Return objects](https://developers.cloudflare.com/d1/worker-api/return-object/) |
+| Choose supported JavaScript values and TypeScript result types | [Workers Binding API](https://developers.cloudflare.com/d1/worker-api/) |
+| Choose consistency constraints and carry bookmarks between requests | [Read replication and Sessions API](https://developers.cloudflare.com/d1/best-practices/read-replication/) |
+| Query from a server-side script outside Workers | [REST query API](https://developers.cloudflare.com/api/resources/d1/subresources/database/methods/query/) |
+| Handle query failures and transient errors | [Debug D1](https://developers.cloudflare.com/d1/observability/debug-d1/) and [retry queries](https://developers.cloudflare.com/d1/best-practices/retry-queries/) |
+| Test database queries and apply migrations in tests | [Workers Vitest APIs: D1](https://developers.cloudflare.com/workers/testing/vitest-integration/test-apis/#d1) |
+
+Bind untrusted values with prepared statements; do not interpolate them into SQL. Parameters do not replace identifiers: choose dynamic table, column, or sort names from an application-controlled allowlist.
+
+D1 sessions provide sequential consistency for replicated queries. They are not a way to extend query execution limits. Choose the starting constraint or bookmark from the application's consistency requirements using the replication guide.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/d1/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/d1/configuration.md
new file mode 100644
index 0000000..14f253e
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/d1/configuration.md
@@ -0,0 +1,18 @@
+# D1 Configuration
+
+Read the task's documentation before adding bindings or running database commands. Confirm the database and environment being targeted, particularly when applying migrations or importing data.
+
+| Task | Current documentation |
+| -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
+| Create a database and attach a Worker binding | [Getting started](https://developers.cloudflare.com/d1/get-started/) |
+| Configure binding fields and multiple databases | [Wrangler D1 configuration](https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases) |
+| Separate staging and production databases | [D1 environments](https://developers.cloudflare.com/d1/configuration/environments/) |
+| Create, track, and apply schema migrations | [Migrations](https://developers.cloudflare.com/d1/reference/migrations/) |
+| Look up CLI flags for management, execution, and exports | [D1 Wrangler commands](https://developers.cloudflare.com/d1/wrangler-commands/) |
+| Develop against local database state | [Local development](https://developers.cloudflare.com/d1/best-practices/local-development/) |
+| Generate binding types | [Workers TypeScript](https://developers.cloudflare.com/workers/languages/typescript/) |
+| Choose an ORM or query builder, including Drizzle | [D1 community projects](https://developers.cloudflare.com/d1/reference/community-projects/) (follow the integration's current setup guide) |
+| Import or export SQL data | [Import and export data](https://developers.cloudflare.com/d1/best-practices/import-export-data/) |
+| Enable replicas and use them through sessions | [Read replication](https://developers.cloudflare.com/d1/best-practices/read-replication/) |
+
+Local migrations and data do not automatically update a remote database. Test against a separate staging database before a production migration. Naming another binding `DB_REPLICA` does not configure replica routing; follow the replication guide.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/d1/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/d1/gotchas.md
new file mode 100644
index 0000000..a5172fe
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/d1/gotchas.md
@@ -0,0 +1,18 @@
+# D1 Gotchas & Troubleshooting
+
+Use current documentation to diagnose the failure before changing query or database configuration.
+
+| Symptom or question | What to check |
+| ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Missing table, query exception, or constraint error | [Debug D1](https://developers.cloudflare.com/d1/observability/debug-d1/); verify the target binding, environment, and applied [migrations](https://developers.cloudflare.com/d1/reference/migrations/) |
+| Boolean, date, or other binding type mismatch | [Workers Binding API type conversion](https://developers.cloudflare.com/d1/worker-api/) and [SQL support](https://developers.cloudflare.com/d1/sql-api/sql-statements/) |
+| Foreign key failure during writes or migrations | [Foreign key enforcement and deferral](https://developers.cloudflare.com/d1/sql-api/foreign-keys/) |
+| Slow queries, scans, or excessive rows read | [Indexes and query plans](https://developers.cloudflare.com/d1/best-practices/use-indexes/) and [metrics](https://developers.cloudflare.com/d1/observability/metrics-analytics/) |
+| Query duration, statement, storage, or account limits | [Current limits](https://developers.cloudflare.com/d1/platform/limits/) |
+| Unexpected usage charges or plan assumptions | [Pricing](https://developers.cloudflare.com/d1/platform/pricing/) |
+| Stale reads after a write | [Sessions, bookmarks, and read replication](https://developers.cloudflare.com/d1/best-practices/read-replication/) |
+| Transient query failures | [Retry guidance](https://developers.cloudflare.com/d1/best-practices/retry-queries/); check idempotency before retrying writes |
+| Import/export failure or unsupported data | [Import/export behavior and limitations](https://developers.cloudflare.com/d1/best-practices/import-export-data/) |
+| Local and deployed databases differ | [Local development](https://developers.cloudflare.com/d1/best-practices/local-development/) and [environment configuration](https://developers.cloudflare.com/d1/configuration/environments/) |
+
+Continue to bind untrusted SQL values as described in [api.md](./api.md). Do not treat SQL injection as a recoverable database error or assume retries correct invalid queries.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/d1/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/d1/patterns.md
new file mode 100644
index 0000000..41208a2
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/d1/patterns.md
@@ -0,0 +1,20 @@
+# D1 Patterns & Best Practices
+
+Use these guides to design the operation, then fetch [api.md](./api.md) for implementation references.
+
+| Task | Current documentation |
+| --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Design pagination, filters, joins, and aggregations | [Query a database](https://developers.cloudflare.com/d1/best-practices/query-d1/) and [supported SQL](https://developers.cloudflare.com/d1/sql-api/sql-statements/) |
+| Reduce scans and inspect query plans | [Use indexes](https://developers.cloudflare.com/d1/best-practices/use-indexes/) |
+| Batch writes or transform data | [Database API](https://developers.cloudflare.com/d1/worker-api/d1-database/) and [limits](https://developers.cloudflare.com/d1/platform/limits/) |
+| Store and query event metadata | [Query JSON](https://developers.cloudflare.com/d1/sql-api/query-json/) |
+| Evaluate a cache in front of D1 | [How KV works](https://developers.cloudflare.com/kv/concepts/how-kv-works/) |
+| Choose shared or per-tenant databases | [D1 FAQs](https://developers.cloudflare.com/d1/reference/faq/) and [limits](https://developers.cloudflare.com/d1/platform/limits/) |
+| Reduce read latency while preserving required consistency | [Read replication](https://developers.cloudflare.com/d1/best-practices/read-replication/) |
+| Plan point-in-time recovery or portable backups | [Time Travel](https://developers.cloudflare.com/d1/reference/time-travel/) and [import/export](https://developers.cloudflare.com/d1/best-practices/import-export-data/) |
+
+Keep result sets bounded and pagination ordering deterministic. Choose indexes from actual query plans. When splitting a large operation into batches, account for the loss of whole-operation atomicity across batches.
+
+Authorize a tenant before selecting its database or rows; a request header alone is not proof of tenant membership. Application login sessions stored in tables are separate from D1's Sessions API.
+
+Before caching reads, decide how stale data may be and how writes invalidate cached results. For replicated reads, choose session constraints and bookmark propagation based on read-after-write requirements rather than assuming every read sees the latest primary state.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/ddos/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/ddos/README.md
new file mode 100644
index 0000000..b58c6f2
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/ddos/README.md
@@ -0,0 +1,42 @@
+# Cloudflare DDoS Protection
+
+Autonomous, always-on protection against DDoS attacks across L3/4 and L7.
+
+## Protection Types
+
+- **HTTP DDoS (L7)**: Protects HTTP/HTTPS traffic, phase `ddos_l7`, zone/account level
+- **Network DDoS (L3/4)**: UDP/SYN/DNS floods, phase `ddos_l4`, account level only
+- **Adaptive DDoS**: Learns 7-day baseline, detects deviations, 4 profile types (Origins, User-Agents, Locations, Protocols)
+
+## Plan Availability
+
+| Feature | Free | Pro | Business | Enterprise | Enterprise Advanced |
+| ------------------- | ----- | ----- | -------- | ---------- | ------------------- |
+| HTTP DDoS (L7) | ✓ | ✓ | ✓ | ✓ | ✓ |
+| Network DDoS (L3/4) | ✓ | ✓ | ✓ | ✓ | ✓ |
+| Override rules | 1 | 1 | 1 | 1 | 10 |
+| Custom expressions | ✗ | ✗ | ✗ | ✗ | ✓ |
+| Log action | ✗ | ✗ | ✗ | ✗ | ✓ |
+| Adaptive DDoS | ✗ | ✗ | ✗ | ✓ | ✓ |
+| Alert filters | Basic | Basic | Basic | Advanced | Advanced |
+
+## Actions & Sensitivity
+
+- **Actions**: `block`, `managed_challenge`, `challenge`, `log` (Enterprise Advanced only)
+- **Sensitivity**: `default` (high), `medium`, `low`, `eoff` (essentially off)
+- **Override**: By category/tag or individual rule ID
+- **Scope**: Zone-level overrides take precedence over account-level
+
+## Reading Order
+
+| File | Purpose | Start Here If... |
+| -------------------------------------- | --------------------------------------------------------- | ----------------------------------------------------------- |
+| [configuration.md](./configuration.md) | Dashboard setup, rule structure, adaptive profiles | You're setting up DDoS protection for the first time |
+| [api.md](./api.md) | API endpoints, SDK usage, ruleset ID discovery | You're automating configuration or need programmatic access |
+| [patterns.md](./patterns.md) | Protection strategies, defense-in-depth, dynamic response | You need implementation patterns or layered security |
+| [gotchas.md](./gotchas.md) | False positives, tuning, error handling | You're troubleshooting or optimizing existing protection |
+
+## See Also
+
+- [waf](../waf/) - Application-layer security rules
+- [bot-management](../bot-management/) - Bot detection and mitigation
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/ddos/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/ddos/api.md
new file mode 100644
index 0000000..7cdeed0
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/ddos/api.md
@@ -0,0 +1,158 @@
+# DDoS API
+
+## Endpoints
+
+### HTTP DDoS (L7)
+
+```typescript
+// Zone-level
+PUT / zones / { zoneId } / rulesets / phases / ddos_l7 / entrypoint;
+GET / zones / { zoneId } / rulesets / phases / ddos_l7 / entrypoint;
+
+// Account-level (Enterprise Advanced)
+PUT / accounts / { accountId } / rulesets / phases / ddos_l7 / entrypoint;
+GET / accounts / { accountId } / rulesets / phases / ddos_l7 / entrypoint;
+```
+
+### Network DDoS (L3/4)
+
+```typescript
+// Account-level only
+PUT / accounts / { accountId } / rulesets / phases / ddos_l4 / entrypoint;
+GET / accounts / { accountId } / rulesets / phases / ddos_l4 / entrypoint;
+```
+
+## TypeScript SDK
+
+**SDK Version**: Requires `cloudflare` >= 3.0.0 for ruleset phase methods.
+
+```typescript
+import Cloudflare from 'cloudflare';
+
+const client = new Cloudflare({ apiToken: process.env.CLOUDFLARE_API_TOKEN });
+
+// STEP 1: Discover managed ruleset ID (required for overrides)
+const allRulesets = await client.rulesets.list({ zone_id: zoneId });
+const ddosRuleset = allRulesets.result.find((r) => r.kind === 'managed' && r.phase === 'ddos_l7');
+if (!ddosRuleset) throw new Error('DDoS managed ruleset not found');
+const managedRulesetId = ddosRuleset.id;
+
+// STEP 2: Get current HTTP DDoS configuration
+const entrypointRuleset = await client.zones.rulesets.phases.entrypoint.get('ddos_l7', {
+ zone_id: zoneId
+});
+
+// STEP 3: Update HTTP DDoS ruleset with overrides
+await client.zones.rulesets.phases.entrypoint.update('ddos_l7', {
+ zone_id: zoneId,
+ rules: [
+ {
+ action: 'execute',
+ expression: 'true',
+ action_parameters: {
+ id: managedRulesetId, // From discovery step
+ overrides: {
+ sensitivity_level: 'medium',
+ action: 'managed_challenge'
+ }
+ }
+ }
+ ]
+});
+
+// Network DDoS (account level, L3/4)
+const l4Rulesets = await client.rulesets.list({ account_id: accountId });
+const l4DdosRuleset = l4Rulesets.result.find((r) => r.kind === 'managed' && r.phase === 'ddos_l4');
+const l4Ruleset = await client.accounts.rulesets.phases.entrypoint.get('ddos_l4', {
+ account_id: accountId
+});
+```
+
+## Alert Configuration
+
+```typescript
+interface DDoSAlertConfig {
+ name: string;
+ enabled: boolean;
+ alert_type:
+ | 'http_ddos_attack_alert'
+ | 'layer_3_4_ddos_attack_alert'
+ | 'advanced_http_ddos_attack_alert'
+ | 'advanced_layer_3_4_ddos_attack_alert';
+ filters?: {
+ zones?: string[];
+ hostnames?: string[];
+ requests_per_second?: number;
+ packets_per_second?: number;
+ megabits_per_second?: number;
+ ip_prefixes?: string[]; // CIDR
+ ip_addresses?: string[];
+ protocols?: string[];
+ };
+ mechanisms: {
+ email?: Array<{ id: string }>;
+ webhooks?: Array<{ id: string }>;
+ pagerduty?: Array<{ id: string }>;
+ };
+}
+
+// Create alert
+await fetch(`https://api.cloudflare.com/client/v4/accounts/${accountId}/alerting/v3/policies`, {
+ method: 'POST',
+ headers: {
+ Authorization: `Bearer ${apiToken}`,
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(alertConfig)
+});
+```
+
+## Typed Override Examples
+
+```typescript
+// Override by category
+interface CategoryOverride {
+ action: 'execute';
+ expression: string;
+ action_parameters: {
+ id: string;
+ overrides: {
+ categories?: Array<{
+ category: 'http-flood' | 'http-anomaly' | 'udp-flood' | 'syn-flood';
+ sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
+ action?: 'block' | 'managed_challenge' | 'challenge' | 'log';
+ }>;
+ };
+ };
+}
+
+// Override by rule ID
+interface RuleOverride {
+ action: 'execute';
+ expression: string;
+ action_parameters: {
+ id: string;
+ overrides: {
+ rules?: Array<{
+ id: string;
+ action?: 'block' | 'managed_challenge' | 'challenge' | 'log';
+ sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
+ }>;
+ };
+ };
+}
+
+// Example: Override specific adaptive rule
+const adaptiveOverride: RuleOverride = {
+ action: 'execute',
+ expression: 'true',
+ action_parameters: {
+ id: managedRulesetId,
+ overrides: {
+ rules: [{ id: '...adaptive-origins-rule-id...', sensitivity_level: 'low' }]
+ }
+ }
+};
+```
+
+See [patterns.md](./patterns.md) for complete implementation patterns.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/ddos/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/ddos/configuration.md
new file mode 100644
index 0000000..ebb867b
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/ddos/configuration.md
@@ -0,0 +1,94 @@
+# DDoS Configuration
+
+## Dashboard Setup
+
+1. Navigate to Security > DDoS
+2. Select HTTP DDoS or Network-layer DDoS
+3. Configure sensitivity & action per ruleset/category/rule
+4. Apply overrides with optional expressions (Enterprise Advanced)
+5. Enable Adaptive DDoS toggle (Enterprise/Enterprise Advanced, requires 7 days traffic history)
+
+## Rule Structure
+
+```typescript
+interface DDoSOverride {
+ description: string;
+ rules: Array<{
+ action: 'execute';
+ expression: string; // Custom expression (Enterprise Advanced) or "true" for all
+ action_parameters: {
+ id: string; // Managed ruleset ID (discover via api.md)
+ overrides: {
+ sensitivity_level?: 'default' | 'medium' | 'low' | 'eoff';
+ action?: 'block' | 'managed_challenge' | 'challenge' | 'log'; // log = Enterprise Advanced only
+ categories?: Array<{
+ category: string; // e.g., "http-flood", "udp-flood"
+ sensitivity_level?: string;
+ }>;
+ rules?: Array<{
+ id: string;
+ action?: string;
+ sensitivity_level?: string;
+ }>;
+ };
+ };
+ }>;
+}
+```
+
+## Expression Availability
+
+| Plan | Custom Expressions | Example |
+| ------------------- | ------------------ | -------------------------------------------------------- |
+| Free/Pro/Business | ✗ | Use `"true"` only |
+| Enterprise | ✗ | Use `"true"` only |
+| Enterprise Advanced | ✓ | `ip.src in {...}`, `http.request.uri.path matches "..."` |
+
+## Sensitivity Mapping
+
+| UI | API | Threshold |
+| --------------- | --------- | ------------------ |
+| High | `default` | Most aggressive |
+| Medium | `medium` | Balanced |
+| Low | `low` | Less aggressive |
+| Essentially Off | `eoff` | Minimal mitigation |
+
+## Common Categories
+
+- `http-flood`, `http-anomaly` (L7)
+- `udp-flood`, `syn-flood`, `dns-flood` (L3/4)
+
+## Override Precedence
+
+Multiple override layers apply in this order (higher precedence wins):
+
+```
+Zone-level > Account-level
+Individual Rule > Category > Global sensitivity/action
+```
+
+**Example**: Zone rule for `/api/*` overrides account-level global settings.
+
+## Adaptive DDoS Profiles
+
+**Availability**: Enterprise, Enterprise Advanced
+**Learning period**: 7 days of traffic history required
+
+| Profile Type | Description | Detects |
+| --------------- | ------------------------------------ | --------------------------------------- |
+| **Origins** | Traffic patterns per origin server | Anomalous requests to specific origins |
+| **User-Agents** | Traffic patterns per User-Agent | Malicious/anomalous user agent strings |
+| **Locations** | Traffic patterns per geo-location | Attacks from specific countries/regions |
+| **Protocols** | Traffic patterns per protocol (L3/4) | Protocol-specific flood attacks |
+
+Configure by targeting specific adaptive rule IDs via API (see api.md#typed-override-examples).
+
+## Alerting
+
+Configure via Notifications:
+
+- Alert types: `http_ddos_attack_alert`, `layer_3_4_ddos_attack_alert`, `advanced_*` variants
+- Filters: zones, hostnames, RPS/PPS/Mbps thresholds, IPs, protocols
+- Mechanisms: email, webhooks, PagerDuty
+
+See [api.md](./api.md#alert-configuration) for API examples.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/ddos/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/ddos/gotchas.md
new file mode 100644
index 0000000..080d527
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/ddos/gotchas.md
@@ -0,0 +1,114 @@
+# DDoS Gotchas
+
+## Common Errors
+
+### "False positives blocking legitimate traffic"
+
+**Cause**: Sensitivity too high, wrong action, or missing exceptions
+**Solution**:
+
+1. Lower sensitivity for specific rule/category
+2. Use `log` action first to validate (Enterprise Advanced)
+3. Add exception with custom expression (e.g., allowlist IPs)
+4. Query flagged requests via GraphQL Analytics API to identify patterns
+
+### "Attacks getting through"
+
+**Cause**: Sensitivity too low or wrong action
+**Solution**: Increase to `default` sensitivity and use `block` action:
+
+```typescript
+const config = {
+ rules: [
+ {
+ expression: 'true',
+ action: 'execute',
+ action_parameters: {
+ id: managedRulesetId,
+ overrides: { sensitivity_level: 'default', action: 'block' }
+ }
+ }
+ ]
+};
+```
+
+### "Adaptive rules not working"
+
+**Cause**: Insufficient traffic history (needs 7 days)
+**Solution**: Wait for baseline to establish, check dashboard for adaptive rule status
+
+### "Zone override ignored"
+
+**Cause**: Account overrides conflict with zone overrides
+**Solution**: Configure at zone level OR remove zone overrides to use account-level
+
+### "Log action not available"
+
+**Cause**: Not on Enterprise Advanced DDoS plan
+**Solution**: Use `managed_challenge` with low sensitivity for testing
+
+### "Rule limit exceeded"
+
+**Cause**: Too many override rules (Free/Pro/Business: 1, Enterprise Advanced: 10)
+**Solution**: Combine conditions in single expression using `and`/`or`
+
+### "Cannot override rule"
+
+**Cause**: Rule is read-only
+**Solution**: Check API response for read-only indicator, use different rule
+
+### "Cannot disable DDoS protection"
+
+**Cause**: DDoS managed rulesets cannot be fully disabled (always-on protection)
+**Solution**: Set `sensitivity_level: "eoff"` for minimal mitigation
+
+### "Expression not allowed"
+
+**Cause**: Custom expressions require Enterprise Advanced plan
+**Solution**: Use `expression: "true"` for all traffic, or upgrade plan
+
+### "Managed ruleset not found"
+
+**Cause**: Zone/account doesn't have DDoS managed ruleset, or incorrect phase
+**Solution**: Verify ruleset exists via `client.rulesets.list()`, check phase name (`ddos_l7` or `ddos_l4`)
+
+## API Error Codes
+
+| Error Code | Message | Cause | Solution |
+| ---------- | ------------------------- | -------------------------------- | --------------------------------------------------- |
+| 10000 | Authentication error | Invalid/missing API token | Check token has DDoS permissions |
+| 81000 | Ruleset validation failed | Invalid rule structure | Verify `action_parameters.id` is managed ruleset ID |
+| 81020 | Expression not allowed | Custom expressions on wrong plan | Use `"true"` or upgrade to Enterprise Advanced |
+| 81021 | Rule limit exceeded | Too many override rules | Reduce rules or upgrade (Enterprise Advanced: 10) |
+| 81022 | Invalid sensitivity level | Wrong sensitivity value | Use: `default`, `medium`, `low`, `eoff` |
+| 81023 | Invalid action | Wrong action for plan | Enterprise Advanced only: `log` action |
+
+## Limits
+
+| Resource/Limit | Free/Pro/Business | Enterprise | Enterprise Advanced |
+| ------------------------ | ----------------- | ---------- | ------------------- |
+| Override rules per zone | 1 | 1 | 10 |
+| Custom expressions | ✗ | ✗ | ✓ |
+| Log action | ✗ | ✗ | ✓ |
+| Adaptive DDoS | ✗ | ✓ | ✓ |
+| Traffic history required | - | 7 days | 7 days |
+
+## Tuning Strategy
+
+1. Start with `log` action + `medium` sensitivity
+2. Monitor for 24-48 hours
+3. Identify false positives, add exceptions
+4. Gradually increase to `default` sensitivity
+5. Change action from `log` → `managed_challenge` → `block`
+6. Document all adjustments
+
+## Best Practices
+
+- Test during low-traffic periods
+- Use zone-level for per-site tuning
+- Reference IP lists for easier management
+- Set appropriate alert thresholds (avoid noise)
+- Combine with WAF for layered defense
+- Avoid over-tuning (keep config simple)
+
+See [patterns.md](./patterns.md) for progressive rollout examples.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/ddos/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/ddos/patterns.md
new file mode 100644
index 0000000..3aa5f5b
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/ddos/patterns.md
@@ -0,0 +1,222 @@
+# DDoS Protection Patterns
+
+## Allowlist Trusted IPs
+
+```typescript
+const config = {
+ description: 'Allowlist trusted IPs',
+ rules: [
+ {
+ expression: 'ip.src in { 203.0.113.0/24 192.0.2.1 }',
+ action: 'execute',
+ action_parameters: {
+ id: managedRulesetId,
+ overrides: { sensitivity_level: 'eoff' }
+ }
+ }
+ ]
+};
+
+await client.accounts.rulesets.phases.entrypoint.update('ddos_l7', {
+ account_id: accountId,
+ ...config
+});
+```
+
+## Route-specific Sensitivity
+
+```typescript
+const config = {
+ description: 'Route-specific protection',
+ rules: [
+ {
+ expression: 'not http.request.uri.path matches "^/api/"',
+ action: 'execute',
+ action_parameters: {
+ id: managedRulesetId,
+ overrides: { sensitivity_level: 'default', action: 'block' }
+ }
+ },
+ {
+ expression: 'http.request.uri.path matches "^/api/"',
+ action: 'execute',
+ action_parameters: {
+ id: managedRulesetId,
+ overrides: { sensitivity_level: 'low', action: 'managed_challenge' }
+ }
+ }
+ ]
+};
+```
+
+## Progressive Enhancement
+
+```typescript
+enum ProtectionLevel {
+ MONITORING = 'monitoring',
+ LOW = 'low',
+ MEDIUM = 'medium',
+ HIGH = 'high'
+}
+
+const levelConfig = {
+ [ProtectionLevel.MONITORING]: { action: 'log', sensitivity: 'eoff' },
+ [ProtectionLevel.LOW]: { action: 'managed_challenge', sensitivity: 'low' },
+ [ProtectionLevel.MEDIUM]: { action: 'managed_challenge', sensitivity: 'medium' },
+ [ProtectionLevel.HIGH]: { action: 'block', sensitivity: 'default' }
+} as const;
+
+async function setProtectionLevel(
+ zoneId: string,
+ level: ProtectionLevel,
+ rulesetId: string,
+ client: Cloudflare
+) {
+ const settings = levelConfig[level];
+ return client.zones.rulesets.phases.entrypoint.update('ddos_l7', {
+ zone_id: zoneId,
+ rules: [
+ {
+ expression: 'true',
+ action: 'execute',
+ action_parameters: {
+ id: rulesetId,
+ overrides: { action: settings.action, sensitivity_level: settings.sensitivity }
+ }
+ }
+ ]
+ });
+}
+```
+
+## Dynamic Response to Attacks
+
+```typescript
+interface Env {
+ CLOUDFLARE_API_TOKEN: string;
+ ZONE_ID: string;
+ KV: KVNamespace;
+}
+
+export default {
+ async fetch(request: Request, env: Env): Promise {
+ if (request.url.includes('/attack-detected')) {
+ const attackData = await request.json();
+ await env.KV.put(`attack:${Date.now()}`, JSON.stringify(attackData), {
+ expirationTtl: 86400
+ });
+ const recentAttacks = await getRecentAttacks(env.KV);
+ if (recentAttacks.length > 5) {
+ await setProtectionLevel(env.ZONE_ID, ProtectionLevel.HIGH, managedRulesetId, client);
+ return new Response('Protection increased');
+ }
+ }
+ return new Response('OK');
+ },
+ async scheduled(event: ScheduledEvent, env: Env): Promise {
+ const recentAttacks = await getRecentAttacks(env.KV);
+ if (recentAttacks.length === 0)
+ await setProtectionLevel(env.ZONE_ID, ProtectionLevel.MEDIUM, managedRulesetId, client);
+ }
+};
+```
+
+## Multi-rule Tiered Protection (Enterprise Advanced)
+
+```typescript
+const config = {
+ description: 'Multi-tier DDoS protection',
+ rules: [
+ {
+ expression: 'not ip.src in $known_ips and not cf.bot_management.score gt 30',
+ action: 'execute',
+ action_parameters: {
+ id: managedRulesetId,
+ overrides: { sensitivity_level: 'default', action: 'block' }
+ }
+ },
+ {
+ expression: 'cf.bot_management.verified_bot',
+ action: 'execute',
+ action_parameters: {
+ id: managedRulesetId,
+ overrides: { sensitivity_level: 'medium', action: 'managed_challenge' }
+ }
+ },
+ {
+ expression: 'ip.src in $trusted_ips',
+ action: 'execute',
+ action_parameters: { id: managedRulesetId, overrides: { sensitivity_level: 'low' } }
+ }
+ ]
+};
+```
+
+## Defense in Depth
+
+Layered security stack: DDoS + WAF + Rate Limiting + Bot Management.
+
+```typescript
+// Layer 1: DDoS (volumetric attacks)
+await client.zones.rulesets.phases.entrypoint.update('ddos_l7', {
+ zone_id: zoneId,
+ rules: [
+ {
+ expression: 'true',
+ action: 'execute',
+ action_parameters: { id: ddosRulesetId, overrides: { sensitivity_level: 'medium' } }
+ }
+ ]
+});
+
+// Layer 2: WAF (exploit protection)
+await client.zones.rulesets.phases.entrypoint.update('http_request_firewall_managed', {
+ zone_id: zoneId,
+ rules: [{ expression: 'true', action: 'execute', action_parameters: { id: wafRulesetId } }]
+});
+
+// Layer 3: Rate Limiting (abuse prevention)
+await client.zones.rulesets.phases.entrypoint.update('http_ratelimit', {
+ zone_id: zoneId,
+ rules: [
+ {
+ expression: 'http.request.uri.path eq "/api/login"',
+ action: 'block',
+ ratelimit: { characteristics: ['ip.src'], period: 60, requests_per_period: 5 }
+ }
+ ]
+});
+
+// Layer 4: Bot Management (automation detection)
+await client.zones.rulesets.phases.entrypoint.update('http_request_sbfm', {
+ zone_id: zoneId,
+ rules: [{ expression: 'cf.bot_management.score lt 30', action: 'managed_challenge' }]
+});
+```
+
+## Cache Strategy for DDoS Mitigation
+
+Exclude query strings from cache key to counter randomized query parameter attacks.
+
+```typescript
+const cacheRule = {
+ expression: 'http.request.uri.path matches "^/api/"',
+ action: 'set_cache_settings',
+ action_parameters: {
+ cache: true,
+ cache_key: {
+ ignore_query_strings_order: true,
+ custom_key: { query_string: { exclude: { all: true } } }
+ }
+ }
+};
+
+await client.zones.rulesets.phases.entrypoint.update('http_request_cache_settings', {
+ zone_id: zoneId,
+ rules: [cacheRule]
+});
+```
+
+**Rationale**: Attackers randomize query strings (`?random=123456`) to bypass cache. Excluding query params ensures cache hits absorb attack traffic.
+
+See [configuration.md](./configuration.md) for rule structure details.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/do-storage/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/do-storage/README.md
new file mode 100644
index 0000000..a44792c
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/do-storage/README.md
@@ -0,0 +1,16 @@
+# Cloudflare Durable Objects Storage
+
+Use SQLite for new classes. Existing KV-backed classes need their matching API reference; using key-value methods does not by itself identify the backend.
+
+Fetch the relevant current documentation before implementing or reviewing changes.
+
+| Task | Documentation |
+| ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Choose SQL, key-value access, transactions, or recovery APIs | [SQLite storage API](https://developers.cloudflare.com/durable-objects/api/sqlite-storage-api/); [Legacy KV storage API](https://developers.cloudflare.com/durable-objects/api/legacy-kv-storage-api/) |
+| Configure the backend, class lifecycle, and placement | [Configuration](configuration.md) |
+| Find operation semantics and storage options | [API routing](api.md) |
+| Design schemas, caches, scheduled work, or cleanup | [Patterns](patterns.md) |
+| Diagnose concurrency, limits, and billing | [Troubleshooting](gotchas.md) |
+| Verify storage behavior in the Workers runtime | [Testing](testing.md) |
+
+For object routing, WebSockets, and coordination design, see the [Durable Objects skill](../../../durable-objects/SKILL.md).
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/do-storage/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/do-storage/api.md
new file mode 100644
index 0000000..3a98729
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/do-storage/api.md
@@ -0,0 +1,14 @@
+# DO Storage API
+
+Check the class’s backend before choosing operations; storage APIs and recovery capabilities differ.
+
+Fetch the relevant current documentation before implementing or reviewing changes.
+
+| Task | Documentation |
+| ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Use SQL cursors, bound parameters, supported SQL, or database size | [SQLite storage API](https://developers.cloudflare.com/durable-objects/api/sqlite-storage-api/) |
+| Use synchronous or asynchronous key-value methods on SQLite | [SQLite storage API](https://developers.cloudflare.com/durable-objects/api/sqlite-storage-api/) |
+| Maintain asynchronous KV operations on a legacy backend | [Legacy KV storage API](https://developers.cloudflare.com/durable-objects/api/legacy-kv-storage-api/) |
+| Review transactions, write coalescing, storage options, or cleanup | [SQLite storage API](https://developers.cloudflare.com/durable-objects/api/sqlite-storage-api/); [Legacy KV storage API](https://developers.cloudflare.com/durable-objects/api/legacy-kv-storage-api/) |
+| Create bookmarks or restore SQLite data | [SQLite storage API](https://developers.cloudflare.com/durable-objects/api/sqlite-storage-api/) |
+| Schedule, inspect, or cancel an alarm | [Alarms](https://developers.cloudflare.com/durable-objects/api/alarms/) |
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/do-storage/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/do-storage/configuration.md
new file mode 100644
index 0000000..a20c525
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/do-storage/configuration.md
@@ -0,0 +1,16 @@
+# DO Storage Configuration
+
+Prefer SQLite for new classes. Inspect an existing class’s backend and lifecycle configuration before changing either.
+
+Fetch the relevant current documentation before implementing or reviewing changes.
+
+| Task | Documentation |
+| ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Create a SQLite-backed class, binding, and generated types | [Getting started](https://developers.cloudflare.com/durable-objects/get-started/) |
+| Choose storage and manage class exports | [Class exports](https://developers.cloudflare.com/durable-objects/reference/durable-objects-migrations/) |
+| Maintain legacy migration configuration | [Legacy class migrations](https://developers.cloudflare.com/durable-objects/reference/durable-object-class-migrations-legacy/) |
+| Initialize schemas or evolve application tables | [Rules of Durable Objects](https://developers.cloudflare.com/durable-objects/best-practices/rules-of-durable-objects/); [SQLite storage API](https://developers.cloudflare.com/durable-objects/api/sqlite-storage-api/) |
+| Set placement hints or jurisdiction constraints | [Data location](https://developers.cloudflare.com/durable-objects/reference/data-location/) |
+| Configure CPU allowances and check storage constraints | [Limits](https://developers.cloudflare.com/durable-objects/platform/limits/) |
+
+A class configuration change is not an application-data migration. Check the documented backend transition constraints in [Class exports](https://developers.cloudflare.com/durable-objects/reference/durable-objects-migrations/) before planning a backend change.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/do-storage/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/do-storage/gotchas.md
new file mode 100644
index 0000000..8cfe1ff
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/do-storage/gotchas.md
@@ -0,0 +1,15 @@
+# DO Storage Troubleshooting
+
+Identify the backend and failing operation before applying concurrency or recovery guidance.
+
+Fetch the relevant current documentation before implementing or reviewing changes.
+
+| Task | Documentation |
+| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Input/output gates, write coalescing, external I/O races, or storage options | [Rules of Durable Objects](https://developers.cloudflare.com/durable-objects/best-practices/rules-of-durable-objects/); [SQLite storage API](https://developers.cloudflare.com/durable-objects/api/sqlite-storage-api/); [Legacy KV storage API](https://developers.cloudflare.com/durable-objects/api/legacy-kv-storage-api/) |
+| SQL transactions, synchronous callbacks, parameter types, or numeric precision | [SQLite storage API](https://developers.cloudflare.com/durable-objects/api/sqlite-storage-api/) |
+| Alarm cancellation and storage deletion | [Alarms](https://developers.cloudflare.com/durable-objects/api/alarms/); [SQLite storage API](https://developers.cloudflare.com/durable-objects/api/sqlite-storage-api/) |
+| Slow queries, indexing, caching, or initialization | [Rules of Durable Objects](https://developers.cloudflare.com/durable-objects/best-practices/rules-of-durable-objects/); [Durable Object State](https://developers.cloudflare.com/durable-objects/api/state/) |
+| Storage limits or CPU exhaustion | [Limits](https://developers.cloudflare.com/durable-objects/platform/limits/) |
+| Storage charges and operation accounting | [Pricing](https://developers.cloudflare.com/durable-objects/platform/pricing/) |
+| Overload, storage timeouts, or object resets | [Troubleshooting](https://developers.cloudflare.com/durable-objects/observability/troubleshooting/); [Error handling](https://developers.cloudflare.com/durable-objects/best-practices/error-handling/) |
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/do-storage/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/do-storage/patterns.md
new file mode 100644
index 0000000..d0318db
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/do-storage/patterns.md
@@ -0,0 +1,15 @@
+# DO Storage Patterns
+
+Persist essential state and treat memory as a reconstructible cache. Coordinate related updates within the storage and concurrency guarantees of the selected backend.
+
+Fetch the relevant current documentation before implementing or reviewing changes.
+
+| Task | Documentation |
+| --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Schema initialization, migrations, indexes, caching, or parent-child coordination | [Rules of Durable Objects](https://developers.cloudflare.com/durable-objects/best-practices/rules-of-durable-objects/) |
+| Counters, transactions, and atomic updates | [SQLite storage API](https://developers.cloudflare.com/durable-objects/api/sqlite-storage-api/); [Legacy KV storage API](https://developers.cloudflare.com/durable-objects/api/legacy-kv-storage-api/); [Counter example](https://developers.cloudflare.com/durable-objects/examples/build-a-counter/) |
+| Batch processing or multiple scheduled events | [Alarms](https://developers.cloudflare.com/durable-objects/api/alarms/); [Batching example](https://developers.cloudflare.com/durable-objects/examples/alarms-api/) |
+| Cleanup and expiration | [Time to Live example](https://developers.cloudflare.com/durable-objects/examples/durable-object-ttl/); [SQLite storage API](https://developers.cloudflare.com/durable-objects/api/sqlite-storage-api/) |
+| Design application-specific rate limiting | [Rules of Durable Objects](https://developers.cloudflare.com/durable-objects/best-practices/rules-of-durable-objects/); [SQLite storage API](https://developers.cloudflare.com/durable-objects/api/sqlite-storage-api/) |
+
+Verify persistence, isolation, and rollback behavior with the [testing guidance](testing.md).
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/do-storage/testing.md b/.agents/plugins/cloudflare/skills/cloudflare/references/do-storage/testing.md
new file mode 100644
index 0000000..df37eb4
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/do-storage/testing.md
@@ -0,0 +1,13 @@
+# DO Storage Testing
+
+Choose tests around persistence, rollback, instance isolation, and scheduled-work behavior. Inspect installed test packages and configuration before changing the suite.
+
+Fetch the relevant current documentation before implementing or reviewing changes.
+
+| Task | Documentation |
+| -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Set up or migrate a test suite, choose helpers, and manage isolation | [Testing Durable Objects](../../../durable-objects/references/testing.md) |
+| Exercise RPC, SQLite storage, and alarms | [Testing Durable Objects example](https://developers.cloudflare.com/durable-objects/examples/testing-with-durable-objects/) |
+| Determine the storage or recovery contract to verify | [SQLite storage API](https://developers.cloudflare.com/durable-objects/api/sqlite-storage-api/); [Legacy KV storage API](https://developers.cloudflare.com/durable-objects/api/legacy-kv-storage-api/) |
+
+Use the current test documentation for helper signatures and runtime limitations. For point-in-time recovery tests, check both the storage API and the test runtime’s supported behavior before assuming a restart reproduces production recovery.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/email-routing/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/email-routing/README.md
new file mode 100644
index 0000000..8b41d39
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/email-routing/README.md
@@ -0,0 +1,19 @@
+# Email Routing
+
+Use routing rules for address-based forwarding; use an Email Worker when incoming mail needs custom processing. Fetch the linked docs before implementing APIs, DNS, configuration, or limits.
+
+| Task | Start here |
+| ----------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
+| Forward incoming mail to an existing mailbox | [Route emails](https://developers.cloudflare.com/email-service/get-started/route-emails/) |
+| Manage addresses, verification, catch-all rules, or subaddressing | [Routing rules and addresses](https://developers.cloudflare.com/email-service/configuration/email-routing-addresses/) |
+| Filter, parse, reply to, or store incoming mail | [Email Workers](../email-workers/README.md) |
+| Send a new outbound message | [Send emails](https://developers.cloudflare.com/email-service/get-started/send-emails/) — Workers binding, REST API, or SMTP |
+
+Forwarding requires verified destinations. Replying within an incoming email event and sending a new outbound message have different requirements; use the relevant API docs.
+
+## Reference map
+
+- [Configuration](configuration.md): domains, rules, deployment, and local testing.
+- [API](api.md): routing management and inbound/outbound operations.
+- [Patterns](patterns.md): filtering, parsing, storage, and notifications.
+- [Troubleshooting](gotchas.md): authentication, delivery, and current limits.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/email-routing/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/email-routing/api.md
new file mode 100644
index 0000000..44e4d1b
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/email-routing/api.md
@@ -0,0 +1,13 @@
+# Email Routing APIs
+
+Fetch the relevant API page before writing code; do not infer sending types or recipient restrictions from incoming-mail APIs.
+
+| Task | Documentation |
+| -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Manage routing settings, rules, and destination addresses programmatically | [Email Routing REST API](https://developers.cloudflare.com/api/resources/email_routing/) |
+| Read incoming message metadata; forward, reply, or reject | [Email handler API](https://developers.cloudflare.com/email-service/api/route-emails/email-handler/) |
+| Send from a Worker, including attachments or existing raw MIME | [Sending Workers API](https://developers.cloudflare.com/email-service/api/send-emails/workers-api/) |
+| Restrict a sending binding's senders or recipients | [Configure send bindings](https://developers.cloudflare.com/email-service/configuration/send-bindings/) |
+| Send from an external application | [Sending REST API](https://developers.cloudflare.com/email-service/api/send-emails/rest-api/) or [SMTP](https://developers.cloudflare.com/email-service/api/send-emails/smtp/) |
+
+For incoming messages, distinguish SMTP envelope addresses from message headers. Use [Email Workers API guidance](../email-workers/api.md) for processing and [authentication docs](https://developers.cloudflare.com/email-service/concepts/email-authentication/) for identity checks.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/email-routing/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/email-routing/configuration.md
new file mode 100644
index 0000000..dd080c7
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/email-routing/configuration.md
@@ -0,0 +1,13 @@
+# Email Routing Setup
+
+Fetch the setup page matching the operation. Email Sending and Email Routing have separate domain configuration; enabling one is not a substitute for configuring the other.
+
+| Task | Documentation |
+| -------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Onboard a routing domain and deploy/connect an Email Worker | [Route emails](https://developers.cloudflare.com/email-service/get-started/route-emails/) |
+| Inspect DNS records, conflicts, verification, or disable routing | [Domain configuration](https://developers.cloudflare.com/email-service/configuration/domains/) |
+| Verify forwarding destinations and manage routing or catch-all rules | [Routing rules and addresses](https://developers.cloudflare.com/email-service/configuration/email-routing-addresses/) |
+| Configure a subdomain | [Subdomains](https://developers.cloudflare.com/email-service/configuration/subdomains/) |
+| Configure outbound email | [Send emails](https://developers.cloudflare.com/email-service/get-started/send-emails/) and [send binding restrictions](https://developers.cloudflare.com/email-service/configuration/send-bindings/) |
+| Test an incoming email locally | [Local routing development](https://developers.cloudflare.com/email-service/local-development/routing/) |
+| Add Worker storage, types, secrets, or environments | [Email Workers configuration](../email-workers/configuration.md) |
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/email-routing/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/email-routing/gotchas.md
new file mode 100644
index 0000000..b643f1c
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/email-routing/gotchas.md
@@ -0,0 +1,15 @@
+# Email Routing Troubleshooting
+
+Start with the message's activity log to distinguish routing, authentication, and delivery failures, then fetch the matching documentation.
+
+| Symptom or question | Documentation |
+| ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
+| Rule disabled, wrong destination, or catch-all behavior | [Routing rules and verified addresses](https://developers.cloudflare.com/email-service/configuration/email-routing-addresses/) |
+| DNS conflict or domain not configured | [Domain configuration](https://developers.cloudflare.com/email-service/configuration/domains/) |
+| SPF, DKIM, or DMARC failure | [Authentication troubleshooting](https://developers.cloudflare.com/email-service/reference/troubleshooting/) |
+| Message missing, rejected, dropped, or delivery failed | [Email logs](https://developers.cloudflare.com/email-service/observability/logs/) |
+| Quotas, message sizes, routing capacity, or Worker resource exhaustion | [Current limits](https://developers.cloudflare.com/email-service/platform/limits/) |
+| Sending costs and verified-destination allowances | [Pricing](https://developers.cloudflare.com/email-service/platform/pricing/) |
+| Stream, parser, reply, or Worker execution error | [Email Workers troubleshooting](../email-workers/gotchas.md) |
+
+Do not use a sender-address string as proof of authentication. Inspect the authentication results described in the logs and authentication docs.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/email-routing/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/email-routing/patterns.md
new file mode 100644
index 0000000..24e808f
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/email-routing/patterns.md
@@ -0,0 +1,13 @@
+# Email Routing Patterns
+
+Prefer a routing rule when the destination depends only on the email address. Use an Email Worker for decisions based on message content or application state.
+
+| Task | Documentation |
+| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
+| Address-based forwarding, catch-all, or subaddressing | [Routing rules and addresses](https://developers.cloudflare.com/email-service/configuration/email-routing-addresses/) |
+| Recipient/subject routing, multiple destinations, rejection, or automatic replies | [Email handler actions](https://developers.cloudflare.com/email-service/api/route-emails/email-handler/) |
+| Filter unwanted messages | [Spam filtering](https://developers.cloudflare.com/email-service/examples/email-routing/spam-filtering/) |
+| Parse MIME, extract attachments, archive mail, or notify an application | [Email Workers patterns](../email-workers/patterns.md) |
+| Send outbound attachments | [Email attachments](https://developers.cloudflare.com/email-service/examples/email-sending/email-attachments/) |
+
+Verify all forwarding destinations. For delayed responses after processing or human review, use the outbound sending API; an incoming event's reply operation belongs to that event.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/email-workers/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/email-workers/README.md
new file mode 100644
index 0000000..776cb70
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/email-workers/README.md
@@ -0,0 +1,18 @@
+# Email Workers
+
+Use an Email Worker's `email()` handler for custom processing of incoming mail. Use [routing rules](../email-routing/README.md) for simple address-based forwarding. Fetch current documentation before implementing the handler or its dependencies.
+
+| Operation | Documentation |
+| ----------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
+| Forward to a verified destination, reject, or reply within the incoming event | [Email handler API](https://developers.cloudflare.com/email-service/api/route-emails/email-handler/) |
+| Send a new message or a later response | [Sending Workers API](https://developers.cloudflare.com/email-service/api/send-emails/workers-api/) |
+| Parse and store mail for later processing | [Email storage and processing](https://developers.cloudflare.com/email-service/examples/email-routing/email-storage/) |
+
+`message.raw` is a single-use stream. If parsing and archiving both need the raw content, plan how to reuse it rather than reading the stream twice. Forwarding destinations must be verified; reply requirements are documented separately from outbound sending.
+
+## Reference map
+
+- [Configuration](configuration.md): routing, bindings, local development, and types.
+- [API](api.md): message actions, MIME, and sending.
+- [Patterns](patterns.md): filtering, storage, attachments, and background processing.
+- [Troubleshooting](gotchas.md): stream handling, authentication, limits, and errors.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/email-workers/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/email-workers/api.md
new file mode 100644
index 0000000..9cdf2b0
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/email-workers/api.md
@@ -0,0 +1,15 @@
+# Email Workers APIs
+
+Fetch the relevant page for current interfaces and return types.
+
+| Task | Documentation |
+| -------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Implement the handler; inspect envelope addresses, headers, raw content, or size | [Email handler API](https://developers.cloudflare.com/email-service/api/route-emails/email-handler/) |
+| Forward, add forwarding headers, reject, or reply with MIME and threading | [Email actions and reply requirements](https://developers.cloudflare.com/email-service/api/route-emails/email-handler/) |
+| Parse MIME bodies and attachments | [Email handler parsing guidance](https://developers.cloudflare.com/email-service/api/route-emails/email-handler/) — follow its postal-mime reference |
+| Send new outbound mail or an existing raw MIME message | [Sending Workers API](https://developers.cloudflare.com/email-service/api/send-emails/workers-api/) |
+| Configure sender and recipient restrictions | [Send bindings](https://developers.cloudflare.com/email-service/configuration/send-bindings/) |
+| Set outbound headers | [Email headers](https://developers.cloudflare.com/email-service/reference/headers/) |
+| Generate Worker and binding types | [Workers TypeScript](https://developers.cloudflare.com/workers/languages/typescript/) |
+
+Envelope addresses describe SMTP transport; message headers describe the message. Neither an address comparison nor a display header replaces [email authentication](https://developers.cloudflare.com/email-service/concepts/email-authentication/).
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/email-workers/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/email-workers/configuration.md
new file mode 100644
index 0000000..11dcaf2
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/email-workers/configuration.md
@@ -0,0 +1,16 @@
+# Email Workers Configuration
+
+An incoming routing rule connects an address to a Worker. Add an outbound sending binding when the application needs the sending API.
+
+| Task | Documentation |
+| ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Create, deploy, and connect an email-processing Worker | [Route emails](https://developers.cloudflare.com/email-service/get-started/route-emails/) |
+| Verify destinations, configure rules, or check DNS | [Email Routing configuration](../email-routing/configuration.md) |
+| Configure outbound sending and address restrictions | [Sending Workers API](https://developers.cloudflare.com/email-service/api/send-emails/workers-api/) and [send bindings](https://developers.cloudflare.com/email-service/configuration/send-bindings/) |
+| Simulate incoming messages | [Local routing development](https://developers.cloudflare.com/email-service/local-development/routing/) |
+| Test outbound messages and attachment behavior | [Local sending development](https://developers.cloudflare.com/email-service/local-development/sending/) |
+| Configure KV, R2, D1, variables, or environments | [Wrangler configuration](https://developers.cloudflare.com/workers/wrangler/configuration/) |
+| Generate runtime and binding types | [Workers TypeScript](https://developers.cloudflare.com/workers/languages/typescript/) |
+| Store credentials | [Workers secrets](https://developers.cloudflare.com/workers/configuration/secrets/) |
+
+Follow the handler docs for MIME library requirements. Local sending simulation and remote sending have different effects: remote bindings deliver real email.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/email-workers/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/email-workers/gotchas.md
new file mode 100644
index 0000000..8ecd1c6
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/email-workers/gotchas.md
@@ -0,0 +1,15 @@
+# Email Workers Troubleshooting
+
+| Symptom or decision | Documentation |
+| ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Raw stream already consumed or locked | [ReadableStream](https://developers.cloudflare.com/workers/runtime-apis/streams/readablestream/) and [handler parsing guidance](https://developers.cloudflare.com/email-service/api/route-emails/email-handler/) |
+| Forwarding or reply exception; unsupported forwarding headers | [Email handler actions and requirements](https://developers.cloudflare.com/email-service/api/route-emails/email-handler/) |
+| Unverified destination or disabled rule | [Routing rules and addresses](https://developers.cloudflare.com/email-service/configuration/email-routing-addresses/) |
+| Sender identity or authentication failure | [Email authentication](https://developers.cloudflare.com/email-service/concepts/email-authentication/) and [troubleshooting](https://developers.cloudflare.com/email-service/reference/troubleshooting/) |
+| Sending validation, attachment, or recipient error | [Sending API errors](https://developers.cloudflare.com/email-service/api/send-emails/workers-api/) |
+| Local test or binary attachment issue | [Local routing](https://developers.cloudflare.com/email-service/local-development/routing/) and [local sending](https://developers.cloudflare.com/email-service/local-development/sending/) |
+| CPU, memory, message-size, or reply limits | [Email limits](https://developers.cloudflare.com/email-service/platform/limits/) and [Workers limits](https://developers.cloudflare.com/workers/platform/limits/) |
+| Background work or unhandled error | [Execution context](https://developers.cloudflare.com/workers/runtime-apis/context/) and [Workers logs](https://developers.cloudflare.com/workers/observability/logs/) |
+| Mail accepted but missing at the destination | [Email activity logs](https://developers.cloudflare.com/email-service/observability/logs/) |
+
+Raw content is single-use: reuse buffered content if multiple operations need it, and account for memory limits. `waitUntil()` extends execution lifetime; it does not remove CPU or memory limits. Diagnose reply failures against the incoming message's requirements, not just the sending domain's DNS.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/email-workers/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/email-workers/patterns.md
new file mode 100644
index 0000000..b9b67e1
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/email-workers/patterns.md
@@ -0,0 +1,16 @@
+# Email Workers Patterns
+
+Fetch the workflow page, then adapt it to the application's routing and storage requirements.
+
+| Task | Documentation |
+| -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Route by recipient or subject, forward to multiple destinations, or reject | [Email handler actions](https://developers.cloudflare.com/email-service/api/route-emails/email-handler/) |
+| Parse MIME bodies and attachments | [Email handler parsing guidance](https://developers.cloudflare.com/email-service/api/route-emails/email-handler/) |
+| Filter incoming mail | [Spam filtering](https://developers.cloudflare.com/email-service/examples/email-routing/spam-filtering/) |
+| Reply within the incoming event with threading | [Reply requirements and examples](https://developers.cloudflare.com/email-service/api/route-emails/email-handler/) |
+| Archive metadata in KV or enqueue mail for later processing | [Email storage and processing](https://developers.cloudflare.com/email-service/examples/email-routing/email-storage/) |
+| Store raw mail or extracted attachment bytes in R2 | [R2 Workers API](https://developers.cloudflare.com/r2/api/workers/workers-api-reference/) |
+| Notify a webhook or schedule work within the invocation lifetime | [Fetch](https://developers.cloudflare.com/workers/runtime-apis/fetch/) and [execution context](https://developers.cloudflare.com/workers/runtime-apis/context/) |
+| Send a later response or new outbound attachment | [Sending Workers API](https://developers.cloudflare.com/email-service/api/send-emails/workers-api/) and [attachment examples](https://developers.cloudflare.com/email-service/examples/email-sending/email-attachments/) |
+
+Plan a single read of raw content when both parsing and storage need it. A queue consumer or later request sends through the outbound API because the original incoming email event is no longer available.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/flagship/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/flagship/README.md
new file mode 100644
index 0000000..3bb7cc1
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/flagship/README.md
@@ -0,0 +1,59 @@
+# Cloudflare Flagship
+
+Feature flag service for controlling feature visibility without redeploying code. Define flags with targeting rules and percentage-based rollouts, then evaluate them in Workers via a native binding or from any JavaScript runtime via the OpenFeature SDK.
+
+## When to Use
+
+| Need | Use Flagship? | Alternative |
+| ---------------------------------------------- | ------------- | ------------------------------ |
+| Feature toggles (on/off) | Yes | — |
+| Gradual rollouts (percentage-based) | Yes | — |
+| A/B testing with attribute targeting | Yes | — |
+| Multi-variant configuration delivery | Yes | — |
+| Environment-specific config (dev/staging/prod) | Consider | Wrangler environments, secrets |
+| Static config that never changes | No | `wrangler.jsonc` vars |
+| Per-request rate limiting | No | Rate Limiting rules |
+
+## Key Concepts
+
+- **Apps** — Top-level organizational unit. Maps to a project or service. Each account can have multiple apps.
+- **Flags** — Named feature toggles with a key, variations, targeting rules, and enabled/disabled state.
+- **Variations** — Possible values a flag returns. Types: boolean, string, number, JSON object. All variations on a flag must share the same type.
+- **Targeting rules** — Sequential, priority-ordered conditions that determine which variation to serve. First match wins; no match returns the default.
+- **Evaluation context** — Key-value attributes (`userId`, `country`, `plan`, etc.) passed at evaluation time for rule matching and rollout bucketing.
+- **Percentage rollouts** — Gradually release to a fraction of users. Consistent hashing on a configurable attribute ensures sticky bucketing.
+
+## Two Evaluation Paths
+
+| Path | Runtime | Package | Latency | Auth |
+| ------------------------- | ------------------------- | ---------------------------------------------------------------------------- | ------------------------------------------- | -------------------------------- |
+| **Binding** (`env.FLAGS`) | Workers only | `@cloudflare/workers-types` | Lowest (no HTTP) | Automatic via binding |
+| **OpenFeature SDK** | Workers, Node.js, browser | `@cloudflare/flagship` + `@openfeature/server-sdk` or `@openfeature/web-sdk` | HTTP per eval (server) or prefetch (client) | API token or binding passthrough |
+
+**Recommendation:** Use the binding inside Workers. Use the SDK when running outside Workers or when you need OpenFeature vendor-neutrality.
+
+## Reading Order
+
+| Task | Read |
+| --------------------------------- | ---------------------------------- |
+| Set up Flagship in a Worker | `configuration.md` → `api.md` |
+| Evaluate flags in code | `configuration.md` → `patterns.md` |
+| Manage flags via REST API | `api.md` → `patterns.md` |
+| Design targeting rules & rollouts | `patterns.md` → `gotchas.md` |
+| Debug flag evaluation issues | `gotchas.md` → `api.md` |
+
+REST API note: management endpoints use Cloudflare v4 envelopes (`result`, `result_info`, `errors`) and snake_case fields. The `/evaluate` endpoint is the exception: it is not enveloped and returns OpenFeature-style camelCase.
+
+## In This Reference
+
+- **[api.md](./api.md)** — REST API endpoints, binding methods, OpenFeature SDK, schemas
+- **[configuration.md](./configuration.md)** — Wrangler binding setup, SDK installation, TypeScript types
+- **[patterns.md](./patterns.md)** — Flag CRUD via API, targeting rules, rollouts, OpenFeature usage
+- **[gotchas.md](./gotchas.md)** — Common errors, limits, anti-patterns, troubleshooting
+
+## See Also
+
+- **[Flagship API reference](https://developers.cloudflare.com/api/resources/flagship/)** — Source of truth for REST API paths, envelopes, and response fields
+- **[Workers docs](https://developers.cloudflare.com/workers/)** — Workers runtime (Flagship runs inside Workers)
+- **[../kv/](../kv/)** — KV storage (Flagship uses KV infrastructure for flag delivery)
+- **[Wrangler docs](https://developers.cloudflare.com/workers/wrangler/)** — Wrangler CLI for deployment and config
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/flagship/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/flagship/api.md
new file mode 100644
index 0000000..c98cdfa
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/flagship/api.md
@@ -0,0 +1,394 @@
+# Flagship API Reference
+
+## Binding API (Workers)
+
+The binding is available as `env.FLAGS` (type `Flagship` from `@cloudflare/workers-types`).
+
+### Evaluation Methods
+
+All methods are async, never throw, and return the `defaultValue` on errors.
+
+| Method | Signature | Returns |
+| ------------------- | ------------------------------------------------------ | --------------------------------------------- |
+| `get` | `get(flagKey, defaultValue?, context?)` | `Promise` |
+| `getBooleanValue` | `getBooleanValue(flagKey, defaultValue, context?)` | `Promise` |
+| `getStringValue` | `getStringValue(flagKey, defaultValue, context?)` | `Promise` |
+| `getNumberValue` | `getNumberValue(flagKey, defaultValue, context?)` | `Promise` |
+| `getObjectValue` | `getObjectValue(flagKey, defaultValue, context?)` | `Promise` |
+| `getBooleanDetails` | `getBooleanDetails(flagKey, defaultValue, context?)` | `Promise>` |
+| `getStringDetails` | `getStringDetails(flagKey, defaultValue, context?)` | `Promise>` |
+| `getNumberDetails` | `getNumberDetails(flagKey, defaultValue, context?)` | `Promise>` |
+| `getObjectDetails` | `getObjectDetails(flagKey, defaultValue, context?)` | `Promise>` |
+
+### Parameters (shared across all methods)
+
+| Parameter | Type | Required | Description |
+| -------------- | --------------------------- | ------------------ | ----------------------------------------------------------------------- |
+| `flagKey` | `string` | Yes | Flag key to evaluate |
+| `defaultValue` | varies | Yes (except `get`) | Fallback if evaluation fails or flag not found |
+| `context` | `FlagshipEvaluationContext` | No | Attributes for targeting rules (`{ userId: "user-42", country: "US" }`) |
+
+### Types
+
+```typescript
+type FlagshipEvaluationContext = Record;
+
+interface FlagshipEvaluationDetails {
+ flagKey: string;
+ value: T;
+ variant?: string; // name of the matched variation
+ reason?: string; // "TARGETING_MATCH" | "DEFAULT" | "DISABLED" | "SPLIT"
+ errorCode?: string; // "TYPE_MISMATCH" | "GENERAL"
+ errorMessage?: string;
+}
+```
+
+### Example
+
+```typescript
+export default {
+ async fetch(request: Request, env: Env): Promise {
+ const enabled = await env.FLAGS.getBooleanValue('new-feature', false, {
+ userId: 'user-42'
+ });
+ return new Response(enabled ? 'Feature on' : 'Feature off');
+ }
+};
+```
+
+---
+
+## OpenFeature SDK
+
+Package: `@cloudflare/flagship`
+
+### Server Provider (`FlagshipServerProvider`)
+
+For Workers, Node.js, and server-side JavaScript.
+
+**With binding (recommended inside Workers):**
+
+```typescript
+import { OpenFeature } from '@openfeature/server-sdk';
+import { FlagshipServerProvider } from '@cloudflare/flagship';
+
+await OpenFeature.setProviderAndWait(new FlagshipServerProvider({ binding: env.FLAGS }));
+const client = OpenFeature.getClient();
+const enabled = await client.getBooleanValue('new-checkout', false, {
+ targetingKey: 'user-42'
+});
+```
+
+**With app ID (Node.js / non-Worker runtimes):**
+
+```typescript
+import { OpenFeature } from '@openfeature/server-sdk';
+import { FlagshipServerProvider } from '@cloudflare/flagship';
+
+await OpenFeature.setProviderAndWait(
+ new FlagshipServerProvider({
+ appId: '',
+ accountId: '',
+ authToken: ''
+ })
+);
+const client = OpenFeature.getClient();
+const enabled = await client.getBooleanValue('new-checkout', false, {
+ targetingKey: 'user-42'
+});
+```
+
+### Client Provider (`FlagshipClientProvider`)
+
+For browser applications. Pre-fetches flags on init, evaluates synchronously.
+
+```typescript
+import { OpenFeature } from '@openfeature/web-sdk';
+import { FlagshipClientProvider } from '@cloudflare/flagship';
+
+await OpenFeature.setProviderAndWait(
+ new FlagshipClientProvider({
+ appId: '',
+ accountId: '',
+ authToken: '',
+ prefetchFlags: ['promo-banner', 'dark-mode']
+ })
+);
+await OpenFeature.setContext({ targetingKey: 'user-42', plan: 'enterprise' });
+const client = OpenFeature.getClient();
+
+// Synchronous — no await needed
+const showBanner = client.getBooleanValue('promo-banner', false);
+```
+
+**Important:** Only flags listed in `prefetchFlags` are available. Unlisted flags return `FLAG_NOT_FOUND`.
+
+### SDK Hooks
+
+```typescript
+import { LoggingHook, TelemetryHook } from '@cloudflare/flagship';
+OpenFeature.addHooks(new LoggingHook(), new TelemetryHook());
+```
+
+---
+
+## REST API (Flag Management)
+
+Source of truth: [Cloudflare Flagship API reference](https://developers.cloudflare.com/api/resources/flagship/). Use it to verify REST paths, envelopes, response fields, and permission wording before relying on examples here.
+
+### FIRST: Check Prerequisites
+
+Before making any REST API calls (create, read, update, delete, toggle flags), verify these environment variables are set:
+
+| Variable | Purpose | How to get |
+| ----------------------- | ------------------------- | -------------------------------------------------------------------------------------------- |
+| `CLOUDFLARE_ACCOUNT_ID` | Account identifier | Dashboard URL or `wrangler whoami` |
+| `CLOUDFLARE_API_TOKEN` | Bearer token for API auth | [Create API token](https://dash.cloudflare.com/profile/api-tokens) with Flagship permissions |
+| `FLAGSHIP_APP_ID` | Target app UUID | Dashboard under **Compute > Flagship**, or `GET /apps` endpoint |
+
+Check with:
+
+```bash
+echo "CLOUDFLARE_ACCOUNT_ID=${CLOUDFLARE_ACCOUNT_ID:-(not set)}"
+echo "CLOUDFLARE_API_TOKEN=${CLOUDFLARE_API_TOKEN:-(not set)}"
+echo "FLAGSHIP_APP_ID=${FLAGSHIP_APP_ID:-(not set)}"
+```
+
+**If any are missing, ask the user to provide them before proceeding.**
+
+### Base URL and Auth
+
+Base URL: `https://api.cloudflare.com/client/v4/accounts/{account_id}/flagship`
+
+Authentication: `Authorization: Bearer `
+
+Management endpoints use the Cloudflare v4 envelope. On success, the payload is under `result`; errors are an array under `errors`.
+
+```jsonc
+// Success
+{ "success": true, "result": , "errors": [], "messages": [] }
+
+// Paginated success
+{
+ "success": true,
+ "result": [],
+ "result_info": { "count": 50, "cursor": "next-cursor-or-null" },
+ "errors": [],
+ "messages": []
+}
+
+// Error
+{ "success": false, "result": null, "errors": [{ "message": "message" }], "messages": [] }
+```
+
+### App Endpoints
+
+| Method | Path | Description |
+| -------- | ---------------- | ------------------------------------- |
+| `GET` | `/apps` | List all apps |
+| `GET` | `/apps/{app_id}` | Get app |
+| `POST` | `/apps` | Create app (`{ "name": "my-app" }`) |
+| `PUT` | `/apps/{app_id}` | Update app (`{ "name": "new-name" }`) |
+| `DELETE` | `/apps/{app_id}` | Delete app |
+
+App name constraints: alphanumeric + hyphens + underscores, 1-64 chars.
+
+### Flag Endpoints
+
+| Method | Path | Description |
+| -------- | -------------------------------------------------------------------- | -------------------------- |
+| `GET` | `/apps/{app_id}/flags?limit=50&cursor=` | List flags (paginated) |
+| `GET` | `/apps/{app_id}/flags/{flag_key}` | Get flag |
+| `POST` | `/apps/{app_id}/flags` | Create flag |
+| `PUT` | `/apps/{app_id}/flags/{flag_key}` | Update flag (full replace) |
+| `DELETE` | `/apps/{app_id}/flags/{flag_key}` | Delete flag |
+| `GET` | `/apps/{app_id}/flags/{flag_key}/changelog?limit=20&cursor=` | Flag changelog |
+
+### Evaluate Endpoint
+
+```
+GET /apps/{app_id}/evaluate?flagKey=&
+```
+
+Requires an API token with the `com.cloudflare.account.flagship.evaluate` permission. Context attributes passed as query params. This endpoint is not wrapped in the management envelope; the SDK contract returns OpenFeature-style camelCase:
+
+```json
+{
+ "flagKey": "my-flag",
+ "value": true,
+ "variant": "on",
+ "reason": "SPLIT"
+}
+```
+
+Reasons: `TARGETING_MATCH`, `SPLIT`, `DEFAULT`, `DISABLED`.
+
+### Management Response Payloads
+
+Management endpoints are wrapped in the Cloudflare v4 envelope shown above. Common `.result` payloads:
+
+**App result**
+
+```json
+{
+ "id": "app-uuid",
+ "name": "my-app",
+ "created_at": "2026-06-09T12:00:00.000Z",
+ "updated_at": "2026-06-09T12:00:00.000Z",
+ "updated_by": "user@example.com"
+}
+```
+
+**Flag result**
+
+```json
+{
+ "key": "my-flag",
+ "type": "boolean",
+ "default_variation": "off",
+ "variations": { "on": true, "off": false },
+ "rules": [],
+ "description": "Enables the new feature",
+ "enabled": true,
+ "updated_at": "2026-06-09T12:00:00.000Z",
+ "updated_by": "user@example.com"
+}
+```
+
+**Changelog entry**
+
+```json
+{
+ "flag_key": "my-flag",
+ "event": "update",
+ "after": {
+ "key": "my-flag",
+ "default_variation": "off",
+ "variations": { "on": true, "off": false },
+ "rules": [],
+ "enabled": true
+ },
+ "diff": { "enabled": { "from": false, "to": true } }
+}
+```
+
+Changelog entries include the full flag state after the change. `update` entries also include `diff`.
+
+---
+
+## FlagDefinition Schema
+
+```json
+{
+ "key": "my-flag",
+ "type": "boolean",
+ "default_variation": "off",
+ "variations": {
+ "on": true,
+ "off": false
+ },
+ "rules": [
+ {
+ "priority": 1,
+ "conditions": [
+ {
+ "attribute": "email",
+ "operator": "ends_with",
+ "value": "@cloudflare.com"
+ }
+ ],
+ "serve_variation": "on",
+ "rollout": { "percentage": 100 }
+ }
+ ],
+ "description": "Enables the new feature",
+ "enabled": true
+}
+```
+
+### Field Constraints
+
+| Field | Type | Constraints |
+| ------------------- | ------------------- | ---------------------------------------------------------------------------------------------------------- |
+| `key` | string | 1-64 chars, `/^[a-zA-Z0-9_-]+$/` |
+| `type` | enum | Optional. `boolean`, `string`, `number`, `json` (auto-inferred from variations) |
+| `default_variation` | string | Must be a key in `variations` |
+| `variations` | `Record` | At least one. All values same type. Keys: alphanumeric/hyphens/underscores, max 64 chars. Values max 10KB. |
+| `rules` | `Rule[]` | Can be empty. No duplicate priorities. |
+| `description` | string? | Max 512 chars, nullable |
+| `enabled` | boolean | Required. `false` = always returns default variation. |
+
+### Rule Schema
+
+```json
+{
+ "priority": 1,
+ "conditions": [/* Condition[] */],
+ "serve_variation": "on",
+ "rollout": { "percentage": 50, "attribute": "targetingKey" }
+}
+```
+
+- `priority`: integer >= 1, unique across rules in the flag (lower = evaluated first)
+- `conditions`: array of base or logical conditions
+- `serve_variation`: must be a key in `variations`
+- `rollout`: optional. `percentage` 0-100. `attribute` defaults to `targetingKey`.
+
+### Condition Schema
+
+**Base condition:**
+
+```json
+{ "attribute": "email", "operator": "ends_with", "value": "@cloudflare.com" }
+```
+
+**Logical condition (AND/OR):**
+
+```json
+{
+ "logical_operator": "AND",
+ "clauses": [
+ { "attribute": "country", "operator": "equals", "value": "US" },
+ { "attribute": "plan", "operator": "in", "value": ["enterprise", "business"] }
+ ]
+}
+```
+
+Nesting supported up to 6 levels deep.
+
+### Operators
+
+| Operator | Description | Value Type |
+| ------------------------ | -------------------------------- | ---------------- |
+| `equals` | Exact match (case-sensitive) | String |
+| `not_equals` | Not exact match | String |
+| `greater_than` | Numeric / datetime > | Number, ISO 8601 |
+| `less_than` | Numeric / datetime < | Number, ISO 8601 |
+| `greater_than_or_equals` | >= | Number, ISO 8601 |
+| `less_than_or_equals` | <= | Number, ISO 8601 |
+| `contains` | Substring match (case-sensitive) | String |
+| `starts_with` | Prefix match | String |
+| `ends_with` | Suffix match | String |
+| `in` | Value in array | Array |
+| `not_in` | Value not in array | Array |
+
+---
+
+## Rate Limits
+
+| Operation | Limit |
+| --------------------------- | --------------------------- |
+| Mutations (POST/PUT/DELETE) | 60 per 60s per account:app |
+| Reads (GET) | 600 per 60s per account:app |
+
+## Error Codes
+
+| HTTP Status | Meaning |
+| ----------- | ------------------------------------------- |
+| 200 | Success (read/update/delete) |
+| 201 | Created (create) |
+| 400 | Validation error (check `errors[].message`) |
+| 401 | Invalid or missing token |
+| 404 | Flag or app not found |
+| 409 | Flag key already exists (create) |
+| 429 | Rate limited |
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/flagship/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/flagship/configuration.md
new file mode 100644
index 0000000..b423b89
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/flagship/configuration.md
@@ -0,0 +1,200 @@
+# Flagship Configuration
+
+## Wrangler Binding Setup
+
+Add a Flagship binding to your Wrangler config to access flags via `env.FLAGS`.
+
+### Single App
+
+```jsonc
+// wrangler.jsonc
+{
+ "flagship": {
+ "binding": "FLAGS",
+ "app_id": ""
+ }
+}
+```
+
+```toml
+# wrangler.toml
+[flagship]
+binding = "FLAGS"
+app_id = ""
+```
+
+### Multiple Apps
+
+```jsonc
+// wrangler.jsonc
+{
+ "flagship": [
+ {
+ "binding": "FLAGS",
+ "app_id": ""
+ },
+ {
+ "binding": "EXPERIMENT_FLAGS",
+ "app_id": ""
+ }
+ ]
+}
+```
+
+```toml
+# wrangler.toml
+[[flagship]]
+binding = "FLAGS"
+app_id = ""
+
+[[flagship]]
+binding = "EXPERIMENT_FLAGS"
+app_id = ""
+```
+
+### Generate Types
+
+After adding the binding, generate TypeScript types:
+
+```bash
+npx wrangler types
+```
+
+This creates the `Env` interface with each binding typed as `Flagship`:
+
+```typescript
+interface Env {
+ FLAGS: Flagship;
+ EXPERIMENT_FLAGS: Flagship; // if multiple
+}
+```
+
+The `Flagship` type comes from `@cloudflare/workers-types`.
+
+---
+
+## OpenFeature SDK Installation
+
+### Server-Side (Workers, Node.js)
+
+```bash
+npm i @cloudflare/flagship @openfeature/server-sdk
+```
+
+### Browser
+
+```bash
+npm i @cloudflare/flagship @openfeature/web-sdk
+```
+
+---
+
+## SDK Provider Setup
+
+### Server Provider — With Binding (Workers)
+
+Recommended approach inside Workers. No HTTP overhead, auth handled automatically.
+
+```typescript
+import { OpenFeature } from '@openfeature/server-sdk';
+import { FlagshipServerProvider } from '@cloudflare/flagship';
+
+export default {
+ async fetch(request: Request, env: Env): Promise {
+ await OpenFeature.setProviderAndWait(new FlagshipServerProvider({ binding: env.FLAGS }));
+ const client = OpenFeature.getClient();
+ // ... evaluate flags
+ }
+};
+```
+
+### Server Provider — With App ID (Node.js)
+
+For non-Worker runtimes. Requires an API token with Flagship read permissions.
+
+```typescript
+import { OpenFeature } from '@openfeature/server-sdk';
+import { FlagshipServerProvider } from '@cloudflare/flagship';
+
+await OpenFeature.setProviderAndWait(
+ new FlagshipServerProvider({
+ appId: '',
+ accountId: '',
+ authToken: ''
+ })
+);
+const client = OpenFeature.getClient();
+```
+
+### Client Provider (Browser)
+
+Pre-fetches flags on init, then evaluates synchronously. Only `prefetchFlags` are available.
+
+```typescript
+import { OpenFeature } from '@openfeature/web-sdk';
+import { FlagshipClientProvider } from '@cloudflare/flagship';
+
+await OpenFeature.setProviderAndWait(
+ new FlagshipClientProvider({
+ appId: '',
+ accountId: '',
+ authToken: '',
+ prefetchFlags: ['promo-banner', 'dark-mode', 'max-uploads']
+ })
+);
+await OpenFeature.setContext({ targetingKey: 'user-42', plan: 'enterprise' });
+const client = OpenFeature.getClient();
+```
+
+### Provider Options Reference
+
+**FlagshipServerProvider:**
+
+| Option | Type | Required | Description |
+| ----------- | ---------- | -------- | ------------------------------------------------------------------- |
+| `binding` | `Flagship` | No | Binding from `env.FLAGS`. Use inside Workers. |
+| `appId` | string | No | App ID from dashboard. Required without binding. |
+| `accountId` | string | No | Cloudflare account ID. Required without binding. |
+| `authToken` | string | No | API token with Flagship read permissions. Required without binding. |
+
+Provide either `binding` or all three of `appId` + `accountId` + `authToken`.
+
+**FlagshipClientProvider:**
+
+| Option | Type | Required | Description |
+| --------------- | -------- | -------- | -------------------------------------------------------------- |
+| `appId` | string | Yes | App ID from dashboard |
+| `accountId` | string | Yes | Cloudflare account ID |
+| `authToken` | string | Yes | API token with Flagship read permissions |
+| `prefetchFlags` | string[] | Yes | Flag keys to prefetch. Unlisted flags return `FLAG_NOT_FOUND`. |
+
+---
+
+## REST API Authentication
+
+For managing flags via the REST API (create, update, delete), set these environment variables:
+
+| Variable | Description |
+| ----------------------- | ----------------------------------------------------------------------------- |
+| `CLOUDFLARE_ACCOUNT_ID` | Your Cloudflare account ID |
+| `CLOUDFLARE_API_TOKEN` | API token with Flagship permissions |
+| `FLAGSHIP_APP_ID` | Target app UUID (from dashboard under **Compute > Flagship**, or `GET /apps`) |
+
+Base URL: `https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/flagship`
+
+```bash
+curl -s -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
+ "https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/flagship/apps" | jq .
+```
+
+App IDs are shown in the Cloudflare dashboard under **Compute > Flagship**.
+
+---
+
+## Local Development
+
+Flagship bindings work in local dev with `wrangler dev`. Flag evaluation uses the live Flagship configuration — there is no local flag store. Ensure the `app_id` in your Wrangler config points to a valid app.
+
+```bash
+npx wrangler dev
+```
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/flagship/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/flagship/gotchas.md
new file mode 100644
index 0000000..d4a28bf
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/flagship/gotchas.md
@@ -0,0 +1,180 @@
+# Flagship Gotchas & Troubleshooting
+
+## Common Errors
+
+### Flag Always Returns Default Value
+
+**Cause:** Flag is disabled (`enabled: false`), or no targeting rules match, or evaluation context is missing expected attributes.
+
+**Solution:** Check these in order:
+
+1. Is the flag enabled? (`"enabled": true`)
+2. Do your targeting rules match the context you're passing?
+3. Are you passing the right attributes in the evaluation context?
+
+```typescript
+// ❌ BAD — no context, rules can't match
+const val = await env.FLAGS.getBooleanValue('my-flag', false);
+
+// ✅ GOOD — pass context attributes that rules reference
+const val = await env.FLAGS.getBooleanValue('my-flag', false, {
+ userId: 'user-42',
+ plan: 'enterprise'
+});
+```
+
+### TYPE_MISMATCH Error in Details
+
+**Cause:** Calling a typed method on a flag with a different type (e.g., `getBooleanValue` on a string flag).
+
+**Solution:** Use the method matching the flag's variation type.
+
+```typescript
+// ❌ BAD — flag "checkout-flow" has string variations
+const val = await env.FLAGS.getBooleanValue('checkout-flow', false);
+
+// ✅ GOOD
+const val = await env.FLAGS.getStringValue('checkout-flow', 'original');
+```
+
+### 409 Conflict on Flag Creation
+
+**Cause:** A flag with that key already exists in the app.
+
+**Solution:** Use a different key, or GET + PUT to update the existing flag.
+
+### Inconsistent Rollout Results
+
+**Cause:** `targetingKey` (or the configured bucketing attribute) is missing from the evaluation context, causing random bucketing on each request.
+
+**Solution:** Always pass a stable identifier:
+
+```typescript
+// ❌ BAD — no targetingKey, rollout is random per request
+const val = await env.FLAGS.getBooleanValue('gradual-rollout', false);
+
+// ✅ GOOD — stable userId for consistent bucketing
+const val = await env.FLAGS.getBooleanValue('gradual-rollout', false, {
+ userId: sessionUserId
+});
+```
+
+### Update Overwrites Entire Flag
+
+**Cause:** PUT replaces the full `FlagDefinition`. Sending only changed fields deletes the rest.
+
+**Solution:** Always read-modify-write:
+
+```bash
+# ❌ BAD — overwrites the entire flag, losing rules/variations
+curl -X PUT -d '{"enabled": true}' ...
+
+# ✅ GOOD — GET first, modify, PUT back
+FLAG=$(curl -s -H "Authorization: Bearer $TOKEN" "$URL/flags/my-flag" | jq '.result')
+UPDATED=$(echo "$FLAG" | jq '.enabled = true')
+echo "$UPDATED" | curl -s -X PUT -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d @- "$URL/flags/my-flag"
+```
+
+### Reading REST Envelope Fields
+
+**Cause:** Management endpoints use Cloudflare v4 envelopes, not raw payloads.
+
+**Solution:** Read `.result` for successful payloads, `.result_info.cursor` for pagination, and `.errors[].message` for errors.
+
+```bash
+jq '.result'
+jq '.result_info.cursor'
+jq '.errors[].message'
+```
+
+### Mixing CamelCase and Snake Case in REST Responses
+
+**Cause:** Management API responses are public API JSON and use snake_case. Evaluation responses use OpenFeature-style camelCase.
+
+**Solution:** For management endpoints use `default_variation`, `serve_variation`, `updated_at`, `updated_by`, and changelog `flag_key`. For `/evaluate`, use `flagKey`, `variant`, and `reason`.
+
+### FLAG_NOT_FOUND in Client Provider
+
+**Cause:** Flag key not included in `prefetchFlags` array.
+
+**Solution:** Add the flag key to `prefetchFlags` when initializing `FlagshipClientProvider`.
+
+### Client Provider Token Exposure
+
+**Cause:** The `authToken` passed to `FlagshipClientProvider` is visible in the browser. It can evaluate flags across all apps in the account.
+
+**Solution:** Use a token with minimal permissions (Flagship Evaluate only). Never use a token with write/management permissions in the browser.
+
+---
+
+## Limits
+
+| Limit | Value | Notes |
+| --------------------- | -------------------- | --------------------------------------- |
+| Flag key length | 1-64 chars | Alphanumeric, hyphens, underscores only |
+| Flag key pattern | `/^[a-zA-Z0-9_-]+$/` | — |
+| Variation value size | 10KB max | Per variation, serialized |
+| Variation name length | 64 chars max | Alphanumeric, hyphens, underscores |
+| Description length | 512 chars max | Nullable |
+| App name length | 1-64 chars | Alphanumeric, hyphens, underscores |
+| Logical nesting depth | 6 levels | AND/OR conditions |
+| Mutation rate limit | 60 / 60s | Per account:app |
+| Read rate limit | 600 / 60s | Per account:app |
+| Rollout percentage | 0-100 | Integer |
+| Rule priorities | Unique integers >= 1 | Lower = evaluated first |
+
+---
+
+## Anti-Patterns
+
+### Evaluating Flags in a Tight Loop
+
+Flag evaluation via the binding is fast but not free. Avoid evaluating the same flag repeatedly in a loop — evaluate once and reuse the result.
+
+```typescript
+// ❌ BAD
+for (const item of items) {
+ const enabled = await env.FLAGS.getBooleanValue('my-flag', false, ctx);
+ // ...
+}
+
+// ✅ GOOD
+const enabled = await env.FLAGS.getBooleanValue('my-flag', false, ctx);
+for (const item of items) {
+ // use `enabled`
+}
+```
+
+### Using the SDK Inside Workers When Binding Is Available
+
+The binding avoids HTTP overhead entirely. Only use the SDK inside Workers when you specifically need OpenFeature vendor-neutrality.
+
+```typescript
+// ❌ Unnecessary HTTP overhead inside a Worker
+const provider = new FlagshipServerProvider({
+ appId: '...',
+ accountId: '...',
+ authToken: '...'
+});
+
+// ✅ Use the binding directly, or pass it to the SDK
+const provider = new FlagshipServerProvider({ binding: env.FLAGS });
+```
+
+### Partial PUT Updates
+
+The flag update API (PUT) requires the complete `FlagDefinition`. Sending only changed fields silently drops everything else. Always GET first, then modify and PUT back the full object.
+
+### Stale Flag Cleanup
+
+Flags that are disabled and no longer referenced in code should be deleted. Stale flags clutter the dashboard and make it harder to understand which flags are active. Follow the safe deletion workflow in `patterns.md`.
+
+---
+
+## Propagation Behavior
+
+Flag changes propagate globally within seconds. During the brief propagation window, some regions may serve the previous value. After propagation completes, all evaluations return the updated value.
+
+- No Worker redeployment needed for flag changes.
+- If the dashboard is temporarily unavailable, evaluation continues using the last propagated configuration.
+- Flag changes made via the REST API and dashboard are equivalent — both trigger propagation.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/flagship/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/flagship/patterns.md
new file mode 100644
index 0000000..7c169f5
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/flagship/patterns.md
@@ -0,0 +1,459 @@
+# Flagship Patterns & Best Practices
+
+## Evaluating Flags in Workers (Binding)
+
+### Simple Boolean Toggle
+
+```typescript
+export default {
+ async fetch(request: Request, env: Env): Promise {
+ const showNewUI = await env.FLAGS.getBooleanValue('new-ui', false, {
+ userId: 'user-42'
+ });
+
+ if (showNewUI) {
+ return new Response('New UI');
+ }
+ return new Response('Classic UI');
+ }
+};
+```
+
+### Multi-Variant String Flag
+
+```typescript
+const checkoutFlow = await env.FLAGS.getStringValue('checkout-flow', 'original', {
+ userId,
+ country: 'US'
+});
+
+switch (checkoutFlow) {
+ case 'streamlined':
+ return handleStreamlined(request);
+ case 'one-click':
+ return handleOneClick(request);
+ default:
+ return handleOriginal(request);
+}
+```
+
+### JSON Config Flag
+
+```typescript
+interface RateLimitConfig {
+ rpm: number;
+ burst: number;
+}
+
+const limits = await env.FLAGS.getObjectValue(
+ 'rate-limits',
+ { rpm: 100, burst: 20 },
+ { plan: userPlan }
+);
+```
+
+### Using Details for Observability
+
+```typescript
+const details = await env.FLAGS.getBooleanDetails('new-checkout', false, {
+ userId: 'user-42'
+});
+
+console.log(details.value); // true
+console.log(details.variant); // "on"
+console.log(details.reason); // "TARGETING_MATCH"
+console.log(details.errorCode); // undefined (no error)
+```
+
+---
+
+## Evaluating Flags with OpenFeature (Workers)
+
+### Binding Passthrough (Recommended)
+
+```typescript
+import { OpenFeature } from '@openfeature/server-sdk';
+import { FlagshipServerProvider } from '@cloudflare/flagship';
+
+export default {
+ async fetch(request: Request, env: Env): Promise {
+ await OpenFeature.setProviderAndWait(new FlagshipServerProvider({ binding: env.FLAGS }));
+ const client = OpenFeature.getClient();
+
+ const enabled = await client.getBooleanValue('new-checkout', false, {
+ targetingKey: 'user-42',
+ plan: 'enterprise',
+ country: 'US'
+ });
+
+ return new Response(enabled ? 'New checkout' : 'Standard checkout');
+ }
+};
+```
+
+### Migration from Another Provider
+
+Only the provider initialization changes — evaluation call sites stay the same:
+
+```typescript
+// ❌ Before (LaunchDarkly)
+await OpenFeature.setProviderAndWait(new LaunchDarklyProvider({ sdkKey: '...' }));
+
+// ✅ After (Flagship)
+await OpenFeature.setProviderAndWait(new FlagshipServerProvider({ binding: env.FLAGS }));
+
+// Evaluation code is unchanged
+const enabled = await client.getBooleanValue('my-flag', false, {
+ targetingKey: 'user-42'
+});
+```
+
+---
+
+## Managing Flags via REST API
+
+All examples use `api.cloudflare.com`. Set `CLOUDFLARE_ACCOUNT_ID`, `FLAGSHIP_APP_ID`, and `CLOUDFLARE_API_TOKEN` first.
+
+### Create a Boolean Flag
+
+```bash
+curl -s -X POST \
+ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "key": "new-feature",
+ "default_variation": "off",
+ "variations": { "on": true, "off": false },
+ "rules": [],
+ "description": "Enable the new feature",
+ "enabled": false
+ }' \
+ "https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/flagship/apps/$FLAGSHIP_APP_ID/flags" | jq .
+```
+
+### Create a Flag with Internal-Only Targeting
+
+```bash
+curl -s -X POST \
+ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "key": "beta-feature",
+ "default_variation": "off",
+ "variations": { "on": true, "off": false },
+ "rules": [
+ {
+ "priority": 1,
+ "conditions": [
+ { "attribute": "email", "operator": "ends_with", "value": "@cloudflare.com" }
+ ],
+ "serve_variation": "on"
+ }
+ ],
+ "description": "Beta feature for internal users",
+ "enabled": true
+ }' \
+ "https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/flagship/apps/$FLAGSHIP_APP_ID/flags" | jq .
+```
+
+### Create a JSON Config Flag
+
+```bash
+curl -s -X POST \
+ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "key": "rate-limits",
+ "default_variation": "standard",
+ "variations": {
+ "standard": { "rpm": 100, "burst": 20 },
+ "premium": { "rpm": 1000, "burst": 200 }
+ },
+ "rules": [
+ {
+ "priority": 1,
+ "conditions": [
+ { "attribute": "plan", "operator": "in", "value": ["enterprise", "business"] }
+ ],
+ "serve_variation": "premium"
+ }
+ ],
+ "description": "Rate limit configuration by plan",
+ "enabled": true
+ }' \
+ "https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/flagship/apps/$FLAGSHIP_APP_ID/flags" | jq .
+```
+
+### Read a Flag
+
+```bash
+curl -s -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
+ "https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/flagship/apps/$FLAGSHIP_APP_ID/flags/new-feature" | jq .
+```
+
+### List All Flags (with pagination)
+
+```bash
+curl -s -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
+ "https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/flagship/apps/$FLAGSHIP_APP_ID/flags?limit=50" | jq .
+```
+
+If `result_info.cursor` is non-null, fetch the next page:
+
+```bash
+curl -s -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
+ "https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/flagship/apps/$FLAGSHIP_APP_ID/flags?limit=50&cursor=" | jq .
+```
+
+### Update a Flag (Full Replace)
+
+Updates use PUT with the full `FlagDefinition`. Always GET first, modify, then PUT back.
+
+```bash
+# 1. Read current flag
+FLAG=$(curl -s -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
+ "https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/flagship/apps/$FLAGSHIP_APP_ID/flags/new-feature" | jq '.result')
+
+# 2. Modify (e.g., enable the flag)
+UPDATED=$(echo "$FLAG" | jq '.enabled = true')
+
+# 3. PUT back
+echo "$UPDATED" | curl -s -X PUT \
+ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
+ -H "Content-Type: application/json" \
+ -d @- \
+ "https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/flagship/apps/$FLAGSHIP_APP_ID/flags/new-feature" | jq .
+```
+
+### Toggle a Flag On
+
+Read-modify-write to set `enabled: true`:
+
+```bash
+BASE="https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/flagship/apps/$FLAGSHIP_APP_ID/flags"
+
+FLAG=$(curl -s -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" "$BASE/new-feature" | jq '.result')
+UPDATED=$(echo "$FLAG" | jq '.enabled = true')
+echo "$UPDATED" | curl -s -X PUT \
+ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
+ -H "Content-Type: application/json" \
+ -d @- "$BASE/new-feature" | jq .
+```
+
+### Toggle a Flag Off (Disable)
+
+Same pattern, set `enabled: false`. The flag immediately returns its default variation for all evaluations.
+
+```bash
+BASE="https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/flagship/apps/$FLAGSHIP_APP_ID/flags"
+
+FLAG=$(curl -s -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" "$BASE/new-feature" | jq '.result')
+UPDATED=$(echo "$FLAG" | jq '.enabled = false')
+echo "$UPDATED" | curl -s -X PUT \
+ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
+ -H "Content-Type: application/json" \
+ -d @- "$BASE/new-feature" | jq .
+```
+
+### Add a Targeting Rule to an Existing Flag
+
+Append a rule to the existing rules array. Pick a priority that doesn't collide with existing rules.
+
+```bash
+BASE="https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/flagship/apps/$FLAGSHIP_APP_ID/flags"
+
+FLAG=$(curl -s -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" "$BASE/new-feature" | jq '.result')
+UPDATED=$(echo "$FLAG" | jq '.rules += [{
+ "priority": 2,
+ "conditions": [{ "attribute": "plan", "operator": "equals", "value": "enterprise" }],
+ "serve_variation": "on"
+}]')
+echo "$UPDATED" | curl -s -X PUT \
+ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
+ -H "Content-Type: application/json" \
+ -d @- "$BASE/new-feature" | jq .
+```
+
+### Change Rollout Percentage
+
+Update the rollout percentage on an existing rule (e.g., rule at index 0):
+
+```bash
+BASE="https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/flagship/apps/$FLAGSHIP_APP_ID/flags"
+
+FLAG=$(curl -s -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" "$BASE/gradual-rollout" | jq '.result')
+UPDATED=$(echo "$FLAG" | jq '.rules[0].rollout.percentage = 50')
+echo "$UPDATED" | curl -s -X PUT \
+ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
+ -H "Content-Type: application/json" \
+ -d @- "$BASE/gradual-rollout" | jq .
+```
+
+### Change Default Variation
+
+```bash
+BASE="https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/flagship/apps/$FLAGSHIP_APP_ID/flags"
+
+FLAG=$(curl -s -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" "$BASE/new-feature" | jq '.result')
+UPDATED=$(echo "$FLAG" | jq '.default_variation = "on"')
+echo "$UPDATED" | curl -s -X PUT \
+ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
+ -H "Content-Type: application/json" \
+ -d @- "$BASE/new-feature" | jq .
+```
+
+### Add a New Variation
+
+```bash
+BASE="https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/flagship/apps/$FLAGSHIP_APP_ID/flags"
+
+FLAG=$(curl -s -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" "$BASE/checkout-flow" | jq '.result')
+UPDATED=$(echo "$FLAG" | jq '.variations["treatment-c"] = "minimal"')
+echo "$UPDATED" | curl -s -X PUT \
+ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
+ -H "Content-Type: application/json" \
+ -d @- "$BASE/checkout-flow" | jq .
+```
+
+### Remove a Rule
+
+Remove a rule by filtering on priority:
+
+```bash
+BASE="https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/flagship/apps/$FLAGSHIP_APP_ID/flags"
+
+FLAG=$(curl -s -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" "$BASE/new-feature" | jq '.result')
+UPDATED=$(echo "$FLAG" | jq '.rules = [.rules[] | select(.priority != 2)]')
+echo "$UPDATED" | curl -s -X PUT \
+ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
+ -H "Content-Type: application/json" \
+ -d @- "$BASE/new-feature" | jq .
+```
+
+### Delete a Flag
+
+```bash
+curl -s -X DELETE \
+ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
+ "https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/flagship/apps/$FLAGSHIP_APP_ID/flags/old-feature" | jq .
+```
+
+---
+
+## Targeting Rule Patterns
+
+### Enterprise-Only Access
+
+```json
+{
+ "priority": 1,
+ "conditions": [{ "attribute": "plan", "operator": "equals", "value": "enterprise" }],
+ "serve_variation": "on"
+}
+```
+
+### Country-Based Targeting with Logical AND/OR
+
+Target enterprise users in the US or Canada:
+
+```json
+{
+ "priority": 1,
+ "conditions": [
+ {
+ "logical_operator": "AND",
+ "clauses": [
+ { "attribute": "plan", "operator": "equals", "value": "enterprise" },
+ {
+ "logical_operator": "OR",
+ "clauses": [
+ { "attribute": "country", "operator": "equals", "value": "US" },
+ { "attribute": "country", "operator": "equals", "value": "CA" }
+ ]
+ }
+ ]
+ }
+ ],
+ "serve_variation": "on"
+}
+```
+
+### Percentage Rollout
+
+Gradually roll out to 10% of users:
+
+```json
+{
+ "priority": 1,
+ "conditions": [{ "attribute": "targetingKey", "operator": "not_equals", "value": "" }],
+ "serve_variation": "on",
+ "rollout": {
+ "percentage": 10,
+ "attribute": "targetingKey"
+ }
+}
+```
+
+### A/B/n (Multi-Variant) Testing
+
+To split traffic across N variants, create one rule per variant with **cumulative** rollout percentages. Flagship evaluates rules in priority order. If a rule's conditions match but the user misses that rule's rollout percentage, evaluation continues to the next rule. Use the same stable rollout attribute on every rule so each user is compared against the same bucket as the thresholds increase.
+
+The example uses `conditions: []` because the rules are intended to match every context. For sticky user assignment, callers must still pass the configured bucketing attribute (`targetingKey` here); otherwise Flagship uses a random bucket per request.
+
+For example, to split traffic 30% / 40% / 30% across variants A, B, and C:
+
+| Variant | Share | Cumulative threshold |
+| ------- | ----- | -------------------- |
+| A | 30% | 30 |
+| B | 40% | 70 |
+| C | 30% | 100 |
+
+```json
+"rules": [
+ {
+ "priority": 1,
+ "conditions": [],
+ "serve_variation": "variant-a",
+ "rollout": { "percentage": 30, "attribute": "targetingKey" }
+ },
+ {
+ "priority": 2,
+ "conditions": [],
+ "serve_variation": "variant-b",
+ "rollout": { "percentage": 70, "attribute": "targetingKey" }
+ },
+ {
+ "priority": 3,
+ "conditions": [],
+ "serve_variation": "variant-c",
+ "rollout": { "percentage": 100, "attribute": "targetingKey" }
+ }
+]
+```
+
+Key points:
+
+- Rules are evaluated lowest-priority-number first. A user who falls into rule 1's 0-30% bucket gets `variant-a` and is not evaluated further.
+- Rule 2's 70% threshold covers the next 40% of users (31-70%).
+- Rule 3's 100% threshold catches the remaining 30% (71-100%).
+- Always set the last rule to `100` so every context with the bucketing attribute is assigned a variant.
+- For sticky A/B/n assignment, pass a stable `targetingKey` or configured bucketing attribute. Without it, rollout assignment is random per request, which can be useful for request-level sampling but is usually wrong for user experiments.
+- A percentage rollout match reports reason `SPLIT` in evaluation details.
+
+### Progressive Rollout Workflow
+
+1. Create flag with 5% rollout, enable it
+2. Monitor metrics
+3. Increase to 25% → 50% → 100% by updating the `rollout.percentage`
+4. Once at 100%, remove the rule and set `default_variation` to the winning variation
+5. Eventually remove the flag and the code branch
+
+---
+
+## Safe Deletion Workflow
+
+1. **Disable** the flag first (`enabled: false`) — confirms nothing depends on it being active
+2. **Monitor** for unexpected behavior
+3. **Remove** flag evaluation code from your application
+4. **Deploy** the code change
+5. **Delete** the flag via API
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/graphql-api/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/graphql-api/README.md
new file mode 100644
index 0000000..334c6a8
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/graphql-api/README.md
@@ -0,0 +1,147 @@
+# Cloudflare GraphQL Analytics API
+
+Query analytics data across all Cloudflare products via a single GraphQL endpoint. Covers HTTP requests, Workers metrics, DNS, Firewall events, Network Analytics, and 70+ other datasets.
+
+## Overview
+
+- **Single endpoint** for all analytics: `https://api.cloudflare.com/client/v4/graphql`
+- **1,400+ schema types** spanning every Cloudflare product
+- **Two scopes**: zone-level (per-domain) and account-level (cross-domain)
+- **Adaptive sampling** on high-traffic datasets with confidence intervals
+- **No mutations** - read-only analytics (the Mutation type is a stub)
+- **Cost-based rate limiting** - default 300 queries per 5 minutes per user (max 320, varies by query cost)
+
+## Quick Decision Tree
+
+```
+Need analytics data from Cloudflare?
+├─ HTTP traffic (requests, bandwidth, cache) → httpRequestsAdaptiveGroups (zone or account)
+├─ Workers performance (CPU, wall time, errors) → workersInvocationsAdaptive (account)
+├─ Firewall/WAF events → firewallEventsAdaptive / firewallEventsAdaptiveGroups (zone or account)
+├─ DNS query analytics → dnsAnalyticsAdaptive / dnsAnalyticsAdaptiveGroups (zone or account)
+├─ Network layer (DDoS, Magic Transit) → *NetworkAnalyticsAdaptiveGroups (account)
+├─ Storage (R2, KV, D1, DO) → r2OperationsAdaptiveGroups / kvOperationsAdaptiveGroups / etc. (account)
+├─ AI (Workers AI, AI Gateway) → aiInferenceAdaptive / aiGatewayRequestsAdaptiveGroups (account)
+├─ Load Balancing → loadBalancingRequestsAdaptiveGroups (zone)
+├─ Custom high-cardinality metrics → Workers Analytics Engine (see ../analytics-engine/)
+└─ Need raw logs, not aggregates → Logpush (see Cloudflare docs)
+```
+
+## Core Concepts
+
+| Concept | Description |
+| --------------------- | ----------------------------------------------------------------------------------------------- |
+| **Endpoint** | `POST https://api.cloudflare.com/client/v4/graphql` |
+| **Explorer** | [graphql.cloudflare.com](https://graphql.cloudflare.com/) - interactive query builder |
+| **Viewer** | Root query object: `viewer { zones(...) { ... } }` or `viewer { accounts(...) { ... } }` |
+| **Dataset (Node)** | A queryable table under a zone or account (e.g., `httpRequestsAdaptiveGroups`) |
+| **Dimensions** | Fields to group by (time buckets, country, status code, script name, etc.) |
+| **Metrics** | Aggregation fields: `count`, `sum { ... }`, `avg { ... }`, `quantiles { ... }`, `ratio { ... }` |
+| **Filter** | Input object constraining results by time range, dimensions, etc. |
+| **Limit** | Maximum rows returned per dataset node (required, max varies by dataset) |
+| **OrderBy** | Enum-based sorting: `[field_ASC]` or `[field_DESC]` |
+| **Adaptive Sampling** | Nodes with `Adaptive` in the name use ABR sampling; results are statistically representative |
+
+## Query Structure
+
+Every query follows this pattern:
+
+```graphql
+{
+ viewer {
+ # Zone-scoped
+ zones(filter: { zoneTag: "ZONE_ID" }) {
+ datasetName(
+ filter: { datetime_gt: "...", datetime_lt: "..." }
+ limit: 1000
+ orderBy: [datetimeFiveMinutes_DESC]
+ ) {
+ count
+ dimensions { ... }
+ sum { ... }
+ }
+ }
+ # Account-scoped
+ accounts(filter: { accountTag: "ACCOUNT_ID" }) {
+ datasetName(filter: { ... }, limit: 100) {
+ count
+ dimensions { ... }
+ sum { ... }
+ }
+ }
+ }
+}
+```
+
+## Dataset Naming Convention
+
+Dataset names follow a consistent pattern visible in the schema:
+
+| Pattern | Meaning | Example |
+| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
+| `*Adaptive` | Raw rows with adaptive sampling; some (e.g., `workersInvocationsAdaptive`) also support aggregation fields (`sum`, `quantiles`, `avg`) | `httpRequestsAdaptive`, `workersInvocationsAdaptive` |
+| `*AdaptiveGroups` | Aggregated data with adaptive sampling | `httpRequestsAdaptiveGroups` |
+| `*1hGroups` | Hourly rollups (pre-aggregated) | `httpRequests1hGroups` |
+| `*1dGroups` | Daily rollups (pre-aggregated) | `httpRequests1dGroups` |
+| `*1mGroups` | Minutely rollups | `httpRequests1mGroups` |
+| `Zone*` prefix | Zone-scoped dataset | `ZoneHttpRequestsAdaptiveGroups` |
+| `Account*` prefix | Account-scoped dataset | `AccountWorkersInvocationsAdaptive` |
+
+**Prefer `*AdaptiveGroups` nodes** for most use cases - they support flexible time grouping via dimension fields (`datetimeFiveMinutes`, `datetimeHour`, etc.) and are the most commonly used.
+
+## Key Datasets by Product
+
+### Zone-Scoped (per-domain)
+
+| Dataset | Description |
+| ------------------------------------------------ | ------------------------------------------------------------------- |
+| `httpRequestsAdaptiveGroups` | HTTP traffic: requests, bytes, cache status, bot scores, WAF scores |
+| `httpRequests1hGroups` / `1dGroups` / `1mGroups` | Pre-aggregated HTTP rollups (hourly/daily/minutely) |
+| `firewallEventsAdaptiveGroups` | WAF, rate limiting, bot management, firewall rule events |
+| `dnsAnalyticsAdaptiveGroups` | DNS query volumes, response codes, query types |
+| `loadBalancingRequestsAdaptiveGroups` | Load Balancer origin request metrics |
+| `pageShieldReportsAdaptiveGroups` | Page Shield CSP reports |
+
+### Account-Scoped (cross-domain)
+
+| Dataset | Description |
+| -------------------------------------------------------------- | ----------------------------------------------------------- |
+| `workersInvocationsAdaptive` | Workers: requests, errors, CPU time, wall time, subrequests |
+| `durableObjectsInvocationsAdaptiveGroups` | DO invocations |
+| `durableObjectsStorageGroups` / `durableObjectsPeriodicGroups` | DO storage and periodic metrics |
+| `d1AnalyticsAdaptiveGroups` / `d1QueriesAdaptiveGroups` | D1 database analytics |
+| `r2OperationsAdaptiveGroups` / `r2StorageAdaptiveGroups` | R2 operations and storage |
+| `kvOperationsAdaptiveGroups` / `kvStorageAdaptiveGroups` | KV operations and storage |
+| `aiInferenceAdaptiveGroups` | Workers AI inference metrics |
+| `aiGatewayRequestsAdaptiveGroups` | AI Gateway request analytics |
+| `pagesFunctionsInvocationsAdaptiveGroups` | Pages Functions metrics |
+| `magicTransitNetworkAnalyticsAdaptiveGroups` | Magic Transit packet/byte analytics |
+| `spectrumNetworkAnalyticsAdaptiveGroups` | Spectrum TCP/UDP analytics |
+| `gatewayL7RequestsAdaptiveGroups` | Zero Trust Gateway HTTP metrics |
+| `gatewayResolverQueriesAdaptiveGroups` | Zero Trust Gateway DNS metrics |
+
+## Reading Order
+
+| Task | Start Here | Then Read |
+| ---------------------------- | ---------------------------------------------------------------------- | --------------------------------------- |
+| **First query** | [configuration.md](configuration.md) (auth) -> this README (structure) | [api.md](api.md) |
+| **Build a dashboard** | [patterns.md](patterns.md) (time-series, top-N) | [api.md](api.md) (aggregation fields) |
+| **Debug query issues** | [gotchas.md](gotchas.md) | [api.md](api.md) (filtering) |
+| **Understand sampling** | [gotchas.md](gotchas.md) (sampling section) | [api.md](api.md) (confidence intervals) |
+| **Product-specific metrics** | [patterns.md](patterns.md) (per-product examples) | [api.md](api.md) (dataset reference) |
+
+## In This Reference
+
+- **[api.md](api.md)** - Query structure, aggregation fields (sum/avg/quantiles/count), filtering operators, dimensions, dataset details
+- **[configuration.md](configuration.md)** - Authentication, API tokens, client setup (curl, JS, Python), introspection
+- **[patterns.md](patterns.md)** - Common queries: time-series, top-N, Workers metrics, HTTP analytics, firewall events, multi-zone
+- **[gotchas.md](gotchas.md)** - Rate limits, sampling caveats, query cost, common errors, plan-based limits
+
+## See Also
+
+- [GraphQL Analytics API Docs](https://developers.cloudflare.com/analytics/graphql-api/)
+- [GraphQL API Explorer](https://graphql.cloudflare.com/)
+- [Observability Reference](../observability/) - Workers Logs, Tail Workers, console logging
+- [Analytics Engine Reference](../analytics-engine/) - Custom high-cardinality analytics via Workers
+- [Web Analytics Reference](../web-analytics/) - Client-side (RUM) analytics
+- [API Reference](../api/) - REST API, SDKs, authentication basics
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/graphql-api/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/graphql-api/api.md
new file mode 100644
index 0000000..697f239
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/graphql-api/api.md
@@ -0,0 +1,175 @@
+# GraphQL Analytics API Reference
+
+## Query Root
+
+The schema has a single entry point: `Query.viewer`. Mutations are not supported.
+
+```graphql
+{
+ cost # uint64 -- query cost (returned in response)
+ viewer {
+ budget # uint64 -- remaining budget
+ zones(filter: { zoneTag: "..." }) { ... }
+ accounts(filter: { accountTag: "..." }) { ... }
+ }
+}
+```
+
+## Aggregation Fields
+
+Aggregated dataset nodes (`*Groups`) return these field categories. Not every node has all — use introspection to check.
+
+### count
+
+Total events in the group. Available on `*Groups` nodes but **not** on raw `*Adaptive` nodes (e.g., `workersInvocationsAdaptive` — use `sum { requests }` instead).
+
+### sum
+
+Cumulative metrics. Fields vary by dataset:
+
+```graphql
+# HTTP requests
+sum { edgeResponseBytes edgeRequestBytes visits edgeTimeToFirstByteMs originResponseDurationMs }
+
+# Workers invocations
+sum { requests errors subrequests cpuTimeUs wallTime duration responseBodySize clientDisconnects requestDuration }
+```
+
+### quantiles
+
+Percentile distributions (on datasets like `workersInvocationsAdaptive`). Available percentiles: P25, P50, P75, P90, P95, P99, P999 for `cpuTime`, `wallTime`, `requestDuration`, `duration`, `responseBodySize`.
+
+```graphql
+quantiles { cpuTimeP50 cpuTimeP99 wallTimeP50 wallTimeP99 }
+```
+
+### ratio, avg, uniq, confidence
+
+```graphql
+ratio { status4xx status5xx } # float64 (0 to 1) -- HTTP datasets only
+avg { sampleInterval } # useful for understanding sampling resolution
+uniq { uniques } # unique IP count -- rollup datasets (*1hGroups, *1dGroups) only
+confidence(level: 0.95) { # Adaptive datasets only; works on count and sum fields
+ count { estimate lower upper sampleSize }
+}
+```
+
+## Dimensions
+
+Dimensions are fields you can group by via the `dimensions` sub-selection.
+
+### Time Dimensions
+
+| Dimension | Granularity |
+| ------------------------ | --------------- |
+| `date` | Day |
+| `datetime` | Exact timestamp |
+| `datetimeMinute` | 1 minute |
+| `datetimeFiveMinutes` | 5 minutes |
+| `datetimeFifteenMinutes` | 15 minutes |
+| `datetimeHour` | 1 hour |
+
+Workers datasets also support `datetimeSixHours`.
+
+### HTTP Request Dimensions (httpRequestsAdaptiveGroups)
+
+83 dimensions available. Key ones:
+
+| Dimension | Description |
+| ------------------------------------ | --------------------------------------- |
+| `clientCountryName` | Country of origin |
+| `clientRequestHTTPHost` | Requested hostname |
+| `clientRequestHTTPMethodName` | HTTP method |
+| `clientRequestPath` | URI path |
+| `edgeResponseStatus` | Edge HTTP status code |
+| `cacheStatus` | Cache status (hit, miss, dynamic, etc.) |
+| `coloCode` | Cloudflare datacenter IATA code |
+| `clientIP` / `clientAsn` | Client IP address / ASN |
+| `botScore` / `botManagementDecision` | Bot management score (0-99) / verdict |
+| `wafAttackScore` / `securityAction` | WAF score / firewall action taken |
+| `ja3Hash` / `ja4` | TLS fingerprints |
+| `sampleInterval` | ABR sample interval |
+
+### Workers Dimensions (workersInvocationsAdaptive)
+
+`scriptName`, `scriptTag`, `scriptVersion`, `environmentName`, `status`, `usageModel`, `coloCode`, `dispatchNamespaceName`, `isDispatcher`
+
+### Firewall Dimensions (firewallEventsAdaptive)
+
+`action`, `source`, `ruleId`, `clientCountryName`, `clientIP`, `clientAsn`, `userAgent`
+
+## Filtering
+
+### Scope Filters
+
+```graphql
+zones(filter: { zoneTag: "ZONE_ID" }) # up to 10 zones
+zones(filter: { zoneTag_in: ["Z1", "Z2"] })
+accounts(filter: { accountTag: "ACCOUNT_ID" }) # exactly 1 account
+```
+
+### Dataset Filters
+
+**Always include a time range filter.** Multiple filters at the same level are implicitly AND-ed.
+
+```graphql
+httpRequestsAdaptiveGroups(
+ filter: { datetime_gt: "2025-01-01T00:00:00Z", datetime_lt: "2025-01-02T00:00:00Z", clientCountryName: "US" }
+ limit: 1000
+)
+```
+
+### Filter Operators
+
+| Operator | Meaning | Example |
+| ------------------------------ | --------------------- | ------------------------------------ |
+| (none) | equals | `clientCountryName: "US"` |
+| `_gt` / `_lt` | greater / less than | `datetime_gt: "..."` |
+| `_geq` / `_leq` | greater/less or equal | `datetime_geq: "..."` |
+| `_neq` | not equal | `cacheStatus_neq: "hit"` |
+| `_in` / `_notin` | in / not in list | `clientCountryName_in: ["US", "GB"]` |
+| `_like` / `_notlike` | SQL LIKE with `%` | `clientRequestPath_like: "/api/%"` |
+| `_has` / `_hasall` / `_hasany` | array contains | `botDetectionIds_has: "abc"` |
+
+> `_notin` and `_notlike` are in the schema but not in official docs. Confirmed via introspection.
+
+### Boolean Operators (AND / OR)
+
+```graphql
+# Explicit AND
+filter: { AND: [{ datetime_gt: "..." }, { datetime_lt: "..." }, { clientCountryName: "US" }] }
+
+# Explicit OR
+filter: { datetime_gt: "...", OR: [{ edgeResponseStatus: 403 }, { edgeResponseStatus: 429 }] }
+```
+
+## Pagination & Sorting
+
+No cursor-based pagination. Use `limit`, `orderBy`, and filter-based offsets:
+
+```graphql
+# First page
+httpRequestsAdaptiveGroups(filter: { datetime_gt: "..." }, limit: 100, orderBy: [datetime_ASC])
+
+# Next page: filter by last seen value from previous page
+httpRequestsAdaptiveGroups(filter: { datetime_gt: "2025-01-01T01:35:00Z" }, limit: 100, orderBy: [datetime_ASC])
+```
+
+Sort with `orderBy: [field_ASC]` or `[field_DESC]`. Multiple sort fields supported.
+
+## Settings Node
+
+Query per-node limits and availability:
+
+```graphql
+viewer { zones(filter: { zoneTag: "..." }) { settings {
+ httpRequestsAdaptiveGroups { enabled maxDuration maxNumberOfFields maxPageSize notOlderThan }
+} } }
+```
+
+## See Also
+
+- [README.md](README.md) - Overview, decision tree, dataset index
+- [configuration.md](configuration.md) - Authentication, client setup, introspection queries
+- [patterns.md](patterns.md) - Common query patterns (time-series, top-N, per-product)
+- [gotchas.md](gotchas.md) - Rate limits, sampling, troubleshooting
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/graphql-api/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/graphql-api/configuration.md
new file mode 100644
index 0000000..ee7c586
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/graphql-api/configuration.md
@@ -0,0 +1,151 @@
+# GraphQL Analytics API Configuration
+
+## Authentication
+
+### API Token (Recommended)
+
+| Permission | Scope | Use Case |
+| ------------------------------- | ------------ | ---------------------------------------------- |
+| **Account Analytics: Read** | Account-wide | Workers, R2, KV, D1, DO, AI, Network Analytics |
+| **Zone Analytics: Read** | Per-zone | HTTP requests, Firewall, DNS, Load Balancing |
+| **All zones - Analytics: Read** | All zones | Multi-zone HTTP/Firewall/DNS queries |
+
+Create tokens at: [dash.cloudflare.com > Account API Tokens](https://dash.cloudflare.com/?to=/:account/api-tokens)
+
+```bash
+# Verify token
+curl -s https://api.cloudflare.com/client/v4/graphql \
+ -H "Authorization: Bearer $CF_API_TOKEN" \
+ -H "Content-Type: application/json" \
+ --data '{"query":"{ viewer { zones(filter: {zoneTag: \"ZONE_ID\"}) { httpRequestsAdaptiveGroups(limit: 1, filter: {datetime_gt: \"2025-01-01T00:00:00Z\"}) { count } } } }"}'
+```
+
+### API Key + Email (Legacy)
+
+Not recommended. Use `X-Auth-Email` + `X-Auth-Key` headers instead of `Authorization: Bearer`.
+
+## Client Setup
+
+### curl
+
+```bash
+curl -s https://api.cloudflare.com/client/v4/graphql \
+ -H "Authorization: Bearer $CF_API_TOKEN" \
+ -H "Content-Type: application/json" \
+ --data '{
+ "query": "query($zoneTag: string!, $start: Time!, $end: Time!) { viewer { zones(filter: {zoneTag: $zoneTag}) { httpRequestsAdaptiveGroups(filter: {datetime_gt: $start, datetime_lt: $end}, limit: 10, orderBy: [datetimeFiveMinutes_DESC]) { count dimensions { datetimeFiveMinutes } } } } }",
+ "variables": { "zoneTag": "ZONE_ID", "start": "2025-01-01T00:00:00Z", "end": "2025-01-02T00:00:00Z" }
+ }' | jq .
+```
+
+### TypeScript / JavaScript
+
+```typescript
+const GRAPHQL_ENDPOINT = 'https://api.cloudflare.com/client/v4/graphql';
+
+async function queryGraphQL(query: string, variables: Record = {}): Promise {
+ const response = await fetch(GRAPHQL_ENDPOINT, {
+ method: 'POST',
+ headers: {
+ Authorization: `Bearer ${process.env.CF_API_TOKEN}`,
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify({ query, variables })
+ });
+ if (!response.ok) throw new Error(`HTTP ${response.status}: ${response.statusText}`);
+ const json = (await response.json()) as { data: T | null; errors?: { message: string }[] };
+ if (json.errors?.length) throw new Error(json.errors.map((e) => e.message).join('; '));
+ return json.data!;
+}
+```
+
+### Python
+
+```python
+import requests, os
+
+def query_graphql(query: str, variables: dict = None) -> dict:
+ r = requests.post("https://api.cloudflare.com/client/v4/graphql",
+ headers={"Authorization": f"Bearer {os.environ['CF_API_TOKEN']}", "Content-Type": "application/json"},
+ json={"query": query, "variables": variables or {}})
+ r.raise_for_status()
+ result = r.json()
+ if result.get("errors"):
+ raise Exception("; ".join(e["message"] for e in result["errors"]))
+ return result["data"]
+```
+
+### From a Cloudflare Worker
+
+Store the API token as a secret (`CF_API_TOKEN`). Use standard `fetch` to POST to `https://api.cloudflare.com/client/v4/graphql` with the same JSON body format as above. Always check `response.errors` — GraphQL returns 200 even on query failures.
+
+## GraphQL API Explorer
+
+Interactive explorer at [graphql.cloudflare.com](https://graphql.cloudflare.com/) — provides schema docs, autocomplete, variable panel, and shareable queries. Authenticates via your Cloudflare dashboard session.
+
+## Schema Introspection
+
+```graphql
+# List zone-scoped datasets
+{
+ __type(name: "zone") {
+ fields {
+ name
+ description
+ }
+ }
+}
+
+# List account-scoped datasets
+{
+ __type(name: "account") {
+ fields {
+ name
+ description
+ }
+ }
+}
+
+# Discover dimensions for a dataset
+{
+ __type(name: "ZoneHttpRequestsAdaptiveGroupsDimensions") {
+ fields {
+ name
+ type {
+ name
+ kind
+ }
+ }
+ }
+}
+
+# Discover filter operators for a dataset
+{
+ __type(name: "ZoneHttpRequestsAdaptiveGroupsFilter_InputObject") {
+ inputFields {
+ name
+ type {
+ name
+ kind
+ }
+ }
+ }
+}
+```
+
+## Finding Your Zone and Account IDs
+
+- **Zone ID**: Dashboard > select zone > Overview (right sidebar), or via API
+- **Account ID**: Dashboard > Account Home URL, or via API
+
+```bash
+curl -s https://api.cloudflare.com/client/v4/zones -H "Authorization: Bearer $CF_API_TOKEN" | jq '.result[] | {name, id}'
+curl -s https://api.cloudflare.com/client/v4/accounts -H "Authorization: Bearer $CF_API_TOKEN" | jq '.result[] | {name, id}'
+```
+
+## See Also
+
+- [README.md](README.md) - Overview, decision tree, dataset index
+- [api.md](api.md) - Query structure, aggregation fields, filtering operators
+- [patterns.md](patterns.md) - Common query patterns (time-series, top-N, per-product)
+- [gotchas.md](gotchas.md) - Rate limits, sampling, troubleshooting
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/graphql-api/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/graphql-api/gotchas.md
new file mode 100644
index 0000000..125fef8
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/graphql-api/gotchas.md
@@ -0,0 +1,111 @@
+# GraphQL Analytics API Gotchas & Troubleshooting
+
+## Rate Limits
+
+| Limit | Value |
+| ------------------------ | --------------------------------------------------------- |
+| GraphQL queries per user | **Default 300 per 5 minutes** (max 320, at least 1/sec) |
+| General API rate limit | 1200 requests per 5 minutes (shared across all API calls) |
+| Zone scope per query | Up to **10 zones** |
+| Account scope per query | Exactly **1 account** |
+
+The GraphQL rate limit is separate from the general API limit. Exceeding either results in `HTTP 429` and blocks all API calls for 5 minutes. Enterprise customers can contact support to raise limits.
+
+### "429 Too Many Requests"
+
+**Cause:** Exceeded rate limit.
+
+**Solution:** Batch multiple datasets into single queries, cache results, increase intervals between queries. Use `{ viewer { budget } }` to monitor remaining budget.
+
+## Sampling & Data Accuracy
+
+### Adaptive Bit Rate (ABR) Sampling
+
+Datasets with `Adaptive` in the name use adaptive sampling:
+
+- Results are **statistically representative**, not exact
+- Same query may return **slightly different numbers** each run
+- Higher traffic = higher sampling rate = more accurate
+- `sampleInterval` dimension shows the ratio (1 = no sampling, 10 = ~1-in-10 sampled)
+
+For high-confidence numbers, use `confidence(level: 0.95)` to get estimate bounds. For exact counts, use rollup nodes (`httpRequests1hGroups`, `httpRequests1dGroups`) which are pre-aggregated without sampling.
+
+### Rollup vs. Adaptive
+
+| Feature | Rollup (`*1hGroups`, `*1dGroups`) | Adaptive (`*AdaptiveGroups`) |
+| ----------- | --------------------------------- | ---------------------------- |
+| Sampling | No (pre-aggregated) | Yes (ABR) |
+| Flexibility | Fixed time buckets | Any granularity |
+| Dimensions | Fewer | Many more |
+| Accuracy | Exact | Statistical estimate |
+
+## Common Errors
+
+### "Access denied" / "authentication error"
+
+**Cause:** Token lacks required permission or wrong scope.
+
+**Solution:** Account-scoped queries need **Account Analytics: Read**. Zone-scoped queries need **Zone Analytics: Read**. Verify: `curl -s https://api.cloudflare.com/client/v4/user/tokens/verify -H "Authorization: Bearer $TOKEN"`
+
+### "field not found" / "Cannot query field"
+
+**Cause:** Wrong dataset name, nonexistent field, or wrong scope (zone vs. account).
+
+**Solution:** Names are case-sensitive camelCase (`httpRequestsAdaptiveGroups`). Zone datasets go under `zones(...)`, account datasets under `accounts(...)`. Use introspection to verify.
+
+### "filter is required" / empty results
+
+**Cause:** Missing required time range filter or incorrect zone/account tag.
+
+**Solution:** Always include `datetime_gt` / `datetime_lt` (or `_geq` / `_leq`).
+
+### "limit is required" / "limit exceeds maximum"
+
+**Cause:** Missing `limit` or exceeding node's max page size.
+
+**Solution:** Always specify `limit`. Max varies by dataset (typically 10,000 for groups, 100 for raw events). Check via settings query.
+
+### "query is too complex" / "query exceeds budget"
+
+**Cause:** Too many fields, datasets, or too broad a time range.
+
+**Solution:** Reduce time range, request fewer dimensions/metrics, break into smaller queries. Monitor `cost` and `budget` in responses.
+
+### 200 Response with Errors
+
+GraphQL returns HTTP 200 even on failures. **Always check `response.errors`:**
+
+```json
+{ "data": null, "errors": [{ "message": "filter is required for httpRequestsAdaptiveGroups" }] }
+```
+
+## Plan-Based Availability
+
+Not all datasets are available on all plans. Higher plans get more datasets, longer retention (`notOlderThan`), wider time ranges (`maxDuration`), more fields, and larger page sizes.
+
+### "node is not available" / "node is disabled"
+
+**Cause:** Dataset not on your plan, or product not enabled.
+
+**Solution:** Check `settings { { enabled } }`. Some datasets require specific subscriptions (e.g., Network Analytics requires Magic Transit/Spectrum).
+
+## DateTime & Timezone Handling
+
+- All times are **UTC only** (ISO 8601: `"2025-01-15T10:30:00Z"`)
+- `Date` type: `"2025-01-15"` (used in `date_geq`/`date_leq` for storage datasets)
+- `Time` type: `"2025-01-15T10:30:00Z"` (used in `datetime_gt`/`datetime_lt`)
+- Filters are start-inclusive: events that start within the window are included
+
+## Performance Tips
+
+- **Narrow time ranges** are faster and cheaper
+- **Select only needed dimensions** — each additional dimension increases cost
+- **Use rollup nodes** (`*1dGroups`) for simple daily totals without dimension breakdowns
+- **Batch datasets** into one query instead of separate HTTP requests
+
+## See Also
+
+- [README.md](README.md) - Overview, decision tree, dataset index
+- [api.md](api.md) - Query structure, aggregation fields, filtering operators
+- [configuration.md](configuration.md) - Authentication, client setup, introspection queries
+- [patterns.md](patterns.md) - Common query patterns (time-series, top-N, per-product)
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/graphql-api/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/graphql-api/patterns.md
new file mode 100644
index 0000000..fa45ae2
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/graphql-api/patterns.md
@@ -0,0 +1,276 @@
+# GraphQL Analytics API Patterns & Best Practices
+
+## Time-Series Queries
+
+Use time dimension granularity matching your range (see Best Practices below).
+
+```graphql
+query TrafficTimeSeries($zoneTag: string!, $start: Time!, $end: Time!) {
+ viewer {
+ zones(filter: { zoneTag: $zoneTag }) {
+ httpRequestsAdaptiveGroups(
+ filter: { datetime_gt: $start, datetime_lt: $end }
+ limit: 1000
+ orderBy: [datetimeFiveMinutes_ASC] # or datetimeHour_ASC for longer ranges
+ ) {
+ count
+ dimensions {
+ datetimeFiveMinutes
+ }
+ sum {
+ edgeResponseBytes
+ }
+ ratio {
+ status4xx
+ status5xx
+ }
+ }
+ }
+ }
+}
+```
+
+## Top-N Queries
+
+### Top Countries by Request Count
+
+```graphql
+query TopCountries($zoneTag: string!, $start: Time!, $end: Time!) {
+ viewer {
+ zones(filter: { zoneTag: $zoneTag }) {
+ httpRequestsAdaptiveGroups(
+ filter: { datetime_gt: $start, datetime_lt: $end }
+ limit: 10
+ orderBy: [count_DESC]
+ ) {
+ count
+ dimensions {
+ clientCountryName
+ }
+ }
+ }
+ }
+}
+```
+
+Use `orderBy: [sum_edgeResponseBytes_DESC]` for top paths by bandwidth. Add `edgeResponseStatus_geq: 400` to the filter for top error status codes.
+
+## Workers Analytics
+
+```graphql
+query WorkersOverview($accountTag: string!, $start: Time!, $end: Time!) {
+ viewer {
+ accounts(filter: { accountTag: $accountTag }) {
+ workersInvocationsAdaptive(
+ filter: { datetime_gt: $start, datetime_lt: $end }
+ limit: 100
+ orderBy: [sum_requests_DESC]
+ ) {
+ sum {
+ requests
+ errors
+ subrequests
+ wallTime
+ }
+ quantiles {
+ cpuTimeP50
+ cpuTimeP99
+ wallTimeP50
+ wallTimeP99
+ }
+ dimensions {
+ scriptName
+ }
+ }
+ }
+ }
+}
+```
+
+Filter by `scriptName` for a specific Worker. Add `datetimeFiveMinutes` dimension + `orderBy: [datetimeFiveMinutes_ASC]` for error rate over time.
+
+## Firewall / Security
+
+```graphql
+query RecentFirewallEvents($zoneTag: string!, $start: Time!) {
+ viewer {
+ zones(filter: { zoneTag: $zoneTag }) {
+ firewallEventsAdaptive(filter: { datetime_gt: $start }, limit: 50, orderBy: [datetime_DESC]) {
+ action
+ source
+ clientIP
+ clientCountryName
+ userAgent
+ clientRequestHTTPHost
+ clientRequestPath
+ ruleId
+ datetime
+ }
+ }
+ }
+}
+```
+
+For aggregated firewall stats, use `firewallEventsAdaptiveGroups` with `action: "block"` filter and group by `ruleId`, `source`, `datetimeHour`.
+
+## DNS Analytics
+
+```graphql
+query DNSQueryVolume($zoneTag: string!, $start: Time!, $end: Time!) {
+ viewer {
+ zones(filter: { zoneTag: $zoneTag }) {
+ dnsAnalyticsAdaptiveGroups(
+ filter: { datetime_gt: $start, datetime_lt: $end }
+ limit: 500
+ orderBy: [datetimeFiveMinutes_ASC]
+ ) {
+ count
+ dimensions {
+ datetimeFiveMinutes
+ }
+ }
+ }
+ }
+}
+```
+
+## Storage Analytics (Account-Scoped)
+
+R2, KV, and D1 use `date` (Date type) filters instead of `datetime` (Time type).
+
+```graphql
+# R2 operations
+r2OperationsAdaptiveGroups(filter: { date_geq: $start, date_leq: $end }, limit: 100, orderBy: [date_DESC]) {
+ dimensions { date bucketName actionType }
+ sum { requests }
+}
+
+# KV operations
+kvOperationsAdaptiveGroups(filter: { date_geq: $start, date_leq: $end }, limit: 100, orderBy: [date_DESC]) {
+ dimensions { date actionType }
+ sum { requests }
+}
+
+# D1 analytics
+d1AnalyticsAdaptiveGroups(filter: { date_geq: $start, date_leq: $end }, limit: 100, orderBy: [date_DESC]) {
+ dimensions { date databaseId }
+ sum { readQueries writeQueries rowsRead rowsWritten }
+}
+```
+
+## Cache Analytics
+
+```graphql
+query CacheStatusBreakdown($zoneTag: string!, $start: Time!, $end: Time!) {
+ viewer {
+ zones(filter: { zoneTag: $zoneTag }) {
+ httpRequestsAdaptiveGroups(
+ filter: { datetime_gt: $start, datetime_lt: $end }
+ limit: 20
+ orderBy: [count_DESC]
+ ) {
+ count
+ dimensions {
+ cacheStatus
+ }
+ sum {
+ edgeResponseBytes
+ }
+ }
+ }
+ }
+}
+```
+
+For cache hit ratio over time, use aliases to query the same dataset twice — once with `cacheStatus: "hit"` filter and once without — then compute the ratio client-side.
+
+## Multi-Dataset Queries
+
+A single request can query multiple datasets, avoiding extra HTTP round-trips:
+
+```graphql
+query DashboardOverview($zoneTag: string!, $start: Time!, $end: Time!) {
+ viewer {
+ zones(filter: { zoneTag: $zoneTag }) {
+ httpTraffic: httpRequestsAdaptiveGroups(
+ filter: { datetime_gt: $start, datetime_lt: $end }
+ limit: 1
+ ) {
+ count
+ sum {
+ edgeResponseBytes
+ }
+ ratio {
+ status4xx
+ status5xx
+ }
+ }
+ firewallEvents: firewallEventsAdaptiveGroups(
+ filter: { datetime_gt: $start, datetime_lt: $end }
+ limit: 5
+ orderBy: [count_DESC]
+ ) {
+ count
+ dimensions {
+ action
+ source
+ }
+ }
+ dnsQueries: dnsAnalyticsAdaptiveGroups(
+ filter: { datetime_gt: $start, datetime_lt: $end }
+ limit: 1
+ ) {
+ count
+ }
+ }
+ }
+}
+```
+
+## AI & Gateway Analytics
+
+```graphql
+# Workers AI inference
+aiInferenceAdaptiveGroups(
+ filter: { datetime_gt: $start, datetime_lt: $end }, limit: 100, orderBy: [datetimeHour_DESC]
+) {
+ count
+ sum { totalInputTokens totalOutputTokens totalRequestBytesIn }
+ dimensions { modelId datetimeHour }
+}
+
+# AI Gateway requests
+aiGatewayRequestsAdaptiveGroups(
+ filter: { datetime_gt: $start, datetime_lt: $end }, limit: 100, orderBy: [datetimeHour_DESC]
+) {
+ count
+ dimensions { gateway provider model datetimeHour }
+ sum { cachedTokensIn cachedTokensOut uncachedTokensIn uncachedTokensOut }
+}
+```
+
+Both are account-scoped — nest under `accounts(filter: { accountTag: $accountTag })`.
+
+## Best Practices
+
+**Always include time filters.** Queries without time filters scan all data and are slow/expensive.
+
+**Match time granularity to range:**
+
+| Time Range | Recommended Dimension |
+| ---------- | ------------------------------------------------- |
+| < 6 hours | `datetimeMinute` or `datetimeFiveMinutes` |
+| 6-48 hours | `datetimeFiveMinutes` or `datetimeFifteenMinutes` |
+| 2-14 days | `datetimeHour` |
+| 14+ days | `date` |
+
+**Use aliases** for querying the same dataset with different filters in one request.
+
+**Request only needed fields.** Extra dimensions and metrics increase query cost.
+
+## See Also
+
+- [README.md](README.md) - Overview, decision tree, dataset index
+- [api.md](api.md) - Query structure, aggregation fields, filtering operators
+- [configuration.md](configuration.md) - Authentication, client setup, introspection queries
+- [gotchas.md](gotchas.md) - Rate limits, sampling, troubleshooting
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/hyperdrive/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/hyperdrive/README.md
new file mode 100644
index 0000000..500d9ba
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/hyperdrive/README.md
@@ -0,0 +1,27 @@
+# Hyperdrive
+
+Use Hyperdrive to connect Workers to an existing PostgreSQL or MySQL database with connection pooling and optional query caching. It does not replace the origin database or replicate its data. Start with [how Hyperdrive works](https://developers.cloudflare.com/hyperdrive/concepts/how-hyperdrive-works/) and [supported databases and features](https://developers.cloudflare.com/hyperdrive/reference/supported-databases-and-features/) to assess fit.
+
+## Retrieve current documentation
+
+Fetch the relevant official page before implementing. Driver versions, compatibility settings, API shapes, CLI flags, cache settings, and limits belong in the docs rather than this reference. Use the [Hyperdrive documentation index](https://developers.cloudflare.com/hyperdrive/llms.txt) to discover additional pages. Retrieve a page as Markdown by sending `Accept: text/markdown` to its URL.
+
+## Choose the next reference
+
+| Task | Reference |
+| ---------------------------------------------------------------------- | -------------------------------------- |
+| Create a configuration, bind it, connect privately, or develop locally | [configuration.md](./configuration.md) |
+| Choose a driver, use binding credentials, or integrate an ORM | [api.md](./api.md) |
+| Decide read freshness, connection lifetime, or query placement | [patterns.md](./patterns.md) |
+| Diagnose connection, cache, latency, or capacity problems | [gotchas.md](./gotchas.md) |
+
+## Decisions to preserve
+
+- Choose a driver for the database engine and existing application stack; verify supported versions and Worker requirements in its guide.
+- Create database clients inside each handler invocation. Hyperdrive manages the underlying origin pool; consult [connection lifecycle](https://developers.cloudflare.com/hyperdrive/concepts/connection-lifecycle/) for cleanup behavior.
+- Choose caching by read freshness. Disabling caching still allows connection pooling; a write does not invalidate cached reads. See [query caching](https://developers.cloudflare.com/hyperdrive/concepts/query-caching/).
+
+## See also
+
+- [D1](../d1/) for a managed SQLite alternative.
+- [Workers](https://developers.cloudflare.com/workers/) for the runtime and bindings.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/hyperdrive/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/hyperdrive/api.md
new file mode 100644
index 0000000..66e29fe
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/hyperdrive/api.md
@@ -0,0 +1,26 @@
+# Hyperdrive API and drivers
+
+Start with [README.md](./README.md) and [configuration.md](./configuration.md). Fetch the selected guide before writing connection or query code; use its current supported package version and compatibility settings.
+
+## Driver and binding routes
+
+| Task | Official documentation |
+| --------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
+| PostgreSQL with node-postgres (`pg`), including binding connection string and parameterized queries | [node-postgres](https://developers.cloudflare.com/hyperdrive/examples/connect-to-postgres/postgres-drivers-and-libraries/node-postgres/) |
+| PostgreSQL with tagged-template queries and Postgres.js driver options | [Postgres.js](https://developers.cloudflare.com/hyperdrive/examples/connect-to-postgres/postgres-drivers-and-libraries/postgres-js/) |
+| MySQL with binding connection properties and Worker-specific driver options | [mysql2](https://developers.cloudflare.com/hyperdrive/examples/connect-to-mysql/mysql-drivers-and-libraries/mysql2/) |
+| Check database features, prepared statements, and library compatibility | [Supported databases and features](https://developers.cloudflare.com/hyperdrive/reference/supported-databases-and-features/) |
+| Generate binding and runtime TypeScript types | [Workers TypeScript](https://developers.cloudflare.com/workers/languages/typescript/) |
+
+Keep an existing supported driver when it fits the application. Choose by database engine and library integration needs; do not infer cache behavior from a driver's prepared-statement setting. Fetch [query caching](https://developers.cloudflare.com/hyperdrive/concepts/query-caching/) for cache eligibility and freshness controls.
+
+## ORMs and query builders
+
+| Task | Official documentation |
+| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Use Drizzle with PostgreSQL | [PostgreSQL Drizzle guide](https://developers.cloudflare.com/hyperdrive/examples/connect-to-postgres/postgres-drivers-and-libraries/drizzle-orm/) |
+| Use Drizzle with MySQL | [MySQL Drizzle guide](https://developers.cloudflare.com/hyperdrive/examples/connect-to-mysql/mysql-drivers-and-libraries/drizzle-orm/) |
+| Use Prisma with PostgreSQL | [Prisma guide](https://developers.cloudflare.com/hyperdrive/examples/connect-to-postgres/postgres-drivers-and-libraries/prisma-orm/) |
+| Assess another query builder, including Kysely | [Postgres.js integration notes](https://developers.cloudflare.com/hyperdrive/examples/connect-to-postgres/postgres-drivers-and-libraries/postgres-js/) and [database compatibility](https://developers.cloudflare.com/hyperdrive/reference/supported-databases-and-features/), then the library's current dialect documentation |
+
+An ORM still uses a database driver and inherits its Worker connection constraints. Keep clients scoped to the invocation using [connection lifecycle](https://developers.cloudflare.com/hyperdrive/concepts/connection-lifecycle/). When a library owns SQL for authentication or other fresh reads, pass a client using a cache-disabled configuration as described in [query caching](https://developers.cloudflare.com/hyperdrive/concepts/query-caching/).
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/hyperdrive/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/hyperdrive/configuration.md
new file mode 100644
index 0000000..64594e3
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/hyperdrive/configuration.md
@@ -0,0 +1,27 @@
+# Hyperdrive configuration
+
+See [README.md](./README.md) for the retrieval workflow. Fetch the relevant guide before creating or changing resources; use current configuration fields and CLI syntax from these sources.
+
+| Task | Official documentation |
+| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
+| Create the first configuration and bind it to a Worker | [Get started](https://developers.cloudflare.com/hyperdrive/get-started/) |
+| Create, inspect, update, or delete configurations; set cache or pool options | [Wrangler commands](https://developers.cloudflare.com/hyperdrive/reference/wrangler-commands/) |
+| Generate TypeScript types from Worker configuration | [Workers TypeScript](https://developers.cloudflare.com/workers/languages/typescript/) |
+| Connect a private database using the recommended Workers VPC route | [Workers VPC integration](https://developers.cloudflare.com/hyperdrive/configuration/connect-to-private-database-vpc/) |
+| Maintain a private database connection using Tunnel and Access | [Tunnel integration](https://developers.cloudflare.com/hyperdrive/configuration/connect-to-private-database/) |
+| Configure database network access | [Firewall and networking](https://developers.cloudflare.com/hyperdrive/configuration/firewall-and-networking-configuration/) |
+| Configure server verification or client certificates | [SSL/TLS certificates](https://developers.cloudflare.com/hyperdrive/configuration/tls-ssl-certificates-for-hyperdrive/) |
+| Rotate origin database credentials | [Credential rotation](https://developers.cloudflare.com/hyperdrive/configuration/rotate-credentials/) |
+| Configure cache freshness or separate cached and fresh-read bindings | [Query caching](https://developers.cloudflare.com/hyperdrive/concepts/query-caching/) |
+| Budget origin connections across configurations | [Tune connection pooling](https://developers.cloudflare.com/hyperdrive/configuration/tune-connection-pool/) |
+| Choose local database access or remote Hyperdrive testing | [Local development](https://developers.cloudflare.com/hyperdrive/configuration/local-development/) |
+| Evaluate Worker placement for multiple database round trips | [Smart Placement](https://developers.cloudflare.com/workers/configuration/placement/) |
+
+## Setup decisions
+
+- Identify the database engine, provider, and network path first. The [PostgreSQL](https://developers.cloudflare.com/hyperdrive/examples/connect-to-postgres/) and [MySQL](https://developers.cloudflare.com/hyperdrive/examples/connect-to-mysql/) indexes route to provider-specific instructions.
+- For private connectivity, choose Workers VPC or the existing Tunnel/Access integration before configuring credentials. Follow the selected guide's prerequisites and TLS guidance.
+- Decide which reads may be stale before selecting cache settings. Multiple configurations against one database contribute to its total origin connection usage.
+- Local direct database access does not exercise Hyperdrive pooling or caching. Use the local-development guide's remote option when verifying those behaviors, and identify the database that option targets before running writes.
+
+See [api.md](./api.md) for drivers and [gotchas.md](./gotchas.md) for diagnosis.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/hyperdrive/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/hyperdrive/gotchas.md
new file mode 100644
index 0000000..6e08517
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/hyperdrive/gotchas.md
@@ -0,0 +1,20 @@
+# Hyperdrive troubleshooting
+
+Start with the actual error and the affected configuration. Fetch [Troubleshoot and debug](https://developers.cloudflare.com/hyperdrive/observability/troubleshooting/) for current error codes and diagnosis rather than guessing from a generic connection failure.
+
+| Symptom | What to inspect and where to read |
+| -------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Connection refused or authentication failure | Check origin reachability and credentials using [troubleshooting](https://developers.cloudflare.com/hyperdrive/observability/troubleshooting/) and [firewall/networking configuration](https://developers.cloudflare.com/hyperdrive/configuration/firewall-and-networking-configuration/). |
+| Private database or TLS failure | Follow the selected [Workers VPC](https://developers.cloudflare.com/hyperdrive/configuration/connect-to-private-database-vpc/) or [Tunnel/Access](https://developers.cloudflare.com/hyperdrive/configuration/connect-to-private-database/) path and its certificate prerequisites; see [SSL/TLS configuration](https://developers.cloudflare.com/hyperdrive/configuration/tls-ssl-certificates-for-hyperdrive/). |
+| Pool exhaustion or too many connections | Distinguish client connection lifetime from origin pool capacity. Read [connection lifecycle](https://developers.cloudflare.com/hyperdrive/concepts/connection-lifecycle/), [pool tuning](https://developers.cloudflare.com/hyperdrive/configuration/tune-connection-pool/), and [limits](https://developers.cloudflare.com/hyperdrive/platform/limits/). |
+| Query timeout | Check the current [limits](https://developers.cloudflare.com/hyperdrive/platform/limits/) and [metrics](https://developers.cloudflare.com/hyperdrive/observability/metrics/) before changing query or transaction design. |
+| Stale reads or unexpectedly uncached queries | Inspect the binding's cache configuration and query eligibility in [query caching](https://developers.cloudflare.com/hyperdrive/concepts/query-caching/). Writes do not purge cached reads; do not treat prepared-statement settings as cache controls. |
+| Slow multi-query requests | Inspect [metrics](https://developers.cloudflare.com/hyperdrive/observability/metrics/) and evaluate [Smart Placement](https://developers.cloudflare.com/workers/configuration/placement/). |
+| Local connection failure, ignored environment variable, or absent cache behavior | Check binding names, local connection overrides, precedence, and remote testing in [local development](https://developers.cloudflare.com/hyperdrive/configuration/local-development/). |
+| Unsupported driver or SQL feature | Check [supported databases and features](https://developers.cloudflare.com/hyperdrive/reference/supported-databases-and-features/) and the selected [driver guide](./api.md). |
+
+## Capacity and changes
+
+Retrieve [limits](https://developers.cloudflare.com/hyperdrive/platform/limits/) and [pricing](https://developers.cloudflare.com/hyperdrive/platform/pricing/) for current plan allowances, connection and query bounds, and limit-increase guidance. Check [release notes](https://developers.cloudflare.com/hyperdrive/platform/release-notes/) when behavior changes after an upgrade.
+
+See [configuration.md](./configuration.md) to change a configuration and [patterns.md](./patterns.md) to revisit freshness or connection decisions.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/hyperdrive/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/hyperdrive/patterns.md
new file mode 100644
index 0000000..fcc58fc
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/hyperdrive/patterns.md
@@ -0,0 +1,15 @@
+# Hyperdrive design patterns
+
+See [api.md](./api.md) for maintained driver and ORM examples. Use the following decisions to select a pattern, then fetch its linked documentation for implementation.
+
+| Workload or decision | Guidance and documentation |
+| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Popular content or analytics dashboards | Cache only when the product can tolerate the configured stale window. Use [query caching](https://developers.cloudflare.com/hyperdrive/concepts/query-caching/) for eligibility, parameters, and settings. |
+| Mixed cached reads and fresh reads | Route authentication, permissions, and reads after writes through a cache-disabled configuration. Writes do not invalidate cached results; see [read-after-write behavior](https://developers.cloudflare.com/hyperdrive/concepts/query-caching/#read-after-write-behavior). |
+| Multi-tenant queries | Derive tenant scope from authenticated application context and apply it to every query. A cache is not an authorization boundary. Review [query caching](https://developers.cloudflare.com/hyperdrive/concepts/query-caching/) for the selected query's behavior. |
+| Globally distributed callers | Understand the distinction between fast connection setup and the remaining query round trip in [how Hyperdrive works](https://developers.cloudflare.com/hyperdrive/concepts/how-hyperdrive-works/). |
+| Multiple sequential database queries | Measure placement rather than assuming the nearest user location is best. Consult [Smart Placement](https://developers.cloudflare.com/workers/configuration/placement/) and [Hyperdrive metrics](https://developers.cloudflare.com/hyperdrive/observability/metrics/). |
+| Transactions or connection-local state | Keep transactions short and do not assume state survives across transactions. Fetch [connection pooling](https://developers.cloudflare.com/hyperdrive/concepts/connection-pooling/) and [supported features](https://developers.cloudflare.com/hyperdrive/reference/supported-databases-and-features/) before relying on session settings. |
+| Client lifetime and pool sizing | Create clients per handler invocation; Hyperdrive owns the origin pool. Use [connection lifecycle](https://developers.cloudflare.com/hyperdrive/concepts/connection-lifecycle/) and [pool tuning](https://developers.cloudflare.com/hyperdrive/configuration/tune-connection-pool/) instead of a global driver pool or copied connection counts. |
+
+Separate application correctness from acceleration: use parameterized queries, enforce tenant access in the application, and select freshness before tuning cache hit rate. See [gotchas.md](./gotchas.md) when observed behavior differs from the design.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/images/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/images/README.md
new file mode 100644
index 0000000..824309c
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/images/README.md
@@ -0,0 +1,12 @@
+# Cloudflare Images
+
+Choose the image source and operation before selecting an API. Hosted-image management, remote URL transformations, and the Workers optimization binding have different contracts. Retrieve the documentation for the path the project uses.
+
+| Task | Start here |
+| --------------------------------------------------------------------------------- | --------------------------------- |
+| Optimize image bytes in a Worker or manage hosted images | [API selection](api.md) |
+| Configure a binding, variants, or private delivery | [Configuration](configuration.md) |
+| Accept client uploads, serve responsive images, watermark, or store results in R2 | [Patterns](patterns.md) |
+| Diagnose failures, check limits, or investigate caching | [Troubleshooting](gotchas.md) |
+
+For new work, inspect the project's installed Wrangler version, compatibility settings, existing image storage, and public/private access requirements. Read only the relevant linked pages and adapt them to the project; preserve existing conventions and verify behavior with representative images.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/images/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/images/api.md
new file mode 100644
index 0000000..b933212
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/images/api.md
@@ -0,0 +1,13 @@
+# Images API Selection
+
+| Operation | Documentation |
+| --------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
+| Optimize image bytes in a Worker; select input, transform, output, and response methods | [Optimize with Workers](https://developers.cloudflare.com/images/optimization/binding/#methods) |
+| Upload, list, retrieve, update, or delete hosted images from a Worker | [Manage hosted images with Workers](https://developers.cloudflare.com/images/storage/binding/) |
+| Upload or manage images through HTTP | [Upload methods](https://developers.cloudflare.com/images/storage/upload-images/methods/#upload-using-api) and its linked Images API reference |
+| Accept uploads directly from a client | [Direct Creator Upload](https://developers.cloudflare.com/images/storage/upload-images/direct-creator-upload/) |
+| Construct hosted-image delivery URLs | [Serve uploaded images](https://developers.cloudflare.com/images/optimization/hosted-images/serve-uploaded-images/) |
+| Apply URL optimization parameters or select fit, quality, and format | [Optimization features](https://developers.cloudflare.com/images/optimization/features/) |
+| Draw overlays or watermarks | [Draw overlays](https://developers.cloudflare.com/images/optimization/draw-overlays/) |
+
+Do not transfer URL parameters or HTTP request shapes directly into binding calls. Read the contract for the selected interface, including output format handling. Use the project's generated binding types and existing error handling. See [configuration](configuration.md) for setup and [troubleshooting](gotchas.md) for failures and limits.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/images/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/images/configuration.md
new file mode 100644
index 0000000..b514793
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/images/configuration.md
@@ -0,0 +1,17 @@
+# Images Configuration
+
+Inspect the project's Wrangler configuration, dependency versions, existing bindings, and credential storage before changing setup. Preserve its configuration format and generate binding types through its existing tooling.
+
+| Task | Documentation |
+| --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
+| Add the optimization binding | [Binding setup](https://developers.cloudflare.com/images/optimization/binding/#setup) |
+| Configure hosted-image management in a Worker | [Hosted binding setup](https://developers.cloudflare.com/images/storage/binding/#setup) |
+| Choose local or remote development for the optimization binding | [Local binding development](https://developers.cloudflare.com/images/optimization/binding/#interact-with-your-images-binding-locally) |
+| Upload through the dashboard or API | [Upload methods](https://developers.cloudflare.com/images/storage/upload-images/methods/) |
+| Create named presets for hosted images | [Create predefined variants](https://developers.cloudflare.com/images/optimization/hosted-images/create-variants/) |
+| Enable dynamic options for hosted-image URLs | [Enable flexible variants](https://developers.cloudflare.com/images/optimization/hosted-images/enable-flexible-variants/) |
+| Find account hash and delivery URL components | [Serve uploaded images](https://developers.cloudflare.com/images/optimization/hosted-images/serve-uploaded-images/) |
+| Configure private access and generate signed URLs | [Serve private images](https://developers.cloudflare.com/images/optimization/hosted-images/serve-private-images/) |
+| Set hosted-image cache lifetime | [Browser TTL](https://developers.cloudflare.com/images/optimization/hosted-images/browser-ttl/) |
+
+Keep API tokens and signing keys in the project's secret mechanism. Verify private-delivery requirements when choosing variants, and follow the documented signing procedure rather than maintaining a custom signing recipe here. Confirm that the selected local test mode covers the features being changed. Continue with [API selection](api.md) or [patterns](patterns.md).
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/images/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/images/gotchas.md
new file mode 100644
index 0000000..98c3f05
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/images/gotchas.md
@@ -0,0 +1,16 @@
+# Images Troubleshooting
+
+First identify whether the failure involves hosted-image storage, remote URL transformations, or a Worker binding. Capture the failing operation, response status, relevant headers, and error message before changing options.
+
+| Symptom or question | Documentation |
+| -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Resizing is absent, an origin request fails, or a transformation returns an error code | [Troubleshooting](https://developers.cloudflare.com/images/reference/troubleshooting/) |
+| Input size, dimensions, animation, or format compatibility | [Limits and formats](https://developers.cloudflare.com/images/get-started/limits/) — choose the section for the affected interface |
+| Unexpected fit, quality, format, or crop behavior | [Optimization features](https://developers.cloudflare.com/images/optimization/features/) |
+| Binding input, output, or response handling fails | [Binding methods](https://developers.cloudflare.com/images/optimization/binding/#methods) |
+| Local behavior differs from production | [Local binding development](https://developers.cloudflare.com/images/optimization/binding/#interact-with-your-images-binding-locally) |
+| Private delivery fails or an image is unexpectedly public | [Serve private images](https://developers.cloudflare.com/images/optimization/hosted-images/serve-private-images/) and [variant public access](https://developers.cloudflare.com/images/optimization/hosted-images/create-variants/#public-access) |
+| Remote transformations appear stale | [Caching and purging](https://developers.cloudflare.com/images/reference/troubleshooting/#caching-and-purging) |
+| Worker transformations repeat unnecessarily | [Binding caching guidance](https://developers.cloudflare.com/images/optimization/binding/#methods) |
+
+Do not apply one interface's limits, error codes, or caching rules to another. Reproduce with a representative image and verify the chosen fix using the project's existing checks. Retry only after identifying a transient failure; changing invalid inputs or access configuration requires a different fix. See [API selection](api.md) and [configuration](configuration.md) when the wrong interface or setup is responsible.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/images/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/images/patterns.md
new file mode 100644
index 0000000..b5f62a1
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/images/patterns.md
@@ -0,0 +1,16 @@
+# Images Patterns
+
+Choose the workflow that matches the existing storage and delivery architecture, then read its implementation guide.
+
+| Workflow | Documentation |
+| ------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
+| Let users upload without exposing account credentials | [Direct Creator Upload](https://developers.cloudflare.com/images/storage/upload-images/direct-creator-upload/) |
+| Serve images for different layouts and display densities | [Make responsive images](https://developers.cloudflare.com/images/optimization/make-responsive-images/) |
+| Select output format for hosted images | [Hosted-image format optimization](https://developers.cloudflare.com/images/optimization/hosted-images/serve-uploaded-images/#optimize-format) |
+| Select output format for a Worker pipeline | [Workers optimization binding](https://developers.cloudflare.com/images/optimization/binding/) |
+| Optimize user uploads, add a watermark, and store the result in R2 | [Transform user-uploaded images before uploading to R2](https://developers.cloudflare.com/images/tutorials/optimize-user-uploaded-image/) |
+| Compose overlays and watermarks | [Draw overlays](https://developers.cloudflare.com/images/optimization/draw-overlays/) |
+| Cache a Worker transformation response | [Binding methods and caching guidance](https://developers.cloudflare.com/images/optimization/binding/#methods) |
+| Configure hosted-image browser caching | [Browser TTL](https://developers.cloudflare.com/images/optimization/hosted-images/browser-ttl/) |
+
+Adapt dimensions and quality to the actual layout and representative source images. Keep upload credentials server-side, preserve the application's access checks, and validate both the resulting image and its response headers. Consult [limits and troubleshooting](gotchas.md) before choosing batch sizes or retry behavior.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/kv/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/kv/README.md
new file mode 100644
index 0000000..b246645
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/kv/README.md
@@ -0,0 +1,15 @@
+# Cloudflare Workers KV
+
+Use KV for read-heavy configuration, preferences, and application caches that tolerate stale data. Read [how KV works](https://developers.cloudflare.com/kv/concepts/how-kv-works/) before choosing it: reads are eventually consistent, including cached missing keys, and immediate visibility is not guaranteed even in the location of a write.
+
+For atomic updates or coordination, consider [Durable Objects](https://developers.cloudflare.com/durable-objects/); for relational queries, [D1](../d1/); for large objects, [R2](../r2/). Use the [storage comparison](https://developers.cloudflare.com/workers/platform/storage-options/) to choose based on requirements.
+
+Read the current documentation for the task before implementing. Use the [KV documentation index](https://developers.cloudflare.com/kv/llms.txt) to discover additional guides; these files preserve task routes rather than copies of APIs, commands, or numeric limits.
+
+## Start here
+
+- [Get started](https://developers.cloudflare.com/kv/get-started/): create a namespace, bind it, and read and write data.
+- [configuration.md](./configuration.md): bindings, environments, types, local development, CLI, and REST access.
+- [api.md](./api.md): reads, writes, metadata, deletion, bulk operations, and pagination.
+- [patterns.md](./patterns.md): caching, sessions, key design, versioning, and fallback decisions.
+- [gotchas.md](./gotchas.md): stale reads, concurrent writes, missing values, performance, limits, and pricing.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/kv/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/kv/api.md
new file mode 100644
index 0000000..54b3cc8
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/kv/api.md
@@ -0,0 +1,18 @@
+# KV API Reference
+
+Read the relevant API page before implementing; it defines current options, result shapes, supported bulk operations, and constraints.
+
+| Task | Documentation |
+| ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Read one or several keys; choose text, JSON, binary, or stream results | [Read key-value pairs](https://developers.cloudflare.com/kv/api/read-key-value-pairs/) |
+| Read metadata with values; tune read caching or coalesce related keys | [Read guidance](https://developers.cloudflare.com/kv/api/read-key-value-pairs/) |
+| Write values and metadata; set absolute expiration or a relative lifetime | [Write key-value pairs](https://developers.cloudflare.com/kv/api/write-key-value-pairs/) |
+| Delete a key | [Delete key-value pairs](https://developers.cloudflare.com/kv/api/delete-key-value-pairs/) |
+| Enumerate keys, filter by prefix, and paginate | [List keys](https://developers.cloudflare.com/kv/api/list-keys/) |
+| Access namespaces or perform bulk operations outside a Worker | [KV REST API](https://developers.cloudflare.com/api/resources/kv/) and [Wrangler KV commands](https://developers.cloudflare.com/kv/reference/kv-commands/) |
+
+Handle missing values explicitly: JavaScript reads return `null` for absent keys; valid stored values can be falsy. Choose defaults separately from how you handle request failures.
+
+For pagination, follow the returned cursor until `list_complete` is true, even if a page has no keys. Preserve the original prefix on subsequent calls. Listing returns key information, not stored values; use the listing guide to decide whether metadata avoids additional reads.
+
+Use [gotchas.md](./gotchas.md) for consistency and contention decisions before adding retries or read-after-write verification.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/kv/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/kv/configuration.md
new file mode 100644
index 0000000..bda91b4
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/kv/configuration.md
@@ -0,0 +1,16 @@
+# KV Configuration
+
+Read the setup guide for the target environment before creating resources or editing bindings.
+
+| Task | Documentation |
+| --------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Create a namespace and connect a Worker | [Get started](https://developers.cloudflare.com/kv/get-started/) and [KV bindings](https://developers.cloudflare.com/kv/concepts/kv-bindings/) |
+| Configure staging and production namespaces | [KV environments](https://developers.cloudflare.com/kv/reference/environments/) |
+| Generate Worker environment and binding types | [Workers TypeScript](https://developers.cloudflare.com/workers/languages/typescript/) |
+| Develop against local storage or a remote binding | [KV local development](https://developers.cloudflare.com/kv/concepts/kv-bindings/) and [remote bindings](https://developers.cloudflare.com/workers/local-development/#remote-bindings) |
+| Manage namespaces, individual keys, and bulk files from the CLI | [Wrangler KV commands](https://developers.cloudflare.com/kv/reference/kv-commands/) |
+| Manage KV from another service or SDK | [KV REST API](https://developers.cloudflare.com/api/resources/kv/) |
+
+Choose the namespace, account, and environment deliberately. Local KV data is separate from remote data; a remote binding accesses the selected Cloudflare namespace even when Worker code runs locally. Check the command's local/remote options and environment selection before seeding or inspecting data. A separate preview namespace is not required simply to use local KV.
+
+Use generated types for binding shapes. JSON type annotations do not validate stored data at runtime; validate application data when its source or schema requires it.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/kv/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/kv/gotchas.md
new file mode 100644
index 0000000..f2233c9
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/kv/gotchas.md
@@ -0,0 +1,17 @@
+# KV Gotchas & Troubleshooting
+
+Read the linked explanation before applying a workaround.
+
+| Symptom or decision | Documentation and guidance |
+| --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Stale value after a write or delete | [How KV works](https://developers.cloudflare.com/kv/concepts/how-kv-works/): allow for eventual consistency; neither local read-after-write visibility nor a fixed global propagation deadline is guaranteed. |
+| Newly created key still appears absent | [Read caching](https://developers.cloudflare.com/kv/api/read-key-value-pairs/): missing-key lookups are cached too. Treat check-then-create as a race, not an atomic existence test. |
+| Concurrent updates overwrite each other or writes are throttled | [Concurrent writes](https://developers.cloudflare.com/kv/api/write-key-value-pairs/#concurrent-writes-to-the-same-key): retries do not make read-modify-write atomic. Use coordination when correctness depends on ordering. |
+| Missing-value errors | [Read results](https://developers.cloudflare.com/kv/api/read-key-value-pairs/): distinguish `null` from valid falsy values and distinguish absence from an operation failure. |
+| Slow reads, large results, or excessive operations | [Read guidance](https://developers.cloudflare.com/kv/api/read-key-value-pairs/): select result types and bulk reads to match the workload; increasing read cache lifetime trades freshness for cache reuse. |
+| Unexpected empty listing page | [Pagination](https://developers.cloudflare.com/kv/api/list-keys/): use the completion flag and cursor, not page length, to determine whether to continue. |
+| Data present in one environment but missing in another | [KV bindings](https://developers.cloudflare.com/kv/concepts/kv-bindings/) and [environments](https://developers.cloudflare.com/kv/reference/environments/): check local versus remote storage and the selected namespace. |
+| Size, operation, or write-rate failures | [Limits](https://developers.cloudflare.com/kv/platform/limits/): retrieve current constraints before sizing values, batches, or retry policies. |
+| Estimate costs or explain billing | [Pricing](https://developers.cloudflare.com/kv/platform/pricing/): check allowances, billable operations, storage, and bulk accounting for the actual workload. |
+
+Confirm freshness and failure requirements before adding a cache or a permissive fallback; see [patterns.md](./patterns.md).
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/kv/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/kv/patterns.md
new file mode 100644
index 0000000..99c0b52
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/kv/patterns.md
@@ -0,0 +1,21 @@
+# KV Patterns & Best Practices
+
+Read the guide for the pattern before implementing it, and confirm that [KV's consistency model](https://developers.cloudflare.com/kv/concepts/how-kv-works/) fits the application.
+
+| Task | Documentation and design decision |
+| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Cache application data or API results | [Cache data with KV](https://developers.cloudflare.com/kv/examples/cache-data-with-workers-kv/): decide acceptable staleness, expiration, and behavior when the origin fails. |
+| Cache eligible HTTP responses | [Workers Cache](https://developers.cloudflare.com/workers/cache/): choose the HTTP caching mechanism based on response semantics. |
+| Store configuration or feature flags | [Distributed configuration](https://developers.cloudflare.com/kv/examples/distributed-configuration-with-workers-kv/): choose defaults and rollout behavior that tolerate delayed updates. |
+| Coalesce related keys | [Read guidance](https://developers.cloudflare.com/kv/api/read-key-value-pairs/): fewer reads can improve cache reuse, but combined values couple updates and can introduce write races. |
+| Organize and enumerate keys by prefix | [List keys](https://developers.cloudflare.com/kv/api/list-keys/): use a consistent naming scheme and paginate every listing. |
+| Attach schema versions or other metadata | [Write metadata](https://developers.cloudflare.com/kv/api/write-key-value-pairs/) and [read metadata](https://developers.cloudflare.com/kv/api/read-key-value-pairs/): define compatibility and migration behavior for older records; migrations must account for concurrent writes. |
+
+## Application-specific decisions
+
+The linked APIs are building blocks, not complete session or multi-tier cache implementations. Preserve these requirements when designing an application:
+
+- For a memory → KV → origin cache, define each layer's lifetime and refill behavior. Process memory is not shared durable state; KV adds its own stale-value and negative-lookup caching.
+- For sessions, decide how quickly creation, updates, and revocation must become visible. KV alone cannot provide immediate global revocation or guaranteed immediate reads after session creation. Use a store with suitable consistency when those are requirements, and define application expiration checks using the [write expiration guidance](https://developers.cloudflare.com/kv/api/write-key-value-pairs/).
+- For counters, rate limits, or other atomic read-modify-write decisions, use coordination such as [Durable Objects](https://developers.cloudflare.com/durable-objects/). Serializing writes through an object does not make separate KV reads strongly consistent.
+- Choose missing-data defaults separately from service-error handling. A fallback appropriate for display preferences may be inappropriate for authorization or session validation.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/miniflare/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/miniflare/README.md
new file mode 100644
index 0000000..4a8a861
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/miniflare/README.md
@@ -0,0 +1,22 @@
+# Miniflare
+
+Miniflare provides programmatic control of local Workers simulation. Read the linked documentation before choosing APIs, configuration, or a migration path.
+
+## Choose the testing tool
+
+| Need | Start here |
+| ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------- |
+| Unit tests that execute in the Workers runtime | [Workers Vitest setup](https://developers.cloudflare.com/workers/testing/vitest-integration/write-your-first-test/) |
+| Integration tests against built Workers | [Integration test harness](https://developers.cloudflare.com/workers/testing/test-harness/) |
+| Low-level simulator control for a custom harness | [Miniflare testing guide](https://developers.cloudflare.com/workers/testing/miniflare/writing-tests/) |
+| Binding access from a Node.js process | [Wrangler getPlatformProxy](https://developers.cloudflare.com/workers/wrangler/api/#getplatformproxy) |
+
+For interactive local development, use the project's Wrangler or Cloudflare Vite workflow. Direct Miniflare is useful when the higher-level testing tools do not expose the control needed.
+
+## Read for the task
+
+- [Get started](https://developers.cloudflare.com/workers/testing/miniflare/get-started/) — installation, scripts, lifecycle, and event dispatch.
+- [API routing](./api.md) — events and access to local resources.
+- [Configuration](./configuration.md) — modules, bindings, compatibility, and multiple Workers.
+- [Testing patterns](./patterns.md) — runtime choice, mocking, and test lifecycle.
+- [Troubleshooting and migrations](./gotchas.md) — build/configuration differences and existing test suites.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/miniflare/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/miniflare/api.md
new file mode 100644
index 0000000..5bb1dee
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/miniflare/api.md
@@ -0,0 +1,16 @@
+# Miniflare API
+
+Use the current documentation for method signatures and examples:
+
+| Task | Documentation |
+| ---------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Create, reload, or dispose an instance; wait for its HTTP server | [Get started](https://developers.cloudflare.com/workers/testing/miniflare/get-started/) |
+| Dispatch requests and supply request metadata | [Fetch events](https://developers.cloudflare.com/workers/testing/miniflare/core/fetch/) |
+| Trigger queue and scheduled handlers programmatically | [Dispatching events](https://developers.cloudflare.com/workers/testing/miniflare/get-started/#dispatching-events) |
+| Configure queue producers and consumers | [Queues](https://developers.cloudflare.com/workers/testing/miniflare/core/queues/) |
+| Trigger scheduled events over HTTP or the API | [Scheduled events](https://developers.cloudflare.com/workers/testing/miniflare/core/scheduled/) |
+| Access bindings from tests | [Interacting with bindings](https://developers.cloudflare.com/workers/testing/miniflare/writing-tests/#interacting-with-bindings) |
+| Access local storage | [KV](https://developers.cloudflare.com/workers/testing/miniflare/storage/kv/), [R2](https://developers.cloudflare.com/workers/testing/miniflare/storage/r2/), [D1](https://developers.cloudflare.com/workers/testing/miniflare/storage/d1/), [Durable Objects](https://developers.cloudflare.com/workers/testing/miniflare/storage/durable-objects/), [Cache](https://developers.cloudflare.com/workers/testing/miniflare/storage/cache/) |
+| Handle a WebSocket upgrade in a test | [WebSockets](https://developers.cloudflare.com/workers/testing/miniflare/core/web-sockets/) |
+
+For constructor options, read [configuration.md](./configuration.md). For runtime-specific test helpers, read [patterns.md](./patterns.md).
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/miniflare/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/miniflare/configuration.md
new file mode 100644
index 0000000..3c9db57
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/miniflare/configuration.md
@@ -0,0 +1,16 @@
+# Miniflare Configuration
+
+Direct Miniflare does not read Wrangler configuration. Configure its bindings explicitly and build TypeScript or bundled Workers before starting tests; see [writing tests](https://developers.cloudflare.com/workers/testing/miniflare/writing-tests/).
+
+Match the Worker's intended compatibility date and flags when testing its behavior. Consult [compatibility dates](https://developers.cloudflare.com/workers/testing/miniflare/core/compatibility/) rather than substituting a fixed date from a sample.
+
+| Configure | Documentation |
+| ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Script source, HTTP server, request metadata, or reloading | [Get started](https://developers.cloudflare.com/workers/testing/miniflare/get-started/) |
+| Module format and resolution rules | [Modules](https://developers.cloudflare.com/workers/testing/miniflare/core/modules/) |
+| Values and file-backed bindings | [Variables and secrets](https://developers.cloudflare.com/workers/testing/miniflare/core/variables-secrets/) |
+| Service bindings, shared storage, and several Workers | [Multiple Workers](https://developers.cloudflare.com/workers/testing/miniflare/core/multiple-workers/) |
+| Storage bindings and documented persistence options | [KV](https://developers.cloudflare.com/workers/testing/miniflare/storage/kv/), [R2](https://developers.cloudflare.com/workers/testing/miniflare/storage/r2/), [D1](https://developers.cloudflare.com/workers/testing/miniflare/storage/d1/), [Durable Objects](https://developers.cloudflare.com/workers/testing/miniflare/storage/durable-objects/), [Cache](https://developers.cloudflare.com/workers/testing/miniflare/storage/cache/) |
+| Queue producers and consumers | [Queues](https://developers.cloudflare.com/workers/testing/miniflare/core/queues/) |
+
+If the task is to run tests from the project's build and Wrangler configuration, consider the [integration test harness](https://developers.cloudflare.com/workers/testing/test-harness/) or [Workers Vitest setup](https://developers.cloudflare.com/workers/testing/vitest-integration/write-your-first-test/).
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/miniflare/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/miniflare/gotchas.md
new file mode 100644
index 0000000..8335f9b
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/miniflare/gotchas.md
@@ -0,0 +1,15 @@
+# Miniflare Troubleshooting and Migrations
+
+| Symptom or task | Check |
+| ------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| TypeScript, bundled code, or imports fail to load | [Custom builds](https://developers.cloudflare.com/workers/testing/miniflare/writing-tests/#custom-builds) and [module rules](https://developers.cloudflare.com/workers/testing/miniflare/core/modules/#module-rules) |
+| Bindings from Wrangler configuration are missing | [Interacting with bindings](https://developers.cloudflare.com/workers/testing/miniflare/writing-tests/#interacting-with-bindings) — direct Miniflare needs explicit configuration |
+| Tests disagree with Worker runtime behavior | [Test runtime differences](https://developers.cloudflare.com/workers/testing/miniflare/writing-tests/) and [compatibility dates](https://developers.cloudflare.com/workers/testing/miniflare/core/compatibility/) |
+| Instances keep running, ports conflict, or request metadata is unexpected | [Instance lifecycle and HTTP server](https://developers.cloudflare.com/workers/testing/miniflare/get-started/) — dispatching a request without HTTP does not mean the instance has no HTTP server |
+| Storage disappears or leaks across tests | Check the relevant [storage configuration](./configuration.md) and the chosen test tool's persistence settings |
+| Breakpoints are needed with direct Miniflare | [Attaching a debugger](https://developers.cloudflare.com/workers/testing/miniflare/developing/debugger/) |
+| Upgrade a Miniflare 2 application | [Migrate from version 2](https://developers.cloudflare.com/workers/testing/miniflare/migrations/from-v2/) |
+| Upgrade an existing Workers Vitest package | [Migrate to Vitest plugin](https://developers.cloudflare.com/workers/testing/vitest-integration/migration-guides/migrate-to-vitest-plugin/) |
+| Replace unstable_dev tests | [Migration guide](https://developers.cloudflare.com/workers/testing/vitest-integration/migration-guides/migrate-from-unstable-dev/) and [integration test harness](https://developers.cloudflare.com/workers/testing/test-harness/) |
+
+For a migration, choose the target using [the testing-tool decision](./README.md#choose-the-testing-tool) before translating old options. A historical migration page describes that version transition; use current setup documentation for new test suites.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/miniflare/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/miniflare/patterns.md
new file mode 100644
index 0000000..16ebf2a
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/miniflare/patterns.md
@@ -0,0 +1,19 @@
+# Miniflare Testing Patterns
+
+Choose the test runtime before adapting an example. With direct Miniflare, the Worker runs in workerd while the test runner runs in Node.js; importing Worker functions into Node.js can change runtime-dependent behavior. See [writing tests](https://developers.cloudflare.com/workers/testing/miniflare/writing-tests/).
+
+| Task | Documentation |
+| -------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
+| Write unit tests in the Workers runtime | [Workers Vitest setup](https://developers.cloudflare.com/workers/testing/vitest-integration/write-your-first-test/) |
+| Use event, Durable Object, or other runtime test helpers | [Vitest test APIs](https://developers.cloudflare.com/workers/testing/vitest-integration/test-apis/) |
+| Test built Workers from an external runner | [Integration test harness](https://developers.cloudflare.com/workers/testing/test-harness/) |
+| Build a custom runner with direct simulator control | [Miniflare writing tests](https://developers.cloudflare.com/workers/testing/miniflare/writing-tests/) |
+| Access emulated bindings from Node.js | [getPlatformProxy](https://developers.cloudflare.com/workers/wrangler/api/#getplatformproxy) |
+| Mock outbound requests in Workers Vitest tests | [Mock outbound requests](https://developers.cloudflare.com/workers/testing/vitest-integration/mock-outbound-requests/) |
+| Understand Vitest runtime isolation and concurrency | [Isolation and concurrency](https://developers.cloudflare.com/workers/testing/vitest-integration/isolation-and-concurrency/) |
+| Simulate inter-Worker calls and substitute services | [Multiple Workers](https://developers.cloudflare.com/workers/testing/miniflare/core/multiple-workers/) |
+| Test WebSockets or access local storage | [API routing](./api.md) |
+
+`getPlatformProxy` is for Node.js callers. The Workers Vitest runtime modules require tests running in the Workers runtime; they are not a substitute for calling `getPlatformProxy` in a Node.js test.
+
+For direct Miniflare, clean up instances after tests using the documented [lifecycle](https://developers.cloudflare.com/workers/testing/miniflare/get-started/#watching-reloading-and-disposing). Choose persistence deliberately so tests do not inherit unintended state.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/network-interconnect/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/network-interconnect/README.md
new file mode 100644
index 0000000..1bb6566
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/network-interconnect/README.md
@@ -0,0 +1,104 @@
+# Cloudflare Network Interconnect (CNI)
+
+Private, high-performance connectivity to Cloudflare's network. **Enterprise-only**.
+
+## Connection Types
+
+**Direct**: Physical fiber in shared datacenter. 10/100 Gbps. You order cross-connect.
+
+**Partner**: Virtual via Console Connect, Equinix, Megaport, etc. Managed via partner SDN.
+
+**Cloud**: AWS Direct Connect or GCP Cloud Interconnect. Magic WAN only.
+
+## Dataplane Versions
+
+**v1 (Classic)**: GRE tunnel support, VLAN/BFD/LACP, asymmetric MTU (1500↓/1476↑), peering support.
+
+**v2 (Beta)**: No GRE, 1500 MTU both ways, no VLAN/BFD/LACP yet, ECMP instead.
+
+## Use Cases
+
+- **Magic Transit DSR**: DDoS protection, egress via ISP (v1/v2)
+- **Magic Transit + Egress**: DDoS + egress via CF (v1/v2)
+- **Magic WAN + Zero Trust**: Private backbone (v1 needs GRE, v2 native)
+- **Peering**: Public routes at PoP (v1 only)
+- **App Security**: WAF/Cache/LB (v1/v2 over Magic Transit)
+
+## Prerequisites
+
+- Enterprise plan
+- IPv4 /24+ or IPv6 /48+ prefixes
+- BGP ASN for v1
+- See [locations PDF](https://developers.cloudflare.com/network-interconnect/static/cni-locations-05-may-2026.pdf)
+
+## Specs
+
+- /31 point-to-point subnets
+- 10km max optical distance
+- 10G: 10GBASE-LR single-mode
+- 100G: 100GBASE-LR4 single-mode
+- **No SLA** (free service)
+- Backup Internet required
+
+## Throughput
+
+| Direction | 10G | 100G |
+| ----------------------- | -------------------- | -------------------- |
+| CF → Customer | 10 Gbps | 100 Gbps |
+| Customer → CF (peering) | 10 Gbps | 100 Gbps |
+| Customer → CF (Magic) | 1 Gbps/tunnel or CNI | 1 Gbps/tunnel or CNI |
+
+## Timeline
+
+2-4 weeks typical. Steps: request → config review → order connection → configure → test → enable health checks → activate → monitor.
+
+## In This Reference
+
+- [configuration.md](./configuration.md) - BGP, routing, setup
+- [api.md](./api.md) - API endpoints, SDKs
+- [patterns.md](./patterns.md) - HA, hybrid cloud, failover
+- [gotchas.md](./gotchas.md) - Troubleshooting, limits
+
+## Reading Order by Task
+
+| Task | Files to Load |
+| --------------------------- | ---------------------------------- |
+| Initial setup | README → configuration.md → api.md |
+| Create interconnect via API | api.md → gotchas.md |
+| Design HA architecture | patterns.md → README |
+| Troubleshoot connection | gotchas.md → configuration.md |
+| Cloud integration (AWS/GCP) | configuration.md → patterns.md |
+| Monitor + alerts | configuration.md |
+
+## Automation Boundary
+
+**API-Automatable:**
+
+- List/create/delete interconnects (Direct, Partner)
+- List available slots
+- Get interconnect status
+- Download LOA PDF
+- Create/update CNI objects (BGP config)
+- Query settings
+
+**Requires Account Team:**
+
+- Initial request approval
+- AWS Direct Connect setup (send LOA+VLAN to CF)
+- GCP Cloud Interconnect final activation
+- Partner interconnect acceptance (Equinix, Megaport)
+- VLAN assignment (v1)
+- Configuration document generation (v1)
+- Escalations + troubleshooting support
+
+**Cannot Be Automated:**
+
+- Physical cross-connect installation (Direct)
+- Partner portal operations (virtual circuit ordering)
+- AWS/GCP portal operations
+- Maintenance window coordination
+
+## See Also
+
+- [tunnel](../tunnel/) - Alternative for private network connectivity
+- [spectrum](../spectrum/) - Layer 4 proxy for TCP/UDP traffic
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/network-interconnect/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/network-interconnect/api.md
new file mode 100644
index 0000000..16ef1bc
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/network-interconnect/api.md
@@ -0,0 +1,220 @@
+# CNI API Reference
+
+See [README.md](README.md) for overview.
+
+## Base
+
+```
+https://api.cloudflare.com/client/v4
+Auth: Authorization: Bearer
+```
+
+## SDK Namespaces
+
+**Primary (recommended):**
+
+```typescript
+client.networkInterconnects.interconnects.*
+client.networkInterconnects.cnis.*
+client.networkInterconnects.slots.*
+```
+
+**Alternate (deprecated):**
+
+```typescript
+client.magicTransit.cfInterconnects.*
+```
+
+Use `networkInterconnects` namespace for all new code.
+
+## Interconnects
+
+```http
+GET /accounts/{account_id}/cni/interconnects # Query: page, per_page
+POST /accounts/{account_id}/cni/interconnects # Query: validate_only=true (optional)
+GET /accounts/{account_id}/cni/interconnects/{icon}
+GET /accounts/{account_id}/cni/interconnects/{icon}/status
+GET /accounts/{account_id}/cni/interconnects/{icon}/loa # Returns PDF
+DELETE /accounts/{account_id}/cni/interconnects/{icon}
+```
+
+**Create Body:** `account`, `slot_id`, `type`, `facility`, `speed`, `name`, `description`
+**Status Values:** `active` | `healthy` | `unhealthy` | `pending` | `down`
+
+**Response Example:**
+
+```json
+{
+ "result": [
+ {
+ "id": "icon_abc",
+ "name": "prod",
+ "type": "direct",
+ "facility": "EWR1",
+ "speed": "10G",
+ "status": "active"
+ }
+ ]
+}
+```
+
+## CNI Objects (BGP config)
+
+```http
+GET /accounts/{account_id}/cni/cnis
+POST /accounts/{account_id}/cni/cnis
+GET /accounts/{account_id}/cni/cnis/{cni}
+PUT /accounts/{account_id}/cni/cnis/{cni}
+DELETE /accounts/{account_id}/cni/cnis/{cni}
+```
+
+Body: `account`, `cust_ip`, `cf_ip`, `bgp_asn`, `bgp_password`, `vlan`
+
+## Slots
+
+```http
+GET /accounts/{account_id}/cni/slots
+GET /accounts/{account_id}/cni/slots/{slot}
+```
+
+Query: `facility`, `occupied`, `speed`
+
+## Health Checks
+
+Configure via Magic Transit/WAN tunnel endpoints (CNI v2).
+
+```typescript
+await client.magicTransit.tunnels.update(accountId, tunnelId, {
+ health_check: { enabled: true, target: '192.0.2.1', rate: 'high', type: 'request' }
+});
+```
+
+Rates: `high` | `medium` | `low`. Types: `request` | `reply`. See [Magic Transit docs](https://developers.cloudflare.com/magic-transit/how-to/configure-tunnel-endpoints/#add-tunnels).
+
+## Settings
+
+```http
+GET /accounts/{account_id}/cni/settings
+PUT /accounts/{account_id}/cni/settings
+```
+
+Body: `default_asn`
+
+## TypeScript SDK
+
+```typescript
+import Cloudflare from 'cloudflare';
+
+const client = new Cloudflare({ apiToken: process.env.CF_TOKEN });
+
+// List
+await client.networkInterconnects.interconnects.list({ account_id: id });
+
+// Create with validation
+await client.networkInterconnects.interconnects.create(
+ {
+ account_id: id,
+ account: id,
+ slot_id: 'slot_abc',
+ type: 'direct',
+ facility: 'EWR1',
+ speed: '10G',
+ name: 'prod-interconnect'
+ },
+ {
+ query: { validate_only: true } // Dry-run validation
+ }
+);
+
+// Create without validation
+await client.networkInterconnects.interconnects.create({
+ account_id: id,
+ account: id,
+ slot_id: 'slot_abc',
+ type: 'direct',
+ facility: 'EWR1',
+ speed: '10G',
+ name: 'prod-interconnect'
+});
+
+// Status
+await client.networkInterconnects.interconnects.get(accountId, iconId);
+
+// LOA (use fetch)
+const res = await fetch(
+ `https://api.cloudflare.com/client/v4/accounts/${id}/cni/interconnects/${iconId}/loa`,
+ {
+ headers: { Authorization: `Bearer ${token}` }
+ }
+);
+await fs.writeFile('loa.pdf', Buffer.from(await res.arrayBuffer()));
+
+// CNI object
+await client.networkInterconnects.cnis.create({
+ account_id: id,
+ account: id,
+ cust_ip: '192.0.2.1/31',
+ cf_ip: '192.0.2.0/31',
+ bgp_asn: 65000,
+ vlan: 100
+});
+
+// Slots (filter by facility and speed)
+await client.networkInterconnects.slots.list({
+ account_id: id,
+ occupied: false,
+ facility: 'EWR1',
+ speed: '10G'
+});
+```
+
+## Python SDK
+
+```python
+from cloudflare import Cloudflare
+
+client = Cloudflare(api_token=os.environ["CF_TOKEN"])
+
+# List, create, status (same pattern as TypeScript)
+client.network_interconnects.interconnects.list(account_id=id)
+client.network_interconnects.interconnects.create(account_id=id, account=id, slot_id="slot_abc", type="direct", facility="EWR1", speed="10G")
+client.network_interconnects.interconnects.get(account_id=id, icon=icon_id)
+
+# CNI objects and slots
+client.network_interconnects.cnis.create(account_id=id, cust_ip="192.0.2.1/31", cf_ip="192.0.2.0/31", bgp_asn=65000)
+client.network_interconnects.slots.list(account_id=id, occupied=False)
+```
+
+## cURL
+
+```bash
+# List interconnects
+curl "https://api.cloudflare.com/client/v4/accounts/${ACCOUNT_ID}/cni/interconnects" \
+ -H "Authorization: Bearer ${CF_TOKEN}"
+
+# Create interconnect
+curl -X POST "https://api.cloudflare.com/client/v4/accounts/${ACCOUNT_ID}/cni/interconnects?validate_only=true" \
+ -H "Authorization: Bearer ${CF_TOKEN}" -H "Content-Type: application/json" \
+ -d '{"account": "id", "slot_id": "slot_abc", "type": "direct", "facility": "EWR1", "speed": "10G"}'
+
+# LOA PDF
+curl "https://api.cloudflare.com/client/v4/accounts/${ACCOUNT_ID}/cni/interconnects/${ICON_ID}/loa" \
+ -H "Authorization: Bearer ${CF_TOKEN}" --output loa.pdf
+```
+
+## Not Available via API
+
+**Missing Capabilities:**
+
+- BGP session state query (use Dashboard or BGP logs)
+- Bandwidth utilization metrics (use external monitoring)
+- Traffic statistics per interconnect
+- Historical uptime/downtime data
+- Light level readings (contact account team)
+- Maintenance window scheduling (notifications only)
+
+## Resources
+
+- [API Docs](https://developers.cloudflare.com/api/resources/network_interconnects/)
+- [TypeScript SDK](https://github.com/cloudflare/cloudflare-typescript)
+- [Python SDK](https://github.com/cloudflare/cloudflare-python)
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/network-interconnect/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/network-interconnect/configuration.md
new file mode 100644
index 0000000..508f0db
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/network-interconnect/configuration.md
@@ -0,0 +1,123 @@
+# CNI Configuration
+
+See [README.md](README.md) for overview.
+
+## Workflow (2-4 weeks)
+
+1. **Submit request** (Week 1): Contact account team, provide type/location/use case
+2. **Review config** (Week 1-2, v1 only): Approve IP/VLAN/spec doc
+3. **Order connection** (Week 2-3):
+ - **Direct**: Get LOA, order cross-connect from facility
+ - **Partner**: Order virtual circuit in partner portal
+ - **Cloud**: Order Direct Connect/Cloud Interconnect, send LOA+VLAN to CF
+4. **Configure** (Week 3): Both sides configure per doc
+5. **Test** (Week 3-4): Ping, verify BGP, check routes
+6. **Health checks** (Week 4): Configure [Magic Transit](https://developers.cloudflare.com/magic-transit/how-to/configure-tunnel-endpoints/#add-tunnels) or [Magic WAN](https://developers.cloudflare.com/magic-wan/configuration/manually/how-to/configure-tunnel-endpoints/#add-tunnels) health checks
+7. **Activate** (Week 4): Route traffic, verify flow
+8. **Monitor**: Enable [maintenance notifications](https://developers.cloudflare.com/network-interconnect/monitoring-and-alerts/#enable-cloudflare-status-maintenance-notification)
+
+## BGP Configuration
+
+**v1 Requirements:**
+
+- BGP ASN (provide during setup)
+- /31 subnet for peering
+- Optional: BGP password
+
+**v2:** Simplified, less BGP config needed.
+
+**BGP over CNI (Dec 2024):** Magic WAN/Transit can now peer BGP directly over CNI v2 (no GRE tunnel required).
+
+**Example v1 BGP:**
+
+```
+Router ID: 192.0.2.1
+Peer IP: 192.0.2.0
+Remote ASN: 13335
+Local ASN: 65000
+Password: [optional]
+VLAN: 100
+```
+
+## Cloud Interconnect Setup
+
+### AWS Direct Connect (Beta)
+
+**Requirements:** Magic WAN, AWS Dedicated Direct Connect 1/10 Gbps.
+
+**Process:**
+
+1. Contact CF account team
+2. Choose location
+3. Order in AWS portal
+4. AWS provides LOA + VLAN ID
+5. Send to CF account team
+6. Wait ~4 weeks
+
+**Post-setup:** Add [static routes](https://developers.cloudflare.com/magic-wan/configuration/manually/how-to/configure-routes/#configure-static-routes) to Magic WAN. Enable [bidirectional health checks](https://developers.cloudflare.com/magic-wan/configuration/manually/how-to/configure-tunnel-endpoints/#legacy-bidirectional-health-checks).
+
+### GCP Cloud Interconnect (Beta)
+
+**Setup via Dashboard:**
+
+1. Interconnects → Create → Cloud Interconnect → Google
+2. Provide name, MTU (match GCP VLAN attachment), speed (50M-50G granular options available for partner interconnects)
+3. Enter VLAN attachment pairing key
+4. Confirm order
+
+**Routing to GCP:** Add [static routes](https://developers.cloudflare.com/magic-wan/configuration/manually/how-to/configure-routes/#configure-static-routes). BGP routes from GCP Cloud Router **ignored**.
+
+**Routing to CF:** Configure [custom learned routes](https://cloud.google.com/network-connectivity/docs/router/how-to/configure-custom-learned-routes) in Cloud Router. Request prefixes from CF account team.
+
+## Monitoring
+
+**Dashboard Status:**
+
+| Status | Meaning |
+| ------------- | ------------------------------------------------------------ |
+| **Healthy** | Link operational, traffic flowing, health checks passing |
+| **Active** | Link up, sufficient light, Ethernet negotiated |
+| **Unhealthy** | Link down, no/low light (<-20 dBm), can't negotiate |
+| **Pending** | Cross-connect incomplete, device unresponsive, RX/TX swapped |
+| **Down** | Physical link down, no connectivity |
+
+**Alerts:**
+
+**CNI Connection Maintenance** (Magic Networking only):
+
+```
+Dashboard → Notifications → Add
+Product: Cloudflare Network Interconnect
+Type: Connection Maintenance Alert
+```
+
+Warnings up to 2 weeks advance. 6hr delay for new additions.
+
+**Cloudflare Status Maintenance** (entire PoP):
+
+```
+Dashboard → Notifications → Add
+Product: Cloudflare Status
+Filter PoPs: gru,fra,lhr
+```
+
+**Find PoP code:**
+
+```
+Dashboard → Magic Transit/WAN → Configuration → Interconnects
+Select CNI → Note Data Center (e.g., "gru-b")
+Use first 3 letters: "gru"
+```
+
+## Best Practices
+
+**Critical config-specific practices:**
+
+- /31 subnets required for BGP
+- BGP passwords recommended
+- BFD for fast failover (v1 only)
+- Test ping connectivity before BGP
+- Enable maintenance notifications immediately after activation
+- Monitor status programmatically via API
+
+For design patterns, HA architecture, and security best practices, see [patterns.md](./patterns.md).
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/network-interconnect/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/network-interconnect/gotchas.md
new file mode 100644
index 0000000..2b6a729
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/network-interconnect/gotchas.md
@@ -0,0 +1,175 @@
+# CNI Gotchas & Troubleshooting
+
+## Common Errors
+
+### "Status: Pending"
+
+**Cause:** Cross-connect not installed, RX/TX fibers reversed, wrong fiber type, or low light levels
+**Solution:**
+
+1. Verify cross-connect installed
+2. Check fiber at patch panel
+3. Swap RX/TX fibers
+4. Check light with optical power meter (target > -20 dBm)
+5. Contact account team
+
+### "Status: Unhealthy"
+
+**Cause:** Physical issue, low light (<-20 dBm), optic mismatch, or dirty connectors
+**Solution:**
+
+1. Check physical connections
+2. Clean fiber connectors
+3. Verify optic types (10GBASE-LR/100GBASE-LR4)
+4. Test with known-good optics
+5. Check patch panel
+6. Contact account team
+
+### "BGP Session Down"
+
+**Cause:** Wrong IP addressing, wrong ASN, password mismatch, or firewall blocking TCP/179
+**Solution:**
+
+1. Verify IPs match CNI object
+2. Confirm ASN correct
+3. Check BGP password
+4. Verify no firewall on TCP/179
+5. Check BGP logs
+6. Review BGP timers
+
+### "Low Throughput"
+
+**Cause:** MTU mismatch, fragmentation, single GRE tunnel (v1), or routing inefficiency
+**Solution:**
+
+1. Check MTU (1500↓/1476↑ for v1, 1500 both for v2)
+2. Test various packet sizes
+3. Add more GRE tunnels (v1)
+4. Consider upgrading to v2
+5. Review routing tables
+6. Use LACP for bundling (v1)
+
+## API Errors
+
+### 400 Bad Request: "slot_id already occupied"
+
+**Cause:** Another interconnect already uses this slot
+**Solution:** Use `occupied=false` filter when listing slots:
+
+```typescript
+await client.networkInterconnects.slots.list({
+ account_id: id,
+ occupied: false,
+ facility: 'EWR1'
+});
+```
+
+### 400 Bad Request: "invalid facility code"
+
+**Cause:** Typo or unsupported facility
+**Solution:** Check [locations PDF](https://developers.cloudflare.com/network-interconnect/static/cni-locations-05-may-2026.pdf) for valid codes
+
+### 403 Forbidden: "Enterprise plan required"
+
+**Cause:** Account not enterprise-level
+**Solution:** Contact account team to upgrade
+
+### 422 Unprocessable: "validate_only request failed"
+
+**Cause:** Dry-run validation found issues (wrong slot, invalid config)
+**Solution:** Review error message details, fix config before real creation
+
+### Rate Limiting
+
+**Limit:** 1200 requests/5min per token
+**Solution:** Implement exponential backoff, cache slot listings
+
+## Cloud-Specific Issues
+
+### AWS Direct Connect: "VLAN not matching"
+
+**Cause:** VLAN ID from AWS LOA doesn't match CNI config
+**Solution:**
+
+1. Get VLAN from AWS Console after ordering
+2. Send exact VLAN to CF account team
+3. Verify match in CNI object config
+
+### AWS: "Connection stuck in Pending"
+
+**Cause:** LOA not provided to CF or AWS connection not accepted
+**Solution:**
+
+1. Verify AWS connection status is "Available"
+2. Confirm LOA sent to CF account team
+3. Wait for CF team acceptance (can take days)
+
+### GCP: "BGP routes not propagating"
+
+**Cause:** BGP routes from GCP Cloud Router **ignored by design**
+**Solution:** Use [static routes](https://developers.cloudflare.com/magic-wan/configuration/manually/how-to/configure-routes/#configure-static-routes) in Magic WAN instead
+
+### GCP: "Cannot query VLAN attachment status via API"
+
+**Cause:** GCP Cloud Interconnect Dashboard-only (no API yet)
+**Solution:** Check status in CF Dashboard or GCP Console
+
+## Partner Interconnect Issues
+
+### Equinix: "Virtual circuit not appearing"
+
+**Cause:** CF hasn't accepted Equinix connection request
+**Solution:**
+
+1. Verify VC created in Equinix Fabric Portal
+2. Contact CF account team to accept
+3. Allow 2-3 business days
+
+### Console Connect/Megaport: "API creation fails"
+
+**Cause:** Partner interconnects require partner portal + CF approval
+**Solution:** Cannot fully automate. Order in partner portal, notify CF account team.
+
+## Anti-Patterns
+
+| Anti-Pattern | Why Bad | Solution |
+| -------------------------------------- | ------------------------------------ | ------------------------------------ |
+| Single interconnect for production | No SLA, single point of failure | Use ≥2 with device diversity |
+| No backup Internet | CNI fails = total outage | Always maintain alternate path |
+| Polling status every second | Rate limits, wastes API calls | Poll every 30-60s max |
+| Using v1 for Magic WAN v2 workloads | GRE overhead, complexity | Use v2 for simplified routing |
+| Assuming BGP session = traffic flowing | BGP up ≠ routes installed | Verify routing tables + test traffic |
+| Not enabling maintenance alerts | Surprise downtime during maintenance | Enable notifications immediately |
+| Hardcoding VLAN in automation | VLAN assigned by CF (v1) | Get VLAN from CNI object response |
+| Using Direct without colocation | Can't access cross-connect | Use Partner or Cloud interconnect |
+
+## What's Not Queryable via API
+
+**Cannot retrieve:**
+
+- BGP session state (use Dashboard or BGP logs)
+- Light levels (contact account team)
+- Historical metrics (uptime, traffic)
+- Bandwidth utilization per interconnect
+- Maintenance window schedules (notifications only)
+- Fiber path details
+- Cross-connect installation status
+
+**Workarounds:**
+
+- External monitoring for BGP state
+- Log aggregation for historical data
+- Notifications for maintenance windows
+
+## Limits
+
+| Resource/Limit | Value | Notes |
+| --------------------- | ------------- | ----------------------------------- |
+| Max optical distance | 10km | Physical limit |
+| MTU (v1) | 1500↓ / 1476↑ | Asymmetric |
+| MTU (v2) | 1500 both | Symmetric |
+| GRE tunnel throughput | 1 Gbps | Per tunnel (v1) |
+| Recovery time | Days | No formal SLA |
+| Light level minimum | -20 dBm | Target threshold |
+| API rate limit | 1200 req/5min | Per token |
+| Health check delay | 6 hours | New maintenance alert subscriptions |
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/network-interconnect/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/network-interconnect/patterns.md
new file mode 100644
index 0000000..a37cbac
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/network-interconnect/patterns.md
@@ -0,0 +1,174 @@
+# CNI Patterns
+
+See [README.md](README.md) for overview.
+
+## High Availability
+
+**Critical:** Design for resilience from day one.
+
+**Requirements:**
+
+- Device-level diversity (separate hardware)
+- Backup Internet connectivity (no SLA on CNI)
+- Network-resilient locations preferred
+- Regular failover testing
+
+**Architecture:**
+
+```
+Your Network A ──10G CNI v2──> CF CCR Device 1
+ │
+Your Network B ──10G CNI v2──> CF CCR Device 2
+ │
+ CF Global Network (AS13335)
+```
+
+**Capacity Planning:**
+
+- Plan across all links
+- Account for failover scenarios
+- Your responsibility
+
+## Pattern: Magic Transit + CNI v2
+
+**Use Case:** DDoS protection, private connectivity, no GRE overhead.
+
+```typescript
+// 1. Create interconnect
+const ic = await client.networkInterconnects.interconnects.create({
+ account_id: id,
+ type: 'direct',
+ facility: 'EWR1',
+ speed: '10G',
+ name: 'magic-transit-primary'
+});
+
+// 2. Poll until active
+const status = await pollUntilActive(id, ic.id);
+
+// 3. Configure Magic Transit tunnel via Dashboard/API
+```
+
+**Benefits:** 1500 MTU both ways, simplified routing.
+
+## Pattern: Multi-Cloud Hybrid
+
+**Use Case:** AWS/GCP workloads with Cloudflare.
+
+**AWS Direct Connect:**
+
+```typescript
+// 1. Order Direct Connect in AWS Console
+// 2. Get LOA + VLAN from AWS
+// 3. Send to CF account team (no API)
+// 4. Configure static routes in Magic WAN
+
+await configureStaticRoutes(id, {
+ prefix: '10.0.0.0/8',
+ nexthop: 'aws-direct-connect'
+});
+```
+
+**GCP Cloud Interconnect:**
+
+```
+1. Get VLAN attachment pairing key from GCP Console
+2. Create via Dashboard: Interconnects → Create → Cloud Interconnect → Google
+ - Enter pairing key, name, MTU, speed
+3. Configure static routes in Magic WAN (BGP routes from GCP ignored)
+4. Configure custom learned routes in GCP Cloud Router
+```
+
+**Note:** Dashboard-only. No API/SDK support yet.
+
+## Pattern: Multi-Location HA
+
+**Use Case:** 99.99%+ uptime.
+
+```typescript
+// Primary (NY)
+const primary = await client.networkInterconnects.interconnects.create({
+ account_id: id,
+ type: 'direct',
+ facility: 'EWR1',
+ speed: '10G',
+ name: 'primary-ewr1'
+});
+
+// Secondary (NY, different hardware)
+const secondary = await client.networkInterconnects.interconnects.create({
+ account_id: id,
+ type: 'direct',
+ facility: 'EWR2',
+ speed: '10G',
+ name: 'secondary-ewr2'
+});
+
+// Tertiary (LA, different geography)
+const tertiary = await client.networkInterconnects.interconnects.create({
+ account_id: id,
+ type: 'partner',
+ facility: 'LAX1',
+ speed: '10G',
+ name: 'tertiary-lax1'
+});
+
+// BGP local preferences:
+// Primary: 200
+// Secondary: 150
+// Tertiary: 100
+// Internet: Last resort
+```
+
+## Pattern: Partner Interconnect (Equinix)
+
+**Use Case:** Quick deployment, no colocation.
+
+**Setup:**
+
+1. Order virtual circuit in Equinix Fabric Portal
+2. Select Cloudflare as destination
+3. Choose facility
+4. Send details to CF account team
+5. CF accepts in portal
+6. Configure BGP
+
+**No API automation** – partner portals managed separately.
+
+## Failover & Security
+
+**Failover Best Practices:**
+
+- Use BGP local preferences for priority
+- Configure BFD for fast detection (v1)
+- Test regularly with traffic shift
+- Document runbooks
+
+**Security:**
+
+- BGP password authentication
+- BGP route filtering
+- Monitor unexpected routes
+- Magic Firewall for DDoS/threats
+- Minimum API token permissions
+- Rotate credentials periodically
+
+## Decision Matrix
+
+| Requirement | Recommended |
+| ------------------ | ----------- |
+| Collocated with CF | Direct |
+| Not collocated | Partner |
+| AWS/GCP workloads | Cloud |
+| 1500 MTU both ways | v2 |
+| VLAN tagging | v1 |
+| Public peering | v1 |
+| Simplest config | v2 |
+| BFD fast failover | v1 |
+| LACP bundling | v1 |
+
+## Resources
+
+- [Magic Transit Docs](https://developers.cloudflare.com/magic-transit/)
+- [Magic WAN Docs](https://developers.cloudflare.com/magic-wan/)
+- [Argo Smart Routing](https://developers.cloudflare.com/argo-smart-routing/)
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/observability/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/observability/README.md
new file mode 100644
index 0000000..c6293df
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/observability/README.md
@@ -0,0 +1,27 @@
+# Cloudflare Observability
+
+Use this reference to choose a telemetry signal and find the maintained implementation guide. Fetch the linked documentation before writing configuration, queries, or export code; it is the source of truth for APIs, availability, retention, limits, and pricing.
+
+## Choose a signal
+
+| Need | Start here |
+| ------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
+| Store, search, and investigate historical Worker logs | [Workers Logs](https://developers.cloudflare.com/workers/observability/logs/workers-logs/) |
+| Watch a deployment or reproduce an issue live | [Real-time logs and Wrangler tail](https://developers.cloudflare.com/workers/observability/logs/real-time-logs/) |
+| Understand request flows and dependency latency | [Workers Traces](https://developers.cloudflare.com/workers/observability/traces/) |
+| Monitor built-in request, error, and CPU metrics | [Metrics and analytics](https://developers.cloudflare.com/workers/observability/metrics-and-analytics/) |
+| Record custom events and tenant-level usage for SQL analysis | [Analytics Engine](https://developers.cloudflare.com/analytics/analytics-engine/get-started/) |
+| Export logs and traces to an observability provider | [OpenTelemetry export](https://developers.cloudflare.com/workers/observability/exporting-opentelemetry-data/) |
+| Apply custom filtering, transformation, or delivery logic | [Tail Workers](https://developers.cloudflare.com/workers/observability/logs/tail-workers/) |
+| Deliver Workers Trace Events to a supported log storage destination | [Workers Logpush](https://developers.cloudflare.com/workers/observability/logs/logpush/) |
+
+Workers Logs supports retained historical data; live tailing is a separate debugging workflow. Choose persistence, sampling, and export destinations deliberately rather than assuming that every signal is stored or included without usage charges.
+
+## Load only what the task needs
+
+- [configuration.md](configuration.md): enable collection, bindings, environments, and exports.
+- [api.md](api.md): logging, telemetry types, SQL, GraphQL, and Logpush APIs.
+- [patterns.md](patterns.md): billing, performance, errors, tenant tracking, and export decisions.
+- [gotchas.md](gotchas.md): missing data, sampling, timing, privacy, and cost checks.
+
+For broader product tasks, see [Analytics Engine](../analytics-engine/README.md), [GraphQL API](../graphql-api/README.md), and [Tail Workers](../tail-workers/README.md).
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/observability/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/observability/api.md
new file mode 100644
index 0000000..db3fa81
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/observability/api.md
@@ -0,0 +1,20 @@
+# Observability APIs
+
+Fetch the applicable reference for current signatures, field locations, units, authentication, and query syntax. Do not infer the Tail event schema from an OpenTelemetry span or a Logpush record.
+
+| Task | Maintained documentation |
+| ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
+| Emit console messages and check supported methods | [Console API](https://developers.cloudflare.com/workers/runtime-apis/console/) |
+| Filter, group, and aggregate stored Workers Logs | [Query Builder](https://developers.cloudflare.com/workers/observability/query-builder/) |
+| Query built-in Workers metrics with GraphQL | [Querying Workers metrics](https://developers.cloudflare.com/analytics/graphql-api/tutorials/querying-workers-metrics/) |
+| Define Analytics Engine fields and call `writeDataPoint()` | [Write data points](https://developers.cloudflare.com/analytics/analytics-engine/get-started/) |
+| Authenticate and query Analytics Engine datasets | [SQL API](https://developers.cloudflare.com/analytics/analytics-engine/sql-api/) |
+| Calculate counts, sums, and averages on sampled events | [Analytics Engine sampling](https://developers.cloudflare.com/analytics/analytics-engine/sampling/) |
+| Implement a Tail consumer and inspect event properties | [Tail handler API](https://developers.cloudflare.com/workers/runtime-apis/handlers/tail/) |
+| Create and manage Logpush jobs | [Logpush API configuration](https://developers.cloudflare.com/logs/logpush/logpush-job/api-configuration/) |
+| Select exported Workers event fields | [Workers Trace Events dataset](https://developers.cloudflare.com/logs/logpush/logpush-job/datasets/account/workers_trace_events/) |
+| Export OTLP logs and traces | [OpenTelemetry export](https://developers.cloudflare.com/workers/observability/exporting-opentelemetry-data/) |
+
+Keep dataset field meanings and units consistent between writers and queries. Follow the SQL reference linked from the SQL API for supported date bucketing and aggregate functions; do not assume another SQL dialect's syntax works here. Account for sampling in averages as well as counts and sums.
+
+See [configuration.md](configuration.md) for setup and [patterns.md](patterns.md) for application-level decisions.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/observability/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/observability/configuration.md
new file mode 100644
index 0000000..461d296
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/observability/configuration.md
@@ -0,0 +1,23 @@
+# Observability Configuration
+
+Fetch the relevant guide before configuring the selected Worker and deployment environment.
+
+| Task | Maintained documentation |
+| ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Enable persisted logs, structured JSON logging, and sampling | [Workers Logs](https://developers.cloudflare.com/workers/observability/logs/workers-logs/) |
+| Enable traces and set their sampling independently of logs | [Workers Traces](https://developers.cloudflare.com/workers/observability/traces/) |
+| Configure a named deployment environment | [Wrangler environments](https://developers.cloudflare.com/workers/wrangler/environments/) and the environment example in [Workers Logs](https://developers.cloudflare.com/workers/observability/logs/workers-logs/) |
+| Bind an Analytics Engine dataset and write its first data point | [Analytics Engine get started](https://developers.cloudflare.com/analytics/analytics-engine/get-started/) |
+| Connect a producer to a Tail Worker | [Configure Tail Workers](https://developers.cloudflare.com/workers/observability/logs/tail-workers/) |
+| Create a Logpush job, configure access, and enable Worker log delivery | [Workers Logpush](https://developers.cloudflare.com/workers/observability/logs/logpush/) |
+| Configure OTLP destinations, authentication, and local persistence | [Exporting OpenTelemetry data](https://developers.cloudflare.com/workers/observability/exporting-opentelemetry-data/) |
+
+## Setup decisions
+
+- Confirm which account, Worker, and environment will emit telemetry, then deploy that configuration and generate representative traffic.
+- Decide log and trace sampling separately. Increasing sampling during an investigation changes volume and cost; restore the intended operational settings afterwards.
+- For Tail Workers, configure the consumer relationship on the producer Worker; use the guide for deployment order and the handler contract.
+- Choose whether to persist data in Cloudflare as well as exporting it. Verify destination names, supported signal types, and credentials using the export guide.
+- Use stable structured fields and redact secrets and unnecessary personal data before emission. Configure development and production collection intentionally.
+
+See [gotchas.md](gotchas.md) when configured telemetry is missing.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/observability/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/observability/gotchas.md
new file mode 100644
index 0000000..6415052
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/observability/gotchas.md
@@ -0,0 +1,25 @@
+# Observability Troubleshooting and Constraints
+
+## Missing or incomplete data
+
+| Symptom | Check and authoritative guide |
+| ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Logs missing from the dashboard | Confirm the deployed Worker/environment, collection and persistence settings, recent traffic, query time range, and sampling. Follow [Workers Logs](https://developers.cloudflare.com/workers/observability/logs/workers-logs/) and [Query Builder](https://developers.cloudflare.com/workers/observability/query-builder/). |
+| Live logs differ from stored logs | Confirm which workflow is being inspected; live streams can sample under load. See [real-time logs](https://developers.cloudflare.com/workers/observability/logs/real-time-logs/). |
+| Traces missing or incomplete | Check trace enablement and sampling separately from logs, then consult [tracing setup](https://developers.cloudflare.com/workers/observability/traces/) and [known limitations](https://developers.cloudflare.com/workers/observability/traces/known-limitations/). |
+| Export destination has no data | Check signal type, destination name, credentials, endpoint compatibility, and provider status using [OpenTelemetry export](https://developers.cloudflare.com/workers/observability/exporting-opentelemetry-data/). For a Logpush job, use [Workers Logpush](https://developers.cloudflare.com/workers/observability/logs/logpush/). |
+| Tail consumer receives no events | Check the producer's consumer configuration and deployment using [Tail Workers](https://developers.cloudflare.com/workers/observability/logs/tail-workers/). |
+| Analytics Engine totals or averages look wrong | Account for sample weights and consistent field meanings using [sampling guidance](https://developers.cloudflare.com/analytics/analytics-engine/sampling/). Check [limits](https://developers.cloudflare.com/analytics/analytics-engine/limits/) for missing writes or expired data. |
+| Very short operations appear to take no time | Read [performance and timers](https://developers.cloudflare.com/workers/runtime-apis/performance/) and [trace limitations](https://developers.cloudflare.com/workers/observability/traces/known-limitations/). Tracing does not eliminate the runtime's timing restrictions. |
+
+## Limits, retention, and cost
+
+Fetch these pages when estimating cost or diagnosing truncation and missing data:
+
+- [Workers Logs](https://developers.cloudflare.com/workers/observability/logs/workers-logs/): log size, retention, sampling, and pricing.
+- [Workers Traces](https://developers.cloudflare.com/workers/observability/traces/) and [known limitations](https://developers.cloudflare.com/workers/observability/traces/known-limitations/): availability, propagation, and instrumentation constraints.
+- [Workers pricing](https://developers.cloudflare.com/workers/platform/pricing/): current observability and Tail Worker billing terms.
+- [Analytics Engine limits](https://developers.cloudflare.com/analytics/analytics-engine/limits/) and [pricing](https://developers.cloudflare.com/analytics/analytics-engine/pricing/): field/write limits, retention, query costs, and billing availability.
+- [Workers Logpush](https://developers.cloudflare.com/workers/observability/logs/logpush/): Workers-specific eligibility, permissions, and pricing.
+
+Sampling reduces coverage as well as volume. Do not interpret the absence of a sampled event as proof that an error did not happen. Keep required diagnostic context while avoiding credentials, full sensitive URLs, and unnecessary personal data in logs, custom dimensions, and exported records.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/observability/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/observability/patterns.md
new file mode 100644
index 0000000..bc33954
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/observability/patterns.md
@@ -0,0 +1,14 @@
+# Observability Patterns
+
+Use these decisions alongside the linked implementation guides. Application event schemas, billing policies, alert thresholds, and delivery behavior still need to be designed for the application.
+
+| Task | Design decision and documentation |
+| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Usage-based billing | Define the billable event, tenant identity, time window, and accuracy requirements. Start with the maintained [Analytics Engine billing recipe](https://developers.cloudflare.com/analytics/analytics-engine/recipes/usage-based-billing-for-your-saas-product/) and [sampling guidance](https://developers.cloudflare.com/analytics/analytics-engine/sampling/); assess whether sampled estimates satisfy the billing contract. |
+| Performance monitoring | Use [built-in metrics](https://developers.cloudflare.com/workers/observability/metrics-and-analytics/) for aggregate health and [traces](https://developers.cloudflare.com/workers/observability/traces/) to investigate dependency latency. Custom measurements need consistent units and aggregation semantics; check [runtime timers](https://developers.cloudflare.com/workers/runtime-apis/performance/) before measuring CPU-only work. |
+| Error tracking | Emit structured context without secrets, investigate with [Query Builder](https://developers.cloudflare.com/workers/observability/query-builder/), and choose [Tail Workers](https://developers.cloudflare.com/workers/observability/logs/tail-workers/) if custom alert processing is needed. Define thresholds and duplicate handling for your alert destination. |
+| Multi-tenant tracking | Choose the tenant dimension and consistent field positions using [Analytics Engine get started](https://developers.cloudflare.com/analytics/analytics-engine/get-started/) and [sampling guidance](https://developers.cloudflare.com/analytics/analytics-engine/sampling/). Enforce tenant authorization in the application that exposes analytics; a dataset index is not an access-control boundary. |
+| Tail Worker filtering | Use the current [Tail handler schema](https://developers.cloudflare.com/workers/runtime-apis/handlers/tail/) for outcomes, exceptions, and timing fields, with [Tail configuration](https://developers.cloudflare.com/workers/observability/logs/tail-workers/) for producer wiring. Define filtering, redaction, and downstream failure handling for the destination. |
+| OpenTelemetry export | Prefer the maintained [OTLP export integration](https://developers.cloudflare.com/workers/observability/exporting-opentelemetry-data/) for supported destinations. For Honeycomb, follow [Export to Honeycomb](https://developers.cloudflare.com/workers/observability/exporting-opentelemetry-data/honeycomb/) instead of synthesizing spans from Tail events. |
+
+Use [Workers Logpush](https://developers.cloudflare.com/workers/observability/logs/logpush/) when the requirement is Workers Trace Event delivery to a supported log destination. Use a Tail Worker when custom processing is required beyond the configured export integration.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/pages-functions/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/pages-functions/README.md
new file mode 100644
index 0000000..7fc9e66
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/pages-functions/README.md
@@ -0,0 +1,20 @@
+# Cloudflare Pages Functions
+
+Use this reference for server-side behavior in an existing Pages project. For new applications, follow the Workers recommendation in the [Pages framework guidance](https://developers.cloudflare.com/pages/framework-guides/).
+
+| Task | Documentation |
+| ---------------------------------------------------- | --------------------------------------------------------------------------------- |
+| Identify filesystem routes and invocation boundaries | [Routing](https://developers.cloudflare.com/pages/functions/routing/) |
+| Implement request handlers | [API reference](https://developers.cloudflare.com/pages/functions/api-reference/) |
+| Understand generated Worker output | [Advanced mode](https://developers.cloudflare.com/pages/functions/advanced-mode/) |
+
+Inspect whether the project uses a Functions directory or framework-generated advanced mode before selecting a routing approach. Fetch current documentation for signatures, supported bindings, configuration, and examples.
+
+## In This Reference
+
+- [api.md](./api.md) — handlers, context, middleware, and assets
+- [configuration.md](./configuration.md) — bindings, environments, types, and local development
+- [patterns.md](./patterns.md) — request ownership and shared logic
+- [gotchas.md](./gotchas.md) — route, binding, and runtime investigation
+
+See [Pages](../pages/README.md) for builds and deployment decisions.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/pages-functions/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/pages-functions/api.md
new file mode 100644
index 0000000..13dba11
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/pages-functions/api.md
@@ -0,0 +1,13 @@
+# Pages Functions APIs
+
+Fetch the API reference before writing a handler; keep runtime types and examples in their authoritative documentation.
+
+| Task | Documentation |
+| ----------------------------------------------- | --------------------------------------------------------------------------------- |
+| Choose method handlers and access EventContext | [API reference](https://developers.cloudflare.com/pages/functions/api-reference/) |
+| Read parameters and resolve dynamic routes | [Routing](https://developers.cloudflare.com/pages/functions/routing/) |
+| Compose middleware and continue a request | [Middleware](https://developers.cloudflare.com/pages/functions/middleware/) |
+| Use a supported resource binding | [Bindings](https://developers.cloudflare.com/pages/functions/bindings/) |
+| Handle requests through generated Worker output | [Advanced mode](https://developers.cloudflare.com/pages/functions/advanced-mode/) |
+
+Decide which handler owns the response, where shared state is established, and which paths should fall through to assets. The API reference also covers asynchronous work and asset fetching. See [configuration.md](./configuration.md) for binding setup and [patterns.md](./patterns.md) for request design.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/pages-functions/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/pages-functions/configuration.md
new file mode 100644
index 0000000..394081a
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/pages-functions/configuration.md
@@ -0,0 +1,14 @@
+# Pages Functions Configuration
+
+Read Pages-specific configuration before reusing settings from a Worker project.
+
+| Task | Documentation |
+| ---------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
+| Manage Wrangler settings and environment overrides | [Functions configuration](https://developers.cloudflare.com/pages/functions/wrangler-configuration/) |
+| Configure supported bindings, variables, and secrets | [Bindings](https://developers.cloudflare.com/pages/functions/bindings/) |
+| Generate and configure runtime and environment types | [TypeScript](https://developers.cloudflare.com/pages/functions/typescript/) |
+| Run assets and Functions locally | [Local development](https://developers.cloudflare.com/pages/functions/local-development/) |
+| Set Function invocation routes | [Routing](https://developers.cloudflare.com/pages/functions/routing/) |
+| Evaluate and enable placement | [Smart Placement](https://developers.cloudflare.com/pages/functions/smart-placement/) |
+
+Identify the target deployment environment and which configuration source controls it. Verify Pages support for each binding and the documented local-development behavior before accessing remote resources. See [Pages configuration](../pages/configuration.md) for build output, headers, and redirects.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/pages-functions/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/pages-functions/gotchas.md
new file mode 100644
index 0000000..5daa456
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/pages-functions/gotchas.md
@@ -0,0 +1,17 @@
+# Pages Functions Troubleshooting
+
+Start with the request path, deployment environment, and generated output that actually handled the request.
+
+| Task | Documentation |
+| --------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
+| A Function does not run or receives unexpected parameters | [Routing](https://developers.cloudflare.com/pages/functions/routing/) |
+| Middleware is skipped or static fallback fails | [Advanced mode](https://developers.cloudflare.com/pages/functions/advanced-mode/) |
+| Middleware order or scope is incorrect | [Middleware](https://developers.cloudflare.com/pages/functions/middleware/) |
+| Bindings or secrets differ between environments | [Bindings](https://developers.cloudflare.com/pages/functions/bindings/) |
+| Runtime or environment types do not match | [TypeScript](https://developers.cloudflare.com/pages/functions/typescript/) |
+| A local request behaves differently | [Local development](https://developers.cloudflare.com/pages/functions/local-development/) |
+| Inspect exceptions and deployment logs | [Debugging and logging](https://developers.cloudflare.com/pages/functions/debugging-and-logging/) |
+| Check runtime quotas | [Workers limits](https://developers.cloudflare.com/workers/platform/limits/) |
+| Check request costs | [Functions pricing](https://developers.cloudflare.com/pages/functions/pricing/) |
+
+Reproduce a failing path through the actual application rather than only calling a handler with a hand-built context. Check the deployed configuration and generated output before changing application code. See [Pages troubleshooting](../pages/gotchas.md) for build, asset, and framework issues.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/pages-functions/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/pages-functions/patterns.md
new file mode 100644
index 0000000..75a860f
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/pages-functions/patterns.md
@@ -0,0 +1,16 @@
+# Pages Functions Request Design
+
+Choose where behavior belongs before adapting an example.
+
+| Task | Documentation |
+| ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
+| Share authentication, logging, and error handling | [Middleware](https://developers.cloudflare.com/pages/functions/middleware/) |
+| Choose request handlers and asynchronous completion behavior | [API reference](https://developers.cloudflare.com/pages/functions/api-reference/) |
+| Keep asset requests outside Function invocation where appropriate | [Routing](https://developers.cloudflare.com/pages/functions/routing/) |
+| Use custom or framework-generated routing | [Advanced mode](https://developers.cloudflare.com/pages/functions/advanced-mode/) |
+| Integrate storage or another service | [Bindings](https://developers.cloudflare.com/pages/functions/bindings/) |
+| Exercise the assembled application locally | [Local development](https://developers.cloudflare.com/pages/functions/local-development/) |
+
+Define the response owner and middleware scope before adding authentication or response transformations. Test protected routes, rejected requests, and static fallbacks together. Choose consistency and concurrency requirements before using storage for session state or rate limiting; a generic read-modify-write example is not a complete policy.
+
+See [Pages project decisions](../pages/patterns.md) for framework and migration work.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/pages/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/pages/README.md
new file mode 100644
index 0000000..f19c1ea
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/pages/README.md
@@ -0,0 +1,20 @@
+# Cloudflare Pages
+
+Use this reference when maintaining an existing Pages project. For new applications, start with Workers as recommended in the [Pages framework guidance](https://developers.cloudflare.com/pages/framework-guides/). Fetch current documentation before implementing.
+
+| Task | Documentation |
+| ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
+| Configure the existing build | [Build configuration](https://developers.cloudflare.com/pages/configuration/build-configuration/) |
+| Manage automatic deployments from a repository | [Git integration](https://developers.cloudflare.com/pages/configuration/git-integration/) |
+| Deploy prebuilt output | [Direct Upload](https://developers.cloudflare.com/pages/get-started/direct-upload/) |
+| Implement server-side requests | [Functions API reference](https://developers.cloudflare.com/pages/functions/api-reference/) |
+| Plan a move to Workers | [Migrate from Pages to Workers](https://developers.cloudflare.com/workers/static-assets/migration-guides/migrate-from-pages/) |
+
+## In This Reference
+
+- [configuration.md](./configuration.md) — build output, environments, and static rules
+- [api.md](./api.md) — request handling and framework integration
+- [patterns.md](./patterns.md) — project decisions and migration
+- [gotchas.md](./gotchas.md) — build, routing, and deployment investigation
+
+See [Pages Functions](../pages-functions/README.md) for handler-focused navigation. Identify the existing deployment method and framework before proposing changes.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/pages/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/pages/api.md
new file mode 100644
index 0000000..ae21e42
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/pages/api.md
@@ -0,0 +1,13 @@
+# Pages Request Handling
+
+Use the current Pages API and the project framework guide rather than translating a generic Worker example into Pages.
+
+| Task | Documentation |
+| ---------------------------------------------------- | ------------------------------------------------------------------------------------------- |
+| Implement handlers and use context or asset fallback | [Functions API reference](https://developers.cloudflare.com/pages/functions/api-reference/) |
+| Resolve dynamic paths and invocation routes | [Routing](https://developers.cloudflare.com/pages/functions/routing/) |
+| Apply shared request logic | [Middleware](https://developers.cloudflare.com/pages/functions/middleware/) |
+| Understand framework-generated Worker output | [Advanced mode](https://developers.cloudflare.com/pages/functions/advanced-mode/) |
+| Find the guide for the existing framework | [Framework guides](https://developers.cloudflare.com/pages/framework-guides/) |
+
+First identify whether routing comes from the Functions directory or generated advanced-mode output. See [Pages Functions APIs](../pages-functions/api.md) for focused handler tasks and [patterns.md](./patterns.md) for migration decisions.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/pages/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/pages/configuration.md
new file mode 100644
index 0000000..4938ee8
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/pages/configuration.md
@@ -0,0 +1,16 @@
+# Pages Configuration
+
+Inspect the existing project configuration and build output before changing deployment settings.
+
+| Task | Documentation |
+| -------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
+| Set build commands, root/output directories, and build variables | [Build configuration](https://developers.cloudflare.com/pages/configuration/build-configuration/) |
+| Manage Wrangler configuration, environments, and dashboard migration | [Functions configuration](https://developers.cloudflare.com/pages/functions/wrangler-configuration/) |
+| Configure resource bindings, variables, and secrets | [Bindings](https://developers.cloudflare.com/pages/functions/bindings/) |
+| Set static response headers | [Headers](https://developers.cloudflare.com/pages/configuration/headers/) |
+| Configure static redirects and rewrites | [Redirects](https://developers.cloudflare.com/pages/configuration/redirects/) |
+| Choose which requests invoke Functions | [Routing](https://developers.cloudflare.com/pages/functions/routing/) |
+| Configure monorepo project boundaries | [Monorepos](https://developers.cloudflare.com/pages/configuration/monorepos/) |
+| Run the project locally | [Local development](https://developers.cloudflare.com/pages/functions/local-development/) |
+
+Distinguish build-time variables from runtime bindings, and check preview and production separately. Determine whether the framework owns generated routing files before editing them. See [Pages Functions configuration](../pages-functions/configuration.md) for types and placement.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/pages/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/pages/gotchas.md
new file mode 100644
index 0000000..c01e3cc
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/pages/gotchas.md
@@ -0,0 +1,19 @@
+# Pages Troubleshooting
+
+Identify whether the failure occurs during the build, asset serving, or Function execution before changing configuration.
+
+| Task | Documentation |
+| --------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
+| Build output is missing or incorrect | [Build configuration](https://developers.cloudflare.com/pages/configuration/build-configuration/) |
+| A static URL redirects or returns an unexpected 404 | [Serving Pages](https://developers.cloudflare.com/pages/configuration/serving-pages/) |
+| Static response headers are not applied | [Headers](https://developers.cloudflare.com/pages/configuration/headers/) |
+| A redirect rule does not match | [Redirects](https://developers.cloudflare.com/pages/configuration/redirects/) |
+| Investigate a failed Function request | [Debugging and logging](https://developers.cloudflare.com/pages/functions/debugging-and-logging/) |
+| Check deployment and file capacity | [Pages limits](https://developers.cloudflare.com/pages/platform/limits/) |
+| Understand Function versus static request billing | [Functions pricing](https://developers.cloudflare.com/pages/functions/pricing/) |
+
+Compare the same route in local, preview, and production environments; record the build output and configuration used by each. See [Pages Functions troubleshooting](../pages-functions/gotchas.md) for handler and binding issues.
+
+## Framework-Specific
+
+Fetch the relevant [framework guide](https://developers.cloudflare.com/pages/framework-guides/) before changing adapters or recommending another host. For a move to Workers, follow the [migration guide](https://developers.cloudflare.com/workers/static-assets/migration-guides/migrate-from-pages/).
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/pages/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/pages/patterns.md
new file mode 100644
index 0000000..e79c8f2
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/pages/patterns.md
@@ -0,0 +1,15 @@
+# Pages Project Decisions
+
+Keep project-specific choices here; fetch framework adapters, configuration, and code examples from the docs.
+
+| Task | Documentation |
+| -------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
+| Maintain a framework deployment | [Framework guides](https://developers.cloudflare.com/pages/framework-guides/) |
+| Deploy from an external build pipeline | [Direct Upload](https://developers.cloudflare.com/pages/get-started/direct-upload/) |
+| Manage multiple apps in one repository | [Monorepos](https://developers.cloudflare.com/pages/configuration/monorepos/) |
+| Evaluate backend locality | [Smart Placement](https://developers.cloudflare.com/pages/functions/smart-placement/) |
+| Plan a move to Workers | [Migrate from Pages to Workers](https://developers.cloudflare.com/workers/static-assets/migration-guides/migrate-from-pages/) |
+
+Check the existing build command, adapter, and output ownership together. Evaluate placement using the application’s backend dependencies and measured latency. For a migration, inventory routes, middleware, bindings, static rules, and deployment settings before following the migration guide.
+
+See [Pages Functions patterns](../pages-functions/patterns.md) for request-level decisions.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/pipelines/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/pipelines/README.md
new file mode 100644
index 0000000..7b9225c
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/pipelines/README.md
@@ -0,0 +1,93 @@
+# Cloudflare Pipelines
+
+Streaming ingest: receive events over HTTP/Workers/Logpush, transform with SQL, write to R2 as Iceberg tables or Parquet/JSON files.
+
+## Documentation
+
+This reference is a fast-start with verified code and gotchas. For limits, settings, full SQL syntax, and pricing, **retrieve the live docs** — use the Cloudflare MCP `docs` tool if available, otherwise `webfetch` the URL. Docs are source of truth over this file.
+
+| Topic | URL |
+| --------------------------------- | -------------------------------------------------------------------------- |
+| Overview / getting started | `https://developers.cloudflare.com/pipelines/getting-started/` |
+| Streams (write, manage, Logpush) | `https://developers.cloudflare.com/pipelines/streams/` |
+| Sinks | `https://developers.cloudflare.com/pipelines/sinks/` |
+| Pipelines & SQL transforms | `https://developers.cloudflare.com/pipelines/pipelines/` |
+| SQL reference (statements, types) | `https://developers.cloudflare.com/pipelines/sql-reference/` |
+| Wrangler commands | `https://developers.cloudflare.com/pipelines/reference/wrangler-commands/` |
+| Terraform | `https://developers.cloudflare.com/pipelines/reference/terraform/` |
+| Limits | `https://developers.cloudflare.com/pipelines/platform/limits/` |
+| Pricing | `https://developers.cloudflare.com/pipelines/platform/pricing/` |
+| Metrics (GraphQL) | `https://developers.cloudflare.com/pipelines/observability/metrics/` |
+
+## Three Components
+
+```
+Sources → Stream → Pipeline (SQL) → Sink → R2
+ ↑ ↓ ↓
+ HTTP / Workers / Transform Iceberg (Data Catalog)
+ Logpush (row-level) or Parquet/JSON files
+```
+
+| Component | Purpose |
+| ------------ | ----------------------------------------------------------------------------------------------------------- |
+| **Stream** | Receives events (HTTP endpoint, Worker binding, or Logpush). Structured (schema-validated) or unstructured. |
+| **Pipeline** | SQL connecting a stream to a sink. Row-level transforms only — no GROUP BY/aggregation. |
+| **Sink** | Writes to R2 — Iceberg via Data Catalog, or raw Parquet/JSON. |
+
+**Status:** Open beta (Workers Paid for production). Pricing announced; verify billing status in docs.
+
+## Quick Start
+
+```bash
+# Interactive — creates stream + sink + pipeline, optionally bucket + catalog
+npx wrangler pipelines setup
+```
+
+Minimal Worker producer:
+
+```typescript
+interface Env {
+ MY_STREAM: Pipeline;
+}
+
+export default {
+ async fetch(req: Request, env: Env, ctx: ExecutionContext): Promise {
+ ctx.waitUntil(env.MY_STREAM.send([{ event_id: crypto.randomUUID(), amount: 29.99 }]));
+ return new Response('OK');
+ }
+} satisfies ExportedHandler;
+```
+
+## Which Sink Type?
+
+```
+Need SQL queries / ACID / time-travel on the data?
+ → R2 Data Catalog (Iceberg) ✅ R2 SQL, schema evolution ❌ more setup
+
+Just archival / external tools (Spark, Athena)?
+ → R2 raw files (Parquet/JSON) ✅ simple, partitioned files ❌ no built-in SQL
+```
+
+## Critical Behaviors (read before building)
+
+These are non-obvious and prevent most failures — see [gotchas.md](gotchas.md) for detail.
+
+- **Everything is immutable after creation** — stream schema, pipeline SQL, sink config. To change, delete and recreate.
+- **Sinks create their own table** — they cannot target an existing Iceberg table.
+- **`__ingest_ts` is added automatically** (TIMESTAMP, partitioned by day). Don't define it in your schema.
+- **Data isn't queryable immediately** — first flush takes **3–7 minutes** (warm-up + table creation) even with a short roll interval.
+- **Schema validation is deferred** — invalid events are accepted then silently dropped. Monitor via GraphQL error metrics.
+- **Binding field renamed `pipeline` → `stream`** (June 2026); old field still accepted.
+
+## Reading Order
+
+1. [configuration.md](configuration.md) — schema, streams, sinks, pipelines (CLI + REST + Terraform), bindings
+2. [api.md](api.md) — `send()`, HTTP ingest, REST API, pipeline SQL, lifecycle states
+3. [patterns.md](patterns.md) — fire-and-forget, validation, Logpush, observability, end-to-end
+4. [gotchas.md](gotchas.md) — silent drops, immutability, REST≠CLI field names
+
+## See Also
+
+- [r2-data-catalog](../r2-data-catalog/) — Iceberg sink destination
+- [r2-sql](../r2-sql/) — query the ingested data
+- [r2](../r2/) · [queues](../queues/) · [workers](https://developers.cloudflare.com/workers/)
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/pipelines/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/pipelines/api.md
new file mode 100644
index 0000000..2fd6159
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/pipelines/api.md
@@ -0,0 +1,128 @@
+# Pipelines API Reference
+
+Code templates and verified behavior. For the full SQL function set and HTTP status semantics, pull `https://developers.cloudflare.com/pipelines/sql-reference/` and the streams docs.
+
+## Worker Binding Interface
+
+```typescript
+// from cloudflare:pipelines / @cloudflare/workers-types
+interface Pipeline {
+ send(records: T[]): Promise;
+}
+
+interface Env {
+ MY_STREAM: Pipeline;
+}
+
+export default {
+ async fetch(req: Request, env: Env, ctx: ExecutionContext): Promise {
+ await env.MY_STREAM.send([{ event_id: crypto.randomUUID(), amount: 29.99 }]);
+ return new Response('OK');
+ }
+} satisfies ExportedHandler;
+```
+
+- `send()` takes an **array**, returns `Promise` (no confirmation payload).
+- Throws on network errors — wrap in try/catch or use `ctx.waitUntil()` for fire-and-forget.
+- Validation errors are **not** thrown here (deferred during processing — see [gotchas.md](gotchas.md)).
+- Payload/rate limits apply — check `https://developers.cloudflare.com/pipelines/platform/limits/` before sizing batches.
+
+## HTTP Ingest
+
+```
+https://{stream-id}.ingest.cloudflare.com
+```
+
+Get `{stream-id}` from `npx wrangler pipelines streams list`.
+
+```bash
+# Batch (preferred)
+curl -X POST https://{stream-id}.ingest.cloudflare.com \
+ -H "Content-Type: application/json" \
+ -d '[{"event_id":"evt-1","amount":29.99},{"event_id":"evt-2","amount":14.99}]'
+
+# Single event — auto-wrapped in an array
+curl -X POST https://{stream-id}.ingest.cloudflare.com \
+ -H "Content-Type: application/json" -d '{"event_id":"evt-3","amount":9.99}'
+```
+
+If stream auth is enabled, add `-H "Authorization: Bearer $TOKEN"` (token needs **Workers Pipelines Send**). Standard HTTP status codes apply (400 invalid, 401 auth, 413 too large, 429 rate-limited, 5xx retry).
+
+> **JSON only** — no Avro, Protobuf, or CSV input.
+
+## REST Management API
+
+Base: `https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/pipelines/v1`
+
+```bash
+# List
+curl -s "$BASE_URL/streams" -H "Authorization: Bearer $API_TOKEN"
+curl -s "$BASE_URL/sinks" -H "Authorization: Bearer $API_TOKEN"
+curl -s "$BASE_URL/pipelines" -H "Authorization: Bearer $API_TOKEN"
+
+# Get one (pipeline GET includes status + failure_reason — useful for debugging)
+curl -s "$BASE_URL/pipelines/{pipeline-id}" -H "Authorization: Bearer $API_TOKEN"
+
+# Delete in reverse order: pipeline → sink → stream
+curl -X DELETE "$BASE_URL/pipelines/{id}" -H "Authorization: Bearer $API_TOKEN"
+curl -X DELETE "$BASE_URL/sinks/{id}" -H "Authorization: Bearer $API_TOKEN"
+curl -X DELETE "$BASE_URL/streams/{id}" -H "Authorization: Bearer $API_TOKEN"
+```
+
+> `wrangler pipelines delete` defaults to "no" non-interactively — use the REST API for automated cleanup. Deleting a stream removes buffered events and dependent pipelines.
+
+### Pipeline Lifecycle States
+
+| Status | Meaning |
+| -------------- | ------------------------------------------------------------------------------------------- |
+| `running` | Active, processing events |
+| `initializing` | Starting up (minutes after creation or recovery) |
+| `failed` | Stopped on error — check `failure_reason` (expired token, deleted bucket, disabled catalog) |
+
+> A `GET` on a sink shows `schema.fields: []` — expected. The sink inherits schema from the stream via the pipeline SQL.
+
+## Pipeline SQL (Transforms)
+
+Row-level only — no GROUP BY/aggregation. CTEs (`WITH`) and `UNNEST` are supported. Full function list: `https://developers.cloudflare.com/pipelines/sql-reference/`.
+
+```sql
+-- Passthrough / filter / enrich
+INSERT INTO my_sink SELECT * FROM my_stream;
+INSERT INTO my_sink SELECT * FROM my_stream WHERE amount > 10;
+INSERT INTO my_sink
+SELECT event_id, UPPER(category) AS category, amount * 1.1 AS amount_with_tax
+FROM my_stream;
+
+-- CTE
+WITH filtered AS (SELECT event_id, amount FROM my_stream WHERE amount > 50)
+INSERT INTO my_sink SELECT * FROM filtered;
+
+-- UNNEST arrays (one per SELECT)
+SELECT UNNEST(tags) AS tag FROM my_stream;
+```
+
+Supported categories: string, regex, hashing (`sha256`), JSON extraction, timestamp conversion, conditional (`CASE`), `CAST`, `COALESCE`, math/comparison operators.
+
+## Verifying End-to-End Data Flow
+
+```bash
+# 1. Pipeline running (not initializing/failed)?
+curl -s "$BASE_URL/pipelines/{id}" -H "Authorization: Bearer $API_TOKEN"
+
+# 2. Table created yet? (3–7 min on first flush)
+curl -s "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/r2-catalog/$BUCKET/namespaces/my_ns/tables" \
+ -H "Authorization: Bearer $API_TOKEN"
+
+# 3. Data present? (R2 SQL)
+curl -s -X POST \
+ "https://api.sql.cloudflarestorage.com/api/v1/accounts/$ACCOUNT_ID/r2-sql/query/$BUCKET" \
+ -H "Authorization: Bearer $API_TOKEN" -H "Content-Type: application/json" \
+ -d '{"query": "SELECT COUNT(*) AS total FROM my_ns.my_table"}'
+```
+
+> Expect **3–7 minutes** from first send to first queryable data. Subsequent flushes are much faster.
+
+## See Also
+
+- [configuration.md](configuration.md) — creating resources · [patterns.md](patterns.md) — producers, Logpush, observability
+- [r2-sql/api.md](../r2-sql/api.md) — querying results
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/pipelines/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/pipelines/configuration.md
new file mode 100644
index 0000000..68ed378
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/pipelines/configuration.md
@@ -0,0 +1,155 @@
+# Pipelines Configuration
+
+Templates for creating streams, sinks, and pipelines via CLI, REST, or Terraform. For the full flag/field list and allowed values, pull `https://developers.cloudflare.com/pipelines/reference/wrangler-commands/` and the streams/sinks/pipelines docs.
+
+## Naming Rules
+
+- **Streams, sinks, pipelines** use underscores: `my_stream`, `my_sink`, `my_pipeline`.
+- **Buckets** use hyphens: `my-bucket`.
+
+## Schema (Structured Streams)
+
+Schema is a JSON object with a `fields` array; each field has `name`, `type`, `required`.
+
+```json
+{
+ "fields": [
+ { "name": "event_id", "type": "string", "required": true },
+ { "name": "amount", "type": "float64", "required": false }
+ ]
+}
+```
+
+Field types include `string`, `bool`, `int32/64`, `float32/64`, `timestamp`, `json`, `binary`, `list`, `struct` (with nested `items`/`fields`). For the authoritative type list, see `https://developers.cloudflare.com/pipelines/sql-reference/sql-data-types/`.
+
+Unstructured streams (no schema) store everything in a single `value` column.
+
+> Pipelines auto-adds `__ingest_ts` (TIMESTAMP, day-partitioned). Do **not** include it in your schema.
+
+## Option A: Interactive (Simplest)
+
+```bash
+npx wrangler pipelines setup # creates stream + sink + pipeline, optionally bucket + catalog
+```
+
+## Option B: Wrangler CLI (Explicit)
+
+```bash
+# 1. Stream
+npx wrangler pipelines streams create my_stream --schema-file schema.json
+
+# 2. Sink — R2 Data Catalog (Iceberg). Creates the namespace + table.
+npx wrangler pipelines sinks create my_sink \
+ --type r2-data-catalog \
+ --bucket my-bucket --namespace my_namespace --table my_table \
+ --catalog-token $API_TOKEN \
+ --compression zstd --roll-interval 300
+
+# 2b. Sink — R2 raw Parquet (alternative)
+npx wrangler pipelines sinks create my_sink \
+ --type r2 --bucket my-bucket --format parquet \
+ --path analytics/events --partitioning "year=%Y/month=%m/day=%d" \
+ --access-key-id $KEY --secret-access-key $SECRET
+
+# 3. Pipeline (SQL connects stream → sink)
+npx wrangler pipelines create my_pipeline \
+ --sql "INSERT INTO my_sink SELECT * FROM my_stream"
+```
+
+Tuning knobs (`--compression`, `--roll-interval`, `--roll-size`, etc.) and their allowed values/defaults change — pull the wrangler-commands and sinks docs rather than hardcoding. Rule of thumb: prod `--roll-interval 300+`, dev `10` (creates many small files).
+
+> **⚠️ Pipelines are immutable.** SQL, schema, and sink config can't be changed — delete and recreate.
+
+## Option C: REST API (Programmatic)
+
+Base: `https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/pipelines/v1`
+
+```bash
+# Stream
+curl -X POST "$BASE_URL/streams" -H "Authorization: Bearer $API_TOKEN" \
+ -H "Content-Type: application/json" -d '{
+ "name": "my_stream",
+ "http": {"enabled": true, "authentication": false},
+ "schema": {"fields": [{"name": "event_id", "type": "string", "required": true}]}
+ }'
+
+# Sink — NOTE REST field names differ from CLI flags (see table)
+curl -X POST "$BASE_URL/sinks" -H "Authorization: Bearer $API_TOKEN" \
+ -H "Content-Type: application/json" -d '{
+ "name": "my_sink", "type": "r2_data_catalog",
+ "config": {"bucket": "my-bucket", "namespace": "my_namespace",
+ "table_name": "my_table", "token": "'$API_TOKEN'",
+ "rolling_policy": {"interval_seconds": 300}},
+ "format": {"type": "parquet"}
+ }'
+
+# Pipeline
+curl -X POST "$BASE_URL/pipelines" -H "Authorization: Bearer $API_TOKEN" \
+ -H "Content-Type: application/json" \
+ -d '{"name": "my_pipeline", "sql": "INSERT INTO my_sink SELECT * FROM my_stream;"}'
+```
+
+**REST field names ≠ CLI flags** (common failure — not obvious from docs):
+
+| REST (config body) | CLI flag | Gotcha |
+| ------------------------------- | ------------------------ | -------------------------------- |
+| `"type": "r2_data_catalog"` | `--type r2-data-catalog` | underscores vs hyphens |
+| `"table_name"` | `--table` | different key |
+| `"token"` | `--catalog-token` | different key |
+| `"format": {"type": "parquet"}` | (implied) | required in REST, omitted in CLI |
+
+## Worker Binding
+
+```jsonc
+// wrangler.jsonc
+{ "pipelines": [{ "stream": "", "binding": "MY_STREAM" }] }
+```
+
+> Binding field is `"stream"` as of June 2026 (was `"pipeline"`, still accepted). Use the **stream ID** (`wrangler pipelines streams list`), not the pipeline ID. Redeploy after adding. Generate typed bindings with `npx wrangler types` → `Pipeline` from `cloudflare:pipelines`.
+
+## Terraform
+
+Resources: `cloudflare_pipeline_stream`, `cloudflare_pipeline_sink`, `cloudflare_pipeline`. For current attribute schemas pull `https://developers.cloudflare.com/pipelines/reference/terraform/`.
+
+```hcl
+resource "cloudflare_pipeline_stream" "my_stream" {
+ account_id = var.cloudflare_account_id
+ name = "my_stream"
+ format = { type = "json" }
+ schema = { fields = [{ name = "value", type = "json", required = true }] }
+ http = { enabled = true, authentication = false, cors = {} }
+ worker_binding = { enabled = false }
+}
+
+resource "cloudflare_pipeline_sink" "my_sink" {
+ account_id = var.cloudflare_account_id
+ name = "my_sink"
+ type = "r2_data_catalog"
+ format = { type = "parquet" }
+ schema = { fields = [] }
+ config = {
+ account_id = var.cloudflare_account_id
+ bucket = cloudflare_r2_bucket.pipeline_bucket.name
+ table_name = "my_table"
+ token = var.catalog_token
+ }
+}
+
+resource "cloudflare_pipeline" "my_pipeline" {
+ account_id = var.cloudflare_account_id
+ name = "my_pipeline"
+ sql = "INSERT INTO ${cloudflare_pipeline_sink.my_sink.name} SELECT * FROM ${cloudflare_pipeline_stream.my_stream.name}"
+}
+```
+
+## Credentials
+
+| Type | Permission |
+| ---------------------------- | ---------------------------------------------------- |
+| Catalog token (Iceberg sink) | R2 Storage Admin R&W + R2 Data Catalog R&W |
+| R2 credentials (raw sink) | Object Read & Write |
+| HTTP ingest token | Workers Pipelines Send (only if stream auth enabled) |
+
+## See Also
+
+- [api.md](api.md) — sending events, REST API, lifecycle · [gotchas.md](gotchas.md) — immutability, REST≠CLI
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/pipelines/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/pipelines/gotchas.md
new file mode 100644
index 0000000..9770c63
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/pipelines/gotchas.md
@@ -0,0 +1,58 @@
+# Pipelines Gotchas
+
+Non-obvious failure modes (not well covered by docs). For current limits and error semantics, pull `https://developers.cloudflare.com/pipelines/platform/limits/`.
+
+## Events accepted but never appear (most common)
+
+HTTP 200 / `send()` resolves, but no data in the sink. Causes:
+
+1. **Schema validation failure** — structured streams accept then **silently drop** invalid events during processing. Validate client-side (Zod) and monitor `pipelinesUserErrorsAdaptiveGroups`.
+2. **First-flush warm-up** — first data takes **3–7 minutes** (warm-up + namespace/table creation) even with `--roll-interval 10`. Poll ≥5 min in tests.
+3. **Roll interval not elapsed** — default 300s.
+4. **Silent sink failure** — deleted bucket or expired token. Check `recordsWritten > 0` but `filesWritten = 0`; inspect `failure_reason` via `GET /pipelines/{id}`.
+
+## Everything is immutable
+
+Cannot modify stream schema, pipeline SQL, or sink config — delete and recreate. Use version naming (`events_v1`) and keep SQL in version control.
+
+```bash
+curl -X DELETE "$BASE_URL/pipelines/{id}" -H "Authorization: Bearer $API_TOKEN"
+curl -X DELETE "$BASE_URL/sinks/{id}" -H "Authorization: Bearer $API_TOKEN"
+curl -X DELETE "$BASE_URL/streams/{id}" -H "Authorization: Bearer $API_TOKEN"
+```
+
+## Worker binding undefined (`env.MY_STREAM`)
+
+1. Use the **stream ID**, not pipeline ID, in `wrangler.jsonc`.
+2. Binding field is `"stream"` (June 2026); old `"pipeline"` still works.
+3. Redeploy after adding the binding.
+
+## REST API field names ≠ CLI flags
+
+`r2_data_catalog` vs `--type r2-data-catalog`, `table_name` vs `--table`, `token` vs `--catalog-token`, and `format` is required in REST but implied in CLI. See [configuration.md](configuration.md#option-c-rest-api-programmatic).
+
+## `wrangler pipelines delete` defaults to "no"
+
+Non-interactive environments answer "no" automatically — use REST `DELETE` for CI/automation.
+
+## Behavioral Notes
+
+- **`__ingest_ts` auto-added** (TIMESTAMP, day-partitioned). Don't put it in your schema.
+- **Sinks can't target existing tables** — the sink creates its own. Use PySpark to write to existing tables.
+- **JSON-only input** — no Avro/Protobuf/CSV.
+- **Naming:** streams/sinks/pipelines use underscores; buckets use hyphens.
+- **Metrics lag 5–10 min** after creation.
+- **Pipeline SQL is row-level only** — no GROUP BY/aggregation/window functions (do aggregation in [R2 SQL](../r2-sql/) at query time). CTEs and `UNNEST` are supported.
+
+## Debug Checklist
+
+- [ ] Stream exists: `wrangler pipelines streams list`
+- [ ] Pipeline `running` (not `initializing`/`failed`): `GET /pipelines/{id}`, check `failure_reason`
+- [ ] SQL matches schema; sink token valid; bucket + catalog exist
+- [ ] Worker redeployed; binding uses **stream ID** under `"stream"`
+- [ ] Waited ≥5 min (first flush)
+- [ ] Sink metrics: `filesWritten > 0`; error metrics show no drops
+
+## See Also
+
+- [configuration.md](configuration.md) · [api.md](api.md) · [patterns.md](patterns.md)
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/pipelines/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/pipelines/patterns.md
new file mode 100644
index 0000000..071232f
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/pipelines/patterns.md
@@ -0,0 +1,136 @@
+# Pipelines Patterns
+
+Code-first patterns. For observability dataset/field schemas and Logpush dataset lists, pull `https://developers.cloudflare.com/pipelines/observability/metrics/` and `https://developers.cloudflare.com/pipelines/streams/logpush/`.
+
+## Fire-and-Forget Producer
+
+```typescript
+export default {
+ async fetch(req, env, ctx) {
+ const event = {
+ event_id: crypto.randomUUID(),
+ event_type: 'page_view',
+ timestamp: new Date().toISOString()
+ };
+ ctx.waitUntil(env.MY_STREAM.send([event])); // don't block the response
+ return new Response('OK');
+ }
+};
+```
+
+## Client-Side Validation with Zod
+
+Structured streams drop invalid events silently during processing. Validate before sending for immediate feedback.
+
+```typescript
+import { z } from 'zod';
+
+const EventSchema = z.object({
+ event_id: z.string(),
+ category: z.enum(['purchase', 'view']),
+ amount: z.number().positive().optional()
+});
+
+const validated = EventSchema.parse(rawEvent); // throws synchronously
+await env.MY_STREAM.send([validated]);
+```
+
+## Scheduled Collector Worker
+
+```jsonc
+// wrangler.jsonc
+{
+ "name": "collector",
+ "pipelines": [{ "stream": "", "binding": "EVENT_STREAM" }],
+ "triggers": { "crons": ["*/5 * * * *"] }
+}
+```
+
+```typescript
+export default {
+ async scheduled(event, env, ctx) {
+ const items = await (await fetch('https://api.example.com/data')).json();
+ const events = items.map((i) => ({
+ event_id: crypto.randomUUID(),
+ timestamp: new Date().toISOString(),
+ category: i.type,
+ amount: i.value
+ }));
+ await env.EVENT_STREAM.send(events);
+ }
+};
+```
+
+## Logpush → Pipelines
+
+Pipelines is a native Logpush destination — ingest Cloudflare logs, transform with SQL, store as Iceberg/Parquet. For the current supported dataset list and field names, pull the Logpush doc above.
+
+```sql
+INSERT INTO http_logs_sink
+SELECT
+ ClientIP,
+ EdgeResponseStatus,
+ to_timestamp_micros(EdgeStartTimestamp) AS event_time,
+ upper(ClientRequestMethod) AS method,
+ sha256(ClientIP) AS hashed_ip -- redact PII at ingest
+FROM http_logs_stream
+WHERE EdgeResponseStatus >= 400;
+```
+
+Configure via Dashboard (**Logpush → Create a job → Pipelines** destination) or API.
+
+## Pipelines + Queues Fan-out
+
+```typescript
+await Promise.all([
+ env.ANALYTICS_STREAM.send([event]), // long-term storage + SQL
+ env.PROCESS_QUEUE.send(event) // immediate processing + retries
+]);
+```
+
+Use Pipelines for long-term storage + SQL; Queues for immediate processing/retries/DLQ; both for fan-out.
+
+## Observability (GraphQL Analytics)
+
+Same R2 API token works. Endpoint: `https://api.cloudflare.com/client/v4/graphql`. Datasets cover ingestion, processing (incl. `decodeErrors`), delivery, sink writes (`filesWritten`), and user/validation errors — see the metrics doc for the full dataset/field catalog.
+
+```bash
+curl -X POST "https://api.cloudflare.com/client/v4/graphql" \
+ -H "Authorization: Bearer $API_TOKEN" -H "Content-Type: application/json" \
+ -d '{"query": "query { viewer { accounts(filter: {accountTag: \"'$ACCOUNT_ID'\"}) { pipelinesIngestionAdaptiveGroups(filter: {pipelineId: \"PIPELINE-UUID-WITH-DASHES\", datetime_geq: \"2026-03-01T00:00:00Z\"}, limit: 10) { sum { ingestedRecords ingestedBytes } dimensions { datetimeHour } } } } }"}'
+```
+
+> **Sink/pipeline IDs need dashes for GraphQL** but wrangler may show them without: `b909fe6e544844abbd63f6dcbc81d602` → `b909fe6e-5448-44ab-bd63-f6dcbc81d602`. Metrics take 5–10 min to populate.
+
+### Detecting Silent Data Loss
+
+If a sink's bucket is deleted or its token expires, events are accepted but lost. Tell-tale: `recordsWritten > 0` but `filesWritten = 0`. Always verify data lands in R2 within the roll interval and R2 SQL returns expected counts.
+
+## Schema Evolution (Immutable Pipelines)
+
+Pipelines can't change. Version + dual-write:
+
+```bash
+npx wrangler pipelines streams create events_v2 --schema-file v2.json
+```
+
+```typescript
+await Promise.all([env.EVENTS_V1.send([event]), env.EVENTS_V2.send([event])]);
+// query across versions with UNION ALL in R2 SQL
+```
+
+## End-to-End: Streaming Analytics Dashboard
+
+```
+External APIs → Collector Worker (cron) → Pipeline → R2 (Iceberg) → Dashboard Worker → R2 SQL
+```
+
+1. Create bucket + enable catalog ([r2-data-catalog](../r2-data-catalog/configuration.md))
+2. Create stream + sink + pipeline (here)
+3. Collector Worker with cron + stream binding (above)
+4. Dashboard Worker querying R2 SQL ([r2-sql/patterns.md](../r2-sql/patterns.md))
+5. Enable automatic compaction
+
+## See Also
+
+- [configuration.md](configuration.md) · [api.md](api.md) · [gotchas.md](gotchas.md) · [r2-sql](../r2-sql/)
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/pulumi/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/pulumi/README.md
new file mode 100644
index 0000000..963f44e
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/pulumi/README.md
@@ -0,0 +1,113 @@
+# Cloudflare Pulumi Provider
+
+Expert guidance for Cloudflare Pulumi Provider (@pulumi/cloudflare).
+
+## Overview
+
+Programmatic management of Cloudflare resources: Workers, Pages, D1, KV, R2, DNS, Queues, etc.
+
+**Packages:**
+
+- TypeScript/JS: `@pulumi/cloudflare`
+- Python: `pulumi-cloudflare`
+- Go: `github.com/pulumi/pulumi-cloudflare/sdk/v6/go/cloudflare`
+- .NET: `Pulumi.Cloudflare`
+
+**Version:** v6.x
+
+## Core Principles
+
+1. Use API tokens (not legacy API keys)
+2. Store accountId in stack config
+3. Match binding names across code/config
+4. Use `module: true` for ES modules
+5. Set `compatibilityDate` to lock behavior
+
+## Authentication
+
+```typescript
+import * as cloudflare from '@pulumi/cloudflare';
+
+// API Token (recommended): CLOUDFLARE_API_TOKEN env
+const provider = new cloudflare.Provider('cf', { apiToken: process.env.CLOUDFLARE_API_TOKEN });
+
+// API Key (legacy): CLOUDFLARE_API_KEY + CLOUDFLARE_EMAIL env
+const provider = new cloudflare.Provider('cf', {
+ apiKey: process.env.CLOUDFLARE_API_KEY,
+ email: process.env.CLOUDFLARE_EMAIL
+});
+
+// API User Service Key: CLOUDFLARE_API_USER_SERVICE_KEY env
+const provider = new cloudflare.Provider('cf', {
+ apiUserServiceKey: process.env.CLOUDFLARE_API_USER_SERVICE_KEY
+});
+```
+
+## Setup
+
+**Pulumi.yaml:**
+
+```yaml
+name: my-cloudflare-app
+runtime: nodejs
+config:
+ cloudflare:apiToken:
+ value: ${CLOUDFLARE_API_TOKEN}
+```
+
+**Pulumi..yaml:**
+
+```yaml
+config:
+ cloudflare:accountId: 'abc123...'
+```
+
+**index.ts:**
+
+```typescript
+import * as pulumi from '@pulumi/pulumi';
+import * as cloudflare from '@pulumi/cloudflare';
+const accountId = new pulumi.Config('cloudflare').require('accountId');
+```
+
+## Common Resource Types
+
+- `Provider` - Provider config
+- `WorkerScript` - Worker
+- `WorkersKvNamespace` - KV
+- `R2Bucket` - R2
+- `D1Database` - D1
+- `Queue` - Queue
+- `PagesProject` - Pages
+- `DnsRecord` - DNS
+- `WorkerRoute` - Worker route
+- `WorkersDomain` - Custom domain
+
+## Key Properties
+
+- `accountId` - Required for most resources
+- `zoneId` - Required for DNS/domain
+- `name`/`title` - Resource identifier
+- `*Bindings` - Connect resources to Workers
+
+## Reading Order
+
+| Order | File | What | When to Read |
+| ----- | -------------------------------------- | ----------------------------------------------------- | ------------------------------------- |
+| 1 | [configuration.md](./configuration.md) | Resource config for Workers/KV/D1/R2/Queues/Pages | First time setup, resource reference |
+| 2 | [patterns.md](./patterns.md) | Architecture patterns, multi-env, component resources | Building complex apps, best practices |
+| 3 | [api.md](./api.md) | Outputs, dependencies, imports, dynamic providers | Advanced features, integrations |
+| 4 | [gotchas.md](./gotchas.md) | Common errors, troubleshooting, limits | Debugging, deployment issues |
+
+## In This Reference
+
+- [configuration.md](./configuration.md) - Provider config, stack setup, Workers/bindings
+- [api.md](./api.md) - Resource types, Workers script, KV/D1/R2/queues/Pages
+- [patterns.md](./patterns.md) - Multi-env, secrets, CI/CD, stack management
+- [gotchas.md](./gotchas.md) - State issues, deployment failures, limits
+
+## See Also
+
+- [terraform](../terraform/) - Alternative IaC for Cloudflare
+- [wrangler](https://developers.cloudflare.com/workers/wrangler/) - CLI deployment alternative
+- [workers](https://developers.cloudflare.com/workers/) - Worker runtime documentation
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/pulumi/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/pulumi/api.md
new file mode 100644
index 0000000..f346acd
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/pulumi/api.md
@@ -0,0 +1,230 @@
+# API & Data Sources
+
+## Outputs and Exports
+
+Export resource identifiers:
+
+```typescript
+export const kvId = kv.id;
+export const bucketName = bucket.name;
+export const workerUrl = worker.subdomain;
+export const dbId = db.id;
+```
+
+## Resource Dependencies
+
+Implicit dependencies via outputs:
+
+```typescript
+const kv = new cloudflare.WorkersKvNamespace('kv', {
+ accountId: accountId,
+ title: 'my-kv'
+});
+
+// Worker depends on KV (implicit via kv.id)
+const worker = new cloudflare.WorkerScript('worker', {
+ accountId: accountId,
+ name: 'my-worker',
+ content: code,
+ kvNamespaceBindings: [{ name: 'MY_KV', namespaceId: kv.id }] // Creates dependency
+});
+```
+
+Explicit dependencies:
+
+```typescript
+const migration = new command.local.Command(
+ 'migration',
+ {
+ create: pulumi.interpolate`wrangler d1 execute ${db.name} --file ./schema.sql`
+ },
+ { dependsOn: [db] }
+);
+
+const worker = new cloudflare.WorkerScript(
+ 'worker',
+ {
+ accountId: accountId,
+ name: 'worker',
+ content: code,
+ d1DatabaseBindings: [{ name: 'DB', databaseId: db.id }]
+ },
+ { dependsOn: [migration] }
+); // Ensure migrations run first
+```
+
+## Using Outputs with API Calls
+
+```typescript
+const db = new cloudflare.D1Database('db', { accountId, name: 'my-db' });
+
+db.id.apply(async (dbId) => {
+ const response = await fetch(
+ `https://api.cloudflare.com/client/v4/accounts/${accountId}/d1/database/${dbId}/query`,
+ {
+ method: 'POST',
+ headers: { Authorization: `Bearer ${apiToken}`, 'Content-Type': 'application/json' },
+ body: JSON.stringify({ sql: 'CREATE TABLE users (id INT)' })
+ }
+ );
+ return response.json();
+});
+```
+
+## Custom Dynamic Providers
+
+For resources not in provider:
+
+```typescript
+import * as pulumi from '@pulumi/pulumi';
+
+class D1MigrationProvider implements pulumi.dynamic.ResourceProvider {
+ async create(inputs: any): Promise {
+ const response = await fetch(
+ `https://api.cloudflare.com/client/v4/accounts/${inputs.accountId}/d1/database/${inputs.databaseId}/query`,
+ {
+ method: 'POST',
+ headers: { Authorization: `Bearer ${inputs.apiToken}`, 'Content-Type': 'application/json' },
+ body: JSON.stringify({ sql: inputs.sql })
+ }
+ );
+ return { id: `${inputs.databaseId}-${Date.now()}`, outs: await response.json() };
+ }
+ async update(id: string, olds: any, news: any): Promise {
+ if (olds.sql !== news.sql) await this.create(news);
+ return {};
+ }
+ async delete(id: string, props: any): Promise {}
+}
+
+class D1Migration extends pulumi.dynamic.Resource {
+ constructor(name: string, args: any, opts?: pulumi.CustomResourceOptions) {
+ super(new D1MigrationProvider(), name, args, opts);
+ }
+}
+
+const migration = new D1Migration(
+ 'migration',
+ {
+ accountId,
+ databaseId: db.id,
+ apiToken,
+ sql: 'CREATE TABLE users (id INT)'
+ },
+ { dependsOn: [db] }
+);
+```
+
+## Data Sources
+
+**Get Zone:**
+
+```typescript
+const zone = cloudflare.getZone({ name: 'example.com' });
+const zoneId = zone.then((z) => z.id);
+```
+
+**Get Accounts (via API):**
+Use Cloudflare API directly or custom dynamic resources.
+
+## Import Existing Resources
+
+```bash
+# Import worker
+pulumi import cloudflare:index/workerScript:WorkerScript my-worker /
+
+# Import KV namespace
+pulumi import cloudflare:index/workersKvNamespace:WorkersKvNamespace my-kv
+
+# Import R2 bucket
+pulumi import cloudflare:index/r2Bucket:R2Bucket my-bucket /
+
+# Import D1 database
+pulumi import cloudflare:index/d1Database:D1Database my-db /
+
+# Import DNS record
+pulumi import cloudflare:index/dnsRecord:DnsRecord my-record /
+```
+
+## Secrets Management
+
+```typescript
+import * as pulumi from '@pulumi/pulumi';
+
+const config = new pulumi.Config();
+const apiKey = config.requireSecret('apiKey'); // Encrypted in state
+
+const worker = new cloudflare.WorkerScript('worker', {
+ accountId: accountId,
+ name: 'my-worker',
+ content: code,
+ secretTextBindings: [{ name: 'API_KEY', text: apiKey }]
+});
+```
+
+Store secrets:
+
+```bash
+pulumi config set --secret apiKey "secret-value"
+```
+
+## Transform Pattern
+
+Modify resource args before creation:
+
+```typescript
+import { Transform } from '@pulumi/pulumi';
+
+interface BucketArgs {
+ accountId: pulumi.Input;
+ transform?: { bucket?: Transform };
+}
+
+function createBucket(name: string, args: BucketArgs) {
+ const bucketArgs: cloudflare.R2BucketArgs = {
+ accountId: args.accountId,
+ name: name,
+ location: 'auto'
+ };
+ const finalArgs = args.transform?.bucket?.(bucketArgs) ?? bucketArgs;
+ return new cloudflare.R2Bucket(name, finalArgs);
+}
+```
+
+## v6.x Worker Versioning Resources
+
+**Worker** - Container for versions:
+
+```typescript
+const worker = new cloudflare.Worker('api', { accountId, name: 'api-worker' });
+export const workerId = worker.id;
+```
+
+**WorkerVersion** - Immutable code + config:
+
+```typescript
+const version = new cloudflare.WorkerVersion('v1', {
+ accountId,
+ workerId: worker.id,
+ content: fs.readFileSync('./dist/worker.js', 'utf8'),
+ compatibilityDate: '2025-01-01'
+});
+export const versionId = version.id;
+```
+
+**WorkersDeployment** - Active deployment with bindings:
+
+```typescript
+const deployment = new cloudflare.WorkersDeployment('prod', {
+ accountId,
+ workerId: worker.id,
+ versionId: version.id,
+ kvNamespaceBindings: [{ name: 'MY_KV', namespaceId: kv.id }]
+});
+```
+
+**Use:** Advanced deployments (canary, blue-green). Most apps should use `WorkerScript` (auto-versioning).
+
+---
+
+See: [README.md](./README.md), [configuration.md](./configuration.md), [patterns.md](./patterns.md), [gotchas.md](./gotchas.md)
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/pulumi/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/pulumi/configuration.md
new file mode 100644
index 0000000..822c819
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/pulumi/configuration.md
@@ -0,0 +1,213 @@
+# Resource Configuration
+
+## Workers (cloudflare.WorkerScript)
+
+```typescript
+import * as cloudflare from '@pulumi/cloudflare';
+import * as fs from 'fs';
+
+const worker = new cloudflare.WorkerScript('my-worker', {
+ accountId: accountId,
+ name: 'my-worker',
+ content: fs.readFileSync('./dist/worker.js', 'utf8'),
+ module: true, // ES modules
+ compatibilityDate: '2025-01-01',
+ compatibilityFlags: ['nodejs_compat'],
+
+ // v6.x: Observability
+ logpush: true, // Enable Workers Logpush
+ tailConsumers: [{ service: 'log-consumer' }], // Stream logs to Worker
+
+ // v6.x: Placement
+ placement: { mode: 'smart' }, // Smart placement for latency optimization
+
+ // Bindings
+ kvNamespaceBindings: [{ name: 'MY_KV', namespaceId: kv.id }],
+ r2BucketBindings: [{ name: 'MY_BUCKET', bucketName: bucket.name }],
+ d1DatabaseBindings: [{ name: 'DB', databaseId: db.id }],
+ queueBindings: [{ name: 'MY_QUEUE', queue: queue.id }],
+ serviceBindings: [{ name: 'OTHER_SERVICE', service: other.name }],
+ plainTextBindings: [{ name: 'ENV_VAR', text: 'value' }],
+ secretTextBindings: [{ name: 'API_KEY', text: secret }],
+
+ // v6.x: Advanced bindings
+ analyticsEngineBindings: [{ name: 'ANALYTICS', dataset: 'my-dataset' }],
+ browserBinding: { name: 'BROWSER' }, // Browser Rendering
+ aiBinding: { name: 'AI' }, // Workers AI
+ hyperdriveBindings: [{ name: 'HYPERDRIVE', id: hyperdriveConfig.id }]
+});
+```
+
+## Workers KV (cloudflare.WorkersKvNamespace)
+
+```typescript
+const kv = new cloudflare.WorkersKvNamespace('my-kv', {
+ accountId: accountId,
+ title: 'my-kv-namespace'
+});
+
+// Write values
+const kvValue = new cloudflare.WorkersKvValue('config', {
+ accountId: accountId,
+ namespaceId: kv.id,
+ key: 'config',
+ value: JSON.stringify({ foo: 'bar' })
+});
+```
+
+## R2 Buckets (cloudflare.R2Bucket)
+
+```typescript
+const bucket = new cloudflare.R2Bucket('my-bucket', {
+ accountId: accountId,
+ name: 'my-bucket',
+ location: 'auto' // or "wnam", etc.
+});
+```
+
+## D1 Databases (cloudflare.D1Database)
+
+```typescript
+const db = new cloudflare.D1Database('my-db', { accountId, name: 'my-database' });
+
+// Migrations via wrangler
+import * as command from '@pulumi/command';
+const migration = new command.local.Command(
+ 'd1-migration',
+ {
+ create: pulumi.interpolate`wrangler d1 execute ${db.name} --file ./schema.sql`
+ },
+ { dependsOn: [db] }
+);
+```
+
+## Queues (cloudflare.Queue)
+
+```typescript
+const queue = new cloudflare.Queue('my-queue', { accountId, name: 'my-queue' });
+
+// Producer
+const producer = new cloudflare.WorkerScript('producer', {
+ accountId,
+ name: 'producer',
+ content: code,
+ queueBindings: [{ name: 'MY_QUEUE', queue: queue.id }]
+});
+
+// Consumer
+const consumer = new cloudflare.WorkerScript('consumer', {
+ accountId,
+ name: 'consumer',
+ content: code,
+ queueConsumers: [{ queue: queue.name, maxBatchSize: 10, maxRetries: 3 }]
+});
+```
+
+## Pages Projects (cloudflare.PagesProject)
+
+```typescript
+const pages = new cloudflare.PagesProject('my-site', {
+ accountId,
+ name: 'my-site',
+ productionBranch: 'main',
+ buildConfig: { buildCommand: 'npm run build', destinationDir: 'dist' },
+ source: {
+ type: 'github',
+ config: { owner: 'my-org', repoName: 'my-repo', productionBranch: 'main' }
+ },
+ deploymentConfigs: {
+ production: {
+ environmentVariables: { NODE_VERSION: '18' },
+ kvNamespaces: { MY_KV: kv.id },
+ d1Databases: { DB: db.id }
+ }
+ }
+});
+```
+
+## DNS Records (cloudflare.DnsRecord)
+
+```typescript
+const zone = cloudflare.getZone({ name: 'example.com' });
+const record = new cloudflare.DnsRecord('www', {
+ zoneId: zone.then((z) => z.id),
+ name: 'www',
+ type: 'A',
+ content: '192.0.2.1',
+ ttl: 3600,
+ proxied: true
+});
+```
+
+## Workers Domains/Routes
+
+```typescript
+// Route (pattern-based)
+const route = new cloudflare.WorkerRoute('my-route', {
+ zoneId: zoneId,
+ pattern: 'example.com/api/*',
+ scriptName: worker.name
+});
+
+// Domain (dedicated subdomain)
+const domain = new cloudflare.WorkersDomain('my-domain', {
+ accountId: accountId,
+ hostname: 'api.example.com',
+ service: worker.name,
+ zoneId: zoneId
+});
+```
+
+## Assets Configuration (v6.x)
+
+Serve static assets from Workers:
+
+```typescript
+const worker = new cloudflare.WorkerScript('app', {
+ accountId: accountId,
+ name: 'my-app',
+ content: code,
+ assets: {
+ path: './public' // Local directory
+ // Assets uploaded and served from Workers
+ }
+});
+```
+
+## v6.x Versioned Deployments (Advanced)
+
+For gradual rollouts, use 3-resource pattern:
+
+```typescript
+// 1. Worker (container for versions)
+const worker = new cloudflare.Worker('api', {
+ accountId: accountId,
+ name: 'api-worker'
+});
+
+// 2. Version (immutable code + config)
+const version = new cloudflare.WorkerVersion('v1', {
+ accountId: accountId,
+ workerId: worker.id,
+ content: fs.readFileSync('./dist/worker.js', 'utf8'),
+ compatibilityDate: '2025-01-01',
+ compatibilityFlags: ['nodejs_compat']
+ // Note: Bindings configured at deployment level
+});
+
+// 3. Deployment (version + bindings + traffic split)
+const deployment = new cloudflare.WorkersDeployment('prod', {
+ accountId: accountId,
+ workerId: worker.id,
+ versionId: version.id,
+ // Bindings applied to deployment
+ kvNamespaceBindings: [{ name: 'MY_KV', namespaceId: kv.id }]
+});
+```
+
+**When to use:** Blue-green deployments, canary releases, gradual rollouts
+**When NOT to use:** Simple single-version deployments (use WorkerScript)
+
+---
+
+See: [README.md](./README.md), [api.md](./api.md), [patterns.md](./patterns.md), [gotchas.md](./gotchas.md)
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/pulumi/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/pulumi/gotchas.md
new file mode 100644
index 0000000..35bfc7a
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/pulumi/gotchas.md
@@ -0,0 +1,205 @@
+# Troubleshooting & Best Practices
+
+## Common Errors
+
+### "No bundler/build step" - Pulumi uploads raw code
+
+**Problem:** Worker fails with "Cannot use import statement outside a module"
+**Cause:** Pulumi doesn't bundle Worker code - uploads exactly what you provide
+**Solution:** Build Worker BEFORE Pulumi deploy
+
+```typescript
+// WRONG: Pulumi won't bundle this
+const worker = new cloudflare.WorkerScript('worker', {
+ content: fs.readFileSync('./src/index.ts', 'utf8') // Raw TS file
+});
+
+// RIGHT: Build first, then deploy
+import * as command from '@pulumi/command';
+const build = new command.local.Command('build', {
+ create: 'npm run build',
+ dir: './worker'
+});
+const worker = new cloudflare.WorkerScript(
+ 'worker',
+ {
+ content: build.stdout.apply(() => fs.readFileSync('./worker/dist/index.js', 'utf8'))
+ },
+ { dependsOn: [build] }
+);
+```
+
+### "wrangler.toml not consumed" - Config drift
+
+**Problem:** Local wrangler dev works, Pulumi deploy fails
+**Cause:** Pulumi ignores wrangler.toml - must duplicate config
+**Solution:** Generate wrangler.toml from Pulumi or keep synced manually
+
+```typescript
+// Pattern: Export Pulumi config to wrangler.toml
+const workerConfig = {
+ name: 'my-worker',
+ compatibilityDate: '2025-01-01',
+ compatibilityFlags: ['nodejs_compat']
+};
+
+new command.local.Command('generate-wrangler', {
+ create: pulumi.interpolate`cat > wrangler.toml <.yaml
+config:
+ cloudflare:accountId: 'abc123...'
+```
+
+### "Binding name mismatch"
+
+**Problem:** Worker fails with "env.MY_KV is undefined"
+**Cause:** Binding name in Pulumi != name in Worker code
+**Solution:** Match exactly (case-sensitive)
+
+```typescript
+// Pulumi
+kvNamespaceBindings: [{ name: 'MY_KV', namespaceId: kv.id }];
+
+// Worker code
+export default {
+ async fetch(request, env) {
+ await env.MY_KV.get('key');
+ }
+};
+```
+
+### "API token permissions insufficient"
+
+**Problem:** `Error: authentication error (10000)`
+**Cause:** Token lacks required permissions
+**Solution:** Grant token permissions: Account.Workers Scripts:Edit, Account.Account Settings:Read
+
+### "Resource not found after import"
+
+**Problem:** Imported resource shows as changed on next `pulumi up`
+**Cause:** State mismatch between actual resource and Pulumi config
+**Solution:** Check property names/types match exactly
+
+```bash
+pulumi import cloudflare:index/workerScript:WorkerScript my-worker /
+pulumi preview # If shows changes, adjust Pulumi code to match actual resource
+```
+
+### "v6.x Worker versioning confusion"
+
+**Problem:** Worker deployed but not receiving traffic
+**Cause:** v6.x requires Worker + WorkerVersion + WorkersDeployment (3 resources)
+**Solution:** Use WorkerScript (auto-versioning) OR full versioning pattern
+
+```typescript
+// SIMPLE: WorkerScript auto-versions (default behavior)
+const worker = new cloudflare.WorkerScript('worker', {
+ accountId,
+ name: 'my-worker',
+ content: code
+});
+
+// ADVANCED: Manual versioning for gradual rollouts (v6.x)
+const worker = new cloudflare.Worker('worker', { accountId, name: 'my-worker' });
+const version = new cloudflare.WorkerVersion('v1', {
+ accountId,
+ workerId: worker.id,
+ content: code,
+ compatibilityDate: '2025-01-01'
+});
+const deployment = new cloudflare.WorkersDeployment('prod', {
+ accountId,
+ workerId: worker.id,
+ versionId: version.id
+});
+```
+
+## Best Practices
+
+1. **Always set compatibilityDate** - Locks Worker behavior, prevents breaking changes
+2. **Build before deploy** - Pulumi doesn't bundle; use Command resource or CI build step
+3. **Match binding names** - Case-sensitive, must match between Pulumi and Worker code
+4. **Use dependsOn for migrations** - Ensure D1 migrations run before Worker deploys
+5. **Version Worker content** - Add VERSION binding to force redeployment on content changes
+6. **Store secrets in stack config** - Use `pulumi config set --secret` for API keys
+
+## Limits
+
+| Resource | Limit | Notes |
+| --------------------- | ------------------------------------------ | --------------------------------------------- |
+| Worker script size | 10 MB | Includes all dependencies, after compression |
+| Worker CPU time | 10ms (free), 30s default / 5min max (paid) | Per request |
+| KV keys per namespace | Unlimited | 1000 ops/sec write, 100k ops/sec read |
+| R2 storage | Unlimited | Class A ops: 1M/mo free, Class B: 10M/mo free |
+| D1 databases | 50,000 per account | Free: 10 per account, 5 GB each |
+| Queues | 10,000 per account | Free: 1M ops/day |
+| Pages projects | 500 per account | Free: 100 projects |
+| API requests | Varies by plan | ~1200 req/5min on free |
+
+## Resources
+
+- **Pulumi Registry:** https://www.pulumi.com/registry/packages/cloudflare/
+- **API Docs:** https://www.pulumi.com/registry/packages/cloudflare/api-docs/
+- **GitHub:** https://github.com/pulumi/pulumi-cloudflare
+- **Cloudflare Docs:** https://developers.cloudflare.com/
+- **Workers Docs:** https://developers.cloudflare.com/workers/
+
+---
+
+See: [README.md](./README.md), [configuration.md](./configuration.md), [api.md](./api.md), [patterns.md](./patterns.md)
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/pulumi/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/pulumi/patterns.md
new file mode 100644
index 0000000..1944366
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/pulumi/patterns.md
@@ -0,0 +1,260 @@
+# Architecture Patterns
+
+## Component Resources
+
+```typescript
+class WorkerApp extends pulumi.ComponentResource {
+ constructor(name: string, args: WorkerAppArgs, opts?) {
+ super('custom:cloudflare:WorkerApp', name, {}, opts);
+ const defaultOpts = { parent: this };
+
+ this.kv = new cloudflare.WorkersKvNamespace(
+ `${name}-kv`,
+ { accountId: args.accountId, title: `${name}-kv` },
+ defaultOpts
+ );
+ this.worker = new cloudflare.WorkerScript(
+ `${name}-worker`,
+ {
+ accountId: args.accountId,
+ name: `${name}-worker`,
+ content: args.workerCode,
+ module: true,
+ kvNamespaceBindings: [{ name: 'KV', namespaceId: this.kv.id }]
+ },
+ defaultOpts
+ );
+ this.domain = new cloudflare.WorkersDomain(
+ `${name}-domain`,
+ {
+ accountId: args.accountId,
+ hostname: args.domain,
+ service: this.worker.name
+ },
+ defaultOpts
+ );
+ }
+}
+```
+
+## Full-Stack Worker App
+
+```typescript
+const kv = new cloudflare.WorkersKvNamespace('cache', { accountId, title: 'api-cache' });
+const db = new cloudflare.D1Database('db', { accountId, name: 'app-database' });
+const bucket = new cloudflare.R2Bucket('assets', { accountId, name: 'app-assets' });
+
+const apiWorker = new cloudflare.WorkerScript('api', {
+ accountId,
+ name: 'api-worker',
+ content: fs.readFileSync('./dist/api.js', 'utf8'),
+ module: true,
+ kvNamespaceBindings: [{ name: 'CACHE', namespaceId: kv.id }],
+ d1DatabaseBindings: [{ name: 'DB', databaseId: db.id }],
+ r2BucketBindings: [{ name: 'ASSETS', bucketName: bucket.name }]
+});
+```
+
+## Multi-Environment Setup
+
+```typescript
+const stack = pulumi.getStack();
+const worker = new cloudflare.WorkerScript(`worker-${stack}`, {
+ accountId,
+ name: `my-worker-${stack}`,
+ content: code,
+ plainTextBindings: [{ name: 'ENVIRONMENT', text: stack }]
+});
+```
+
+## Queue-Based Processing
+
+```typescript
+const queue = new cloudflare.Queue('processing-queue', { accountId, name: 'image-processing' });
+
+// Producer: API receives requests
+const apiWorker = new cloudflare.WorkerScript('api', {
+ accountId,
+ name: 'api-worker',
+ content: apiCode,
+ queueBindings: [{ name: 'PROCESSING_QUEUE', queue: queue.id }]
+});
+
+// Consumer: Process async
+const processorWorker = new cloudflare.WorkerScript('processor', {
+ accountId,
+ name: 'processor-worker',
+ content: processorCode,
+ queueConsumers: [{ queue: queue.name, maxBatchSize: 10, maxRetries: 3, maxWaitTimeMs: 5000 }],
+ r2BucketBindings: [{ name: 'OUTPUT_BUCKET', bucketName: outputBucket.name }]
+});
+```
+
+## Microservices with Service Bindings
+
+```typescript
+const authWorker = new cloudflare.WorkerScript('auth', {
+ accountId,
+ name: 'auth-service',
+ content: authCode
+});
+const apiWorker = new cloudflare.WorkerScript('api', {
+ accountId,
+ name: 'api-service',
+ content: apiCode,
+ serviceBindings: [{ name: 'AUTH', service: authWorker.name }]
+});
+```
+
+## Event-Driven Architecture
+
+```typescript
+const eventQueue = new cloudflare.Queue('events', { accountId, name: 'event-bus' });
+const producer = new cloudflare.WorkerScript('producer', {
+ accountId,
+ name: 'api-producer',
+ content: producerCode,
+ queueBindings: [{ name: 'EVENTS', queue: eventQueue.id }]
+});
+const consumer = new cloudflare.WorkerScript('consumer', {
+ accountId,
+ name: 'email-consumer',
+ content: consumerCode,
+ queueConsumers: [{ queue: eventQueue.name, maxBatchSize: 10 }]
+});
+```
+
+## v6.x Versioned Deployments (Blue-Green/Canary)
+
+```typescript
+const worker = new cloudflare.Worker('api', { accountId, name: 'api-worker' });
+const v1 = new cloudflare.WorkerVersion('v1', {
+ accountId,
+ workerId: worker.id,
+ content: fs.readFileSync('./dist/v1.js', 'utf8'),
+ compatibilityDate: '2025-01-01'
+});
+const v2 = new cloudflare.WorkerVersion('v2', {
+ accountId,
+ workerId: worker.id,
+ content: fs.readFileSync('./dist/v2.js', 'utf8'),
+ compatibilityDate: '2025-01-01'
+});
+
+// Gradual rollout: 10% v2, 90% v1
+const deployment = new cloudflare.WorkersDeployment('canary', {
+ accountId,
+ workerId: worker.id,
+ versions: [
+ { versionId: v2.id, percentage: 10 },
+ { versionId: v1.id, percentage: 90 }
+ ],
+ kvNamespaceBindings: [{ name: 'MY_KV', namespaceId: kv.id }]
+});
+```
+
+**Use:** Canary releases, A/B testing, blue-green. Most apps use `WorkerScript` (auto-versioning).
+
+## Wrangler.toml Generation (Bridge IaC with Local Dev)
+
+Generate wrangler.toml from Pulumi config to keep local dev in sync:
+
+```typescript
+import * as command from '@pulumi/command';
+
+const workerConfig = {
+ name: 'my-worker',
+ compatibilityDate: '2025-01-01',
+ compatibilityFlags: ['nodejs_compat']
+};
+
+// Create resources
+const kv = new cloudflare.WorkersKvNamespace('kv', { accountId, title: 'my-kv' });
+const db = new cloudflare.D1Database('db', { accountId, name: 'my-db' });
+const bucket = new cloudflare.R2Bucket('bucket', { accountId, name: 'my-bucket' });
+
+// Generate wrangler.toml after resources created
+const wranglerGen = new command.local.Command(
+ 'gen-wrangler',
+ {
+ create: pulumi.interpolate`cat > wrangler.toml < fs.readFileSync('./worker/dist/index.js', 'utf8'))
+ },
+ { dependsOn: [build] }
+);
+```
+
+## Content SHA Pattern (Force Updates)
+
+Prevent false "no changes" detections:
+
+```typescript
+const version = Date.now().toString();
+const worker = new cloudflare.WorkerScript('worker', {
+ accountId,
+ name: 'my-worker',
+ content: code,
+ plainTextBindings: [{ name: 'VERSION', text: version }] // Forces deployment
+});
+```
+
+---
+
+See: [README.md](./README.md), [configuration.md](./configuration.md), [api.md](./api.md), [gotchas.md](./gotchas.md)
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/queues/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/queues/README.md
new file mode 100644
index 0000000..7ac07d0
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/queues/README.md
@@ -0,0 +1,24 @@
+# Cloudflare Queues
+
+Use Queues to decouple producers from asynchronous consumers and buffer bursts of work. Design consumers for duplicate delivery; use Workflows when the task needs durable multi-step orchestration.
+
+Fetch the relevant documentation below before implementing. Treat current Cloudflare docs as the source of truth for API signatures, acknowledgement semantics, configuration, limits, and pricing.
+
+## Choose a consumer
+
+- Use a Worker push consumer when processing runs on Workers.
+- Use an HTTP pull consumer when processing runs in another environment; plan for polling, visibility timeouts, and acknowledgement leases.
+- Choose a message encoding the consumer can decode. Check serialization and compatibility-date behavior before sending existing application objects.
+
+See [How Queues works](https://developers.cloudflare.com/queues/reference/how-queues-works/) and [delivery guarantees](https://developers.cloudflare.com/queues/reference/delivery-guarantees/) before choosing ordering or deduplication strategies.
+
+## Read by task
+
+| Task | Reference |
+| -------------------------------------------------------------------- | -------------------------------------- |
+| Create queues, bind producers, and configure consumers | [configuration.md](./configuration.md) |
+| Send messages and implement acknowledgement or retries | [api.md](./api.md) |
+| Buffer APIs, defer jobs, or integrate with storage and orchestration | [patterns.md](./patterns.md) |
+| Diagnose delivery failures, duplicates, or capacity issues | [gotchas.md](./gotchas.md) |
+
+For a first application, fetch [Getting started](https://developers.cloudflare.com/queues/get-started/). Retrieve [limits](https://developers.cloudflare.com/queues/platform/limits/) and [pricing](https://developers.cloudflare.com/queues/platform/pricing/) before sizing throughput, retention, or cost; plan-specific values are not maintained here.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/queues/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/queues/api.md
new file mode 100644
index 0000000..2bc49d5
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/queues/api.md
@@ -0,0 +1,16 @@
+# Queues API Reference
+
+Fetch the current API documentation for the operation being implemented; do not infer signatures, payloads, or acknowledgement rules from old examples.
+
+| Task | Documentation |
+| -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
+| Send individual messages or batches; choose encoding; implement a typed Worker queue handler; dispatch by queue name | [JavaScript APIs](https://developers.cloudflare.com/queues/configuration/javascript-apis/) |
+| Understand automatic acknowledgement, explicit per-message and batch actions, precedence, delivery failures, delays, and backoff | [Batching, retries, and delays](https://developers.cloudflare.com/queues/configuration/batching-retries/) |
+| Pull over HTTP and acknowledge or retry using leases | [Pull consumers](https://developers.cloudflare.com/queues/configuration/pull-consumers/) |
+| Publish from outside Workers | [Publish to a Queue via HTTP](https://developers.cloudflare.com/queues/examples/publish-to-a-queue-via-http/) |
+
+Acknowledge only after the intended work succeeds. For independently processed messages, use per-message outcomes to avoid replaying successful work when another message fails. If catching an error and continuing, explicitly request a retry for work that still needs processing; a successful handler return can acknowledge messages automatically. Fetch the linked acknowledgement rules before mixing message-level and batch-level actions.
+
+Await required work, including downstream writes or sends, before acknowledging it. Check the JavaScript API's handler lifecycle rules before using `waitUntil()`; background work is not independent of delivery success.
+
+See [configuration.md](./configuration.md) for bindings and consumer setup, and [gotchas.md](./gotchas.md) for delivery diagnostics.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/queues/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/queues/configuration.md
new file mode 100644
index 0000000..e892491
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/queues/configuration.md
@@ -0,0 +1,20 @@
+# Queues Configuration
+
+Fetch the relevant guide before writing configuration or running CLI commands. Check the project's Wrangler version and compatibility date when adapting examples.
+
+| Task | Documentation |
+| ---------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
+| Create a queue and connect producer and consumer Workers | [Getting started](https://developers.cloudflare.com/queues/get-started/) |
+| Configure producer bindings, Worker consumers, retention, and concurrency settings | [Configure Queues](https://developers.cloudflare.com/queues/configuration/configure-queues/) |
+| Configure an external HTTP consumer and its visibility timeout | [Pull consumers](https://developers.cloudflare.com/queues/configuration/pull-consumers/) |
+| Choose batching, retry policy, or delivery delays | [Batching, retries, and delays](https://developers.cloudflare.com/queues/configuration/batching-retries/) |
+| Preserve messages that exhaust retries | [Dead Letter Queues](https://developers.cloudflare.com/queues/configuration/dead-letter-queues/) |
+| Set consumer scaling for downstream capacity | [Consumer concurrency](https://developers.cloudflare.com/queues/configuration/consumer-concurrency/) |
+| Choose content types and type Worker messages | [JavaScript APIs](https://developers.cloudflare.com/queues/configuration/javascript-apis/) |
+| Create, update, attach, remove, or delete queues and consumers | [Wrangler commands](https://developers.cloudflare.com/queues/reference/wrangler-commands/) |
+| Pause delivery, resume it, or purge messages | [Pause and purge](https://developers.cloudflare.com/queues/configuration/pause-purge/) |
+| Develop and test producers and consumers locally | [Local development](https://developers.cloudflare.com/queues/configuration/local-development/) |
+
+Choose push or pull based on where processing runs, then select an encoding supported by that consumer. Tune batching for acceptable latency and downstream write capacity. Decide how failed messages will be inspected and replayed before configuring a dead-letter queue.
+
+Fetch [limits](https://developers.cloudflare.com/queues/platform/limits/) and [pricing](https://developers.cloudflare.com/queues/platform/pricing/) for the account's plan before selecting retention, delays, or capacity. Do not reuse numeric settings from unrelated examples.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/queues/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/queues/gotchas.md
new file mode 100644
index 0000000..4786a04
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/queues/gotchas.md
@@ -0,0 +1,18 @@
+# Queues Gotchas & Troubleshooting
+
+Fetch the linked documentation before changing retry policy or interpreting delivery behavior.
+
+| Symptom or question | Documentation and decision |
+| ---------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Successful work repeats after another message fails | Read [acknowledgement and retry rules](https://developers.cloudflare.com/queues/configuration/batching-retries/); use per-message outcomes for independent work. |
+| A caught failure disappears instead of retrying | Read [handler lifecycle and APIs](https://developers.cloudflare.com/queues/configuration/javascript-apis/); returning successfully can acknowledge messages. Explicitly retry failed work when continuing. |
+| Duplicate processing | Read [delivery guarantees](https://developers.cloudflare.com/queues/reference/delivery-guarantees/); enforce idempotency at the side-effect destination. |
+| Pull consumers cannot decode payloads | Check [pull consumer encoding](https://developers.cloudflare.com/queues/configuration/pull-consumers/) and [content types](https://developers.cloudflare.com/queues/configuration/javascript-apis/) against the producer. |
+| Messages stop arriving or backlog grows | Check [consumer configuration](https://developers.cloudflare.com/queues/configuration/configure-queues/), [pause state](https://developers.cloudflare.com/queues/configuration/pause-purge/), and [queue metrics](https://developers.cloudflare.com/queues/observability/metrics/). |
+| Dead-letter volume rises or messages disappear after retries | Read [Dead Letter Queues](https://developers.cloudflare.com/queues/configuration/dead-letter-queues/); inspect failures and plan recovery before increasing retries. |
+| API errors, resource exhaustion, or CPU failures | Read [error codes](https://developers.cloudflare.com/queues/reference/error-codes/), [limits](https://developers.cloudflare.com/queues/platform/limits/), and [consumer concurrency](https://developers.cloudflare.com/queues/configuration/consumer-concurrency/). |
+| Retention, delay, throughput, or cost assumptions no longer hold | Retrieve current [limits](https://developers.cloudflare.com/queues/platform/limits/) and [pricing](https://developers.cloudflare.com/queues/platform/pricing/) for the account's plan. |
+
+Distinguish transient dependency failures from invalid payloads before choosing retry or recovery behavior. Acknowledging a failed message does not send it to a dead-letter queue. If handling a permanent failure separately, persist the intended recovery record successfully before acknowledging; use the documented dead-letter policy when relying on retry exhaustion.
+
+See [patterns.md](./patterns.md) for idempotency and downstream integration decisions.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/queues/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/queues/patterns.md
new file mode 100644
index 0000000..934c88e
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/queues/patterns.md
@@ -0,0 +1,21 @@
+# Queues Patterns & Best Practices
+
+Fetch the guide matching the task and adapt its example to the application's delivery and failure requirements.
+
+| Task | Documentation |
+| -------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Accept requests and enqueue asynchronous tasks; publish to multiple queues | [Publish to a Queue via Workers](https://developers.cloudflare.com/queues/examples/publish-to-a-queue-via-workers/) |
+| Buffer writes to an external API or defer a job | [Batching, retries, and delays](https://developers.cloudflare.com/queues/configuration/batching-retries/) |
+| Handle upstream rate limits and backpressure | [Handle rate limits of external APIs](https://developers.cloudflare.com/queues/tutorials/handle-rate-limits/) and [consumer concurrency](https://developers.cloudflare.com/queues/configuration/consumer-concurrency/) |
+| Isolate workloads with different latency or capacity needs | [Configure Queues](https://developers.cloudflare.com/queues/configuration/configure-queues/) |
+| Retain exhausted retries for inspection and recovery | [Dead Letter Queues](https://developers.cloudflare.com/queues/configuration/dead-letter-queues/) |
+| Process R2 object events | [R2 event notifications](https://developers.cloudflare.com/r2/buckets/event-notifications/) |
+| Batch output into R2 | [Use Queues to store data in R2](https://developers.cloudflare.com/queues/examples/send-errors-to-r2/) |
+| Batch writes into D1 | [D1 database API](https://developers.cloudflare.com/d1/worker-api/d1-database/) |
+| Start durable multi-step jobs | [Trigger Workflows](https://developers.cloudflare.com/workflows/build/trigger-workflows/) |
+| Publish from a Durable Object | [Use Queues from Durable Objects](https://developers.cloudflare.com/queues/examples/use-queues-with-durable-objects/) |
+| Route consumer work to a Durable Object | [Invoke Durable Object methods](https://developers.cloudflare.com/durable-objects/best-practices/create-durable-object-stubs-and-send-requests/) |
+
+Design side effects for [at-least-once delivery](https://developers.cloudflare.com/queues/reference/delivery-guarantees/). A separate check-then-write deduplication flag is not an atomic guarantee: concurrent delivery or a crash between the side effect and recording completion can repeat work. Prefer idempotency keys or transactional enforcement at the destination.
+
+Acknowledge after the destination confirms success. For fan-out, plan for some sends succeeding before another fails; retries must not duplicate downstream effects. Separate queues can isolate workloads, but do not imply a global priority or ordering guarantee.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/r2-data-catalog/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/r2-data-catalog/README.md
new file mode 100644
index 0000000..3ab7800
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/r2-data-catalog/README.md
@@ -0,0 +1,16 @@
+# R2 Data Catalog
+
+Use R2 Data Catalog for Iceberg analytics and data pipelines on object storage. For transactional application queries, consider a database; for unstructured objects, use [R2](../r2/).
+
+Distinguish the Iceberg REST catalog used by query engines from Cloudflare's control-plane API for catalog administration. Start with the workflow you need:
+
+| Task | Reference |
+| -------------------------------------------------------------------- | --------------------------------- |
+| Enable a catalog, discover connection values, and choose credentials | [Configuration](configuration.md) |
+| Select administration or engine APIs | [API selection](api.md) |
+| Choose a Python, Spark, or SQL workflow | [Patterns](patterns.md) |
+| Diagnose authentication, maintenance, or client problems | [Troubleshooting](gotchas.md) |
+
+Copy the actual **Catalog URI** and **Warehouse name** from the catalog detail page or Wrangler's enable output. Pass both to the selected engine; do not reconstruct them from an assumed bucket naming convention. Retrieve [Manage catalogs](https://developers.cloudflare.com/r2-data-catalog/manage-catalogs/) before setup or permission changes.
+
+Related workflows: [Pipelines](../pipelines/) for ingest and [R2 SQL](../r2-sql/) for querying tables.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/r2-data-catalog/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/r2-data-catalog/api.md
new file mode 100644
index 0000000..2f46235
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/r2-data-catalog/api.md
@@ -0,0 +1,52 @@
+# R2 Data Catalog API Selection
+
+Use the Iceberg REST catalog through an engine for table reads and writes; use the Cloudflare control-plane API for catalog administration. Copy the catalog connection values from the actual environment as described in [configuration](configuration.md).
+
+| Task | Documentation |
+| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Enable or disable catalogs; inspect status, credentials, namespaces, tables, and maintenance configuration | [R2 Data Catalog control-plane API](https://developers.cloudflare.com/api/resources/r2_data_catalog/) — select the affected operation for its schema, pagination, and namespace encoding |
+| Connect and create tables through Python | [PyIceberg configuration](https://developers.cloudflare.com/r2-data-catalog/config-examples/pyiceberg/) |
+| Connect, create, write, and query through Spark | [PySpark configuration](https://developers.cloudflare.com/r2-data-catalog/config-examples/spark-python/) |
+| Plan automatic compaction and snapshot expiration | [Table maintenance](https://developers.cloudflare.com/r2-data-catalog/table-maintenance/) |
+| Delete rows, tables, or associated files | [Deleting data](https://developers.cloudflare.com/r2-data-catalog/deleting-data/) |
+
+For engine-specific operations beyond these Cloudflare examples, follow the upstream engine documentation linked from the relevant configuration guide and check the installed version. Do not infer engine method signatures from the control-plane API.
+
+## Get Table (repository-specific metadata introspection note)
+
+This existing repository note is retained because the published control-plane API reference does not document this operation or its snapshot-pruning response. Verify availability and response behavior against the target service or authoritative implementation before relying on it; it is not a documented API guarantee. Do not substitute the documented list-tables response for this metadata response.
+
+`GET /namespaces/{ns}/tables/{table}` returns schema, partition spec, sort order, and snapshot info — like Iceberg "load table" but on the control plane, with snapshots pruned to the most recent 10.
+
+```bash
+curl -s "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/r2-catalog/$BUCKET/namespaces/live/tables/earthquakes" \
+ -H "Authorization: Bearer $API_TOKEN"
+```
+
+```json
+{
+ "result": {
+ "identifier": { "namespace": ["live"], "name": "earthquakes" },
+ "table_uuid": "019edccf-3ac8-73e3-...",
+ "metadata_location": "s3://live-data/__r2_data_catalog/.../metadata/01225-....metadata.json",
+ "total_snapshots": 1225,
+ "returned_snapshots": 10,
+ "metadata": {
+ /* standard Iceberg TableMetadata: schemas, partition-specs, sort-orders,
+ properties, current-snapshot-id, snapshots (≤10), snapshot-log, refs */
+ }
+ },
+ "success": true
+}
+```
+
+| Field | Description |
+| -------------------- | ------------------------------------------------------------------------------------------------------------- |
+| `identifier` | `{namespace: [...], name}` |
+| `table_uuid` | Iceberg table UUID |
+| `metadata_location` | R2 path to current metadata file |
+| `total_snapshots` | Total before pruning |
+| `returned_snapshots` | Count in `metadata.snapshots` (max 10) |
+| `metadata` | Standard [Iceberg TableMetadata](https://iceberg.apache.org/spec/#table-metadata-fields), arrays pruned to 10 |
+
+See [patterns](patterns.md) for engine selection and [troubleshooting](gotchas.md) for diagnosis.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/r2-data-catalog/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/r2-data-catalog/configuration.md
new file mode 100644
index 0000000..6912c24
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/r2-data-catalog/configuration.md
@@ -0,0 +1,17 @@
+# R2 Data Catalog Configuration
+
+Inspect the existing bucket, catalog, engine versions, and credential configuration before making changes. Use the project's installed tools and preserve its environment-variable or secret-management conventions.
+
+| Task | Documentation |
+| ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
+| Enable a catalog and obtain connection details | [Enable R2 Data Catalog](https://developers.cloudflare.com/r2-data-catalog/manage-catalogs/#enable-r2-data-catalog-on-a-bucket) |
+| Select credentials for readers, writers, or maintenance | [Authenticate your Iceberg engine](https://developers.cloudflare.com/r2-data-catalog/manage-catalogs/#authenticate-your-iceberg-engine) |
+| Configure compaction and its service credential | [Enable compaction](https://developers.cloudflare.com/r2-data-catalog/manage-catalogs/#enable-compaction) |
+| Configure snapshot retention | [Enable snapshot expiration](https://developers.cloudflare.com/r2-data-catalog/manage-catalogs/#enable-snapshot-expiration) |
+| Choose file sizes, retention policy, and maintenance scope | [Table maintenance](https://developers.cloudflare.com/r2-data-catalog/table-maintenance/) |
+| Connect a Python client | [PyIceberg](https://developers.cloudflare.com/r2-data-catalog/config-examples/pyiceberg/) |
+| Connect Spark | [PySpark](https://developers.cloudflare.com/r2-data-catalog/config-examples/spark-python/) |
+| Connect another query engine | [Engine configuration guides](https://developers.cloudflare.com/r2-data-catalog/config-examples/) |
+| Disable catalog access | [Disable R2 Data Catalog](https://developers.cloudflare.com/r2-data-catalog/manage-catalogs/#disable-r2-data-catalog-on-a-bucket) |
+
+Copy the Catalog URI and Warehouse name exactly from the catalog detail page or Wrangler enable output. Scope both catalog and storage permissions to the operations the client needs; readers do not need a blanket write-enabled token. Treat maintenance credentials separately from reader credentials. Verify connectivity with a read operation before attempting writes, then check catalog and credential status through the [control-plane API](api.md).
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/r2-data-catalog/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/r2-data-catalog/gotchas.md
new file mode 100644
index 0000000..18133a4
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/r2-data-catalog/gotchas.md
@@ -0,0 +1,18 @@
+# R2 Data Catalog Troubleshooting
+
+Identify whether the failure occurs in catalog administration, engine metadata access, or underlying object access before changing permissions or client settings.
+
+| Check | Documentation |
+| -------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Catalog enablement, Catalog URI, or Warehouse mismatch | [Manage catalogs](https://developers.cloudflare.com/r2-data-catalog/manage-catalogs/) |
+| Reader/writer token scope or file-access denial | [Engine authentication](https://developers.cloudflare.com/r2-data-catalog/manage-catalogs/#authenticate-your-iceberg-engine) — inspect both catalog and storage permissions |
+| Missing maintenance credentials or wrong table/catalog configuration | [Control-plane API](https://developers.cloudflare.com/api/resources/r2_data_catalog/) and [enable compaction](https://developers.cloudflare.com/r2-data-catalog/manage-catalogs/#enable-compaction) |
+| Compaction backlog, retention, or orphaned files | [Table maintenance](https://developers.cloudflare.com/r2-data-catalog/table-maintenance/) |
+| PyIceberg connection or table creation | [PyIceberg configuration](https://developers.cloudflare.com/r2-data-catalog/config-examples/pyiceberg/) |
+| Spark dependency, credential-vending, or signing configuration | [PySpark configuration](https://developers.cloudflare.com/r2-data-catalog/config-examples/spark-python/) |
+| Deleted data is still present | [Deleting data](https://developers.cloudflare.com/r2-data-catalog/deleting-data/) |
+| Catalog request or maintenance-job diagnosis | [Metrics and analytics](https://developers.cloudflare.com/r2-data-catalog/observability/metrics/) |
+
+Compare the client's configured URI and warehouse with the actual catalog values. Test a read operation first; do not grant write access merely to resolve a reader's failure. For schema or concurrency errors, inspect the installed engine's behavior and current table metadata before retrying. The [get-table note](api.md#get-table-repository-specific-metadata-introspection-note) is not a substitute for verifying the service's response contract.
+
+See [configuration](configuration.md) and [patterns](patterns.md) for implementation choices.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/r2-data-catalog/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/r2-data-catalog/patterns.md
new file mode 100644
index 0000000..dc4b05d
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/r2-data-catalog/patterns.md
@@ -0,0 +1,17 @@
+# R2 Data Catalog Patterns
+
+Choose the engine based on the project's existing runtime and workload, then retrieve its current connection example.
+
+| Need | Starting point |
+| ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------- |
+| Python catalog operations and ingestion without a Spark deployment | [PyIceberg](https://developers.cloudflare.com/r2-data-catalog/config-examples/pyiceberg/) |
+| Existing Spark ETL and distributed table processing | [PySpark](https://developers.cloudflare.com/r2-data-catalog/config-examples/spark-python/) |
+| Connect an existing SQL engine | [Engine configuration guides](https://developers.cloudflare.com/r2-data-catalog/config-examples/) |
+| Query through Cloudflare's serverless SQL service | [R2 SQL](../r2-sql/) |
+| Stream events into tables | [Pipelines patterns](../pipelines/patterns.md) |
+
+Use the discovered Catalog URI and Warehouse name from [configuration](configuration.md). Match dependencies to the installed engine and the current guide instead of adopting a universal pinned Spark/Iceberg combination.
+
+Plan ingestion, query, and maintenance responsibilities together. Prefer [automatic table maintenance](https://developers.cloudflare.com/r2-data-catalog/table-maintenance/) when it meets the workload; align retention with time-travel needs before enabling expiration. For engine-specific partitioning, schema evolution, or manual procedures, consult that engine's linked upstream documentation and verify behavior on representative data.
+
+When multiple writers share a table, design recovery around the actual failed operation and the engine's commit semantics. Reproduce conflicts and ensure retries do not duplicate application work. See [API selection](api.md) and [troubleshooting](gotchas.md).
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/r2-sql/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/r2-sql/README.md
new file mode 100644
index 0000000..813f977
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/r2-sql/README.md
@@ -0,0 +1,64 @@
+# Cloudflare R2 SQL
+
+Serverless, distributed, **read-only** query engine (Apache DataFusion) for Apache Iceberg tables in R2 Data Catalog.
+
+## Documentation
+
+For full function lists, data types, and pricing, **retrieve the live docs** — use the Cloudflare MCP `docs` tool if available, otherwise `webfetch`.
+
+| Topic | URL |
+| ---------------------------- | -------------------------------------------------------------------------------- |
+| Overview / get started | `https://developers.cloudflare.com/r2-sql/get-started/` |
+| Query data | `https://developers.cloudflare.com/r2-sql/query-data/` |
+| SQL reference | `https://developers.cloudflare.com/r2-sql/sql-reference/` |
+| Aggregate functions | `https://developers.cloudflare.com/r2-sql/sql-reference/aggregate-functions/` |
+| Scalar functions | `https://developers.cloudflare.com/r2-sql/sql-reference/scalar-functions/` |
+| Complex types | `https://developers.cloudflare.com/r2-sql/sql-reference/complex-types/` |
+| Limitations & best practices | `https://developers.cloudflare.com/r2-sql/reference/limitations-best-practices/` |
+| Wrangler commands | `https://developers.cloudflare.com/r2-sql/reference/wrangler-commands/` |
+| Pricing | `https://developers.cloudflare.com/r2-sql/platform/pricing/` |
+
+## Connection Values
+
+| Value | Format |
+| ------------- | ------------------------------------------------------------------------------------------ |
+| REST endpoint | `https://api.sql.cloudflarestorage.com/api/v1/accounts/{ACCOUNT_ID}/r2-sql/query/{BUCKET}` |
+| Wrangler | `npx wrangler r2 sql query "{WAREHOUSE}" ""` with `WRANGLER_R2_SQL_AUTH_TOKEN` set |
+| Warehouse | `{ACCOUNT_ID}_{BUCKET}` |
+
+> The REST endpoint is `api.sql.cloudflarestorage.com` — **not** `api.cloudflare.com/.../r2/sql`.
+
+## Quick Start
+
+```bash
+npx wrangler r2 bucket catalog enable my-bucket # 1. enable catalog
+export WRANGLER_R2_SQL_AUTH_TOKEN= # 2. auth (Admin R&W + R2 SQL Read)
+npx wrangler r2 sql query "$ACCOUNT_ID"_my-bucket \
+ "SELECT * FROM default.my_table LIMIT 10" # 3. query
+```
+
+## SQL Surface
+
+R2 SQL is read-only and supports a broad analytical SQL surface (SELECT, JOINs, subqueries, CTEs, set operations, window functions, and aggregate/scalar/JSON functions over complex types). For the authoritative, current list of supported syntax, functions, and limitations, see the SQL reference and limitations docs linked above. [api.md](api.md) has query templates.
+
+## When to Use
+
+**Use for:** SQL analytics over Iceberg (logs, BI, fraud, ad-hoc), multi-cloud queries without egress, dashboards (query from a Worker via HTTP).
+
+**Don't use for:** writes (use PySpark/PyIceberg) or real-time OLTP (<100 ms).
+
+## No Workers Binding
+
+There is no `env.R2_SQL` binding. Query from a Worker via `fetch()` to the REST endpoint with the token as a secret (see [patterns.md](patterns.md#dashboard-worker)).
+
+## Reading Order
+
+1. [configuration.md](configuration.md) — enable catalog, tokens, env setup
+2. [api.md](api.md) — SQL syntax templates, JOIN/window examples, response format, data types
+3. [patterns.md](patterns.md) — CLI/REST/Worker queries, use cases, pagination, performance
+4. [gotchas.md](gotchas.md) — what works vs. not, performance, troubleshooting
+
+## See Also
+
+- [r2-data-catalog](../r2-data-catalog/) — PyIceberg/PySpark, table management
+- [pipelines](../pipelines/) — streaming ingest into queryable tables
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/r2-sql/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/r2-sql/api.md
new file mode 100644
index 0000000..c5b6177
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/r2-sql/api.md
@@ -0,0 +1,127 @@
+# R2 SQL API Reference
+
+Read-only SQL over Iceberg (Apache DataFusion). Query templates only. For the authoritative list of supported syntax, functions, data types, and limitations, pull the SQL reference (`sql-reference/`, `.../aggregate-functions/`, `.../scalar-functions/`, `.../complex-types/`) and `reference/limitations-best-practices/`.
+
+## Query Endpoint
+
+```
+POST https://api.sql.cloudflarestorage.com/api/v1/accounts/{ACCOUNT_ID}/r2-sql/query/{BUCKET}
+Authorization: Bearer
+Content-Type: application/json
+Body: {"query": ""}
+```
+
+CLI: `npx wrangler r2 sql query "{WAREHOUSE}" ""` (with `WRANGLER_R2_SQL_AUTH_TOKEN`).
+
+## Response Format
+
+```json
+{
+ "result": {
+ "request_id": "dqe-prod-01...",
+ "schema": [{ "name": "cnt", "descriptor": { "type": { "name": "int64" }, "nullable": false } }],
+ "rows": [{ "category": "Electronics", "cnt": 12345 }],
+ "metrics": {
+ "r2_requests_count": 5,
+ "files_scanned": 29,
+ "bytes_scanned": 12345678,
+ "cache_hits": 0
+ }
+ },
+ "success": true,
+ "errors": []
+}
+```
+
+Error: `{"result": null, "success": false, "errors": [{"code": 40003, "message": "..."}]}`. `bytes_scanned` ≈ billable data.
+
+## Query Structure
+
+```sql
+SELECT [DISTINCT] columns | expressions | aggregations
+FROM namespace.table [alias]
+[ [INNER|LEFT|RIGHT|FULL OUTER|CROSS] JOIN namespace.table2 alias2 ON ... ]
+[WHERE ...] [GROUP BY ...] [HAVING ...]
+[QUALIFY window_predicate]
+[ORDER BY expr [ASC|DESC]]
+[LIMIT n] -- default 500, max 10,000
+```
+
+## Schema Discovery
+
+```sql
+SHOW DATABASES; -- list namespaces (aliases: SHOW NAMESPACES / SHOW SCHEMAS)
+SHOW TABLES IN namespace;
+DESCRIBE namespace.table; -- columns, types, partition keys
+EXPLAIN [FORMAT JSON] SELECT ...; -- execution plan (free; no data scanned)
+```
+
+## JOINs / Subqueries / CTEs / Set Ops
+
+```sql
+-- JOINs: all types + multi-way
+SELECT z.domain, COUNT(*) AS cnt
+FROM ns.zones z
+INNER JOIN ns.http_requests h ON z.zone_id = h.zone_id
+LEFT JOIN ns.firewall_events f ON z.zone_id = f.zone_id
+GROUP BY z.domain ORDER BY cnt DESC LIMIT 20;
+
+-- Subqueries: IN / EXISTS / scalar / derived
+SELECT * FROM ns.t1 WHERE id IN (SELECT id FROM ns.t2 WHERE x > 0);
+SELECT col, (SELECT COUNT(*) FROM ns.t2 s WHERE s.id = t.id) AS cnt FROM ns.t1 t;
+
+-- Multi-table CTE with JOIN
+WITH top AS (SELECT zone_id, COUNT(*) AS req FROM ns.http_requests GROUP BY zone_id ORDER BY req DESC LIMIT 50)
+SELECT t.zone_id, t.req FROM top t LEFT JOIN ns.zones z ON t.zone_id = z.zone_id;
+
+-- Set ops: UNION / UNION ALL / INTERSECT / EXCEPT
+SELECT zone_id FROM ns.firewall_events WHERE action = 'block'
+UNION SELECT zone_id FROM ns.http_requests WHERE risk_score > 0.8;
+```
+
+## Window Functions
+
+Use inline `OVER (...)`. See the SQL reference for the full list of supported window functions and frame syntax.
+
+```sql
+SELECT event_id,
+ ROW_NUMBER() OVER (PARTITION BY mag_type ORDER BY magnitude DESC) AS rn,
+ LAG(magnitude, 2, 0.0) OVER (ORDER BY occurred_at) AS prev2, -- offset + default
+ NTH_VALUE(magnitude, 2) OVER (ORDER BY magnitude DESC) AS n2,
+ SUM(magnitude) OVER (ORDER BY occurred_at) AS running,
+ AVG(magnitude) OVER (ORDER BY magnitude ROWS BETWEEN 2 PRECEDING AND CURRENT ROW) AS moving_avg
+FROM ns.earthquakes;
+
+-- QUALIFY: filter on a window result (top row per partition)
+SELECT event_id, mag_type, magnitude FROM ns.earthquakes
+QUALIFY ROW_NUMBER() OVER (PARTITION BY mag_type ORDER BY magnitude DESC) = 1;
+```
+
+## Functions
+
+Aggregate, scalar, JSON, and array/map function catalogs are in the docs — pull `sql-reference/aggregate-functions/` and `.../scalar-functions/`. JSON functions accept variadic paths, e.g. `json_get_int(doc, 'user', 'profile', 'level')`.
+
+## Data Types
+
+`integer`, `float`, `string` (single quotes), `boolean`, `timestamp` (RFC3339 **with timezone**), `date` (ISO 8601), `struct`, `array` (1-indexed), `map`. No implicit conversions — quote strings, include timezone on timestamps, don't quote integers. Full type docs: `sql-reference/`.
+
+```sql
+WHERE status = 200 AND method = 'GET' -- not '200', not GET
+ AND ts >= '2026-01-01T00:00:00Z' -- not '2026-01-01'
+```
+
+## Complex Types (quick examples; full ref in docs)
+
+```sql
+SELECT pricing['price'] AS price, get_field(pricing, 'discount') AS disc FROM ns.t; -- struct
+SELECT tags[1] AS first_tag, array_length(tags) AS n FROM ns.t; -- array (1-indexed)
+SELECT map_keys(meta), map_extract(meta, 'source') FROM ns.t; -- map
+```
+
+## Errors
+
+Failed queries return `{"success": false, "errors": [{"code": ..., "message": ...}]}`. For error codes and troubleshooting, see `https://developers.cloudflare.com/r2-sql/troubleshooting/`.
+
+## See Also
+
+- [patterns.md](patterns.md) — query examples · [gotchas.md](gotchas.md) — limits & workarounds · [configuration.md](configuration.md)
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/r2-sql/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/r2-sql/configuration.md
new file mode 100644
index 0000000..4dbc049
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/r2-sql/configuration.md
@@ -0,0 +1,50 @@
+# R2 SQL Configuration
+
+Auth and setup. For the current permission matrix and wrangler flags, pull `https://developers.cloudflare.com/r2-sql/reference/wrangler-commands/` and the R2 Data Catalog manage-catalogs doc.
+
+## Prerequisites
+
+- R2 bucket with Data Catalog enabled ([r2-data-catalog/configuration.md](../r2-data-catalog/configuration.md))
+- R2 API token: **R2 Storage Admin Read & Write** (includes R2 SQL Read), or add **R2 SQL Read** explicitly
+- Wrangler CLI (for CLI queries)
+
+> Open-beta limitation: R2 Storage **Admin Read & Write is required even for read-only R2 SQL queries**.
+
+## Enable Catalog + Get Warehouse
+
+```bash
+npx wrangler r2 bucket catalog enable my-bucket
+```
+
+You query by **warehouse** name (`{ACCOUNT_ID}_{BUCKET}`), shown in the output alongside the Catalog URI.
+
+## Configure Auth
+
+### Wrangler CLI
+
+```bash
+export WRANGLER_R2_SQL_AUTH_TOKEN=
+# or a .env file in the project dir (auto-loaded): WRANGLER_R2_SQL_AUTH_TOKEN=
+```
+
+> Wrangler does **not** use the `wrangler login` OAuth session for R2 SQL — the env var is required.
+
+### REST API
+
+```bash
+curl -X POST \
+ "https://api.sql.cloudflarestorage.com/api/v1/accounts/$ACCOUNT_ID/r2-sql/query/$BUCKET" \
+ -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
+ -d '{"query": "SELECT * FROM default.my_table LIMIT 10"}'
+```
+
+## Verify Setup
+
+```bash
+npx wrangler r2 sql query "${ACCOUNT_ID}_my-bucket" "SHOW DATABASES"
+npx wrangler r2 sql query "${ACCOUNT_ID}_my-bucket" "SHOW TABLES IN default"
+```
+
+## See Also
+
+- [api.md](api.md) — SQL syntax · [patterns.md](patterns.md) — query examples · [gotchas.md](gotchas.md) — troubleshooting
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/r2-sql/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/r2-sql/gotchas.md
new file mode 100644
index 0000000..b75824d
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/r2-sql/gotchas.md
@@ -0,0 +1,39 @@
+# R2 SQL Gotchas
+
+Operational pitfalls. For the authoritative list of supported features, unsupported features, and recommended workarounds, pull `https://developers.cloudflare.com/r2-sql/reference/limitations-best-practices/` and `https://developers.cloudflare.com/r2-sql/troubleshooting/`.
+
+## Access
+
+- **No Workers binding.** There is no `env.R2_SQL`. Query the REST endpoint via `fetch()` from a Worker ([patterns.md](patterns.md#dashboard-worker)), or use D1 / an external DB for OLTP.
+- Wrangler needs `WRANGLER_R2_SQL_AUTH_TOKEN` — it does **not** reuse the `wrangler login` OAuth session.
+- Open beta: R2 Storage **Admin Read & Write is required even for read-only** queries.
+
+## Type Safety
+
+```sql
+-- ❌ wrong -- ✅ right
+WHERE status = '200' WHERE status = 200
+WHERE ts > '2026-01-01' WHERE ts > '2026-01-01T00:00:00Z' -- need time + tz
+WHERE method = GET WHERE method = 'GET'
+```
+
+No implicit conversions. Timestamps must be RFC3339 with timezone; dates ISO 8601.
+
+## Performance
+
+- **File count dominates latency** — enable automatic compaction.
+- **Partition-filter + narrow time windows + always `LIMIT`.**
+- **Multi-way JOINs on large tables** can exceed resource limits — filter heavily, join through dimension tables.
+- Per-query `metrics` (`files_scanned`, `bytes_scanned`, `cache_hits`) are the primary observability signal; `bytes_scanned` ≈ billable data. For LIMIT bounds, pagination, and other guidance, see the limitations-best-practices doc.
+
+## Debug Checklist
+
+1. `wrangler r2 bucket catalog enable ` — catalog on?
+2. `echo $WRANGLER_R2_SQL_AUTH_TOKEN` — token set?
+3. `SHOW DATABASES` → `SHOW TABLES IN ns` → `DESCRIBE ns.table`
+4. `SELECT COUNT(*) FROM ns.table` — data present?
+5. Add filters incrementally; read `metrics` to tune.
+
+## See Also
+
+- [api.md](api.md) · [patterns.md](patterns.md) · [configuration.md](configuration.md)
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/r2-sql/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/r2-sql/patterns.md
new file mode 100644
index 0000000..d4414bb
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/r2-sql/patterns.md
@@ -0,0 +1,125 @@
+# R2 SQL Patterns
+
+Code templates for CLI, REST, and Worker access. For performance/partitioning best practices, pull `https://developers.cloudflare.com/r2-sql/reference/limitations-best-practices/`.
+
+## Wrangler CLI
+
+```bash
+export WRANGLER_R2_SQL_AUTH_TOKEN=$API_TOKEN
+
+npx wrangler r2 sql query "${ACCOUNT_ID}_my-bucket" "
+ SELECT category, COUNT(*) AS cnt, round(AVG(amount), 2) AS avg_amount
+ FROM analytics.events
+ WHERE __ingest_ts >= '2026-01-01T00:00:00Z'
+ GROUP BY category ORDER BY cnt DESC LIMIT 100"
+```
+
+## REST API (Python)
+
+```python
+import requests
+
+API = f"https://api.sql.cloudflarestorage.com/api/v1/accounts/{ACCOUNT_ID}/r2-sql/query/{BUCKET}"
+HEADERS = {"Authorization": f"Bearer {TOKEN}", "Content-Type": "application/json"}
+
+def r2sql(query):
+ body = requests.post(API, headers=HEADERS, json={"query": query}, timeout=180).json()
+ if body["success"]:
+ return body["result"]["rows"], body["result"]["metrics"]
+ raise RuntimeError(body["errors"])
+
+rows, metrics = r2sql("SELECT category, COUNT(*) AS cnt FROM analytics.events GROUP BY category LIMIT 10")
+```
+
+## REST API (curl)
+
+```bash
+curl -X POST \
+ "https://api.sql.cloudflarestorage.com/api/v1/accounts/$ACCOUNT_ID/r2-sql/query/$BUCKET" \
+ -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
+ -d '{"query": "SELECT COUNT(*) AS total FROM analytics.events"}'
+```
+
+## Dashboard Worker
+
+No R2 SQL binding exists — query the REST endpoint via `fetch()`.
+
+```typescript
+interface Env {
+ ACCOUNT_ID: string;
+ BUCKET: string;
+ R2_SQL_TOKEN: string;
+}
+
+async function queryR2SQL(env: Env, query: string) {
+ const url = `https://api.sql.cloudflarestorage.com/api/v1/accounts/${env.ACCOUNT_ID}/r2-sql/query/${env.BUCKET}`;
+ const resp = await fetch(url, {
+ method: 'POST',
+ headers: { Authorization: `Bearer ${env.R2_SQL_TOKEN}`, 'Content-Type': 'application/json' },
+ body: JSON.stringify({ query })
+ });
+ if (!resp.ok) throw new Error(`R2 SQL ${resp.status}: ${await resp.text()}`);
+ return ((await resp.json()) as any).result;
+}
+
+export default {
+ async fetch(req: Request, env: Env): Promise {
+ if (new URL(req.url).pathname === '/api/analytics') {
+ const result = await queryR2SQL(
+ env,
+ `
+ SELECT category, COUNT(*) AS cnt FROM analytics.events
+ GROUP BY category ORDER BY cnt DESC LIMIT 10`
+ );
+ return Response.json(result.rows);
+ }
+ return new Response('Not found', { status: 404 });
+ }
+};
+```
+
+```bash
+npx wrangler secret put R2_SQL_TOKEN
+```
+
+## Example Queries
+
+```sql
+-- Error rate by endpoint
+SELECT path, COUNT(*) AS total, SUM(CASE WHEN status >= 400 THEN 1 ELSE 0 END) AS errors
+FROM logs.http_requests WHERE __ingest_ts >= '2026-01-01T00:00:00Z'
+GROUP BY path ORDER BY errors DESC LIMIT 20;
+
+-- Top-3 slowest requests per method (window + QUALIFY)
+SELECT method, path, response_time_ms FROM logs.http_requests
+QUALIFY ROW_NUMBER() OVER (PARTITION BY method ORDER BY response_time_ms DESC) <= 3;
+
+-- Cross-table analytics with approx distinct
+SELECT z.domain, COUNT(*) AS requests, approx_distinct(h.client_ip) AS uniques
+FROM ns.zones z INNER JOIN ns.http_requests h ON z.zone_id = h.zone_id
+WHERE h.__ingest_ts >= '2026-06-01T00:00:00Z'
+GROUP BY z.domain ORDER BY requests DESC LIMIT 25;
+```
+
+## Cursor-Based Pagination
+
+Paginate on a sortable (ideally partition) column rather than `OFFSET`:
+
+```sql
+SELECT * FROM logs.requests ORDER BY __ingest_ts DESC LIMIT 500; -- page 1
+SELECT * FROM logs.requests WHERE __ingest_ts < '' ORDER BY __ingest_ts DESC LIMIT 500; -- page 2
+```
+
+## Performance (essentials)
+
+- **Always `LIMIT`** (early termination); **filter on partition keys first** (`__ingest_ts` range), then add predicates.
+- **Narrow time ranges**; **compact tables** (file count dominates latency — enable automatic compaction in [r2-data-catalog](../r2-data-catalog/configuration.md)).
+- Read response `metrics` (`files_scanned`, `bytes_scanned`) to tune. Full guidance: limitations-best-practices doc.
+
+## Pipelines → R2 SQL
+
+After `npx wrangler pipelines setup` (Data Catalog destination), wait for first flush (3–7 min), then query the table. See [pipelines/patterns.md](../pipelines/patterns.md).
+
+## See Also
+
+- [api.md](api.md) · [gotchas.md](gotchas.md) · [r2-data-catalog/patterns.md](../r2-data-catalog/patterns.md)
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/r2/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/r2/README.md
new file mode 100644
index 0000000..3c5c367
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/r2/README.md
@@ -0,0 +1,26 @@
+# Cloudflare R2 Object Storage
+
+Use R2 for objects such as uploads, media, backups, and static assets. Fetch the linked documentation before implementing; API signatures, configuration, limits, and pricing belong in the current docs.
+
+## Choose an access path
+
+- Use a Workers binding for object access inside a Worker: [Workers API setup](https://developers.cloudflare.com/r2/get-started/workers-api/).
+- Use the S3-compatible API for existing S3 clients or direct client access through presigned URLs: [S3 setup](https://developers.cloudflare.com/r2/get-started/s3/). Check supported operations rather than assuming full S3 parity.
+- Decide whether objects need application authorization, temporary access, or public delivery before exposing the bucket. See [patterns.md](./patterns.md).
+
+## Find the task
+
+| Task | Reference |
+| -------------------------------------------------------------- | -------------------------------------- |
+| Bindings, credentials, local development, bucket settings | [configuration.md](./configuration.md) |
+| Object operations, metadata, conditions, multipart, CLI | [api.md](./api.md) |
+| Uploads, streaming, caching, public delivery, event processing | [patterns.md](./patterns.md) |
+| Pagination, conditional responses, failed uploads, limits | [gotchas.md](./gotchas.md) |
+
+For other topics, discover pages through the [R2 documentation index](https://developers.cloudflare.com/r2/llms.txt). Check [pricing](https://developers.cloudflare.com/r2/pricing/) before estimating costs.
+
+## See also
+
+- [Workers](https://developers.cloudflare.com/workers/) for request handling.
+- [KV](../kv/) or [D1](../d1/) for application metadata associated with objects.
+- [Queues](../queues/) for asynchronous processing of object events.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/r2/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/r2/api.md
new file mode 100644
index 0000000..7bb15f6
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/r2/api.md
@@ -0,0 +1,16 @@
+# R2 API Reference
+
+Fetch the relevant page before writing code. Use the Workers API for bucket bindings and the S3 API for S3 clients; their types and semantics differ.
+
+| Task | Current documentation |
+| -------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
+| Read, write, inspect, delete, or list objects; metadata, checksums, ranges, and return types | [Workers API reference](https://developers.cloudflare.com/r2/api/workers/workers-api-reference/) |
+| Implement a Worker that serves or writes objects | [Use R2 from Workers](https://developers.cloudflare.com/r2/api/workers/workers-api-usage/) |
+| Create, resume, complete, or abort multipart uploads | [Multipart Worker and client example](https://developers.cloudflare.com/r2/api/workers/workers-multipart-usage/) |
+| Check supported S3 operations and headers | [S3 compatibility](https://developers.cloudflare.com/r2/api/s3/api/) |
+| Configure an S3 JavaScript client | [AWS SDK for JavaScript v3](https://developers.cloudflare.com/r2/examples/aws/aws-sdk-js-v3/) |
+| Sign temporary upload or download access | [Presigned URLs](https://developers.cloudflare.com/r2/api/s3/presigned-urls/) |
+| Encrypt with customer-provided keys | [SSE-C usage](https://developers.cloudflare.com/r2/examples/ssec/) |
+| Manage buckets and objects from the command line | [Wrangler R2 commands](https://developers.cloudflare.com/r2/reference/wrangler-commands/) |
+
+Use generated project types rather than maintaining local copies of R2 interfaces; see [Workers TypeScript guidance](https://developers.cloudflare.com/workers/languages/typescript/). For pagination and conditional response handling, read [gotchas.md](./gotchas.md) alongside the API reference.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/r2/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/r2/configuration.md
new file mode 100644
index 0000000..3f1c473
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/r2/configuration.md
@@ -0,0 +1,19 @@
+# R2 Configuration
+
+Fetch the task's documentation before editing Wrangler configuration or bucket settings.
+
+| Task | Current documentation |
+| ----------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Create a bucket and bind it to a Worker | [Workers API setup](https://developers.cloudflare.com/r2/get-started/workers-api/) |
+| Choose local simulation or a remote bucket during development | [Supported bindings per development mode](https://developers.cloudflare.com/workers/local-development/bindings-per-env/) and [local development](https://developers.cloudflare.com/workers/local-development/) |
+| Create S3 credentials and scope permissions | [R2 authentication](https://developers.cloudflare.com/r2/api/tokens/) |
+| Set the S3 endpoint and SDK region | [AWS SDK for JavaScript v3](https://developers.cloudflare.com/r2/examples/aws/aws-sdk-js-v3/) |
+| Choose placement hints or a jurisdiction | [Data location](https://developers.cloudflare.com/r2/reference/data-location/) |
+| Configure browser origins, methods, and headers | [CORS](https://developers.cloudflare.com/r2/buckets/cors/) |
+| Set expiration, storage transitions, or incomplete-upload cleanup | [Object lifecycles](https://developers.cloudflare.com/r2/buckets/object-lifecycles/) |
+| Choose or change storage classes | [Storage classes](https://developers.cloudflare.com/r2/buckets/storage-classes/) and [pricing](https://developers.cloudflare.com/r2/pricing/) |
+| Send object events to a queue | [Event notifications](https://developers.cloudflare.com/r2/buckets/event-notifications/) |
+| Configure public access or a custom domain | [Public buckets](https://developers.cloudflare.com/r2/buckets/public-buckets/) |
+| Manage bucket settings with Wrangler | [R2 commands](https://developers.cloudflare.com/r2/reference/wrangler-commands/) |
+
+Choose the development bucket deliberately: a remote binding accesses real data. Scope S3 credentials to the required buckets and operations; Workers bindings use their own access mechanism. Review lifecycle prefixes and retention needs before applying deletion rules, and evaluate retrieval and minimum-storage charges before choosing a storage class.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/r2/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/r2/gotchas.md
new file mode 100644
index 0000000..ab67b60
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/r2/gotchas.md
@@ -0,0 +1,17 @@
+# R2 Gotchas & Troubleshooting
+
+Use the current references to diagnose the actual response or error instead of copying a workaround.
+
+| Symptom or decision | What to check |
+| ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Listing stops early or escapes the intended prefix | Follow `truncated` and the returned cursor, retaining the original prefix, delimiter, and metadata options on subsequent requests. See the listing section of the [Workers API reference](https://developers.cloudflare.com/r2/api/workers/workers-api-reference/). |
+| Conditional read has no body, or conditional write returns null | Distinguish a missing object from a failed condition; choose the HTTP response for the actual request condition. See conditional operations in the [Workers API reference](https://developers.cloudflare.com/r2/api/workers/workers-api-reference/). |
+| ETag, metadata, checksum, or stream upload behaves unexpectedly | Check supported values and return types in the [Workers API reference](https://developers.cloudflare.com/r2/api/workers/workers-api-reference/), the [Worker upload example](https://developers.cloudflare.com/r2/api/workers/workers-api-usage/), and [Workers streams](https://developers.cloudflare.com/workers/runtime-apis/streams/). |
+| Multipart upload fails or cannot be resumed | Check part constraints and handle an upload that has already completed or aborted: [multipart guide](https://developers.cloudflare.com/r2/api/workers/workers-multipart-usage/) and [API reference](https://developers.cloudflare.com/r2/api/workers/workers-api-reference/). |
+| S3 authentication or signed URL fails | Verify credentials, endpoint, region, operation, signed headers, and expiry using [SDK setup](https://developers.cloudflare.com/r2/examples/aws/aws-sdk-js-v3/), [authentication](https://developers.cloudflare.com/r2/api/tokens/), and [presigned URLs](https://developers.cloudflare.com/r2/api/s3/presigned-urls/). |
+| Browser fails but an HTTP client succeeds | Check [CORS](https://developers.cloudflare.com/r2/buckets/cors/) and [troubleshooting](https://developers.cloudflare.com/r2/platform/troubleshooting/). |
+| Local and deployed data or behavior differ | Check [local development](https://developers.cloudflare.com/workers/local-development/), [supported bindings](https://developers.cloudflare.com/workers/local-development/bindings-per-env/), and the local persistence options in [Wrangler R2 commands](https://developers.cloudflare.com/r2/reference/wrangler-commands/). |
+| Reads serve old or missing content after an update | Check the [consistency model and cache interactions](https://developers.cloudflare.com/r2/reference/consistency/). |
+| Upload size, metadata size, storage cost, or lifecycle behavior is unexpected | Fetch [limits](https://developers.cloudflare.com/r2/platform/limits/), [pricing](https://developers.cloudflare.com/r2/pricing/), [storage classes](https://developers.cloudflare.com/r2/buckets/storage-classes/), and [object lifecycles](https://developers.cloudflare.com/r2/buckets/object-lifecycles/). |
+
+For other failures, start with [R2 troubleshooting](https://developers.cloudflare.com/r2/platform/troubleshooting/) and [error codes](https://developers.cloudflare.com/r2/api/error-codes/).
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/r2/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/r2/patterns.md
new file mode 100644
index 0000000..4cb85c7
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/r2/patterns.md
@@ -0,0 +1,18 @@
+# R2 Patterns & Best Practices
+
+Choose the access and delivery model, then fetch the implementation guide.
+
+| Task | Current documentation |
+| -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Stream object downloads or accept uploads through a Worker | [Use R2 from Workers](https://developers.cloudflare.com/r2/api/workers/workers-api-usage/) |
+| Add conditional reads/writes, range handling, checksums, or batch deletion | [Workers API reference](https://developers.cloudflare.com/r2/api/workers/workers-api-reference/) |
+| Upload large files with multipart state tracked by the client | [Multipart Worker and client example](https://developers.cloudflare.com/r2/api/workers/workers-multipart-usage/) |
+| Upload directly from a browser or share a temporary download | [Presigned URLs](https://developers.cloudflare.com/r2/api/s3/presigned-urls/) and [CORS](https://developers.cloudflare.com/r2/buckets/cors/) |
+| Cache responses served by a Worker | [Cache API example](https://developers.cloudflare.com/r2/examples/cache-api/) |
+| Deliver public objects through a custom domain or evaluate r2.dev | [Public buckets](https://developers.cloudflare.com/r2/buckets/public-buckets/) |
+| Process object changes asynchronously | [Event notifications](https://developers.cloudflare.com/r2/buckets/event-notifications/) and [Queues](../queues/) |
+| Expire objects or transition storage classes | [Object lifecycles](https://developers.cloudflare.com/r2/buckets/object-lifecycles/) and [storage classes](https://developers.cloudflare.com/r2/buckets/storage-classes/) |
+
+Authorize the caller for the selected object key and operation before exposing a Worker endpoint or issuing a presigned URL. A key-format check alone does not establish access rights. Set the intended expiry and signed request constraints for temporary access; configure browser CORS separately.
+
+Keep private responses out of shared public caches. Choose cache keys and invalidation around the application's access model, and check [R2 consistency and caching behavior](https://developers.cloudflare.com/r2/reference/consistency/) when objects can change. For multipart uploads, plan for failed parts, completion, and cleanup using the linked guide.
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/realtime-sfu/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/realtime-sfu/README.md
new file mode 100644
index 0000000..9d48a78
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/realtime-sfu/README.md
@@ -0,0 +1,66 @@
+# Cloudflare Realtime SFU Reference
+
+Expert guidance for building real-time audio/video/data applications using Cloudflare Realtime SFU (Selective Forwarding Unit).
+
+## Reading Order
+
+| Task | Files | ~Tokens |
+| --------------------------- | ------------------------------ | ------- |
+| New project | README → configuration | ~1200 |
+| Implement publish/subscribe | README → api | ~1600 |
+| Add PartyTracks | patterns (PartyTracks section) | ~800 |
+| Build presence system | patterns (DO section) | ~800 |
+| Debug connection issues | gotchas | ~700 |
+| Scale to millions | patterns (Cascading section) | ~600 |
+| Add simulcast | patterns (Advanced section) | ~500 |
+| Configure TURN | configuration (TURN section) | ~400 |
+
+## In This Reference
+
+- **[configuration.md](configuration.md)** - Setup, deployment, environment variables, Wrangler config
+- **[api.md](api.md)** - Sessions, tracks, endpoints, request/response patterns
+- **[patterns.md](patterns.md)** - Architecture patterns, use cases, integration examples
+- **[gotchas.md](gotchas.md)** - Common issues, debugging, performance, security
+
+## Quick Start
+
+Cloudflare Realtime SFU: WebRTC infrastructure on global network (310+ cities). Anycast routing, no regional constraints, pub/sub model.
+
+**Core concepts:**
+
+- **Sessions:** WebRTC PeerConnection to Cloudflare edge
+- **Tracks:** Audio/video/data channels you publish or subscribe to
+- **No rooms:** Build presence layer yourself via track sharing (see patterns.md)
+
+**Mental model:** Your client establishes one WebRTC session, publishes tracks (audio/video), shares track IDs via your backend, others subscribe to your tracks using track IDs + your session ID.
+
+## Choose Your Approach
+
+| Approach | When to Use | Complexity |
+| --------------- | -------------------------------------------- | ---------------------------------------------- |
+| **PartyTracks** | Production apps with device switching, React | Low - Observable-based, handles reconnections |
+| **Raw API** | Custom requirements, non-browser, learning | Medium - Full control, manual WebRTC lifecycle |
+| **RealtimeKit** | End-to-end SDK with UI components | Lowest - Managed state, React hooks |
+
+**Recommendation:** Start with PartyTracks for most production applications. See patterns.md for PartyTracks examples.
+
+## SFU vs RealtimeKit
+
+- **Realtime SFU:** WebRTC infrastructure (this reference). Build your own signaling, presence, UI.
+- **RealtimeKit:** SDK layer on top of SFU. Includes React hooks, state management, UI components. Part of Cloudflare AI platform.
+
+Use SFU directly when you need custom signaling or non-React framework. Use RealtimeKit for faster development with React.
+
+## Setup
+
+Dashboard: https://dash.cloudflare.com/?to=/:account/calls
+
+Get `CALLS_APP_ID` and `CALLS_APP_SECRET` from dashboard, then see configuration.md for deployment.
+
+## See Also
+
+- [Orange Meets Demo](https://demo.orange.cloudflare.dev/)
+- [Orange Source](https://github.com/cloudflare/orange)
+- [Calls Examples](https://github.com/cloudflare/calls-examples)
+- [API Reference](https://developers.cloudflare.com/api/resources/calls/)
+- [RealtimeKit Docs](https://developers.cloudflare.com/realtime/realtimekit/)
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/realtime-sfu/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/realtime-sfu/api.md
new file mode 100644
index 0000000..8ae695a
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/realtime-sfu/api.md
@@ -0,0 +1,164 @@
+# API Reference
+
+## Authentication
+
+```bash
+curl -X POST 'https://rtc.live/v1/apps/${CALLS_APP_ID}/sessions/new' \
+ -H "Authorization: Bearer ${CALLS_APP_SECRET}"
+```
+
+## Core Concepts
+
+**Sessions:** PeerConnection to Cloudflare edge
+**Tracks:** Media/data channels (audio/video/datachannel)
+**No rooms:** Build presence via track sharing
+
+## Client Libraries
+
+**PartyTracks (Recommended):** Observable-based client library for production use. Handles device changes, network switches, ICE restarts automatically. Push/pull API with React hooks. See patterns.md for full examples.
+
+```bash
+npm install partytracks @cloudflare/calls
+```
+
+**Raw API:** Direct HTTP + WebRTC for custom requirements (documented below).
+
+## Endpoints
+
+### Create Session
+
+```http
+POST /v1/apps/{appId}/sessions/new
+→ {sessionId, sessionDescription}
+```
+
+### Add Track (Publish)
+
+```http
+POST /v1/apps/{appId}/sessions/{sessionId}/tracks/new
+Body: {
+ sessionDescription: {sdp, type: "offer"},
+ tracks: [{location: "local", trackName: "my-video"}]
+}
+→ {sessionDescription, tracks: [{trackName}]}
+```
+
+### Add Track (Subscribe)
+
+```http
+POST /v1/apps/{appId}/sessions/{sessionId}/tracks/new
+Body: {
+ tracks: [{
+ location: "remote",
+ trackName: "remote-track-id",
+ sessionId: "other-session-id"
+ }]
+}
+→ {sessionDescription} (server offer)
+```
+
+### Renegotiate
+
+```http
+PUT /v1/apps/{appId}/sessions/{sessionId}/renegotiate
+Body: {sessionDescription: {sdp, type: "answer"}}
+```
+
+### Close Tracks
+
+```http
+PUT /v1/apps/{appId}/sessions/{sessionId}/tracks/close
+Body: {tracks: [{trackName}]}
+→ {requiresImmediateRenegotiation: boolean}
+```
+
+### Get Session
+
+```http
+GET /v1/apps/{appId}/sessions/{sessionId}
+→ {sessionId, tracks: TrackMetadata[]}
+```
+
+## TypeScript Types
+
+```typescript
+interface TrackMetadata {
+ trackName: string;
+ location: 'local' | 'remote';
+ sessionId?: string; // For remote tracks
+ mid?: string; // WebRTC mid
+}
+```
+
+## WebRTC Flow
+
+```typescript
+// 1. Create PeerConnection
+const pc = new RTCPeerConnection({
+ iceServers: [{ urls: 'stun:stun.cloudflare.com:3478' }]
+});
+
+// 2. Add tracks
+const stream = await navigator.mediaDevices.getUserMedia({ video: true, audio: true });
+stream.getTracks().forEach((track) => pc.addTrack(track, stream));
+
+// 3. Create offer
+const offer = await pc.createOffer();
+await pc.setLocalDescription(offer);
+
+// 4. Send to backend → Cloudflare API
+const response = await fetch('/api/new-session', {
+ method: 'POST',
+ body: JSON.stringify({ sdp: offer.sdp })
+});
+
+// 5. Set remote answer
+const { sessionDescription } = await response.json();
+await pc.setRemoteDescription(sessionDescription);
+```
+
+## Publishing
+
+```typescript
+const offer = await pc.createOffer();
+await pc.setLocalDescription(offer);
+
+const res = await fetch(`/api/sessions/${sessionId}/tracks`, {
+ method: 'POST',
+ body: JSON.stringify({
+ sdp: offer.sdp,
+ tracks: [{ location: 'local', trackName: 'my-video' }]
+ })
+});
+
+const { sessionDescription, tracks } = await res.json();
+await pc.setRemoteDescription(sessionDescription);
+const publishedTrackId = tracks[0].trackName; // Share with others
+```
+
+## Subscribing
+
+```typescript
+const res = await fetch(`/api/sessions/${sessionId}/tracks`, {
+ method: 'POST',
+ body: JSON.stringify({
+ tracks: [{ location: 'remote', trackName: remoteTrackId, sessionId: remoteSessionId }]
+ })
+});
+
+const { sessionDescription } = await res.json();
+await pc.setRemoteDescription(sessionDescription);
+
+const answer = await pc.createAnswer();
+await pc.setLocalDescription(answer);
+
+await fetch(`/api/sessions/${sessionId}/renegotiate`, {
+ method: 'PUT',
+ body: JSON.stringify({ sdp: answer.sdp })
+});
+
+pc.ontrack = (event) => {
+ const [remoteStream] = event.streams;
+ videoElement.srcObject = remoteStream;
+};
+```
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/realtime-sfu/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/realtime-sfu/configuration.md
new file mode 100644
index 0000000..ff0992a
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/realtime-sfu/configuration.md
@@ -0,0 +1,141 @@
+# Configuration & Deployment
+
+## Dashboard Setup
+
+1. Navigate to https://dash.cloudflare.com/?to=/:account/calls
+2. Click "Create Application" (or use existing app)
+3. Copy `CALLS_APP_ID` from dashboard
+4. Generate and copy `CALLS_APP_SECRET` (treat as sensitive credential)
+5. Use credentials in Wrangler config or environment variables below
+
+## Dependencies
+
+**Backend (Workers):** Built-in fetch API, no additional packages required
+
+**Client (PartyTracks):**
+
+```bash
+npm install partytracks @cloudflare/calls
+```
+
+**Client (React + PartyTracks):**
+
+```bash
+npm install partytracks @cloudflare/calls observable-hooks
+# Observable hooks: useObservableAsValue, useValueAsObservable
+```
+
+**Client (Raw API):** Native browser WebRTC API only
+
+## Wrangler Setup
+
+```jsonc
+{
+ "name": "my-calls-app",
+ "main": "src/index.ts",
+ "compatibility_date": "2025-01-01", // Use current date for new projects
+ "vars": {
+ "CALLS_APP_ID": "your-app-id",
+ "MAX_WEBCAM_BITRATE": "1200000",
+ "MAX_WEBCAM_FRAMERATE": "24",
+ "MAX_WEBCAM_QUALITY_LEVEL": "1080"
+ },
+ // Set secret: wrangler secret put CALLS_APP_SECRET
+ "durable_objects": {
+ "bindings": [
+ {
+ "name": "ROOM",
+ "class_name": "Room"
+ }
+ ]
+ }
+}
+```
+
+## Deploy
+
+```bash
+wrangler login
+wrangler secret put CALLS_APP_SECRET
+wrangler deploy
+```
+
+## Environment Variables
+
+**Required:**
+
+- `CALLS_APP_ID`: From dashboard
+- `CALLS_APP_SECRET`: From dashboard (secret)
+
+**Optional:**
+
+- `MAX_WEBCAM_BITRATE` (default: 1200000)
+- `MAX_WEBCAM_FRAMERATE` (default: 24)
+- `MAX_WEBCAM_QUALITY_LEVEL` (default: 1080)
+- `TURN_SERVICE_ID`: TURN service
+- `TURN_SERVICE_TOKEN`: TURN auth (secret)
+
+## TURN Configuration
+
+```javascript
+const pc = new RTCPeerConnection({
+ iceServers: [
+ { urls: 'stun:stun.cloudflare.com:3478' },
+ {
+ urls: [
+ 'turn:turn.cloudflare.com:3478?transport=udp',
+ 'turn:turn.cloudflare.com:3478?transport=tcp',
+ 'turns:turn.cloudflare.com:5349?transport=tcp'
+ ],
+ username: turnUsername,
+ credential: turnCredential
+ }
+ ],
+ bundlePolicy: 'max-bundle', // Recommended: reduces overhead
+ iceTransportPolicy: 'all' // Use 'relay' to force TURN (testing only)
+});
+```
+
+**Ports:** 3478 (UDP/TCP), 53 (UDP), 80 (TCP), 443 (TLS), 5349 (TLS)
+
+**When to use TURN:** Required for restrictive corporate firewalls/networks that block UDP. ~5-10% of connections fallback to TURN. STUN works for most users.
+
+**ICE candidate filtering:** Cloudflare handles candidate filtering automatically. No need to manually filter candidates.
+
+## Durable Object Boilerplate
+
+Minimal presence system:
+
+```typescript
+export class Room {
+ private sessions = new Map();
+
+ async fetch(req: Request) {
+ const { pathname } = new URL(req.url);
+ const body = await req.json();
+
+ if (pathname === '/join') {
+ this.sessions.set(body.sessionId, { userId: body.userId, tracks: [] });
+ return Response.json({ participants: this.sessions.size });
+ }
+
+ if (pathname === '/publish') {
+ this.sessions.get(body.sessionId)?.tracks.push(...body.tracks);
+ // Broadcast to others via WebSocket (not shown)
+ return new Response('OK');
+ }
+
+ return new Response('Not found', { status: 404 });
+ }
+}
+```
+
+## Environment Validation
+
+Check credentials before first API call:
+
+```typescript
+if (!env.CALLS_APP_ID || !env.CALLS_APP_SECRET) {
+ throw new Error('CALLS_APP_ID and CALLS_APP_SECRET required');
+}
+```
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/realtime-sfu/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/realtime-sfu/gotchas.md
new file mode 100644
index 0000000..4b5863f
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/realtime-sfu/gotchas.md
@@ -0,0 +1,138 @@
+# Gotchas & Troubleshooting
+
+## Common Errors
+
+### "Slow initial connect (~1.8s)"
+
+**Cause:** First STUN delayed during consensus forming (normal behavior)
+**Solution:** Subsequent connections are faster. CF detects DTLS ClientHello early to compensate.
+
+### "No media flow"
+
+**Cause:** SDP exchange incomplete, connection not established, tracks not added before offer, browser permissions missing
+**Solution:**
+
+1. Verify SDP exchange complete
+2. Check `pc.connectionState === 'connected'`
+3. Ensure tracks added before creating offer
+4. Confirm browser permissions granted
+5. Use `chrome://webrtc-internals` for debugging
+
+### "Track not receiving"
+
+**Cause:** Track not published, track ID not shared, session IDs mismatch, `pc.ontrack` not set, renegotiation needed
+**Solution:**
+
+1. Verify track published successfully
+2. Confirm track ID shared between peers
+3. Check session IDs match
+4. Set `pc.ontrack` handler before answer
+5. Trigger renegotiation if needed
+
+### "ICE connection failed"
+
+**Cause:** Network changed, firewall blocked UDP, TURN needed, transient network issue
+**Solution:**
+
+```typescript
+pc.oniceconnectionstatechange = async () => {
+ if (pc.iceConnectionState === 'failed') {
+ console.warn('ICE failed, attempting restart');
+ await pc.restartIce(); // Triggers new ICE gathering
+
+ // Create new offer with ICE restart flag
+ const offer = await pc.createOffer({ iceRestart: true });
+ await pc.setLocalDescription(offer);
+
+ // Send to backend → Cloudflare API
+ await fetch(`/api/sessions/${sessionId}/renegotiate`, {
+ method: 'PUT',
+ body: JSON.stringify({ sdp: offer.sdp })
+ });
+ }
+};
+```
+
+### "Track stuck/frozen"
+
+**Cause:** Sender paused track, network congestion, codec mismatch, mobile browser backgrounded
+**Solution:**
+
+1. Check `track.enabled` and `track.readyState === 'live'`
+2. Verify sender active: `pc.getSenders().find(s => s.track === track)`
+3. Check stats for packet loss/jitter (see patterns.md)
+4. On mobile: Re-acquire tracks when app foregrounded
+5. Test with different codecs if persistent
+
+### "Network change disconnects call"
+
+**Cause:** Mobile switching WiFi↔cellular, laptop changing networks
+**Solution:**
+
+```typescript
+// Listen for network changes
+if ('connection' in navigator) {
+ (navigator as any).connection.addEventListener('change', async () => {
+ console.log('Network changed');
+ await pc.restartIce(); // Use ICE restart pattern above
+ });
+}
+
+// Or use PartyTracks (handles automatically)
+```
+
+## Retry with Exponential Backoff
+
+```typescript
+async function fetchWithRetry(url: string, options: RequestInit, maxRetries = 3) {
+ for (let i = 0; i < maxRetries; i++) {
+ try {
+ const res = await fetch(url, options);
+ if (res.ok) return res;
+ if (res.status >= 500) throw new Error('Server error');
+ return res; // Client error, don't retry
+ } catch (err) {
+ if (i === maxRetries - 1) throw err;
+ const delay = Math.min(1000 * 2 ** i, 10000); // Cap at 10s
+ await new Promise((resolve) => setTimeout(resolve, delay));
+ }
+ }
+}
+```
+
+## Debugging with chrome://webrtc-internals
+
+1. Open `chrome://webrtc-internals` in Chrome/Edge
+2. Find your PeerConnection in the list
+3. Check **Stats graphs** for packet loss, jitter, bandwidth
+4. Check **ICE candidate pairs**: Look for `succeeded` state, relay vs host candidates
+5. Check **getStats**: Raw metrics for inbound/outbound RTP
+6. Look for errors in **Event log**: `iceConnectionState`, `connectionState` changes
+7. Export data with "Download the PeerConnection updates and stats data" button
+8. Common issues visible here: ICE failures, high packet loss, bitrate drops
+
+## Limits
+
+| Resource/Limit | Value | Notes |
+| ------------------ | -------------- | --------------------------------------------------- |
+| Egress (Free) | 1TB/month | Per account |
+| Egress (Paid) | $0.05/GB | After free tier |
+| Inbound traffic | Free | All plans |
+| TURN service | Free | Included with SFU |
+| Participants | No hard limit | Client bandwidth/CPU bound (typically 10-50 tracks) |
+| Tracks per session | No hard limit | Client resources limited |
+| Session duration | No hard limit | Production calls run for hours |
+| WebRTC ports | UDP 1024-65535 | Outbound only, required for media |
+| API rate limit | 600 req/min | Per app, burst allowed |
+
+## Security Checklist
+
+- ✅ **Never expose** `CALLS_APP_SECRET` to client
+- ✅ **Validate user identity** in backend before creating sessions
+- ✅ **Implement auth tokens** for session access (JWT in custom header)
+- ✅ **Rate limit** session creation endpoints
+- ✅ **Expire sessions** server-side after inactivity
+- ✅ **Validate track IDs** before subscribing (prevent unauthorized access)
+- ✅ **Use HTTPS** for all signaling (API calls)
+- ✅ **Enable DTLS-SRTP** (automatic with Cloudflare, encrypts media)
+- ⚠️ **Consider E2EE** for sensitive content (implement client-side with Insertable Streams API)
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/realtime-sfu/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/realtime-sfu/patterns.md
new file mode 100644
index 0000000..7ad5f96
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/realtime-sfu/patterns.md
@@ -0,0 +1,187 @@
+# Patterns & Use Cases
+
+## Architecture
+
+```
+Client (WebRTC) <---> CF Edge <---> Backend (HTTP)
+ |
+ CF Backbone (310+ DCs)
+ |
+ Other Edges <---> Other Clients
+```
+
+Anycast: Last-mile <50ms (95%), no region select, NACK shield, distributed consensus
+
+Cascading trees auto-scale to millions:
+
+```
+Publisher -> Edge A -> Edge B -> Sub1
+ \-> Edge C -> Sub2,3
+```
+
+## Use Cases
+
+**1:1:** A creates session+publishes, B creates+subscribes to A+publishes, A subscribes to B
+**N:N:** All create session+publish, backend broadcasts track IDs, all subscribe to others
+**1:N:** Publisher creates+publishes, viewers each create+subscribe (no fan-out limit)
+**Breakout:** Same PeerConnection! Backend closes/adds tracks, no recreation
+
+## PartyTracks (Recommended)
+
+Observable-based client with automatic device/network handling:
+
+```typescript
+import {PartyTracks} from 'partytracks';
+
+// Create client
+const pt = new PartyTracks({
+ apiUrl: '/api/calls',
+ sessionId: 'my-session',
+ onTrack: (track, peer) => {
+ const video = document.getElementById(`video-${peer.id}`) as HTMLVideoElement;
+ video.srcObject = new MediaStream([track]);
+ }
+});
+
+// Publish camera (push API)
+const camera = await pt.getCamera(); // Auto-requests permissions, handles device changes
+await pt.publishTrack(camera, {trackName: 'my-camera'});
+
+// Subscribe to remote track (pull API)
+await pt.subscribeToTrack({trackName: 'remote-camera', sessionId: 'other-session'});
+
+// React hook example
+import {useObservableAsValue} from 'observable-hooks';
+
+function VideoCall() {
+ const localTracks = useObservableAsValue(pt.localTracks$);
+ const remoteTracks = useObservableAsValue(pt.remoteTracks$);
+
+ return
{/* Render tracks */}
;
+}
+
+// Screenshare
+const screen = await pt.getScreenshare();
+await pt.publishTrack(screen, {trackName: 'my-screen'});
+
+// Handle device changes (automatic)
+// PartyTracks detects device changes (e.g., Bluetooth headset) and renegotiates
+```
+
+## Backend
+
+Express:
+
+```js
+app.post('/api/new-session', async (req, res) => {
+ const r = await fetch(`${CALLS_API}/apps/${process.env.CALLS_APP_ID}/sessions/new`, {
+ method: 'POST',
+ headers: { Authorization: `Bearer ${process.env.CALLS_APP_SECRET}` }
+ });
+ res.json(await r.json());
+});
+```
+
+Workers: Same pattern, use `env.CALLS_APP_ID` and `env.CALLS_APP_SECRET`
+
+DO Presence: See configuration.md for boilerplate
+
+## Audio Level Detection
+
+```typescript
+// Attach analyzer to audio track
+function attachAudioLevelDetector(track: MediaStreamTrack) {
+ const ctx = new AudioContext();
+ const analyzer = ctx.createAnalyser();
+ const src = ctx.createMediaStreamSource(new MediaStream([track]));
+ src.connect(analyzer);
+
+ const data = new Uint8Array(analyzer.frequencyBinCount);
+ const checkLevel = () => {
+ analyzer.getByteFrequencyData(data);
+ const level = data.reduce((a, b) => a + b) / data.length;
+ if (level > 30) console.log('Speaking:', level); // Trigger UI update
+ requestAnimationFrame(checkLevel);
+ };
+ checkLevel();
+}
+```
+
+## Connection Quality Monitoring
+
+```typescript
+pc.getStats().then((stats) => {
+ stats.forEach((report) => {
+ if (report.type === 'inbound-rtp' && report.kind === 'video') {
+ const { packetsLost, packetsReceived, jitter } = report;
+ const lossRate = packetsLost / (packetsLost + packetsReceived);
+ if (lossRate > 0.05) console.warn('High packet loss:', lossRate);
+ if (jitter > 100) console.warn('High jitter:', jitter);
+ }
+ });
+});
+```
+
+## Stage Management (Limit Visible Participants)
+
+```typescript
+// Subscribe to top 6 active speakers only
+let activeSubscriptions = new Set();
+
+function updateStage(topSpeakers: string[]) {
+ const toAdd = topSpeakers.filter((id) => !activeSubscriptions.has(id)).slice(0, 6);
+ const toRemove = [...activeSubscriptions].filter((id) => !topSpeakers.includes(id));
+
+ toRemove.forEach((id) => {
+ pc.getSenders()
+ .find((s) => s.track?.id === id)
+ ?.track?.stop();
+ activeSubscriptions.delete(id);
+ });
+
+ toAdd.forEach(async (id) => {
+ await fetch(`/api/subscribe`, { method: 'POST', body: JSON.stringify({ trackId: id }) });
+ activeSubscriptions.add(id);
+ });
+}
+```
+
+## Advanced
+
+Bandwidth mgmt:
+
+```ts
+const s = pc.getSenders().find((s) => s.track?.kind === 'video');
+const p = s.getParameters();
+if (!p.encodings) p.encodings = [{}];
+p.encodings[0].maxBitrate = 1200000;
+p.encodings[0].maxFramerate = 24;
+await s.setParameters(p);
+```
+
+Simulcast (CF auto-forwards best layer):
+
+```ts
+pc.addTransceiver('video', {
+ direction: 'sendonly',
+ sendEncodings: [
+ { rid: 'high', maxBitrate: 1200000 },
+ { rid: 'med', maxBitrate: 600000, scaleResolutionDownBy: 2 },
+ { rid: 'low', maxBitrate: 200000, scaleResolutionDownBy: 4 }
+ ]
+});
+```
+
+DataChannel:
+
+```ts
+const dc = pc.createDataChannel('chat', { ordered: true, maxRetransmits: 3 });
+dc.onopen = () => dc.send(JSON.stringify({ type: 'chat', text: 'Hi' }));
+dc.onmessage = (e) => console.log('RX:', JSON.parse(e.data));
+```
+
+**WHIP/WHEP:** For streaming interop (OBS → SFU, SFU → video players), use WHIP (ingest) and WHEP (egress) protocols. See Cloudflare Stream integration docs.
+
+Integrations: R2 for recording `env.R2_BUCKET.put(...)`, Queues for analytics
+
+Perf: 100-250ms connect, ~50ms latency (95%), 200-400ms glass-to-glass, no participant limit (client: 10-50 tracks)
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/realtimekit/README.md b/.agents/plugins/cloudflare/skills/cloudflare/references/realtimekit/README.md
new file mode 100644
index 0000000..5f27e70
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/realtimekit/README.md
@@ -0,0 +1,118 @@
+# Cloudflare RealtimeKit
+
+Expert guidance for building real-time video and audio applications using **Cloudflare RealtimeKit** - a comprehensive SDK suite for adding customizable live video and voice to web or mobile applications.
+
+## Overview
+
+RealtimeKit is Cloudflare's SDK suite built on Realtime SFU, abstracting WebRTC complexity with fast integration, pre-built UI components, global performance (300+ cities), and production features (recording, transcription, chat, polls).
+
+**Use cases**: Team meetings, webinars, social video, audio calls, interactive plugins
+
+## Core Concepts
+
+- **App**: Workspace grouping meetings, participants, presets, recordings. Use separate Apps for staging/production
+- **Meeting**: Re-usable virtual room. Each join creates new **Session**
+- **Session**: Live meeting instance. Created on first join, ends after last leave
+- **Participant**: User added via REST API. Returns `authToken` for client SDK. **Do not reuse tokens**
+- **Preset**: Reusable permission/UI template (permissions, meeting type, theme). Applied at participant creation
+- **Peer ID** (`id`): Unique per session, changes on rejoin
+- **Participant ID** (`userId`): Persistent across sessions
+
+## Quick Start
+
+### 1. Create App & Meeting (Backend)
+
+```bash
+# Create app
+curl -X POST 'https://api.cloudflare.com/client/v4/accounts//realtime/kit/apps' \
+ -H 'Authorization: Bearer ' \
+ -d '{"name": "My RealtimeKit App"}'
+
+# Create meeting
+curl -X POST 'https://api.cloudflare.com/client/v4/accounts//realtime/kit//meetings' \
+ -H 'Authorization: Bearer ' \
+ -d '{"title": "Team Standup"}'
+
+# Add participant
+curl -X POST 'https://api.cloudflare.com/client/v4/accounts//realtime/kit//meetings//participants' \
+ -H 'Authorization: Bearer ' \
+ -d '{"name": "Alice", "preset_name": "host"}'
+# Returns: { authToken }
+```
+
+### 2. Client Integration
+
+**React**:
+
+```tsx
+import { RtkMeeting } from '@cloudflare/realtimekit-react-ui';
+
+function App() {
+ return {}} />;
+}
+```
+
+**Core SDK**:
+
+```typescript
+import RealtimeKitClient from '@cloudflare/realtimekit';
+
+const meeting = new RealtimeKitClient({ authToken: '', video: true, audio: true });
+await meeting.join();
+```
+
+## Reading Order
+
+| Task | Files |
+| ----------------- | ----------------------- |
+| Quick integration | README only |
+| Custom UI | README → patterns → api |
+| Backend setup | README → configuration |
+| Debug issues | gotchas |
+| Advanced features | patterns → api |
+
+## RealtimeKit vs Realtime SFU
+
+| Choose | When |
+| ---------------- | ------------------------------------------------------- |
+| **RealtimeKit** | Need pre-built UI, fast integration, React/Angular/HTML |
+| **Realtime SFU** | Building from scratch, custom WebRTC, full control |
+
+RealtimeKit is built on Realtime SFU but abstracts WebRTC complexity with UI components and SDKs.
+
+## Which Package?
+
+Need pre-built meeting UI?
+
+- React → `@cloudflare/realtimekit-react-ui` (``)
+- Angular → `@cloudflare/realtimekit-angular-ui`
+- HTML/Vanilla → `@cloudflare/realtimekit-ui`
+
+Need custom UI?
+
+- Core SDK → `@cloudflare/realtimekit` (RealtimeKitClient) - full control
+
+Need raw WebRTC control?
+
+- See `realtime-sfu/` reference
+
+## In This Reference
+
+- [Configuration](./configuration.md) - Setup, installation, wrangler config
+- [API](./api.md) - Meeting object, REST API, SDK methods
+- [Patterns](./patterns.md) - Common workflows, code examples
+- [Gotchas](./gotchas.md) - Common issues, troubleshooting
+
+## See Also
+
+- [Workers](https://developers.cloudflare.com/workers/) - Backend integration
+- [D1](../d1/) - Meeting metadata storage
+- [R2](../r2/) - Recording storage
+- [KV](../kv/) - Session management
+
+## Reference Links
+
+- **Official Docs**: https://developers.cloudflare.com/realtime/realtimekit/
+- **API Reference**: https://developers.cloudflare.com/api/resources/realtime_kit/
+- **Examples**: https://github.com/cloudflare/realtimekit-web-examples
+- **Dashboard**: https://dash.cloudflare.com/?to=/:account/realtime/kit
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/realtimekit/api.md b/.agents/plugins/cloudflare/skills/cloudflare/references/realtimekit/api.md
new file mode 100644
index 0000000..8b50f1e
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/realtimekit/api.md
@@ -0,0 +1,237 @@
+# RealtimeKit API Reference
+
+Complete API reference for Meeting object, REST endpoints, and SDK methods.
+
+## Meeting Object API
+
+### `meeting.self` - Local Participant
+
+```typescript
+// Properties: id, userId, name, audioEnabled, videoEnabled, screenShareEnabled, audioTrack, videoTrack, screenShareTracks, roomJoined, roomState
+// Methods
+(await meeting.self.enableAudio()) /
+ disableAudio() /
+ enableVideo() /
+ disableVideo() /
+ enableScreenShare() /
+ disableScreenShare();
+await meeting.self.setName('Name'); // Before join only
+await meeting.self.setDevice(device);
+const devices =
+ (await meeting.self.getAllDevices()) /
+ getAudioDevices() /
+ getVideoDevices() /
+ getSpeakerDevices();
+// Events: 'roomJoined', 'audioUpdate', 'videoUpdate', 'screenShareUpdate', 'deviceUpdate', 'deviceListUpdate'
+meeting.self.on('roomJoined', () => {});
+meeting.self.on('audioUpdate', ({ audioEnabled, audioTrack }) => {});
+```
+
+### `meeting.participants` - Remote Participants
+
+**Collections**:
+
+```typescript
+meeting.participants.joined / active / waitlisted / pinned; // Maps
+const participants = meeting.participants.joined.toArray();
+const count = meeting.participants.joined.size();
+const p = meeting.participants.joined.get('peer-id');
+```
+
+**Participant Properties**:
+
+```typescript
+participant.id / userId / name;
+participant.audioEnabled / videoEnabled / screenShareEnabled;
+participant.audioTrack / videoTrack / screenShareTracks;
+```
+
+**Events**:
+
+```typescript
+meeting.participants.joined.on('participantJoined', (participant) => {});
+meeting.participants.joined.on('participantLeft', (participant) => {});
+```
+
+### `meeting.meta` - Metadata
+
+```typescript
+meeting.meta.meetingId / meetingTitle / meetingStartedTimestamp;
+```
+
+### `meeting.chat` - Chat
+
+```typescript
+meeting.chat.messages; // Array
+(await meeting.chat.sendTextMessage('Hello')) / sendImageMessage(file);
+meeting.chat.on('chatUpdate', ({ message, messages }) => {});
+```
+
+### `meeting.polls` - Polling
+
+```typescript
+meeting.polls.items; // Array
+await meeting.polls.create(question, options, anonymous, hideVotes);
+await meeting.polls.vote(pollId, optionIndex);
+```
+
+### `meeting.plugins` - Collaborative Apps
+
+```typescript
+meeting.plugins.all; // Array
+(await meeting.plugins.activate(pluginId)) / deactivate();
+```
+
+### `meeting.ai` - AI Features
+
+```typescript
+meeting.ai.transcripts; // Live transcriptions (when enabled in Preset)
+```
+
+### Core Methods
+
+```typescript
+await meeting.join(); // Emits 'roomJoined' on meeting.self
+await meeting.leave();
+```
+
+## TypeScript Types
+
+```typescript
+import type { RealtimeKitClient, States, UIConfig, Participant } from '@cloudflare/realtimekit';
+
+// Main interface
+interface RealtimeKitClient {
+ self: SelfState; // Local participant (id, userId, name, audioEnabled, videoEnabled, roomJoined, roomState)
+ participants: { joined; active; waitlisted; pinned }; // Reactive Maps
+ chat: ChatNamespace; // messages[], sendTextMessage(), sendImageMessage()
+ polls: PollsNamespace; // items[], create(), vote()
+ plugins: PluginsNamespace; // all[], activate(), deactivate()
+ ai: AINamespace; // transcripts[]
+ meta: MetaState; // meetingId, meetingTitle, meetingStartedTimestamp
+ join(): Promise;
+ leave(): Promise;
+}
+
+// Participant (self & remote share same shape)
+interface Participant {
+ id: string; // Peer ID (changes on rejoin)
+ userId: string; // Persistent participant ID
+ name: string;
+ audioEnabled: boolean;
+ videoEnabled: boolean;
+ screenShareEnabled: boolean;
+ audioTrack: MediaStreamTrack | null;
+ videoTrack: MediaStreamTrack | null;
+ screenShareTracks: MediaStreamTrack[];
+}
+```
+
+## Store Architecture
+
+RealtimeKit uses reactive store (event-driven updates, live Maps):
+
+```typescript
+// Subscribe to state changes
+meeting.self.on('audioUpdate', ({ audioEnabled, audioTrack }) => {});
+meeting.participants.joined.on('participantJoined', (p) => {});
+
+// Access current state synchronously
+const isAudioOn = meeting.self.audioEnabled;
+const count = meeting.participants.joined.size();
+```
+
+**Key principles:** State updates emit events after changes. Use `.toArray()` sparingly. Collections are live Maps.
+
+## REST API
+
+Base: `https://api.cloudflare.com/client/v4/accounts/{account_id}/realtime/kit/{app_id}`
+
+### Meetings
+
+```bash
+GET /meetings # List all
+GET /meetings/{meeting_id} # Get details
+POST /meetings # Create: {"title": "..."}
+PATCH /meetings/{meeting_id} # Update: {"title": "...", "record_on_start": true}
+```
+
+### Participants
+
+```bash
+GET /meetings/{meeting_id}/participants # List all
+GET /meetings/{meeting_id}/participants/{participant_id} # Get details
+POST /meetings/{meeting_id}/participants # Add: {"name": "...", "preset_name": "...", "custom_participant_id": "..."}
+PATCH /meetings/{meeting_id}/participants/{participant_id} # Update: {"name": "...", "preset_name": "..."}
+DELETE /meetings/{meeting_id}/participants/{participant_id} # Delete
+POST /meetings/{meeting_id}/participants/{participant_id}/token # Refresh token
+```
+
+### Active Session
+
+```bash
+GET /meetings/{meeting_id}/active-session # Get active session
+POST /meetings/{meeting_id}/active-session/kick # Kick users: {"user_ids": ["id1", "id2"]}
+POST /meetings/{meeting_id}/active-session/kick-all # Kick all
+POST /meetings/{meeting_id}/active-session/poll # Create poll: {"question": "...", "options": [...], "anonymous": false}
+```
+
+### Recording
+
+```bash
+GET /recordings?meeting_id={meeting_id} # List recordings
+GET /recordings/active-recording/{meeting_id} # Get active recording
+POST /recordings # Start: {"meeting_id": "...", "type": "composite"} (or "track")
+PUT /recordings/{recording_id} # Control: {"action": "pause"} (or "resume", "stop")
+POST /recordings/track # Track recording: {"meeting_id": "...", "layers": [...]}
+```
+
+### Livestreaming
+
+```bash
+GET /livestreams?exclude_meetings=false # List all
+GET /livestreams/{livestream_id} # Get details
+POST /meetings/{meeting_id}/livestreams # Start for meeting
+POST /meetings/{meeting_id}/active-livestream/stop # Stop
+POST /livestreams # Create independent: returns {ingest_server, stream_key, playback_url}
+```
+
+### Sessions & Analytics
+
+```bash
+GET /sessions # List all
+GET /sessions/{session_id} # Get details
+GET /sessions/{session_id}/participants # List participants
+GET /sessions/{session_id}/participants/{participant_id} # Call stats
+GET /sessions/{session_id}/chat # Download chat CSV
+GET /sessions/{session_id}/transcript # Download transcript CSV
+GET /sessions/{session_id}/summary # Get summary
+POST /sessions/{session_id}/summary # Generate summary
+GET /analytics/daywise?start_date=YYYY-MM-DD&end_date=YYYY-MM-DD # Day-wise analytics
+GET /analytics/livestreams/overall # Livestream analytics
+```
+
+### Webhooks
+
+```bash
+GET /webhooks # List all
+POST /webhooks # Create: {"url": "https://...", "events": ["session.started", "session.ended"]}
+PATCH /webhooks/{webhook_id} # Update
+DELETE /webhooks/{webhook_id} # Delete
+```
+
+## Session Lifecycle
+
+```
+Initialization → Join Intent → [Waitlist?] → Meeting Screen (Stage) → Ended
+ ↓ Approved
+ [Rejected → Ended]
+```
+
+UI Kit handles state transitions automatically.
+
+## See Also
+
+- [Configuration](./configuration.md) - Setup and installation
+- [Patterns](./patterns.md) - Usage examples
+- [README](./README.md) - Overview and quick start
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/realtimekit/configuration.md b/.agents/plugins/cloudflare/skills/cloudflare/references/realtimekit/configuration.md
new file mode 100644
index 0000000..110a585
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/realtimekit/configuration.md
@@ -0,0 +1,226 @@
+# RealtimeKit Configuration
+
+Configuration guide for RealtimeKit setup, client SDKs, and wrangler integration.
+
+## Installation
+
+### React
+
+```bash
+npm install @cloudflare/realtimekit @cloudflare/realtimekit-react-ui
+```
+
+### Angular
+
+```bash
+npm install @cloudflare/realtimekit @cloudflare/realtimekit-angular-ui
+```
+
+### Web Components/HTML
+
+```bash
+npm install @cloudflare/realtimekit @cloudflare/realtimekit-ui
+```
+
+## Client SDK Configuration
+
+### React UI Kit
+
+```tsx
+import { RtkMeeting } from '@cloudflare/realtimekit-react-ui';
+ {}} />;
+```
+
+### Angular UI Kit
+
+```typescript
+@Component({
+ template: ``
+})
+export class AppComponent {
+ authToken = '';
+ onLeave() {}
+}
+```
+
+### Web Components
+
+```html
+
+
+
+```
+
+### Core SDK Configuration
+
+```typescript
+import RealtimeKitClient from '@cloudflare/realtimekit';
+
+const meeting = new RealtimeKitClient({
+ authToken: '',
+ video: true,
+ audio: true,
+ autoSwitchAudioDevice: true,
+ mediaConfiguration: {
+ video: { width: { ideal: 1280 }, height: { ideal: 720 }, frameRate: { ideal: 30 } },
+ audio: { echoCancellation: true, noiseSuppression: true, autoGainControl: true },
+ screenshare: { width: { max: 1920 }, height: { max: 1080 }, frameRate: { ideal: 15 } }
+ }
+});
+await meeting.join();
+```
+
+## Backend Setup
+
+### Create App & Credentials
+
+**Dashboard**: https://dash.cloudflare.com/?to=/:account/realtime/kit
+
+**API**:
+
+```bash
+curl -X POST 'https://api.cloudflare.com/client/v4/accounts//realtime/kit/apps' \
+ -H 'Content-Type: application/json' \
+ -H 'Authorization: Bearer ' \
+ -d '{"name": "My RealtimeKit App"}'
+```
+
+**Required Permissions**: API token with **Realtime / Realtime Admin** permissions
+
+### Create Presets
+
+```bash
+curl -X POST 'https://api.cloudflare.com/client/v4/accounts//realtime/kit//presets' \
+ -H 'Authorization: Bearer ' \
+ -d '{
+ "name": "host",
+ "permissions": {
+ "canShareAudio": true,
+ "canShareVideo": true,
+ "canRecord": true,
+ "canLivestream": true,
+ "canStartStopRecording": true
+ }
+ }'
+```
+
+## Wrangler Configuration
+
+### Basic Configuration
+
+```jsonc
+// wrangler.jsonc
+{
+ "name": "realtimekit-app",
+ "main": "src/index.ts",
+ "compatibility_date": "2025-01-01", // Use current date
+ "vars": {
+ "CLOUDFLARE_ACCOUNT_ID": "abc123",
+ "REALTIMEKIT_APP_ID": "xyz789"
+ }
+ // Secrets: wrangler secret put CLOUDFLARE_API_TOKEN
+}
+```
+
+### With Database & Storage
+
+```jsonc
+{
+ "d1_databases": [{ "binding": "DB", "database_name": "meetings", "database_id": "d1-id" }],
+ "r2_buckets": [{ "binding": "RECORDINGS", "bucket_name": "recordings" }],
+ "kv_namespaces": [{ "binding": "SESSIONS", "id": "kv-id" }]
+}
+```
+
+### Multi-Environment
+
+```bash
+# Deploy to environments
+wrangler deploy --env staging
+wrangler deploy --env production
+```
+
+## TURN Service Configuration
+
+RealtimeKit can use Cloudflare's TURN service for connectivity through restrictive networks:
+
+```jsonc
+// wrangler.jsonc
+{
+ "vars": {
+ "TURN_SERVICE_ID": "your_turn_service_id"
+ }
+ // Set secret: wrangler secret put TURN_SERVICE_TOKEN
+}
+```
+
+TURN automatically configured when enabled in account - no client-side changes needed.
+
+## Theming & Design Tokens
+
+```typescript
+import type { UIConfig } from '@cloudflare/realtimekit';
+
+const uiConfig: UIConfig = {
+ designTokens: {
+ colors: {
+ brand: { 500: '#0066ff', 600: '#0052cc' },
+ background: { 1000: '#1A1A1A', 900: '#2D2D2D' },
+ text: { 1000: '#FFFFFF', 900: '#E0E0E0' }
+ },
+ borderRadius: 'extra-rounded', // 'rounded' | 'extra-rounded' | 'sharp'
+ theme: 'dark' // 'light' | 'dark'
+ },
+ logo: { url: 'https://example.com/logo.png', altText: 'Company' }
+};
+
+// Apply to React
+ {}} />
+
+// Or use CSS variables
+// :root { --rtk-color-brand-500: #0066ff; --rtk-border-radius: 12px; }
+```
+
+## Internationalization (i18n)
+
+### Custom Language Strings
+
+```typescript
+import { useLanguage } from '@cloudflare/realtimekit-ui';
+
+const customLanguage = {
+ 'join': 'Entrar',
+ 'leave': 'Salir',
+ 'mute': 'Silenciar',
+ 'unmute': 'Activar audio',
+ 'turn_on_camera': 'Encender cámara',
+ 'turn_off_camera': 'Apagar cámara',
+ 'share_screen': 'Compartir pantalla',
+ 'stop_sharing': 'Dejar de compartir'
+};
+
+const t = useLanguage(customLanguage);
+
+// React usage
+ {}} />
+```
+
+### Supported Locales
+
+Default locales available: `en`, `es`, `fr`, `de`, `pt`, `ja`, `zh`
+
+```typescript
+import { setLocale } from '@cloudflare/realtimekit-ui';
+setLocale('es'); // Switch to Spanish
+```
+
+## See Also
+
+- [API](./api.md) - Meeting APIs, REST endpoints
+- [Patterns](./patterns.md) - Backend integration examples
+- [README](./README.md) - Overview and quick start
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/realtimekit/gotchas.md b/.agents/plugins/cloudflare/skills/cloudflare/references/realtimekit/gotchas.md
new file mode 100644
index 0000000..61065d3
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/realtimekit/gotchas.md
@@ -0,0 +1,206 @@
+# RealtimeKit Gotchas & Troubleshooting
+
+## Common Errors
+
+### "Cannot connect to meeting"
+
+**Cause:** Auth token invalid/expired, API credentials lack permissions, or network blocks WebRTC
+**Solution:**
+Verify token validity, check API token has **Realtime / Realtime Admin** permissions, enable TURN service for restrictive networks
+
+### "No video/audio tracks"
+
+**Cause:** Browser permissions not granted, video/audio not enabled, device in use, or device unavailable
+**Solution:**
+Request browser permissions explicitly, verify initialization config, use `meeting.self.getAllDevices()` to debug, close other apps using device
+
+### "Participant count mismatched"
+
+**Cause:** `meeting.participants` doesn't include `meeting.self`
+**Solution:** Total count = `meeting.participants.joined.size() + 1`
+
+### "Events not firing"
+
+**Cause:** Listeners registered after actions, incorrect event name, or wrong namespace
+**Solution:**
+Register listeners before calling `meeting.join()`, check event names against docs, verify correct namespace
+
+### "CORS errors in API calls"
+
+**Cause:** Making REST API calls from client-side
+**Solution:** All REST API calls **must** be server-side (Workers, backend). Never expose API tokens to clients.
+
+### "Preset not applying"
+
+**Cause:** Preset doesn't exist, name mismatch (case-sensitive), or participant created before preset
+**Solution:**
+Verify preset exists via Dashboard or API, check exact spelling and case, create preset before adding participants
+
+### "Token reuse error"
+
+**Cause:** Reusing participant tokens across sessions
+**Solution:** Generate fresh token per session. Use refresh endpoint if token expires during session.
+
+### "Video quality poor"
+
+**Cause:** Insufficient bandwidth, resolution/bitrate too high, or CPU overload
+**Solution:**
+Lower `mediaConfiguration.video` resolution/frameRate, monitor network conditions, reduce participant count or grid size
+
+### "Echo or audio feedback"
+
+**Cause:** Multiple devices picking up same audio source
+**Solution:**
+
+- Lower `mediaConfiguration.video` resolution/frameRate
+- Monitor network conditions
+- Reduce participant count or grid size
+
+### Issue: Echo or audio feedback
+
+**Cause**: Multiple devices picking up same audio source
+
+**Solutions**:
+Enable `echoCancellation: true` in `mediaConfiguration.audio`, use headphones, mute when not speaking
+
+### "Screen share not working"
+
+**Cause:** Browser doesn't support screen sharing API, permission denied, or wrong `displaySurface` config
+**Solution:**
+Use Chrome/Edge/Firefox (Safari limited support), check browser permissions, try different `displaySurface` values ('window', 'monitor', 'browser')
+
+### "How do I schedule meetings?"
+
+**Cause:** RealtimeKit has no built-in scheduling system
+**Solution:**
+Store meeting IDs in your database with timestamps. Generate participant tokens only when user should join. Example:
+
+```typescript
+// Store in DB
+{ meetingId: 'abc123', scheduledFor: '2026-02-15T10:00:00Z', userId: 'user456' }
+
+// Generate token when user clicks "Join" near scheduled time
+const response = await fetch('/api/join-meeting', {
+ method: 'POST',
+ body: JSON.stringify({ meetingId: 'abc123' })
+});
+const { authToken } = await response.json();
+```
+
+### "Recording not starting"
+
+**Cause:** Preset lacks recording permissions, no active session, or API call from client
+**Solution:**
+Verify preset has `canRecord: true` and `canStartStopRecording: true`, ensure session is active (at least one participant), make recording API calls server-side only
+
+## Limits
+
+| Resource | Limit |
+| ------------------------------- | ------------------ |
+| Max participants per session | 100 |
+| Max concurrent sessions per App | 1000 |
+| Max recording duration | 6 hours |
+| Max meeting duration | 24 hours |
+| Max chat message length | 4000 characters |
+| Max preset name length | 64 characters |
+| Max meeting title length | 256 characters |
+| Max participant name length | 256 characters |
+| Token expiration | 24 hours (default) |
+| WebRTC ports required | UDP 1024-65535 |
+
+## Network Requirements
+
+### Firewall Rules
+
+Allow outbound UDP/TCP to:
+
+- `*.cloudflare.com` ports 443, 80
+- UDP ports 1024-65535 (WebRTC media)
+
+### TURN Service
+
+Enable for users behind restrictive firewalls/proxies:
+
+```jsonc
+// wrangler.jsonc
+{
+ "vars": {
+ "TURN_SERVICE_ID": "your_turn_service_id"
+ }
+ // Set secret: wrangler secret put TURN_SERVICE_TOKEN
+}
+```
+
+TURN automatically configured in SDK when enabled in account.
+
+## Debugging Tips
+
+```typescript
+// Check devices
+const devices = await meeting.self.getAllDevices();
+meeting.self.on('deviceListUpdate', ({ added, removed, devices }) =>
+ console.log('Devices:', { added, removed, devices })
+);
+
+// Monitor participants
+meeting.participants.joined.on('participantJoined', (p) =>
+ console.log(`${p.name} joined:`, {
+ id: p.id,
+ userId: p.userId,
+ audioEnabled: p.audioEnabled,
+ videoEnabled: p.videoEnabled
+ })
+);
+
+// Check room state
+meeting.self.on('roomJoined', () =>
+ console.log('Room:', {
+ meetingId: meeting.meta.meetingId,
+ meetingTitle: meeting.meta.meetingTitle,
+ participantCount: meeting.participants.joined.size() + 1,
+ audioEnabled: meeting.self.audioEnabled,
+ videoEnabled: meeting.self.videoEnabled
+ })
+);
+
+// Log all events
+[
+ 'roomJoined',
+ 'audioUpdate',
+ 'videoUpdate',
+ 'screenShareUpdate',
+ 'deviceUpdate',
+ 'deviceListUpdate'
+].forEach((event) => meeting.self.on(event, (data) => console.log(`[self] ${event}:`, data)));
+['participantJoined', 'participantLeft'].forEach((event) =>
+ meeting.participants.joined.on(event, (data) => console.log(`[participants] ${event}:`, data))
+);
+meeting.chat.on('chatUpdate', (data) => console.log('[chat] chatUpdate:', data));
+```
+
+## Security & Performance
+
+### Security: Do NOT
+
+- Expose `CLOUDFLARE_API_TOKEN` in client code, hardcode credentials in frontend
+- Reuse participant tokens, store tokens in localStorage without encryption
+- Allow client-side meeting creation
+
+### Security: DO
+
+- Generate tokens server-side only, use HTTPS, implement rate limiting
+- Validate user auth before generating tokens, use `custom_participant_id` to map to your user system
+- Set appropriate preset permissions per user role, rotate API tokens regularly
+
+### Performance
+
+- **CPU**: Lower video resolution/frameRate, disable video for audio-only, use `meeting.participants.active` for large meetings, implement virtual scrolling
+- **Bandwidth**: Set max resolution in `mediaConfiguration`, disable screenshare audio if unneeded, use audio-only mode, implement adaptive bitrate
+- **Memory**: Clean up event listeners on unmount, call `meeting.leave()` when done, don't store large participant arrays
+
+## In This Reference
+
+- [README.md](README.md) - Overview, core concepts, quick start
+- [configuration.md](configuration.md) - SDK config, presets, wrangler setup
+- [api.md](api.md) - Client SDK APIs, REST endpoints
+- [patterns.md](patterns.md) - Common patterns, React hooks, backend integration
diff --git a/.agents/plugins/cloudflare/skills/cloudflare/references/realtimekit/patterns.md b/.agents/plugins/cloudflare/skills/cloudflare/references/realtimekit/patterns.md
new file mode 100644
index 0000000..d6f6e2a
--- /dev/null
+++ b/.agents/plugins/cloudflare/skills/cloudflare/references/realtimekit/patterns.md
@@ -0,0 +1,240 @@
+# RealtimeKit Patterns
+
+## UI Kit (Minimal Code)
+
+```tsx
+// React
+import { RtkMeeting } from '@cloudflare/realtimekit-react-ui';
+ console.log('Left')} />
+
+// Angular
+@Component({ template: `` })
+export class AppComponent { authToken = ''; onLeave(event: unknown) {} }
+
+// HTML/Web Components
+
+
+
+```
+
+## UI Components
+
+RealtimeKit provides 133+ pre-built Stencil.js Web Components with framework wrappers:
+
+### Layout Components
+
+- `` - Full meeting UI (all-in-one)
+- ``, ``, `` - Layout sections
+- `` - Chat/participants sidebar
+- `` - Adaptive video grid
+
+### Control Components
+
+- ``, `` - Media controls
+- `` - Screen sharing
+- `` - Leave meeting
+- `` - Device settings
+
+### Grid Variants
+
+- `` - Active speaker focus
+- `` - Audio-only mode
+- `` - Paginated layout
+
+**See full catalog**: https://docs.realtime.cloudflare.com/ui-kit
+
+## Core SDK Patterns
+
+### Basic Setup
+
+```typescript
+import RealtimeKitClient from '@cloudflare/realtimekit';
+
+const meeting = new RealtimeKitClient({ authToken, video: true, audio: true });
+meeting.self.on('roomJoined', () => console.log('Joined:', meeting.meta.meetingTitle));
+meeting.participants.joined.on('participantJoined', (p) => console.log(`${p.name} joined`));
+await meeting.join();
+```
+
+### Video Grid & Device Selection
+
+```typescript
+// Video grid
+function VideoGrid({ meeting }) {
+ const [participants, setParticipants] = useState([]);
+ useEffect(() => {
+ const update = () => setParticipants(meeting.participants.joined.toArray());
+ meeting.participants.joined.on('participantJoined', update);
+ meeting.participants.joined.on('participantLeft', update);
+ update();
+ return () => { meeting.participants.joined.off('participantJoined', update); meeting.participants.joined.off('participantLeft', update); };
+ }, [meeting]);
+ return