Agent skill

Goldmark Extension v1 to v2 Migration

by yuin in yuin/goldmark

Guides migrating a goldmark Markdown extension from v1 to v2, with a confirmed plan, breaking-changes reference and extension-pattern guide.

MITAuto-check: notesDevelopment

Install Goldmark Extension v1 to v2 Migration

skills CLI
$ npx skills add yuin/goldmark --skill migrate-goldmark-extension-v1-to-v2 -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install yuin/goldmark migrate-goldmark-extension-v1-to-v2 --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/yuin/goldmark.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agent-plugins/migrate-goldmark-v1-to-v2/skills/migrate-goldmark-extension-v1-to-v2 .claude/skills/migrate-goldmark-extension-v1-to-v2 && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
migrate-goldmark-extension-v1-to-v2
GitHub stars
5.1k
Token cost
~2k tokens
SKILL.md length
961 words
Files
2 (incl. references)
Skills in repo
2
Repo updated
First seen
Licence
MIT

At a glance

Guides migrating a goldmark Markdown extension from v1 to v2, with a confirmed plan, breaking-changes reference and extension-pattern guide.

  • Migrating a goldmark Markdown extension from v1 to v2
  • SKILL.md covers Description, Knowledges and Migration steps
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Planning the breaking changes a goldmark extension needs to handle for v2

What it does

The skill walks through migrating a Go extension for the goldmark Markdown library from version 1 to version 2. It requires reading a breaking-changes reference and a guide on creating an extension in the new pattern before writing a migration plan file, and it requires asking the person running it to confirm both the plan and how the extension should be tested afterward before any code changes start.

One documented change is that extensions using a single unified option type for both parser and renderer must split it into separate options per role, shown with a short before-and-after Go example. After the plan is approved, the workflow updates the extension code, updates and runs its tests, and updates documentation to match. A bundled reference file explains how to create a goldmark extension from scratch, which the migration plan also leans on.

When your agent uses it

  • Migrating a goldmark Markdown extension from v1 to v2
  • Planning the breaking changes a goldmark extension needs to handle for v2
  • Splitting a goldmark extension's combined parser and renderer options

Example prompts

  • “Migrate my goldmark syntax-highlighting extension from v1 to v2.”
  • “Write a migration plan for porting this goldmark table extension to v2.”
  • “Split this extension's Option type into separate parser and renderer options for goldmark v2.”

Requirements

  • A Go toolchain
  • The goldmark v1 extension's source code
  • Pre-approved tools (allowed-tools): Bash, Read

What it can do on your machine

Read from SKILL.md and the folder at commit cbf81e9. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash
    • Read

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Goldmark Extension v1 to v2 Migration loads about 2k tokens when it runs, and up to ~7.4k if it reads all its reference files. Until then it costs about 22 tokens; SKILL.md has 961 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~22
When it runs · the whole SKILL.md, loaded when a task matches
~2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~7.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Bash, Read

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from yuin/goldmark at commit cbf81e9, republished under its MIT licence (© yuin). 961 words, ~2,038 tokens.

Download SKILL.mdSave it as .claude/skills/migrate-goldmark-extension-v1-to-v2/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
migrate-goldmark-extension-v1-to-v2
description
Migrate goldmark extension from goldmark v1 to v2.
allowed-tools
Bash, Read
context
fork

migrate-goldmark-extension-v1-to-v2

Description

This skill helps you migrate a goldmark (https://github.com/yuin/goldmark) extension from version 1 to version 2. It provides guidance on the changes needed to update your project to be compatible with the new version of goldmark.

Knowledges

  • CommonMark key points : List of key points of CommonMark spec that you should be aware of when implementing a goldmark extension.
  • Breaking changes in v2 : List of breaking changes in goldmark v2 that you should be aware of when migrating your extension from v1 to v2.
  • How to create an extension : Guide on how to create a goldmark extension in v2, including the new extension pattern and how to implement parser and renderer extensions.

Migration steps

Overview of the migration process
  • Create a migration plan for the extension.
  • MUST ask human to confirm that the migration plan is acceptable before proceeding with the migration.
  • MUST ask human to how to test the extension after migration before proceeding with the migration.
    • e.g. : "How do you want to test the extension after migration? Do you have any test cases or examples that you want to use for testing?"
  • Execute the migration plan to update the extension code to be compatible with goldmark v2.
  • Update the test cases to ensure that the extension works as expected with goldmark v2.
  • Test the extension with goldmark v2 to ensure that it works as expected. If there are any issues, fix them and re-test until the extension works as expected.
  • Update the documentation to reflect any changes made during the migration process.
Create a migration plan
Task
  • Make sure you have read and understood the Breaking changes in v2 document.
  • Make sure you have read and understood the How to create an extension document.
  • You create a ./features/goldmark-migration-plan.md file that contains a migration plan for the extension.
Key points to consider when migrating your extension
Extension options
  • If the extension uses "unified" options for both parser and renderer, they should be split into separate options for each.
    • e.g. :
      • v1
        go
        type Option interface {
            myOption()
        }
        
        type ParserOption interface {
            Option
            applyParserOption(*parserConfig)
        }
        
        type RendererOption interface {
            Option
            applyRendererOption(*rendererConfig)
        }
        
        func New(opts ...Option) goldmark.Extender { // takes unified options
            // ...
        }
      • v2
        go
        type ParserOption interface {
            applyParserOption(*parserConfig)
        }
        
        type HTMLRendererOption interface { // explicitly named for **HTML**
            applyRendererOption(*htmlRendererConfig) // you can access the shared renderer config like `XHTML` or `Unsafe` in the renderer config
        }
        
        func NewParser(opts ...ParserOption) parser.Extension { // takes parser options
            // ...
        }
        
        var Parser = NewParser() // Default instance of parser extension
        
        func NewHTMLRenderer(opts ...HTMLRendererOption) html.Extension { // takes renderer options
            // ...
        }
        
        var HTMLRenderer = NewHTMLRenderer() // Default instance of renderer extension
AST nodes
  • use text.Value(single line), text.MultiLineValue(multi-line) instead of []byte for values that can be parsed from source text in inline AST nodes.
    • In your parser, you must choose text.Decoder implementation to decode the source value
      • text.IdentityDecoder : for raw contents like inline HTMLs, inline code, etc.
      • reader.Decoder : other contents like text, links, etc. This decoder decodes entity references, \ escapes, etc.
    • In most cases, you will choose text.Decoder. DO NOT use text.IdentityDecoder unless you have a clear intention to do so.
  • use text.Lines instead of []text.Segment for values in block AST nodes that have raw contents like HTML blocks, code blocks, etc.
  • Properties in AST Dump should be text.Value as possible.
    • e.g.
      • OK:
        // Dump implements Node.Dump.
        func (n *Text) Dump(_ []byte) *NodeDump {
            m := map[string]any{
                "Value": n.Value, // text.Value
            }
            fs := textFlagsString(n.flags)
            if len(fs) != 0 {
                m["Flags"] = fs
            }
            return NewNodeDump(n, m)
        }
      • Not OK:
        // Dump implements Node.Dump.
        func (n *Text) Dump(source []byte) *NodeDump {
            m := map[string]any{
                "Value": n.Value.Str(source), // string
            }
            fs := textFlagsString(n.flags)
            if len(fs) != 0 {
                m["Flags"] = fs
            }
            return NewNodeDump(n, m)
        }
  • In v2, attribute values are text.Value which has almost the same specification as HTML attributes.
    • Therefore, if the project were using non-string attributes in v1, human must decide on one of the following policies:
      • Use the goldmark_v1_attribute build tag to continue using v1 attributes as they are.
      • Convert attribute values to strings to comply with the v2 specification.
    • MUST ask human to decide on one of the above policies before proceeding with the migration.
Show full SKILL.md (314 more words)Show less
Parsing
  • In v2, all nodes have a start position. goldmark/v2 automatically sets the start position to the node. However, if you want to customize the start position, you need to call SetPos appropriately.
HTML Rendering
  • text.Value and text.Lines can be rendered using the WriteTo method whenever possible. Also, the output destination of WriteTo should use html.ContextHTMLWriter(rc) or html.ContextTextWriter(rc).
    • e.g. :
      go
      tw := html.ContextTextWriter(rc)
      _, _ = n.Value.WriteTo(tw, source)
    • WriteTo is fast because it does not allocate new memory. On the other hand, if you write Value directly like tw.Write(n.Value.Value(source)), it may copy the contents of Value, which can degrade performance.
  • Use myext.NewParser() and myext.NewHTMLRenderer() for the extension constructors.
    • e.g. : meta extension
      • meta.NewParser(), meta.NewHTMLRenderer()
  • Use myext.Parser and myext.HTMLRenderer as the default extension values.
    • e.g. : var Parser = NewParser(), var HTMLRenderer = NewHTMLRenderer()
  • Use myext.ParserOption and myext.HTMLRendererOption for functional options.
    • e.g. : type ParseOption func(*parserConfig), type HTMLRendererOption func(*htmlRendererConfig)
Execute migration plan
  • Make sure you are on a branch that is not main or master. User must create a new branch like 'v2' to work on the migration before using this skill.
    • If you are on main or master, STOP this skill and ask human to create a new branch like 'v2' to work on the migration.
  • Make sure go.mod file is updated to use github.com/yuin/goldmark/v2 instead of github.com/yuin/goldmark. User must add goldmark/v2 before using this skill.
    • If go.mod file is not updated, STOP this skill and ask human to update go.mod file to use github.com/yuin/goldmark/v2 instead of github.com/yuin/goldmark.
  • Update the module path in your go.mod file with new major version. For example, change github.com/you/yourextension to github.com/you/yourextension/v2.
    • MUST ask human to make sure that the module path is updated in go.mod file before proceeding with the migration.
      • If human confirms that the module path is updated, proceed with the migration, otherwise, STOP this skill and ask human to update the module path in go.mod file with new major version.

© yuin, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in .agent-plugins/migrate-goldmark-v1-to-v2/skills/migrate-goldmark-extension-v1-to-v2 of yuin/goldmark.

  • SKILL.md
  • references/how-to-create-an-extension.md

Open the folder on GitHubat commit cbf81e9

Compare with similar skills

Goldmark Extension v1 to v2 Migration next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Goldmark Extension v1 to v2 Migration compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Goldmark Extension v1 to v2 Migration this skillyuin/goldmark5.1k—~2kAutomated safety check: NotesMIT
CLIProxy Core Synccaidaoli/ccLoad419—~1.5kAutomated safety check: PassMIT
Golang Modernizeaiskillstore/marketplace4331 repos~3.3kAutomated safety check: PassMIT
Writing gotest Testsmvrahden/go-test128—~3.1kAutomated safety check: PassMIT
Security UpdatesSmilyOrg/photofield608—~808Automated safety check: PassMIT
Migrate Core Code to Submodulestinyhumansai/openhuman42k—~2.6kAutomated safety check: PassGPL-3.0

Similar skills

  • CLIProxy Core Sync

    caidaoli/ccLoad

    Syncs or audits ccLoad's CLIProxyAPI protocol-conversion core and registered provider adapters against one pinned upstream commit, then verifies the result.

    419 GitHub stars~1.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Golang Modernize

    aiskillstore/marketplace

    Modernize Golang code to use recent language features, standard library improvements, and idiomatic patterns.

    433 GitHub starsUsed in 1 repo~3.3k tokens
    DevelopmentAuto-check passed
  • Writing gotest Tests

    mvrahden/go-test

    Guides writing, fixing and migrating tests in Go repositories that use the gotest suite framework, including version differences and CI setup.

    128 GitHub stars~3.1k tokensUpdated today
    Testing & QAAuto-check passed
  • Security Updates

    SmilyOrg/photofield

    Check and apply security updates across the photofield project (api/Go, ui/npm, docs/npm, e2e/npm).

    608 GitHub stars~808 tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • Migrate Core Code to Submodules

    tinyhumansai/openhuman

    Plans and carries out moving non-host-specific code and its tests from the OpenHuman core into vendored tiny submodule libraries, then releases the submodule and re-pins the host.

    42k GitHub stars~2.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Moves a package from another TryGhost repository into Ghost as an internal workspace package while keeping its Git history, with checkpoints for the steps that need an administrator.

    56k GitHub stars~3.8k tokensUpdated today
    DevelopmentAuto-check passed

More from yuin/goldmark

  • Plans and carries out the migration of a Go application from goldmark v1 to v2, with a written plan, human sign-off, updated tests and documentation.

    5.1k GitHub stars~1.2k tokensUpdated 10 days ago
    Auto-check: notes

Works with

Categories

Questions about Goldmark Extension v1 to v2 Migration

What does Goldmark Extension v1 to v2 Migration do?

Guides migrating a goldmark Markdown extension from v1 to v2, with a confirmed plan, breaking-changes reference and extension-pattern guide. The skill walks through migrating a Go extension for the goldmark Markdown library from version 1 to version 2. It requires reading a breaking-changes reference and a guide on creating an extension in the new pattern before writing a migration plan file, and it requires asking the person running it to confirm both the plan and how the extension should be tested afterward before any code changes start.

When should I use Goldmark Extension v1 to v2 Migration?

Goldmark Extension v1 to v2 Migration fits situations like: migrating a goldmark Markdown extension from v1 to v2; planning the breaking changes a goldmark extension needs to handle for v2; splitting a goldmark extension's combined parser and renderer options.

How do I install Goldmark Extension v1 to v2 Migration in Claude Code?

Run `npx skills add yuin/goldmark --skill migrate-goldmark-extension-v1-to-v2 -a claude-code`. Or copy the skill folder (.agent-plugins/migrate-goldmark-v1-to-v2/skills/migrate-goldmark-extension-v1-to-v2 in yuin/goldmark) into .claude/skills/migrate-goldmark-extension-v1-to-v2 in your project. Claude Code loads it when a task matches its description.

How do I install Goldmark Extension v1 to v2 Migration in Codex?

Run `npx skills add yuin/goldmark --skill migrate-goldmark-extension-v1-to-v2 -a codex`. Or copy the skill folder (.agent-plugins/migrate-goldmark-v1-to-v2/skills/migrate-goldmark-extension-v1-to-v2 in yuin/goldmark) into .agents/skills/migrate-goldmark-extension-v1-to-v2 in your project. Codex loads it when a task matches its description.

Can I use Goldmark Extension v1 to v2 Migration in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add yuin/goldmark --skill migrate-goldmark-extension-v1-to-v2 -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/migrate-goldmark-extension-v1-to-v2, .gemini/skills/migrate-goldmark-extension-v1-to-v2, .github/skills/migrate-goldmark-extension-v1-to-v2 and .opencode/skills/migrate-goldmark-extension-v1-to-v2 in your project.

What does Goldmark Extension v1 to v2 Migration need to run?

SKILL.md names no scripts, command-line tools or credentials: Goldmark Extension v1 to v2 Migration is instructions for the agent only. Our summary lists: A Go toolchain; The goldmark v1 extension's source code. Its frontmatter pre-approves these tools: Bash, Read.

Does Goldmark Extension v1 to v2 Migration access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Goldmark Extension v1 to v2 Migration safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Goldmark Extension v1 to v2 Migration use?

Goldmark Extension v1 to v2 Migration is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Goldmark Extension v1 to v2 Migration use?

About 2k tokens (SKILL.md is roughly 8.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 5.4k tokens, read only when the agent opens those files.

What are the alternatives to Goldmark Extension v1 to v2 Migration?

Skills that share tags, products or a category with Goldmark Extension v1 to v2 Migration: CLIProxy Core Sync (caidaoli/ccLoad, 419 stars), Golang Modernize (aiskillstore/marketplace, 433 stars), Writing gotest Tests (mvrahden/go-test, 128 stars) and Security Updates (SmilyOrg/photofield, 608 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Goldmark Extension v1 to v2 Migration?

yuin (a GitHub user) maintains it in yuin/goldmark, which has 5,056 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 1, 2026.

Source: yuin/goldmark on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.