Migrates .NET documentation code from the legacy ~/samples/snippets/ location to article-relative ./snippets/ projects for an input article file. Use when replacing legacy [!code-*] references, creating compilable C# and Visual Basic snippet projects, or removing migrated legacy snippets.
85%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Migrate code snippets from the legacy ~/samples/snippets/ location to the ./snippets/ location relative to the article that uses the snippet. Legacy snippets are often outdated, incomplete, and unable to compile. New snippets must be complete, compilable, and include project files. Unless the article is part of a language guide, provide both C# and Visual Basic versions of each snippet.
This skill requires one Markdown article file as input. Treat the supplied file as the target article. If the user doesn't provide a file, ask for one before you begin the migration. Don't update other articles that reference the same legacy snippets.
~/samples/snippets/~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/CS/form1.csLegacy code is often written for .NET Framework, incomplete, unable to compile, missing project files, or written with older syntax and patterns.
Legacy article references generally use this syntax:
[!code-{code-language}[description](~/samples/snippets/{path-to-file}#{snippet-identifier})]Follow these steps in order.
~/samples/snippets/ or a relative path that navigates to the repository's samples folder.Choose every required platform, subject, and language path segment. For a language-guide article, omit the language segment. Load and follow the create-snippet-folders skill with the target article and the complete list of chosen segments. Use the returned directories for the migrated files.
Reuse an existing project only when its language, platform, project type, and dependencies are compatible with the migrated code. For each new project, change to its intended snippet directory and use the dotnet CLI to create it. Never create project files manually, and don't specify an output folder with -o.
Use dotnet new console unless the snippet requires another project type, such as Windows Forms. Specify a meaningful project name with -n, such as ClipboardExample or EventsOverview.
For every structure returned by the shared skill, provide the corresponding C# or Visual Basic version. The code must compile, but the project entry point doesn't need to run every snippet.
Replace every legacy reference in the target article with the current directive and a meaningful CamelCase identifier.
Before:
[!code-csharp[description](~/samples/snippets/path/file.cs#snippet1)]After:
:::code language="csharp" source="./snippets/article-name/csharp/file.cs" id="BasicClipboardData":::Build every C# and Visual Basic project that the migration creates or changes. The projects don't need to run, but all builds must succeed.
Use each workflow step title as a heading, and summarize what you did for that step with bullet points. Include all build commands and results, remaining references from other articles, and any legacy files that you couldn't delete.
dotnet/docs
bcbe167
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.