transform-rolldown-code

Transform JavaScript and TypeScript source code using Rolldown's Oxc AST and native MagicString.

931|91|Updated Aug 13, 2025
One-click install
npx skills add https://github.com/videojs/v10 --skill transform-rolldown-code
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: transform-rolldown-code
Source: https://github.com/videojs/v10/tree/main/.agents/skills/transform-rolldown-code
Command: npx skills add https://github.com/videojs/v10 --skill transform-rolldown-code

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires oxc-walker.

What problem does it solve?

Writing Rolldown transform plugins requires correctly pairing the read-only Oxc AST with MagicString edits, and mistakes like mutating the AST, misplacing transforms in renderChunk, or missing native MagicString configuration silently break builds or source maps.

Core Features & Use Cases

  • AST-guided source edits: Walk the Oxc AST with oxc-walker and apply offset-based edits through meta.magicString so changes stay precise and source maps compose automatically.
  • Correct hook placement: Guidance on keeping module-oriented edits in transform and reserving renderChunk for edits that depend on final generated code or chunk metadata.
  • Host configuration: Instructions for enabling experimental.nativeMagicString in Rolldown and tsdown configs, plus adapting transforms for Vite, which does not forward AST or MagicString metadata.
  • Use Case: Rename every $compile() call in a codebase by filtering modules with a cheap code.includes guard, locating call expressions via meta.ast, overwriting callee ranges with meta.magicString, and validating the result in a real Rolldown build.

Quick Start

Write a Rolldown transform plugin that renames all $compile() calls to compile() using the Oxc AST and native MagicString, then verify it in a real build.

Frequently Asked Questions about transform-rolldown-code

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What are the limitations of the Oxc AST for type-aware transforms?

The Oxc AST is purely syntactic. It parses TS and TSX syntax but provides no TypeScript Program, TypeChecker, resolved symbols, inferred types, or cross-file semantics, so type-aware transforms need a separate parser and transformer pipeline.