migrate-goldmark-extension-v1-to-v2
यह क्या करती है
यह एक्सटेंशन को goldmark v2 के साथ काम करने लायक बनाने के बदलाव योजनाबद्ध करती और लागू करती है, जिसमें नई शैली का एक्सटेंशन लिखना भी शामिल है। यह उन Go डेवलपर्स के लिए है जो goldmark एक्सटेंशन सँभालते हैं।
कब इस्तेमाल करें
- ✓जब आप goldmark एक्सटेंशन के मालिक हैं और चाहते हैं कि वह v2 के साथ काम करे।
- ✓जब आपको v2 के लिए goldmark एक्सटेंशन लिखना सीखना है।
- ✓जब आप चाहते हैं कि एक्सटेंशन के लिए goldmark v1 और v2 के टूटने वाले बदलाव समझाए जाएँ।
Skill का लिंक
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 में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरे goldmark टेबल एक्सटेंशन को v1 से v2 पर ले जाइए, और मुझे दिखाइए कि उसे कैसे टेस्ट करूँ।”
हर हफ़्ते 5 नई skills, 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 में एक्सटेंशन बनाने की गाइड शामिल है।
जानकारी
लोकप्रियता
- GitHub स्टार
- 5.1k
- रैंकिंग में स्थान
- #15051
- लाइसेंस
- MIT
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
मिलती-जुलती skills
api-connector-builder
280kयह आपके एजेंट को मौजूदा pattern के हिसाब से नए API connections बनाने देता है। जब बिना कोई नया तरीका बनाए एक और integration जोड़ना हो, तब इसका इस्तेमाल करें।
api-design
280kयह आपके एजेंट को best practices के हिसाब से REST APIs डिज़ाइन करने में मदद करता है। यह तय करने में काम आता है कि APIs आपस में कैसे बात करें, errors कैसे दिखें, और data को कैसे व्यवस्थित करें।
backend-patterns
280kआपके एजेंट को server-side architecture patterns और database optimization में मदद करता है। server पर चलने वाला code बनाने या review करने के लिए उपयोगी है।