
cloudflare / workerd
✓ Official★ 8,400A skill package that teaches your agent 22 capabilities — every one documented and browsable below, no GitHub required · by cloudflare.
Each skill below is one capability this package teaches your agent. Install the whole package, or open a skill to install just that one.
Step-by-step guide for adding a new autogate to workerd for gradual rollout of risky changes, including enum registration, string mapping, usage pattern, and…
1 file — installable on its own
Step-by-step guide for adding a new compatibility flag to workerd, including capnp schema, C++ usage, testing, and documentation requirements.
1 file — installable on its own
Mandatory rules for running bazel tests during development. Load this skill before running any bazel test command, especially when validating fixes or…
1 file — installable on its own
Commit categorization rules for changelogs and "what's new" summaries. MUST be loaded before categorizing commits in changelog or whats-new commands. Provides…
1 file — installable on its own
After completing any task that took more than ~5 tool calls, or after long-running builds/tests finish, load this skill and deliver a dad joke to lighten the…
1 file — installable on its own
How to find, build, and run tests in workerd. Covers wd-test, kj_test target naming, bazel query patterns, and common flags. Also covers parent project…
1 file — installable on its own
Identifies the local user's GitHub account and git identity before performing code reviews. Load this skill at the start of any PR review, code review, or…
1 file — installable on its own
Structured scratch tracking document for investigation state during bug hunts - prevents re-reading code, losing context, and rabbit holes; maintains external…
1 file — installable on its own
KJ/workerd C++ style guidelines for code review. Covers naming, type usage, memory management, error handling, inheritance, constness, and formatting…
1 file — installable on its own
Use markdown formatting when drafting content intended for external systems (GitHub issues/PRs, Jira tickets, wiki pages, design docs, etc.) so formatting is…
1 file — installable on its own
Load when working with the module registry in workerd — reading, modifying, debugging, or reviewing module resolution, compilation, evaluation, or registration…
1 file — installable on its own
Bootstrap skill for discovering additional skills and context from a parent project when workerd is used as a submodule. Load this skill when tasks span…
1 file — installable on its own
Guidelines for posting pull request review comments via GitHub CLI, including suggested edits format, handling unresolved comments, etiquette, and report/issue…
1 file — installable on its own
Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical…
1 file — installable on its own
Rust code review for workerd. Covers CXX FFI safety, unsafe code patterns, JSG resource conventions, error handling, and a review checklist adapted from the…
1 file — installable on its own
Use when investigating bugs, crashes, assertions, or unexpected behavior - requires writing a reproducing test early instead of over-analyzing source code;…
1 file — installable on its own
JS/TS style guidelines and review checklist for workerd. Covers TypeScript strictness, import conventions, export patterns, private field syntax, error…
1 file — installable on its own
Step-by-step guide for updating the V8 JavaScript engine in workerd, including patch rebasing, dependency updates, integrity hashes, and verification. Load…
1 file — installable on its own
Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output…
1 file — installable on its own
Detailed guide for authoring .wd-test files in workerd, with examples of bindings, Durable Objects, multi-service configs, TypeScript tests, and network access.
3 files — installable on its own
Performance optimization, API design & compatibility, security vulnerabilities, and standards spec compliance for workerd code review. Covers tcmalloc-aware…
1 file — installable on its own
Memory safety, thread safety, concurrency, and critical detection patterns for workerd code review. Covers V8/KJ boundary hazards, lifetime management,…
1 file — installable on its own
👷 workerd, Cloudflare's JavaScript/Wasm Runtime

workerd (pronounced: "worker-dee") is a JavaScript / Wasm server runtime based on the same code that powers Cloudflare Workers.
You might use it:
- As an application server, to self-host applications designed for Cloudflare Workers.
- As a development tool, to develop and test such code locally.
- As a programmable HTTP proxy (forward or reverse), to efficiently intercept, modify, and route network requests.
Introduction
Design Principles
-
Server-first: Designed for servers, not CLIs nor GUIs.
-
Standard-based: Built-in APIs are based on web platform standards, such as
fetch(). -
Nanoservices: Split your application into components that are decoupled and independently-deployable like microservices, but with performance of a local function call. When one nanoservice calls another, the callee runs in the same thread and process.
-
Homogeneous deployment: Instead of deploying different microservices to different machines in your cluster, deploy all your nanoservices to every machine in the cluster, making load balancing much easier.
-
Capability bindings:
workerdconfiguration uses capabilities instead of global namespaces to connect nanoservices to each other and external resources. The result is code that is more composable -- and immune to SSRF attacks. -
Always backwards compatible: Updating
workerdto a newer version will never break your JavaScript code.workerd's version number is simply a date, corresponding to the maximum "compatibility date" supported by that version. You can always configure your worker to a past date, andworkerdwill emulate the API as it existed on that date.
Read the blog post to learn more about these principles.
WARNING: workerd is not a hardened sandbox
workerd tries to isolate each Worker so that it can only access the resources it is configured to access. However, workerd on its own does not contain suitable defense-in-depth against the possibility of implementation bugs. When using workerd to run possibly-malicious code, you must run it inside an appropriate secure sandbox, such as a virtual machine. The Cloudflare Workers hosting service in particular uses many additional layers of defense-in-depth.
With that said, if you discover a bug that allows malicious code to break out of workerd, please submit it to Cloudflare's bug bounty program for a reward.
Getting Started
Supported Platforms
In theory, workerd should work on any POSIX system that is supported by V8 and Windows.
In practice, workerd is tested on:
- Linux and macOS (x86-64 and arm64 architectures)
- Windows (x86-64 architecture)
On other platforms, you may have to do tinkering to make things work.
Building workerd
To build workerd, you need:
- Bazel
- If you use Bazelisk (recommended), it will automatically download and use the right version of Bazel for building workerd.
- On Linux:
-
We use the clang/LLVM toolchain to build workerd and support version 19 and higher. Earlier versions of clang may still work, but are not officially supported.
-
Clang 19+ (e.g. package
clang-19on Debian Trixie). If clang is installed asclang-<version>please create a symlink to it in your PATH namedclang, or use--repo_env=CC=clang-<version>onbazelcommand lines to specify the compiler name. -
libc++ 19+ (e.g. packages
libc++-19-devandlibc++abi-19-dev) -
LLD 19+ (e.g. package
lld-19). -
python3,python3-distutils, andtcl8.6
-
- On macOS:
- Xcode 16.3 installation (available on macOS 15 and higher). Building with just the Xcode Command Line Tools is not being tested, but should work too.
- Homebrew installed
tcl-tkpackage (provides Tcl 8.6)
- On Windows:
- Install App Installer
from the Microsoft Store for the
wingetpackage manager and then run install-deps.bat from an administrator prompt to install bazelisk, LLVM, and other dependencies required to build workerd on Windows. - Add
startup --output_user_root=C:/tmpto the.bazelrcfile in your user directory. - When developing at the command-line, run bazel-env.bat in your shell first to select tools and Windows SDK versions before running bazel.
- Install App Installer
from the Microsoft Store for the
You may then build workerd at the command-line with:
bazel build //src/workerd/server:workerdYou can pass --config=release to compile in release mode:
bazel build //src/workerd/server:workerd --config=releaseYou can also build from within Visual Studio Code using the instructions in docs/vscode.md.
The compiled binary will be located at bazel-bin/src/workerd/server/workerd.
If you run a Bazel build before you've installed some dependencies (like clang or libc++), and then you install the dependencies, you must resync locally cached toolchains, or clean Bazel's cache, otherwise you might get strange errors:
bazel fetch --configure --forceIf that fails, you can try:
bazel clean --expungeThe cache will now be cleaned and you can try building again.
If you have a fairly recent clang packages installed you can build a more performant release version of workerd:
bazel build --config=thin-lto //src/workerd/server:workerdConfiguring workerd
workerd is configured using a config file written in Cap'n Proto text format.
A simple "Hello World!" config file might look like:
using Workerd = import "/workerd/workerd.capnp";
const config :Workerd.Config = (
services = [
(name = "main", worker = .mainWorker),
],
sockets = [
# Serve HTTP on port 8080.
( name = "http",
address = "*:8080",
http = (),
service = "main"
),
]
);
const mainWorker :Workerd.Worker = (
serviceWorkerScript = embed "hello.js",
compatibilityDate = "2023-02-28",
# Learn more about compatibility dates at:
# https://developers.cloudflare.com/workers/platform/compatibility-dates/
);Where hello.js contains:
addEventListener("fetch", event => {
event.respondWith(new Response("Hello World"));
});Complete reference documentation is provided by the comments in workerd.capnp.
There is also a library of sample config files.
Running workerd
To serve your config, do:
workerd serve my-config.capnp
For more details about command-line usage, use workerd --help.
Prebuilt binaries are distributed via npm. Run npx workerd ... to use these. If you're running a prebuilt binary, you'll need to make sure your system has the right dependencies installed:
- On Linux:
- glibc 2.35 or higher (already included on e.g. Ubuntu 22.04, Debian Bookworm)
- On macOS:
- macOS 13.5 or higher
- The Xcode command line tools, which can be installed with
xcode-select --install
- x86_64 CPU with at least SSE4.2 and CLMUL ISA extensions, or arm64 CPU with CRC extension (enabled by default under armv8.1-a). These extensions are supported by all recent x86 and arm64 CPUs.
Local Worker development with wrangler
You can use Wrangler (v3.0 or greater) to develop Cloudflare Workers locally, using workerd. First, run the following command to configure Miniflare to use this build of workerd.
export MINIFLARE_WORKERD_PATH="<WORKERD_REPO_DIR>/bazel-bin/src/workerd/server/workerd"Then, run:
wrangler dev
Serving in production
workerd is designed to be unopinionated about how it runs.
One good way to manage workerd in production is using systemd. Particularly useful is systemd's ability to open privileged sockets on workerd's behalf while running the service itself under an unprivileged user account. To help with this, workerd supports inheriting sockets from the parent process using the --socket-fd flag.
Here's an example system service file, assuming your config defines two sockets named http and https:
# /etc/systemd/system/workerd.service
[Unit]
Description=workerd runtime
After=local-fs.target remote-fs.target network-online.target
Requires=local-fs.target remote-fs.target workerd.socket
Wants=network-online.target
[Service]
Type=exec
ExecStart=/usr/bin/workerd serve /etc/workerd/config.capnp --socket-fd http=3 --socket-fd https=4
Sockets=workerd.socket
# If workerd crashes, restart it.
Restart=always
# Run under an unprivileged user account.
User=nobody
Group=nogroup
# Hardening measure: Do not allow workerd to run suid-root programs.
NoNewPrivileges=true
[Install]
WantedBy=multi-user.targetAnd corresponding sockets file:
# /etc/systemd/system/workerd.socket
[Unit]
Description=sockets for workerd
PartOf=workerd.service
[Socket]
ListenStream=0.0.0.0:80
ListenStream=0.0.0.0:443
[Install]
WantedBy=sockets.targetOnce these files are in place you can enable the service -- see the systemd documentation or ask your favorite LLM for details.
Install the whole package (22 skills):
npx skills add https://github.com/cloudflare/workerdOr install a single skill:
npx skills add https://github.com/cloudflare/workerd --skill <name>Pick the skill name from the Skills tab — each entry there installs independently.