[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7819HJJ72Z6AXZH8465FC52":3,"skill-same:01M7819HJJ72Z6AXZH8465FC52":72},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M7819HJJ72Z6AXZH8465FC52","workers-best-practices",null,"Cloudflare Workers best practices for production applications. Use when writing, reviewing, or configuring Workers.","filippolmt\u002Fskills","filippolmt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F61194571?v=4","01M7808VK1A8QF8ZXGT2DWTKHS","Filippo Merante Caparrotta","01M7808VKN74HC3EZMK8EV35KS",1,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Ffilippolmt\u002Fskills\u002Fblob\u002Fmain\u002F.agents\u002Fplugins\u002Fpackages\u002Fworkers-best-practices\u002Fskills\u002Fworkers-best-practices\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Ffilippolmt\u002Fskills\u002Fblob\u002Fmain\u002F.agents\u002Fplugins\u002Fpackages\u002Fworkers-best-practices\u002Fskills\u002Fworkers-best-practices\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: workers-best-practices\ndescription: Cloudflare Workers best practices for production applications. Use when writing, reviewing, or configuring Workers.\n---\n\nYour knowledge of Cloudflare Workers APIs, types, and configuration may be outdated. **Prefer retrieval over pre-training** when writing or reviewing Workers code.\n\nUse the project's installed versions, generated types, and Wrangler compatibility settings as the baseline for existing code. Retrieve relevant Cloudflare documentation to verify API, configuration, runtime behavior, and limit claims.\n\n## References\n\nRead the sections relevant to the task:\n\n| Reference | When to use it |\n|-----------|----------------|\n| [Configuration and observability](references\u002Fconfiguration.md) | Compatibility dates, bindings, generated types, secrets, logs, and traces |\n| [Runtime patterns](references\u002Fruntime-patterns.md) | Streaming, promise lifetime, request state, service calls, security, and runtime tests |\n| [Platform API checks](references\u002Fplatform-apis.md) | Handler signatures, platform classes, binding access, and serialization |\n\nFor missing evidence, consult [Workers best practices](https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fbest-practices\u002Fworkers-best-practices\u002Findex.md) or find the affected product in the [Cloudflare docs directory](https:\u002F\u002Fdevelopers.cloudflare.com\u002Fdirectory\u002Findex.md). Use the installed Wrangler schema for config fields. A newer type package does not supersede the project's configured target.\n\n## Keep Compatibility Dates Current\n\nUse today's date for new Workers. Encourage periodic updates for existing Workers, reviewing compatibility changes and running relevant tests. Assess existing behavior against its configured date and flags; see [compatibility guidance](references\u002Fconfiguration.md#keep-compatibility_date-current).\n\n## Enable Observability\n\nEnable [Workers Logs](https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fobservability\u002Flogs\u002Fworkers-logs\u002Findex.md) and [Traces](https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fobservability\u002Ftraces\u002Findex.md) 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 the [configuration example](references\u002Fconfiguration.md#enable-workers-logs-and-traces).\n\n## Place Compute Near Regional Databases\n\nFor Workers that make multiple sequential queries to one regional database, configure explicit placement matching the database's provider and region before deployment. Ask for missing location information, preserve existing placement choices, and verify handler eligibility and deployed request duration. See [database placement](references\u002Fconfiguration.md#place-compute-near-regional-databases).\n\n## Anti-Patterns to Flag\n\n| Anti-pattern | Consequence and preferred pattern |\n|-------------|-----------------------------------|\n| `await response.text()` or similar buffering on unbounded data | Can exhaust Worker memory; [stream large or unbounded bodies](references\u002Fruntime-patterns.md#stream-request-and-response-bodies). |\n| Hardcoded secrets in source or config | Leaks credentials through version control; use Wrangler secrets. |\n| `Math.random()` for security-sensitive tokens or IDs | Predictable values; use `crypto.randomUUID()` or `crypto.getRandomValues()`. |\n| Async work started without awaiting, returning, or attaching it to `ctx.waitUntil()` | Work can be dropped and errors missed; tie it to the request or background-work lifetime. |\n| Module-level mutable request state | Leaks data across requests and can cause I\u002FO ownership errors; pass request state explicitly. |\n| Cloudflare REST API calls for operations available through Worker bindings | Adds network and authentication overhead; use the available binding. |\n| `ctx.passThroughOnException()` used as general error handling | Can conceal Worker failures by forwarding to the origin; use explicit error handling and structured error responses. |\n| Hand-written `Env` that duplicates Wrangler bindings | Can drift from configuration; generate binding types with `wrangler types`. |\n| Direct string comparison of secret values | Can expose timing differences; use the [Web Crypto comparison pattern](references\u002Fruntime-patterns.md#use-web-crypto-for-secure-token-generation). |\n| Destructuring `ctx` methods, such as `const { waitUntil } = ctx` | Loses the receiver; call `ctx.waitUntil(...)`. |\n| `any` on `Env` or handler parameters | Hides binding and handler contract errors; use the project's generated and platform types. |\n| `as unknown as T` to force a platform type match | Hides incompatibilities; fix the underlying contract. |\n| `implements` used in place of extending a platform base class | Does not inherit runtime behavior, `this.ctx`, or `this.env`; use the appropriate base class. |\n| Unbound `env.X` in a platform class method | Bindings are available through `this.env.X`; see [binding access patterns](references\u002Fplatform-apis.md#binding-access--the-most-common-error). |\n| Applying one serialization rule across Queues, Workflow steps, storage, and WebSockets | Can reject valid payloads or accept unsupported ones; check the [specific API and encoding](references\u002Fplatform-apis.md#serialization-boundaries). |\n\n## Validation\n\nUse the project's existing checks for affected Workers behavior: type-check binding or handler contract changes, and run relevant runtime tests for behavior changes. Preserve required repository checks; a narrow edit does not require a full Workers audit.\n\n## Scope\n\nThis skill covers Workers-specific best practices and code review. For related topics:\n\n- **Durable Objects**: load the `durable-objects` skill\n- **Workflows**: see [Rules of Workflows](https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkflows\u002Fbuild\u002Frules-of-workflows\u002Findex.md)\n- **CLI commands**: load the `cf-cli` skill, or the `wrangler` skill in a project with a Wrangler configuration file\n\n## Skill feedback\n\nIf the user reports that this skill gave incorrect or outdated guidance, or is missing information, read [references\u002Fskill-feedback.md](references\u002Fskill-feedback.md).\n","Your knowledge of Cloudflare Workers APIs, types, and configuration may be outdated. **Prefer retrieval over pre-training** when writing or reviewing Workers code.\n\nUse the project's installed versions, generated types, and Wrangler compatibility settings as the baseline for existing code. Retrieve relevant Cloudflare documentation to verify API, configuration, runtime behavior, and limit claims.\n\n## References\n\nRead the sections relevant to the task:\n\n| Reference | When to use it |\n|-----------|----------------|\n| [Configuration and observability](references\u002Fconfiguration.md) | Compatibility dates, bindings, generated types, secrets, logs, and traces |\n| [Runtime patterns](references\u002Fruntime-patterns.md) | Streaming, promise lifetime, request state, service calls, security, and runtime tests |\n| [Platform API checks](references\u002Fplatform-apis.md) | Handler signatures, platform classes, binding access, and serialization |\n\nFor missing evidence, consult [Workers best practices](https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fbest-practices\u002Fworkers-best-practices\u002Findex.md) or find the affected product in the [Cloudflare docs directory](https:\u002F\u002Fdevelopers.cloudflare.com\u002Fdirectory\u002Findex.md). Use the installed Wrangler schema for config fields. A newer type package does not supersede the project's configured target.\n\n## Keep Compatibility Dates Current\n\nUse today's date for new Workers. Encourage periodic updates for existing Workers, reviewing compatibility changes and running relevant tests. Assess existing behavior against its configured date and flags; see [compatibility guidance](references\u002Fconfiguration.md#keep-compatibility_date-current).\n\n## Enable Observability\n\nEnable [Workers Logs](https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fobservability\u002Flogs\u002Fworkers-logs\u002Findex.md) and [Traces](https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fobservability\u002Ftraces\u002Findex.md) 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 the [configuration example](references\u002Fconfiguration.md#enable-workers-logs-and-traces).\n\n## Place Compute Near Regional Databases\n\nFor Workers that make multiple sequential queries to one regional database, configure explicit placement matching the database's provider and region before deployment. Ask for missing location information, preserve existing placement choices, and verify handler eligibility and deployed request duration. See [database placement](references\u002Fconfiguration.md#place-compute-near-regional-databases).\n\n## Anti-Patterns to Flag\n\n| Anti-pattern | Consequence and preferred pattern |\n|-------------|-----------------------------------|\n| `await response.text()` or similar buffering on unbounded data | Can exhaust Worker memory; [stream large or unbounded bodies](references\u002Fruntime-patterns.md#stream-request-and-response-bodies). |\n| Hardcoded secrets in source or config | Leaks credentials through version control; use Wrangler secrets. |\n| `Math.random()` for security-sensitive tokens or IDs | Predictable values; use `crypto.randomUUID()` or `crypto.getRandomValues()`. |\n| Async work started without awaiting, returning, or attaching it to `ctx.waitUntil()` | Work can be dropped and errors missed; tie it to the request or background-work lifetime. |\n| Module-level mutable request state | Leaks data across requests and can cause I\u002FO ownership errors; pass request state explicitly. |\n| Cloudflare REST API calls for operations available through Worker bindings | Adds network and authentication overhead; use the available binding. |\n| `ctx.passThroughOnException()` used as general error handling | Can conceal Worker failures by forwarding to the origin; use explicit error handling and structured error responses. |\n| Hand-written `Env` that duplicates Wrangler bindings | Can drift from configuration; generate binding types with `wrangler types`. |\n| Direct string comparison of secret values | Can expose timing differences; use the [Web Crypto comparison pattern](references\u002Fruntime-patterns.md#use-web-crypto-for-secure-token-generation). |\n| Destructuring `ctx` methods, such as `const { waitUntil } = ctx` | Loses the receiver; call `ctx.waitUntil(...)`. |\n| `any` on `Env` or handler parameters | Hides binding and handler contract errors; use the project's generated and platform types. |\n| `as unknown as T` to force a platform type match | Hides incompatibilities; fix the underlying contract. |\n| `implements` used in place of extending a platform base class | Does not inherit runtime behavior, `this.ctx`, or `this.env`; use the appropriate base class. |\n| Unbound `env.X` in a platform class method | Bindings are available through `this.env.X`; see [binding access patterns](references\u002Fplatform-apis.md#binding-access--the-most-common-error). |\n| Applying one serialization rule across Queues, Workflow steps, storage, and WebSockets | Can reject valid payloads or accept unsupported ones; check the [specific API and encoding](references\u002Fplatform-apis.md#serialization-boundaries). |\n\n## Validation\n\nUse the project's existing checks for affected Workers behavior: type-check binding or handler contract changes, and run relevant runtime tests for behavior changes. Preserve required repository checks; a narrow edit does not require a full Workers audit.\n\n## Scope\n\nThis skill covers Workers-specific best practices and code review. For related topics:\n\n- **Durable Objects**: load the `durable-objects` skill\n- **Workflows**: see [Rules of Workflows](https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkflows\u002Fbuild\u002Frules-of-workflows\u002Findex.md)\n- **CLI commands**: load the `cf-cli` skill, or the `wrangler` skill in a project with a Wrangler configuration file\n\n## Skill feedback\n\nIf the user reports that this skill gave incorrect or outdated guidance, or is missing information, read [references\u002Fskill-feedback.md](references\u002Fskill-feedback.md).\n",{"name":5,"description":7},"main","e63612d78f9099c1970584ea3faef109f42d20bb",".agents\u002Fplugins\u002Fpackages\u002Fworkers-best-practices\u002Fskills\u002Fworkers-best-practices",0,"https:\u002F\u002Fgithub.com\u002Ffilippolmt\u002Fskills","https:\u002F\u002Fgithub.com\u002Ffilippolmt","2026-11-14 22:46:00",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add filippolmt\u002Fskills --skill workers-best-practices",{"tool":38,"command":39},"bunx","bunx skills add filippolmt\u002Fskills --skill workers-best-practices",{"tool":41,"command":42},"pnpm","pnpm dlx skills add filippolmt\u002Fskills --skill workers-best-practices","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Ffilippolmt\u002Fskills\u002Fblob\u002Fmain\u002F.agents\u002Fplugins\u002Fpackages\u002Fworkers-best-practices\u002Fskills\u002Fworkers-best-practices\u002FSKILL.md",true,[46,50,56,60,64,68],{"path":47,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":16},"LICENSE","许可证",11357,{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"references\u002Fconfiguration.md","REFERENCE","参考文档",6722,"https:\u002F\u002Fgithub.com\u002Ffilippolmt\u002Fskills\u002Fblob\u002Fmain\u002F.agents\u002Fplugins\u002Fpackages\u002Fworkers-best-practices\u002Fskills\u002Fworkers-best-practices\u002Freferences\u002Fconfiguration.md",{"path":57,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Fplatform-apis.md",3876,"https:\u002F\u002Fgithub.com\u002Ffilippolmt\u002Fskills\u002Fblob\u002Fmain\u002F.agents\u002Fplugins\u002Fpackages\u002Fworkers-best-practices\u002Fskills\u002Fworkers-best-practices\u002Freferences\u002Fplatform-apis.md",{"path":61,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":62,"sourceHtmlUrl":63},"references\u002Fruntime-patterns.md",14071,"https:\u002F\u002Fgithub.com\u002Ffilippolmt\u002Fskills\u002Fblob\u002Fmain\u002F.agents\u002Fplugins\u002Fpackages\u002Fworkers-best-practices\u002Fskills\u002Fworkers-best-practices\u002Freferences\u002Fruntime-patterns.md",{"path":65,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":66,"sourceHtmlUrl":67},"references\u002Fskill-feedback.md",2823,"https:\u002F\u002Fgithub.com\u002Ffilippolmt\u002Fskills\u002Fblob\u002Fmain\u002F.agents\u002Fplugins\u002Fpackages\u002Fworkers-best-practices\u002Fskills\u002Fworkers-best-practices\u002Freferences\u002Fskill-feedback.md",{"path":69,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":70,"sourceHtmlUrl":71},"SOURCE.md",416,"https:\u002F\u002Fgithub.com\u002Ffilippolmt\u002Fskills\u002Fblob\u002Fmain\u002F.agents\u002Fplugins\u002Fpackages\u002Fworkers-best-practices\u002Fskills\u002Fworkers-best-practices\u002FSOURCE.md",[73,82,90,98,106,112],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":77,"licenseFileUrl":78,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":20},"01M781ZJN9KDK0YY8EAQ8WXPRQ","writing-for-agents","Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.","MIT","https:\u002F\u002Fgithub.com\u002Ffilippolmt\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-for-agents\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Ffilippolmt\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-for-agents\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":86,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":20},"01M781ZDZ8CQ30GRY5XNT1RF91","wrangler","Run or troubleshoot Wrangler CLI commands in projects that have a wrangler.jsonc, wrangler.json, or wrangler.toml file, including local development, Previews, deployment, and resource management. For new projects and projects without a Wrangler configuration file, use the cf CLI instead.","https:\u002F\u002Fgithub.com\u002Ffilippolmt\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fwrangler\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Ffilippolmt\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fwrangler\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":94,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":20},"01M781ZA1MB7E7T1R1TE0BTTJS","workers-profiling","Profile or debug CPU usage and memory allocation in deployed Cloudflare Workers and Durable Objects. Then use this information to optimize your code.","https:\u002F\u002Fgithub.com\u002Ffilippolmt\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fworkers-profiling\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Ffilippolmt\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fworkers-profiling\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":102,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":20},"01M781Z52Q7PBMDA2YBC3SCTYM","workers-development","Run, inspect, and debug Cloudflare Workers during local development with cf dev, wrangler dev, or the Cloudflare Vite plugin, using Local Explorer to read and seed binding data and query local traces and logs. Also routes production debugging to Workers observability. Use for debugging requests whether or not the project uses Wrangler.","https:\u002F\u002Fgithub.com\u002Ffilippolmt\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fworkers-development\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Ffilippolmt\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fworkers-development\u002FSKILL.md",[],[],{"skillNo":107,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":108,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":20},"01M781Z193MG7SHF4DSD1WK583","https:\u002F\u002Fgithub.com\u002Ffilippolmt\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fworkers-best-practices\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Ffilippolmt\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fworkers-best-practices\u002FSKILL.md",[],[],{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":77,"licenseFileUrl":116,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":20},"01M781YT0JB3GVA1HTFZ9QJHM7","wordpress-pro","Develops custom WordPress themes and plugins, creates and registers Gutenberg blocks and block patterns, configures WooCommerce stores, implements WordPress REST API endpoints, applies security hardening (nonces, sanitization, escaping, capability checks), and optimizes performance through caching and query tuning. Use when building WordPress themes, writing plugins, customizing Gutenberg blocks, extending WooCommerce, working with ACF, using the WordPress REST API, applying hooks and filters, or improving WordPress performance and security.","https:\u002F\u002Fgithub.com\u002Ffilippolmt\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fwordpress-pro\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Ffilippolmt\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fwordpress-pro\u002FSKILL.md",[],[]]