@vesviet/agent-skills 5.6.0 → 5.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/INDEX.md +1 -1
  2. package/README.md +1 -1
  3. package/VERSION +1 -1
  4. package/adapters/antigravity/a2a-config.template.yaml +1 -1
  5. package/adapters/antigravity/role-skill-index.json +1 -1
  6. package/adapters/claude/CLAUDE_ADAPTER.md +1 -1
  7. package/adapters/cursor/README.md +185 -185
  8. package/bin/agent-skills.mjs +17 -14
  9. package/core/contracts/schemas/api-contract-spec.json +191 -191
  10. package/core/contracts/schemas/feature-ticket.json +1293 -1293
  11. package/core/contracts/schemas/pull-request-spec.json +338 -338
  12. package/core/contracts/schemas/references/detailed/01-solution-and-governance.md +19 -19
  13. package/core/contracts/schemas/references/detailed/02-engineering-delivery.md +93 -93
  14. package/core/contracts/schemas/references/detailed/04-finance-accounting-and-compliance.md +54 -54
  15. package/core/contracts/schemas/references/detailed/05-design-and-content.md +92 -92
  16. package/core/contracts/schemas/references/detailed/06-seo-and-publishing.md +48 -48
  17. package/core/contracts/schemas/references/detailed/07-a2a-protocol.md +85 -85
  18. package/core/contracts/schemas/test-report.json +530 -530
  19. package/core/roles/references/business-analyst-responsibilities.md +207 -207
  20. package/core/roles/references/frontend-developer-responsibilities.md +275 -275
  21. package/core/roles/system-engineer.md +465 -465
  22. package/core/skills/agent/agent-memory-compaction/references/anchored-schema-and-compaction-algorithms.md +141 -141
  23. package/core/skills/backend/build-mcp-server/SKILL.md +100 -100
  24. package/core/skills/backend/implement-structured-outputs/SKILL.md +94 -94
  25. package/core/skills/business/elicit-requirements/SKILL.md +102 -102
  26. package/core/skills/business/elicit-requirements/references/elicitation-techniques-and-babok-criteria.md +60 -60
  27. package/core/skills/business/trace-requirements-impact/SKILL.md +97 -97
  28. package/core/skills/business/trace-requirements-impact/references/rtm-graph-and-prioritization-models.md +109 -109
  29. package/core/skills/business/write-use-cases/SKILL.md +106 -106
  30. package/core/skills/business/write-use-cases/references/cockburn-scoping-and-13-field-template.md +135 -135
  31. package/core/skills/document/pptx/scripts/add_slide.py +0 -0
  32. package/core/skills/document/pptx/scripts/clean.py +0 -0
  33. package/core/skills/document/pptx/scripts/thumbnail.py +0 -0
  34. package/core/skills/document/xlsx/scripts/recalc.py +0 -0
  35. package/core/skills/documentation/write-documentation/SKILL.md +143 -143
  36. package/core/skills/documentation/write-tech-radar/SKILL.md +149 -149
  37. package/core/skills/foundation/accessibility-review/SKILL.md +160 -160
  38. package/core/skills/foundation/release-notes/SKILL.md +192 -192
  39. package/core/skills/foundation/webapp-server-runner/scripts/with_server.py +0 -0
  40. package/core/skills/foundation/write-product-brief/SKILL.md +160 -160
  41. package/core/skills/platform/cloudflare-email-service/SKILL.md +166 -166
  42. package/core/skills/platform/cloudflare-email-service/references/routing.md +199 -199
  43. package/core/skills/platform/debug-workers-edge/SKILL.md +111 -111
  44. package/core/skills/platform/sandbox-sdk/SKILL.md +183 -183
  45. package/core/skills/platform/setup-gpu-finops/SKILL.md +107 -107
  46. package/core/skills/platform/setup-llm-gateway/SKILL.md +108 -108
  47. package/core/skills/platform/turnstile-spin/SKILL.md +118 -118
  48. package/core/skills/platform/turnstile-spin/scripts/auth-probe.sh +0 -0
  49. package/core/skills/platform/turnstile-spin/scripts/fetch-secret.sh +0 -0
  50. package/core/skills/platform/turnstile-spin/scripts/persist-skill.sh +0 -0
  51. package/core/skills/platform/turnstile-spin/scripts/validate.sh +0 -0
  52. package/core/skills/platform/turnstile-spin/scripts/widget-create.sh +0 -0
  53. package/core/skills/platform/turnstile-spin/scripts/worker-deploy.sh +0 -0
  54. package/core/skills/platform/turnstile-spin/templates/worker/src/index.ts +199 -199
  55. package/core/skills/platform/turnstile-spin/templates/worker/wrangler.toml +31 -31
  56. package/core/skills/platform/web-perf/SKILL.md +151 -151
  57. package/core/skills/platform/workers-best-practices/references/rules.md +463 -463
  58. package/core/skills/product/build-story-map/SKILL.md +104 -104
  59. package/core/skills/product/build-story-map/references/story-mapping-and-cpm-scheduling.md +101 -101
  60. package/core/skills/product/define-product-strategy/SKILL.md +105 -105
  61. package/core/skills/product/define-product-strategy/references/strategy-frameworks-and-pr-faq.md +142 -142
  62. package/core/skills/product/model-saas-metrics/SKILL.md +104 -104
  63. package/core/skills/product/model-saas-metrics/references/saas-unit-economics-and-pricing.md +110 -110
  64. package/core/skills/product/prioritize-roadmap/SKILL.md +106 -106
  65. package/core/skills/product/prioritize-roadmap/references/prioritization-scoring-and-kill-criteria.md +105 -105
  66. package/core/skills/repo-ops/commit-code/SKILL.md +190 -190
  67. package/core/skills/repo-ops/commit-code/references/multi-repo-and-deployment.md +21 -21
  68. package/core/skills/repo-ops/navigate-service/SKILL.md +199 -199
  69. package/core/skills/repo-ops/review-code/references/process-and-format.md +100 -100
  70. package/core/skills/repo-ops/review-service/SKILL.md +186 -186
  71. package/core/skills/repo-ops/troubleshoot-service/SKILL.md +127 -127
  72. package/core/skills/repo-ops/troubleshoot-service/references/failure-modes-and-security.md +22 -22
  73. package/core/skills/repo-ops/troubleshoot-service/references/suggested-process.md +110 -110
  74. package/core/skills/security-data/security-audit/SKILL.md +119 -119
  75. package/core/workflows/add-new-feature.md +212 -212
  76. package/core/workflows/agent-a2a-delegation.md +142 -142
  77. package/core/workflows/bug-fix.md +147 -147
  78. package/core/workflows/build-deploy.md +208 -208
  79. package/core/workflows/code-review.md +137 -137
  80. package/core/workflows/dependency-upgrade.md +193 -193
  81. package/core/workflows/feature-delivery.md +149 -149
  82. package/core/workflows/hotfix-production.md +172 -172
  83. package/core/workflows/qa-validation.md +231 -231
  84. package/core/workflows/refactoring.md +154 -154
  85. package/core/workflows/revert-deployment.md +147 -147
  86. package/core/workflows/security-incident-response.md +191 -191
  87. package/core/workflows/seo-content-lifecycle.md +91 -91
  88. package/core/workflows/service-review-release.md +223 -223
  89. package/core/workflows/setup-new-service.md +214 -214
  90. package/core/workflows/tech-repo-review.md +245 -245
  91. package/core/workflows/troubleshooting.md +241 -241
  92. package/overlays/astro-cloudflare/README.md +93 -93
  93. package/overlays/data-analyst-stack/README.md +109 -109
  94. package/overlays/data-analyst-stack/rules/metric-dashboard-templates.md +135 -135
  95. package/overlays/data-analyst-stack/rules/stack-conventions.md +80 -80
  96. package/overlays/ecommerce-microservices/README.md +65 -65
  97. package/overlays/go-microservices/README.md +78 -78
  98. package/overlays/go-microservices/rules/go-conventions.md +223 -223
  99. package/overlays/laravel-filament/README.md +90 -90
  100. package/overlays/laravel-filament/rules/laravel-conventions.md +220 -220
  101. package/overlays/laravel-filament/skills/develop-laravel-feature/SKILL.md +141 -141
  102. package/overlays/laravel-filament/workflows/deploy-laravel.md +133 -133
  103. package/overlays/obj-configurator/rules/obj-project-rules.md +111 -111
  104. package/overlays/obj-configurator/skills/develop-obj-feature/SKILL.md +71 -71
  105. package/overlays/r3f-stack/README.md +89 -89
  106. package/overlays/r3f-stack/rules/stub.md +43 -43
  107. package/overlays/r3f-stack/skills/debug-3d-scene/SKILL.md +166 -166
  108. package/overlays/r3f-stack/skills/integrate-r3f-three-legacy/SKILL.md +159 -159
  109. package/overlays/r3f-stack/skills/optimize-3d-assets/SKILL.md +128 -128
  110. package/overlays/seo-publishing/rules/site-mix-and-cannibalization.md +52 -52
  111. package/overlays/ui-design-system/rules/handoff-conventions.md +73 -73
  112. package/package.json +2 -2
  113. package/core/README.md +0 -53
@@ -1,166 +1,166 @@
1
- ---
2
- name: cloudflare-email-service
3
- description: Send and receive transactional emails with Cloudflare Email Service (Email Sending + Email Routing). Use when building email sending (Workers binding or REST API), email routing, Agents SDK email handling, or integrating email into any app — Workers, Node.js, Python, Go, etc. Also use for email deliverability, SPF/DKIM/DMARC, wrangler email setup, MCP email tools, or when a coding agent needs to send emails. Even for simple requests like "add email to my Worker" — this skill has critical config details.
4
- allowed-tools: [read_file, write_file, edit_file, create_file, search_code, run_tests, run_linter, run_build, wrangler_deploy, execute_command]
5
- ---
6
-
7
- # Cloudflare Email Service
8
-
9
- 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.
10
-
11
- 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.
12
-
13
- **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.
14
-
15
- ## Retrieval Sources
16
-
17
- | Source | How to retrieve | Use for |
18
- |--------|----------------|---------|
19
- | Cloudflare docs | `cloudflare-docs` search tool or URL `https://developers.cloudflare.com/email-service/` | API reference, limits, pricing, latest features |
20
- | REST API spec | `https://developers.cloudflare.com/api/resources/email_sending` | OpenAPI spec for the Email Sending REST API |
21
- | Workers types | `https://www.npmjs.com/package/@cloudflare/workers-types` | Type signatures, binding shapes |
22
- | Agents SDK docs | Fetch `docs/email.md` from `https://github.com/cloudflare/agents/tree/main/docs` | Email handling in Agents SDK |
23
-
24
- ## FIRST: Check Prerequisites
25
-
26
- Before writing any email code, verify the basics are in place:
27
-
28
- 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.
29
- 2. **Binding configured?** Look for `send_email` in `wrangler.jsonc` (for Workers)
30
- 3. **postal-mime installed?** Run `npm ls postal-mime` (only needed for receiving/parsing emails)
31
-
32
- ## What Do You Need?
33
-
34
- Start here. Find your situation, then follow the link for full details.
35
-
36
- | I want to... | Path | Reference |
37
- |--------------|------|-----------|
38
- | **Send emails from a Cloudflare Worker** | Workers binding (no API keys needed) | [sending.md](references/sending.md) |
39
- | **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) |
40
- | **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) |
41
- | **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) |
42
- | **Receive and process incoming emails** (Email Routing) | Workers `email()` handler | [routing.md](references/routing.md) |
43
- | **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) |
44
- | **Improve deliverability, avoid spam folders** | Authentication, content, compliance | [deliverability.md](references/deliverability.md) |
45
-
46
- ## Quick Start — Workers Binding
47
-
48
- Add the binding to `wrangler.jsonc`, then call `env.EMAIL.send()`. The `from` domain must be onboarded via `npx wrangler email sending enable yourdomain.com`.
49
-
50
- ```jsonc
51
- // wrangler.jsonc
52
- { "send_email": [{ "name": "EMAIL" }] }
53
- ```
54
-
55
- ```typescript
56
- const response = await env.EMAIL.send({
57
- to: "user@example.com",
58
- from: { email: "welcome@yourdomain.com", name: "My App" },
59
- subject: "Welcome!",
60
- html: "<h1>Welcome!</h1>",
61
- text: "Welcome!",
62
- });
63
- ```
64
-
65
- The binding is recommended for Workers — no API keys needed. If a user specifically requests the REST API from within a Worker (e.g., they already have an API token workflow), that works too — see [rest-api.md](references/rest-api.md).
66
-
67
- See [sending.md](references/sending.md) for the full API, batch sends, attachments, custom headers, restricted bindings, and Agents SDK integration.
68
-
69
- ## Quick Start — REST API
70
-
71
- For apps outside Workers, or within Workers if the user explicitly requests it. Key differences from the Workers binding:
72
-
73
- - Endpoint: `POST https://api.cloudflare.com/client/v4/accounts/{account_id}/email/sending/send`
74
- - `from` object uses `address` (not `email`): `{ "address": "...", "name": "..." }`
75
- - `replyTo` is `reply_to` (snake_case)
76
- - Response returns `{ delivered: [], permanent_bounces: [], queued: [] }` (not `messageId`)
77
-
78
- See [rest-api.md](references/rest-api.md) for curl examples, response format, and error handling.
79
-
80
- ## Common Mistakes
81
-
82
- | Mistake | Why It Happens | Fix |
83
- |---------|---------------|-----|
84
- | Forgetting `send_email` binding in wrangler config | Email Service uses a binding, not an API key | Add `"send_email": [{ "name": "EMAIL" }]` to wrangler.jsonc |
85
- | 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 |
86
- | 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()` |
87
- | Missing `text` field (HTML only) | Some email clients only show plain text; also helps spam scores | Always include both `html` and `text` versions |
88
- | Using email for marketing/bulk sends | Email Service is for transactional email only | Use a dedicated marketing email platform for newsletters and campaigns |
89
- | Forwarding to unverified destinations | `message.forward()` only works with verified addresses | Run `wrangler email routing addresses create user@gmail.com` or add in Dashboard |
90
- | Testing with fake addresses | Bounces from non-existent addresses hurt sender reputation | Use real addresses you control during development |
91
- | Hardcoding API tokens in source code | Tokens in code get committed and leaked | Use environment variables or Cloudflare secrets |
92
- | 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` |
93
- | 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 |
94
- | Using `replyTo` in REST API | REST API uses snake_case field names | Use `reply_to` for REST API, `replyTo` for Workers binding |
95
-
96
- ## References
97
-
98
- Read the reference that matches your situation. You don't need all of them.
99
-
100
- - **[references/sending.md](references/sending.md)** — Workers binding API, attachments, Agents SDK email. For Workers or Agents SDK.
101
- - **[references/rest-api.md](references/rest-api.md)** — REST endpoint, curl examples, error handling. For apps NOT on Workers.
102
- - **[references/routing.md](references/routing.md)** — Inbound `email()` handler, forwarding, replying, parsing. For receiving emails.
103
- - **[references/cli-and-mcp.md](references/cli-and-mcp.md)** — Domain setup, wrangler commands, MCP tools. For first-time setup.
104
- - **[references/deliverability.md](references/deliverability.md)** — SPF/DKIM/DMARC, bounces, suppressions, best practices.
105
-
106
- ## When to Use
107
-
108
- - sending transactional email from a Worker/app
109
- - configuring Email Routing or Agents SDK email
110
- - setting up SPF/DKIM/DMARC deliverability
111
- - wrangler email binding or REST API setup
112
-
113
- ## Core Rules
114
- - Serve transactional emails only (do not use for bulk/marketing sends).
115
- - Verify the sender domain via wrangler CLI or the Cloudflare Dashboard before sending.
116
- - Never expose API tokens in source code or commit local env files.
117
- - Read `message.raw` only once in receiving handlers (the stream is single-use).
118
- - **REST-API-FROM-KEY**: REST API uses `address` (not `email`) in the `from` object and `reply_to` (snake_case) — Worker binding uses `email` (camelCase) and `replyTo`; mixing these causes silent validation failures.
119
- - **DKIM-SPF-DMARC-BEFORE-PROD**: Do NOT send production emails until SPF, DKIM, and DMARC records are verified in Cloudflare Dashboard; missing DKIM causes high spam rate and blocks delivery to major providers (Gmail, Yahoo, Outlook enforce DMARC p=reject).
120
- - **BOUNCE-SUPPRESSION-HYGIENE**: Implement bounce webhook processing; hard-bounced addresses must be added to suppression lists within 24 hours — providers track sender reputation and a >2% bounce rate triggers deliverability degradation.
121
-
122
- ## Suggested Process
123
- 1. Onboard the sending domain in Cloudflare (via Dashboard or Wrangler CLI).
124
- 2. Configure wrangler.jsonc or API token variables for the application environment.
125
- 3. Write client sending logic using standard binding call or REST endpoint.
126
- 4. Implement incoming email routes and handlers if receiving is needed.
127
- 5. Run local dev tests and check compatibility parameters.
128
-
129
- ## Checklist
130
- - [ ] Sending domain is verified and active on Cloudflare.
131
- - [ ] Secret API keys are stored in secure variables or environment files.
132
- - [ ] Email templates include both HTML and plain-text fallbacks.
133
- - [ ] Destination routing addresses are verified if forwarding emails.
134
- - [ ] Smoke tests are run successfully to confirm message delivery.
135
-
136
- ## Output Contracts
137
-
138
- When this skill is invoked as part of a coordinated multi-role delivery, emit:
139
-
140
- - **contracts/schemas/deployment-plan.json** — Required fields: infrastructure_changes[], config_updates[], and
141
- alidation_run. Set produced_by_role to the emitting developer role.
142
-
143
- Skip emission for solo refactor work where no downstream handoff is expected.
144
-
145
- ## Failure Modes
146
-
147
- - **Unverified sender domain**: a Worker or app sends from a domain not onboarded to Email Sending. Mitigation: run `wrangler email sending list` before deploy; reject unverified senders at CI.
148
- - **Missing SPF/DKIM/DMARC**: production emails are sent without authentication records. Mitigation: enforce DKIM + SPF + DMARC verification in the dashboard before any prod send; DMARC `p=reject` is required by Gmail, Yahoo, Outlook.
149
- - **High bounce rate**: hard bounces are not added to suppression lists within 24 hours. Mitigation: implement bounce webhook processing; alert when bounce rate > 2%.
150
- - **API token in source code**: an API token is hardcoded in a Worker or committed file. Mitigation: use `wrangler secret put` or environment variables; lint the repo for token patterns.
151
- - **REST API field drift**: the REST `from` object uses `email` instead of `address`, or `replyTo` instead of `reply_to`. Mitigation: copy field names from the REST spec; CI must reject the Worker-binding field names in REST calls.
152
- - **Single-use stream re-read**: `message.raw` is read twice in a receiving handler, returning empty on the second read. Mitigation: buffer first: `const raw = await new Response(message.raw).arrayBuffer()`.
153
- - **HTML-only email**: a template ships without a plain-text fallback. Mitigation: always include both `html` and `text`; spam scores improve with both.
154
- - **Marketing email sent via Email Service**: bulk or newsletter email is routed through Cloudflare Email Service. Mitigation: Email Service is transactional-only; use a dedicated marketing platform for campaigns.
155
-
156
- ## Security Guardrails (OWASP ASI)
157
-
158
- - **ASI03 Identity & Privilege Abuse**: never embed API tokens in source code or commit local env files; use `wrangler secret put` and CI secret scanning.
159
- - **ASI04 Supply Chain**: validate the Email Service client library against the expected manifest; treat unknown versions as untrusted.
160
- - **ASI05 RCE Guard**: never construct email content, headers, or templates from external or user-supplied content without sanitization; treat HTML as a hostile surface.
161
- - **ASI07 Inter-Agent Communication**: the deployment plan is consumed by DevOps and SRE roles; emit a structured contract so each role can validate the rollout.
162
- - **ASI09 Human-Agent Trust Exploitation**: do not present an email flow as "deliverability-ready" without DKIM/SPF/DMARC verification; surface the actual auth status.
163
-
164
- ## Related Skills
165
- - **wrangler**: Manage bindings and CLI environments.
166
- - **debug-workers-edge**: Troubleshoot edge runtime exceptions.
1
+ ---
2
+ name: cloudflare-email-service
3
+ description: Send and receive transactional emails with Cloudflare Email Service (Email Sending + Email Routing). Use when building email sending (Workers binding or REST API), email routing, Agents SDK email handling, or integrating email into any app — Workers, Node.js, Python, Go, etc. Also use for email deliverability, SPF/DKIM/DMARC, wrangler email setup, MCP email tools, or when a coding agent needs to send emails. Even for simple requests like "add email to my Worker" — this skill has critical config details.
4
+ allowed-tools: [read_file, write_file, edit_file, create_file, search_code, run_tests, run_linter, run_build, wrangler_deploy, execute_command]
5
+ ---
6
+
7
+ # Cloudflare Email Service
8
+
9
+ 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.
10
+
11
+ 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.
12
+
13
+ **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.
14
+
15
+ ## Retrieval Sources
16
+
17
+ | Source | How to retrieve | Use for |
18
+ |--------|----------------|---------|
19
+ | Cloudflare docs | `cloudflare-docs` search tool or URL `https://developers.cloudflare.com/email-service/` | API reference, limits, pricing, latest features |
20
+ | REST API spec | `https://developers.cloudflare.com/api/resources/email_sending` | OpenAPI spec for the Email Sending REST API |
21
+ | Workers types | `https://www.npmjs.com/package/@cloudflare/workers-types` | Type signatures, binding shapes |
22
+ | Agents SDK docs | Fetch `docs/email.md` from `https://github.com/cloudflare/agents/tree/main/docs` | Email handling in Agents SDK |
23
+
24
+ ## FIRST: Check Prerequisites
25
+
26
+ Before writing any email code, verify the basics are in place:
27
+
28
+ 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.
29
+ 2. **Binding configured?** Look for `send_email` in `wrangler.jsonc` (for Workers)
30
+ 3. **postal-mime installed?** Run `npm ls postal-mime` (only needed for receiving/parsing emails)
31
+
32
+ ## What Do You Need?
33
+
34
+ Start here. Find your situation, then follow the link for full details.
35
+
36
+ | I want to... | Path | Reference |
37
+ |--------------|------|-----------|
38
+ | **Send emails from a Cloudflare Worker** | Workers binding (no API keys needed) | [sending.md](references/sending.md) |
39
+ | **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) |
40
+ | **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) |
41
+ | **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) |
42
+ | **Receive and process incoming emails** (Email Routing) | Workers `email()` handler | [routing.md](references/routing.md) |
43
+ | **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) |
44
+ | **Improve deliverability, avoid spam folders** | Authentication, content, compliance | [deliverability.md](references/deliverability.md) |
45
+
46
+ ## Quick Start — Workers Binding
47
+
48
+ Add the binding to `wrangler.jsonc`, then call `env.EMAIL.send()`. The `from` domain must be onboarded via `npx wrangler email sending enable yourdomain.com`.
49
+
50
+ ```jsonc
51
+ // wrangler.jsonc
52
+ { "send_email": [{ "name": "EMAIL" }] }
53
+ ```
54
+
55
+ ```typescript
56
+ const response = await env.EMAIL.send({
57
+ to: "user@example.com",
58
+ from: { email: "welcome@yourdomain.com", name: "My App" },
59
+ subject: "Welcome!",
60
+ html: "<h1>Welcome!</h1>",
61
+ text: "Welcome!",
62
+ });
63
+ ```
64
+
65
+ The binding is recommended for Workers — no API keys needed. If a user specifically requests the REST API from within a Worker (e.g., they already have an API token workflow), that works too — see [rest-api.md](references/rest-api.md).
66
+
67
+ See [sending.md](references/sending.md) for the full API, batch sends, attachments, custom headers, restricted bindings, and Agents SDK integration.
68
+
69
+ ## Quick Start — REST API
70
+
71
+ For apps outside Workers, or within Workers if the user explicitly requests it. Key differences from the Workers binding:
72
+
73
+ - Endpoint: `POST https://api.cloudflare.com/client/v4/accounts/{account_id}/email/sending/send`
74
+ - `from` object uses `address` (not `email`): `{ "address": "...", "name": "..." }`
75
+ - `replyTo` is `reply_to` (snake_case)
76
+ - Response returns `{ delivered: [], permanent_bounces: [], queued: [] }` (not `messageId`)
77
+
78
+ See [rest-api.md](references/rest-api.md) for curl examples, response format, and error handling.
79
+
80
+ ## Common Mistakes
81
+
82
+ | Mistake | Why It Happens | Fix |
83
+ |---------|---------------|-----|
84
+ | Forgetting `send_email` binding in wrangler config | Email Service uses a binding, not an API key | Add `"send_email": [{ "name": "EMAIL" }]` to wrangler.jsonc |
85
+ | 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 |
86
+ | 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()` |
87
+ | Missing `text` field (HTML only) | Some email clients only show plain text; also helps spam scores | Always include both `html` and `text` versions |
88
+ | Using email for marketing/bulk sends | Email Service is for transactional email only | Use a dedicated marketing email platform for newsletters and campaigns |
89
+ | Forwarding to unverified destinations | `message.forward()` only works with verified addresses | Run `wrangler email routing addresses create user@gmail.com` or add in Dashboard |
90
+ | Testing with fake addresses | Bounces from non-existent addresses hurt sender reputation | Use real addresses you control during development |
91
+ | Hardcoding API tokens in source code | Tokens in code get committed and leaked | Use environment variables or Cloudflare secrets |
92
+ | 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` |
93
+ | 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 |
94
+ | Using `replyTo` in REST API | REST API uses snake_case field names | Use `reply_to` for REST API, `replyTo` for Workers binding |
95
+
96
+ ## References
97
+
98
+ Read the reference that matches your situation. You don't need all of them.
99
+
100
+ - **[references/sending.md](references/sending.md)** — Workers binding API, attachments, Agents SDK email. For Workers or Agents SDK.
101
+ - **[references/rest-api.md](references/rest-api.md)** — REST endpoint, curl examples, error handling. For apps NOT on Workers.
102
+ - **[references/routing.md](references/routing.md)** — Inbound `email()` handler, forwarding, replying, parsing. For receiving emails.
103
+ - **[references/cli-and-mcp.md](references/cli-and-mcp.md)** — Domain setup, wrangler commands, MCP tools. For first-time setup.
104
+ - **[references/deliverability.md](references/deliverability.md)** — SPF/DKIM/DMARC, bounces, suppressions, best practices.
105
+
106
+ ## When to Use
107
+
108
+ - sending transactional email from a Worker/app
109
+ - configuring Email Routing or Agents SDK email
110
+ - setting up SPF/DKIM/DMARC deliverability
111
+ - wrangler email binding or REST API setup
112
+
113
+ ## Core Rules
114
+ - Serve transactional emails only (do not use for bulk/marketing sends).
115
+ - Verify the sender domain via wrangler CLI or the Cloudflare Dashboard before sending.
116
+ - Never expose API tokens in source code or commit local env files.
117
+ - Read `message.raw` only once in receiving handlers (the stream is single-use).
118
+ - **REST-API-FROM-KEY**: REST API uses `address` (not `email`) in the `from` object and `reply_to` (snake_case) — Worker binding uses `email` (camelCase) and `replyTo`; mixing these causes silent validation failures.
119
+ - **DKIM-SPF-DMARC-BEFORE-PROD**: Do NOT send production emails until SPF, DKIM, and DMARC records are verified in Cloudflare Dashboard; missing DKIM causes high spam rate and blocks delivery to major providers (Gmail, Yahoo, Outlook enforce DMARC p=reject).
120
+ - **BOUNCE-SUPPRESSION-HYGIENE**: Implement bounce webhook processing; hard-bounced addresses must be added to suppression lists within 24 hours — providers track sender reputation and a >2% bounce rate triggers deliverability degradation.
121
+
122
+ ## Suggested Process
123
+ 1. Onboard the sending domain in Cloudflare (via Dashboard or Wrangler CLI).
124
+ 2. Configure wrangler.jsonc or API token variables for the application environment.
125
+ 3. Write client sending logic using standard binding call or REST endpoint.
126
+ 4. Implement incoming email routes and handlers if receiving is needed.
127
+ 5. Run local dev tests and check compatibility parameters.
128
+
129
+ ## Checklist
130
+ - [ ] Sending domain is verified and active on Cloudflare.
131
+ - [ ] Secret API keys are stored in secure variables or environment files.
132
+ - [ ] Email templates include both HTML and plain-text fallbacks.
133
+ - [ ] Destination routing addresses are verified if forwarding emails.
134
+ - [ ] Smoke tests are run successfully to confirm message delivery.
135
+
136
+ ## Output Contracts
137
+
138
+ When this skill is invoked as part of a coordinated multi-role delivery, emit:
139
+
140
+ - **contracts/schemas/deployment-plan.json** — Required fields: infrastructure_changes[], config_updates[], and
141
+ alidation_run. Set produced_by_role to the emitting developer role.
142
+
143
+ Skip emission for solo refactor work where no downstream handoff is expected.
144
+
145
+ ## Failure Modes
146
+
147
+ - **Unverified sender domain**: a Worker or app sends from a domain not onboarded to Email Sending. Mitigation: run `wrangler email sending list` before deploy; reject unverified senders at CI.
148
+ - **Missing SPF/DKIM/DMARC**: production emails are sent without authentication records. Mitigation: enforce DKIM + SPF + DMARC verification in the dashboard before any prod send; DMARC `p=reject` is required by Gmail, Yahoo, Outlook.
149
+ - **High bounce rate**: hard bounces are not added to suppression lists within 24 hours. Mitigation: implement bounce webhook processing; alert when bounce rate > 2%.
150
+ - **API token in source code**: an API token is hardcoded in a Worker or committed file. Mitigation: use `wrangler secret put` or environment variables; lint the repo for token patterns.
151
+ - **REST API field drift**: the REST `from` object uses `email` instead of `address`, or `replyTo` instead of `reply_to`. Mitigation: copy field names from the REST spec; CI must reject the Worker-binding field names in REST calls.
152
+ - **Single-use stream re-read**: `message.raw` is read twice in a receiving handler, returning empty on the second read. Mitigation: buffer first: `const raw = await new Response(message.raw).arrayBuffer()`.
153
+ - **HTML-only email**: a template ships without a plain-text fallback. Mitigation: always include both `html` and `text`; spam scores improve with both.
154
+ - **Marketing email sent via Email Service**: bulk or newsletter email is routed through Cloudflare Email Service. Mitigation: Email Service is transactional-only; use a dedicated marketing platform for campaigns.
155
+
156
+ ## Security Guardrails (OWASP ASI)
157
+
158
+ - **ASI03 Identity & Privilege Abuse**: never embed API tokens in source code or commit local env files; use `wrangler secret put` and CI secret scanning.
159
+ - **ASI04 Supply Chain**: validate the Email Service client library against the expected manifest; treat unknown versions as untrusted.
160
+ - **ASI05 RCE Guard**: never construct email content, headers, or templates from external or user-supplied content without sanitization; treat HTML as a hostile surface.
161
+ - **ASI07 Inter-Agent Communication**: the deployment plan is consumed by DevOps and SRE roles; emit a structured contract so each role can validate the rollout.
162
+ - **ASI09 Human-Agent Trust Exploitation**: do not present an email flow as "deliverability-ready" without DKIM/SPF/DMARC verification; surface the actual auth status.
163
+
164
+ ## Related Skills
165
+ - **wrangler**: Manage bindings and CLI environments.
166
+ - **debug-workers-edge**: Troubleshoot edge runtime exceptions.