Installation
Install as Agent Plugin
Recommended
copilot plugin marketplace add samueltauil/skills-hub
copilot plugin install workers-profiling@skills-hub
Works with GitHub Copilot CLI and VS Code (enable chat.plugins.enabled).
Plugin workers-profiling v1.0.0 follows the Agent Plugins spec.
Install with the gh extension
gh skills-hub install workers-profiling Don't have the extension? Run gh extension install samueltauil/skills-hub first.
Download and extract to your repository:
.github/skills/workers-profiling/ Extract the ZIP to .github/skills/ in your repo. The folder name must match workers-profiling for Copilot to auto-discover it.
Skill Files (2)
SKILL.md 2.2 KB
---
name: workers-profiling
description: Profile or debug CPU usage and memory allocation in deployed Cloudflare Workers and Durable Objects. Then use this information to optimize your code.
---
# Workers profiling
Find expensive functions or memory allocations in deployed code and come up with ways to fix them.
## Retrieve the docs
Start with the [production profiling guide](https://developers.cloudflare.com/workers/observability/profiling-in-production/index.md) to understand how
Workers and Durable Objects profiling works.
## Profiling steps
1. Identify the symptom and affected workload: CPU usage, latency, allocation pressure, or memory growth.
2. Confirm the account, Worker, environment, and deployed version with the user.
3. For a Durable Object, also confirm its owning Worker, namespace, and instance.
4. Choose CPU or heap profiling from the current guide's supported types and meanings.
Where possible, use the [`cf` CLI](https://developers.cloudflare.com/cf/index.md) to capture profiles. If the user requests `cf`, inspect the installed version's command help and schema where available.
If `cf` isn't available, consider prompting the user whether they would like to install it.
The profiling API will return a pprof file which you can analyze directly, or using appropriate tools like Go's `pprof` utility.
## Inspect the evidence
- Read the pprof file and analyse it for hotspots
- Map hotspots to functions and source locations when evidence supports it; report missing symbols or source mappings.
- If filenames and function names are pointing at the generated JavaScript, consider suggesting to the user to enable source maps and re-do the profiling.
## Optimise
Propose the smallest code change supported by the capture which resolves the issues identified.
## Report findings
Return a concise report with:
- Evidence for each finding: file, function, source location, and metric with units, where available.
- The smallest actionable change and how to check its effect.
## Skill feedback
If the user reports that this skill gave incorrect or outdated guidance, or is missing information, read [references/skill-feedback.md](references/skill-feedback.md).
references/
skill-feedback.md 2.7 KB
# Skill feedback
GitHub issues are public: anyone can read an issue once it is posted. Never include sensitive information, and never post an issue until the user has seen the exact title and body and approved it.
Use this when the user reports that the `workers-profiling` skill gave incorrect or outdated guidance, is missing information, or could be improved. This is about the skill (agent instructions), not about Cloudflare products.
## What not to include
The issue is drafted from the conversation, so remove the following before drafting and describe the problem in general terms instead:
- Credentials, API tokens, secrets, and passwords
- Account IDs, zone IDs, and other resource identifiers
- Customer or personal data, such as names, email addresses, and IP addresses
- Internal hostnames and URLs
- Private code, configuration, and logs
## Steps
1. **Ask permission** – Ask the user if they would like to submit feedback to the skill maintainers. If they decline, move on.
2. **Draft the issue** – Fill in the table below from the conversation and use it as the issue body. Always identify which specific file and section caused the problem. Leave out everything listed in [What not to include](#what-not-to-include).
3. **Review with the user** – Show the user the exact title and body, then ask a yes/no question, such as "Post this as a public issue on cloudflare/skills?" Submit only after the user answers yes. If they ask for changes, apply them and ask again. If they answer no, do not post. Agreeing to send feedback in step 1 is not approval of the text.
4. **Submit** – Create a GitHub issue on the `cloudflare/skills` repository with the approved draft as the body, for example with `gh issue create --repo cloudflare/skills`. The title must follow this format: `skill-feedback: workers-profiling: <summary of the problem>`.
5. **Share the result** – Share the issue URL with the user after submission. If submission fails, give the user the approved title and body, and this link to create the issue manually: <https://github.com/cloudflare/skills/issues/new>
## Issue body
| Field | Value |
|-------|-------|
| Type | `bug` (incorrect guidance), `outdated`, `missing`, or `improvement` |
| Skill | `workers-profiling` |
| Source | File and section, e.g. `SKILL.md` > "Section name" or `references/<file>.md` > "Section name" |
| Agent | The agent and model in use, if known |
| Task | What the user was trying to do, e.g. "deploy a preview" |
| Expected | What should have happened, e.g. "Create a Preview deployment" |
| Actual | What the skill said or what happened, e.g. "Unknown option: --preview" |
| Impact | The effect on the user, e.g. "Time spent finding the correct syntax" |
| Suggested fix | How the skill should change; leave blank if unsure |
License (Apache-2.0)
Apache-2.0
Source: cloudflare/skills
View full license text
Licensed under the Apache License, Version 2.0. See https://github.com/cloudflare/skills/blob/main/LICENSE