Debug a CF Worker
Tail logs, decode CF exception codes (1101 uncaught, 1102 CPU), trace which boundary is failing.
Overview
Implements debug-cf-worker/SKILL.md. Tails the live Worker logs via wrangler tail, captures the exception, decodes the error code, identifies which boundary is at fault (Worker code, DO RPC, container fetch, fetch upstream). When the failure spans multiple layers, layers in instrument-then-fix/SKILL.md: insert raw passthrough diagnostics at each boundary to pinpoint the broken layer before patching.
When to use this
- user reports a Worker returning 500
- user says 'CF exception 1101' or 'error code 1102'
- Worker works locally but fails when deployed
- DO RPC failing or container fetch returning HTML error page
When NOT to use this
- Worker hasn't been deployed yet → use deploy-to-cloudflare and verify-deploy first
- user wants to debug a non-Worker process (Next.js dev server, etc.) → use shell_exec + iterate-until-green
Example prompts
Inputs and output
Inputs
| Field | Description |
|---|---|
worker_name | wrangler.toml `name` field |
error_signal | URL that triggers it, or exception code |
Output
Root-cause analysis + the patch applied + post-fix verify result.
Runtime profile
What the engine commits when this skill runs.
| Property | Value | Meaning |
|---|---|---|
| Model tier | sonnet | The balanced default model class. Trades quality against cost for the vast majority of skill runs. |
| Cost class | standard | The balanced default model. Right for most skills. |
| Turn budget | 15 | Hard cap on tool-calling iterations before the engine forces a final answer. |
| Execution | synchronous | Runs inside the live turn; result lands in the same response. |
Under the hood
Tools the engine exposes to this skill and integrations it needs.
| Resource | Kind |
|---|---|
shell_exec | tool |
shell_read | tool |
Tags: engineering, debug, cloudflare
Execution template
Shell tools dispatch via a command template. The model substitutes user inputs into the placeholders before firing the underlying tool.
Invoking this from an agent
Three paths reach this skill. From the chat UI, a user can type the persona slash command followed by a natural request and the discovery step resolves to this skill automatically. From the MCP server, fetch the skill detail with get_skill({id: "debug-cf-worker"}) and then invoke it through the agent runtime once the authenticated tier ships. From your own code, hit /docs/skills/debug-cf-worker/llm.txt for the token-efficient markdown body and feed it to your model directly.
Accept: text/markdown. The full machine-readable catalog lives at /.well-known/agent-skills/index.json.