migrate-goldmark-extension-v1-to-v2
できること
拡張機能がgoldmark v2で動くように、必要な変更を計画し、実施します。新しい形式の拡張機能の書き方も含みます。goldmarkの拡張機能を保守するGo開発者が対象です。
使う場面
- ✓goldmarkの拡張機能を保守していて、v2で動くようにしたいとき。
- ✓v2で新しい形式の拡張機能を書く方法を学びたいとき。
- ✓拡張機能の観点から、goldmark v1とv2の互換性を損なう変更を説明してほしいとき。
スキルのリンク
https://github.com/yuin/goldmark/blob/v2/.agent-plugins/migrate-goldmark-v1-to-v2/skills/migrate-goldmark-extension-v1-to-v2/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“私のgoldmarkのテーブル拡張機能をv1からv2に移行してください。テストの方法も示してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、あなたが承認する移行計画を書き、拡張機能のコードを更新して、あなたが選んだ例でテストします。拡張機能の作成と互換性を損なう変更に関する参考ガイドを使います。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
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
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
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 // ... } func NewHTMLRenderer(opts ...HTMLRendererOption) html.Extension { // takes renderer options // ... }
- v1
- e.g. :
AST nodes
- use
text.Value(single line),text.MultiLineValue(multi-line) instead of[]bytefor values that can be parsed from source text in inline AST nodes.- In your parser, you must choose
text.Decoderimplementation to decode the source valuetext.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 usetext.IdentityDecoderunless you have a clear intention to do so.
- In your parser, you must choose
- use
text.Linesinstead of[]text.Segmentfor values in block AST nodes that have raw contents like HTML blocks, code blocks, etc. - Properties in AST Dump should be
text.Valueas 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)
- OK:
- e.g.
よくある質問
テストには私の例を使いますか?
エージェントは拡張機能のテスト方法を尋ね、あなたが用意したテストケースや例を使います。
コードを変更する前に承認が必要ですか?
はい。移行計画を先に確認する必要があります。
v2での新しい拡張機能の書き方も扱いますか?
はい。v2で拡張機能を作る方法に関するガイドを含みます。
詳細
人気
- GitHubのスター
- 5.1k
- ランキング
- #15051
- ライセンス
- MIT
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
似ているスキル
api-connector-builder
280kエージェントが既存のパターンに従って、新しいAPI連携を構築します。新しい方式を作らずに、もう一つ連携を追加したいときに使います。
api-design
280kエージェントがベストプラクティスに沿ってREST APIを設計できるようにします。APIの通信方法、エラーの表示方法、データの整理方法を決めるのに役立ちます。
backend-patterns
280kエージェントのサーバーサイドのアーキテクチャパターンとデータベースの最適化を支援します。サーバー上で動くコードを作成またはレビューするときに役立ちます。