Transform Rolldown Code logo

Transform Rolldown Code

OrganizationPopular
videojs
transform-rolldown-code

Transform code. Use for Rolldown.

Overview

Publishervideojs
Repositoryv10
Skill nametransform-rolldown-code
Stars
1K
Forks
93
Bundled files
Instructions only
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by videojs on GitHub. Read the source before you install it.

Installation

Install the Transform Rolldown Code AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/videojs/v10/tree/main/.agents/skills/transform-rolldown-code
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/videojs/v10.git /tmp/v10
mkdir -p .claude/skills
cp -r /tmp/v10/.agents/skills/transform-rolldown-code .claude/skills/transform-rolldown-code
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Transform Rolldown Code in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Transform Rolldown Code on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Transform Rolldown Code is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Rolldown code transforms

Use the incoming Oxc AST for analysis and its paired MagicString for source edits.

Workflow

  1. Narrow modules with a native transform hook filter. Use a cheap code.includes(...) guard before accessing meta.ast so parsing stays lazy.
  2. Access meta.ast only when syntax analysis is required. It is a read-only Oxc Program parsed according to meta.moduleType and supports JavaScript, JSX, TypeScript, and TSX syntax.
  3. Use AST start and end offsets with meta.magicString.overwrite, remove, appendLeft, or related edits. Both values describe the same incoming code string.
  4. Return the edited MagicString as { code: magicString }. Edits are ignored when the hook does not return it. Return null when nothing changed.
  5. Keep using offsets from the original hook input. The AST does not update after MagicString edits. Analyze generated syntax in a later transform pass or plugin when necessary.
  6. Keep module-oriented edits in transform. Use renderChunk only when the replacement depends on final generated code, chunk filenames, output format, or the rendered chunk graph; never move ordinary AST transforms there.

Treat meta.ast as read-only. Mutating its nodes does not change output because Rolldown does not print the modified JavaScript AST.

The Oxc AST is syntactic. It includes TS and TSX nodes but has no TypeScript Program, TypeChecker, resolved symbols, inferred types, or cross-file semantics.

For true AST-to-AST transforms, use an appropriate parser, transformer, and code generator, then return generated code with a source map. Every source-changing transform should provide a map unless it intentionally documents a sourceMap: false option; returning native MagicString provides one automatically. Use map: null only when the edit does not move code.

Treat meta.ast and meta.magicString as a required contract in repository-owned Rolldown builds and fail clearly when either is unexpectedly unavailable. Only synthesize or guard the metadata in an intentional compatibility adapter, such as the Vite adapter.

Host setup

Explicitly enable Rolldown's native implementation in every repository-owned input config that runs these transforms:

ts
experimental: {
  nativeMagicString: true,
}

For tsdown, put the same option under inputOptions.experimental. Keep returning the native object directly so Rolldown can generate and compose source maps off the main thread. Enable output sourcemap: true when the build should emit map files. See the native MagicString guide and source transformation guide.

Vite does not forward Rolldown's ast or magicString transform metadata in the pinned version, even when its build enables native MagicString. Continue to adapt these transforms through packages/vjsc/src/vite/oxc.ts for Vite serve and build.

Pattern

ts
import { walk } from 'oxc-walker';

export const plugin = {
  name: 'example-transform',

  transform(code, id, meta) {
    if (!code.includes('$compile')) return null;

    const ast = meta.ast;
    const magicString = meta.magicString;
    if (!ast || !magicString) {
      throw new Error('example-transform requires Rolldown AST metadata and native MagicString.');
    }

    let changed = false;

    walk(ast, {
      enter(node) {
        if (
          node.type === 'CallExpression' &&
          node.callee.type === 'Identifier' &&
          node.callee.name === '$compile'
        ) {
          magicString.overwrite(node.callee.start, node.callee.end, 'compile');
          changed = true;
        }
      },
    });

    return changed ? { code: magicString } : null;
  },
};

Think of the hook as:

text
incoming code
  -> Oxc AST: find and understand syntax
  -> MagicString: edit source using AST ranges
  -> return edited code

Validation

Run the transform through a real Rolldown build with native MagicString explicitly enabled. Assert changed and unchanged modules, relevant JS/JSX/TS/TSX forms, source maps when consumers need them, and a clear failure when required metadata is unavailable.

Example

Input: "Rename $compile() calls without changing matching strings or comments."

Output: A filtered transform that finds call expressions through meta.ast, overwrites the callee ranges through meta.magicString, returns the edited value, and passes a real Rolldown build test.

Frequently asked questions

What does the Transform Rolldown Code AI skill do?

Transform code. Use for Rolldown.

Why use Transform Rolldown Code on TypingMind?

Because you install it once and use it with any model. Transform Rolldown Code is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Transform Rolldown Code in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/videojs/v10/tree/main/.agents/skills/transform-rolldown-code. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Transform Rolldown Code?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Transform Rolldown Code?

As many as you like. As long as a model supports skills, you can use Transform Rolldown Code with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Transform Rolldown Code AI skill free?

It is published on GitHub by videojs. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇