Bun HTMLRewriter
Use Bun's HTMLRewriter to transform HTML documents with CSS selectors
Install
npx skills add jarle/bun-skills --skill Bun HTMLRewritergit clone --depth 1 https://github.com/jarle/bun-skills.git /tmp/bun-skills
mkdir -p ~/.claude/skills
cp -r /tmp/bun-skills/skills/bun-runtime-html-rewriter ~/.claude/skills/Bun-HTMLRewriterPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# HTMLRewriter
> Use Bun's HTMLRewriter to transform HTML documents with CSS selectors
HTMLRewriter lets you use CSS selectors to transform HTML documents. It works with `Request`, `Response`, as well as `string`. Bun's implementation is based on Cloudflare's [lol-html](https://github.com/cloudflare/lol-html).
***
## Usage
A common usecase is rewriting URLs in HTML content. Here's an example that rewrites image sources and link URLs to use a CDN domain:
```ts theme={"theme":{"light":"github-light","dark":"dracula"}}
// Replace all images with a rickroll
const rewriter = new HTMLRewriter().on("img", {
element(img) {
// Famous rickroll video thumbnail
img.setAttribute("src", "https://img.youtube.com/vi/dQw4w9WgXcQ/maxresdefault.jpg");
// Wrap the image in a link to the video
img.before('<a href="https://www.youtube.com/watch?v=dQw4w9WgXcQ" target="_blank">', {
html: true,
});
img.after("</a>", { html: true });
// Add some fun alt text
img.setAttribute("alt", "Definitely not a rickroll");
},
});
// An example HTML document
const html = `
<html>
<body>
<img src="/cat.jpg">
<img src="dog.png">
<img src="https://example.com/bird.webp">
</body>
</html>
`;
const result = rewriter.transform(html);
console.log(result);
```
This replaces all images with a thumbnail of Rick Astley and wraps each `<img>` in a link, producing a diff like this:Details
- Skill name
Bun HTMLRewriter- Repository
- jarle/bun-skills
- Path
skills/bun-runtime-html-rewriter/SKILL.md- License
- MIT
- Repo updated
- 24 February 2026
FAQ
What does the Bun HTMLRewriter skill do?
Use Bun's HTMLRewriter to transform HTML documents with CSS selectors
How do I install the Bun HTMLRewriter skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add jarle/bun-skills --skill Bun HTMLRewriter. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Bun HTMLRewriter popular?
It lives in jarle/bun-skills, which has 9 GitHub stars and 1 forks.
Related skills
Bun Archive
9jarle/bun-skills
Create and extract tar archives with Bun's fast native implementation
Bun Auto Install
9jarle/bun-skills
Bun's automatic package installation feature for standalone script execution
Bun Bun Add
9jarle/bun-skills
Add packages to your project with Bun's fast package manager
Designing Wireframes
5tomada1114/tomada-claude-plugins
Create ASCII wireframes for every screen and window, user flow diagrams, and per-screen states (empty, loading, error) from a requirements document, for desktop (macOS windows, menu-bar popovers, settings), web (responsive app shells), and mobile. Writes into the requirements document in place, or into a separate file the caller names. Use when asked for a wireframe, screen layout, screen design, window layout, or user flow, to visualize screens before implementation, or as the UX stage of kicking-off-apps.
Bun HTML & Static Sites
9jarle/bun-skills
Build static sites, landing pages, and web applications with Bun's bundler
Kicking Off Apps
5tomada1114/tomada-claude-plugins
Take a rough app idea ("I want an app that…") to a new public GitHub repository cut from one of the user's template repositories, with signed-off requirements, UX flows, a researched design system, design decisions in the template's skills (no architecture docs), loose project permissions, and a dependency-ordered issue backlog for the template's shipping-issues. Orchestrates one child skill per stage — refining-requirements, designing-wireframes, ui-ux-designing, a design skill, bootstrapping-from-templates, configuring-project-permissions, designing-architecture, planning-tickets — and defer
Browse the most popular Claude skills, all frontend & design skills, or write your own with the skills generator.