migrate-goldmark-app-v1-to-v2
Ce qu’il fait
Elle planifie et réalise les modifications nécessaires pour goldmark v2, en commençant par un plan que vous validez et en terminant par des tests. Elle s'adresse aux développeurs Go qui utilisent goldmark dans une application.
Quand l’utiliser
- ✓Quand votre application Go utilise goldmark v1 et que vous voulez passer à la v2.
- ✓Quand vous avez besoin de connaître les changements incompatibles entre goldmark v1 et v2.
- ✓Quand vous voulez faire valider un plan de migration avant le début des modifications de code.
Lien du skill
https://github.com/yuin/goldmark/blob/v2/.agent-plugins/migrate-goldmark-v1-to-v2/skills/migrate-goldmark-app-v1-to-v2/SKILL.mdCopiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.
Comment l’utiliser
Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.
Message prêt à coller
Pour Claude Code, Codex ou Cursor : lancez-la dans le dossier du projet et le skill est installé.
Téléchargez le SKILL.md et placez-le dans le dossier de skills de votre agent.
Exemple de demande à votre IA
“Aide-moi à faire passer mon application Go de goldmark v1 à v2, et valide le plan avec moi avant de modifier le moindre code.”
5 nouveaux skills par semaine. 1 minute de lecture.
Comment ça marche
L'agent rédige un plan de migration à confirmer, met à jour le code, adapte les tests et les lance sur goldmark v2. Il s'appuie sur des notes de référence concernant les changements incompatibles.
Contenu technique (SKILL.md original)
Texte original de l’auteur, en anglais, directement depuis 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-v2skill 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.Markdownis removed. Therefore, you need to replace it with one of the following two patterns:- Pattern 1: Use
parser.Parserandrenderer.Rendererto create your owngoldmark.Markdownalternative.- 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 } }
- Example:
- Pattern 2: Use
parser.Parserandrenderer.Rendererseparately.- 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)
- Example:
- Pattern 1: Use
- 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.BytesandValue.Strmethods withValue.Valuemethod. - Otherwise, you should replace
Value.BytesandValue.Strmethods withValue.Valuemethod.
- If your application relies on the resolved values of AST nodes, you should replace
- You need to check if your application relies on the 'raw' values of AST nodes.
- In v2, to make the AST more semantic, some breaking changes have occurred.
Questions fréquentes
L'agent commence-t-il à modifier le code tout de suite ?
Non. La compétence exige que vous confirmiez d'abord le plan de migration et que vous indiquiez comment tester.
Qu'est-ce qui l'aide à connaître les changements de la v2 ?
Des documents de référence sur les changements incompatibles de la v2 et sur les points clés de CommonMark.
Existe-t-il une compétence distincte pour les extensions ?
Oui. La migration d'une extension goldmark fait l'objet d'une compétence distincte.
Détails
Description originale de l’auteur
Migrate your application from goldmark v1 to v2.
repo: yuin/goldmark
Popularité
- Étoiles GitHub
- 5.1k
- Position au classement
- #15050
- Licence
- MIT
- Mis à jour
- 02/11/2026
Commentaires
- …
Autres skills de ce dépôt
Skills similaires
api-connector-builder
280kPermet à votre agent de créer de nouvelles connexions API en suivant le modèle existant. À utiliser pour ajouter une intégration sans inventer une nouvelle façon de faire.
api-design
280kAide votre agent à concevoir des API REST selon les bonnes pratiques. Utile pour définir la communication entre API, l'affichage des erreurs et l'organisation des données.
backend-patterns
280kAide votre agent avec les architectures côté serveur et l'optimisation des bases de données. Utile pour créer ou relire du code qui s'exécute sur le serveur.