본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)5.1k · #15050

migrate-goldmark-app-v1-to-v2

하는 일

goldmark v2에 필요한 변경을 계획하고 실행합니다. 여러분이 승인한 계획으로 시작해 테스트로 마무리합니다. 애플리케이션에서 goldmark를 쓰는 Go 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓Go 애플리케이션이 goldmark v1을 쓰고 있고 v2로 옮기고 싶을 때.
  • ✓goldmark v1과 v2 사이에서 호환성을 깨는 변경이 무엇인지 확인해야 할 때.
  • ✓코드 변경을 시작하기 전에 마이그레이션 계획을 확정하고 싶을 때.

스킬 링크

https://github.com/yuin/goldmark/blob/v2/.agent-plugins/migrate-goldmark-v1-to-v2/skills/migrate-goldmark-app-v1-to-v2/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/yuin/goldmark/blob/v2/.agent-plugins/migrate-goldmark-v1-to-v2/skills/migrate-goldmark-app-v1-to-v2/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 Go 앱을 goldmark v1에서 v2로 옮겨 주세요. 코드를 바꾸기 전에 계획을 저와 확인해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트가 여러분이 확인할 마이그레이션 계획을 쓰고, 코드를 업데이트하고, 테스트를 맞춘 뒤 goldmark v2에서 테스트를 실행합니다. 호환성을 깨는 변경에 관한 참고 문서를 사용합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

migrate-goldmark-app-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.

Migration steps

Overview of the migration process

  • Create a migration plan for the application.
  • MUST ask human to confirm that the migration plan is acceptable before proceeding with the migration.
  • MUST ask human to how to test the application after migration before proceeding with the migration.
    • e.g. : "How do you want to test the application after migration? Do you have any test cases or examples that you want to use for testing?"
  • Execute the migration plan to update the application code to be compatible with goldmark v2.
  • Update the test cases to ensure that the application works as expected with goldmark v2.
  • Test the application with goldmark v2 to ensure that it works as expected. If there are any issues, fix them and re-test until the application 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.

Extension

  • If the application contains own extensions, you can use /migrate-goldmark-extension-v1-to-v2 skill to migrate the extensions.
  • If the application contains third-party extensions, you need to check if the extensions provide v2 compatible version. - If not, STOP the migration.

Key points to consider when migrating your application

goldmark.Markdown alternatives
  • In v2, goldmark.Markdown is removed. Therefore, you need to replace it with one of the following two patterns:
    • Pattern 1: Use parser.Parser and renderer.Renderer to create your own goldmark.Markdown alternative.
      • Example:
        // MarkdownToStringFunc is a function type that converts markdown to HTML.
        type MarkdownToStringFunc func(source string) (string, error)
        
        // NewMarkdownToStringFunc returns a MarkdownToStringFunc that uses the given parser and renderer.
        func NewMarkdownToStringFunc(p parser.Parser, r html.Renderer) MarkdownToStringFunc {
            return func(source string) (string, error) {
                var buf bytes.Buffer
                b := util.StringToReadOnlyBytes(source)
                doc := p.Parse(b)
                if err := r.Render(&buf, b, doc); err != nil {
                    return "", err
                }
                return buf.String(), nil
            }
        }
        
    • Pattern 2: Use parser.Parser and renderer.Renderer separately.
      • Example:
        var buf bytes.Buffer
        p := parser.New(parser.WithAttribute(), parser.WithExtensions(extension.NewStrikethroughParser()))
        r := html.New(html.WithXHTML(), html.WithUnsafe(), html.WithExtensions(extension.NewStrikethroughHTMLRenderer()))
        doc := p.Parse(b)
        err := r.Render(&buf, b, doc)
        
  • Extensions MUST NOT be shared among multiple parsers/renderers. Create them with the New* constructors (e.g. extension.NewTableParser()) for each parser/renderer instead of using the deprecated default instances (e.g. extension.TableParser).
AST
  • In v1, AST values are mostly 'raw' values; entities references and \ escapes are not resolved. In v2, AST values are resolved values.
    • You need to check if your application relies on the 'raw' values of AST nodes.
      • If your application relies on the resolved values of AST nodes, you should replace Value.Bytes and Value.Str methods with Value.Value method.
      • Otherwise, you should replace Value.Bytes and Value.Str methods with Value.Value method.
  • In v2, to make the AST more semantic, some breaking changes have occurred.
자주 묻는 질문

에이전트가 바로 코드를 바꾸기 시작하나요?

아니요. 스킬은 먼저 마이그레이션 계획을 확정하고 테스트 방법을 알려 달라고 요구합니다.

v2 변경 사항은 어떻게 알게 되나요?

v2의 호환성 깨짐 변경과 CommonMark 핵심 내용을 다룬 참고 문서를 사용합니다.

확장 기능용 스킬은 따로 있나요?

네. goldmark 확장 기능의 마이그레이션은 별도의 스킬이 있습니다.

상세 정보

작성자의 원본 설명

Migrate your application from goldmark v1 to v2.

repo: yuin/goldmark

인기도

GitHub 스타
5.1k
순위
#15050
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬