convert-to-cpm
यह क्या करती है
यह स्किल NuGet package versions को अलग-अलग projects से एक केंद्रीय फ़ाइल में ले जाती है, जिस सेटअप को Central Package Management कहते हैं। यह उन टीमों के लिए है जिनके कई projects के package versions अलग-अलग हो गए हैं।
कब इस्तेमाल करें
- ✓जब solution के कई projects एक ही NuGet package के अलग versions इस्तेमाल करें।
- ✓जब आप Directory.Packages.props फ़ाइल के साथ Central Package Management अपनाना चाहें।
- ✓जब आपको पूरे repository में package versions एक लाइन में लाने हों।
Skill का लिंक
https://github.com/dotnet/skills/blob/main/plugins/dotnet-nuget/skills/convert-to-cpm/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरे solution के दस projects में अलग-अलग Newtonsoft.Json versions हैं। क्या इन्हें एक फ़ाइल में केंद्रीकृत कर सकते हैं?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट जाँचता है कि projects PackageReference इस्तेमाल करते हैं, version बदलावों की योजना बनाता है, केंद्रीय फ़ाइल बनाता है, और फिर build करके पुष्टि करता है कि projects अब भी काम करते हैं।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Convert to Central Package Management
Centralize package versions in Directory.Packages.props while preserving project behavior and producing reviewable before/after evidence.
Choose a mode first
Do this before running builds or changing files.
- Guard mode -- If any in-scope project uses
packages.config, stop. Explain that CPM requiresPackageReferenceand recommend migrating first. Do not create or modify files. - Package-maintenance mode -- A request to update, align, bump, or sync packages authorizes those package edits, not CPM conversion. Audit the named scope, resolve the requested versions, update existing project/shared version declarations, and restore/build every affected CLI target from the directory that establishes its applicable
global.json. Ask only when the version or alignment policy is ambiguous. Do not create or modifyDirectory.Packages.props, remove versions for CPM, or capture conversion artifacts. Complete the package work, then recommend CPM as the durable follow-up. - Conversion mode -- Use only when the user explicitly asks to adopt, enable, or convert to CPM. Follow the workflow below.
If the scope is unclear, ask once before proceeding.
Default execution plan
- Guard: use a minimal scoped detection pass, then answer and stop.
- Package maintenance: use a compact audit, edit only the requested package versions in their existing locations, validate affected targets, then recommend CPM. Do not read conversion references or enter the conversion workflow.
- Conversion: batch the preflight, baseline, audit/mutation, final validation, and report work to avoid redundant turns. Revisit a stage only when new CPM-specific evidence requires a targeted follow-up.
This plan is an efficiency default, not a hard cap. Never omit an in-scope project, imported .props/.targets file, detected complexity, required validation, or deliverable to save a turn. Batch complete work where practical.
Inputs
| Input | Required | Rule |
|---|---|---|
| Scope | Yes | Project, solution, or directory containing the projects to inspect or convert |
| Conflict strategy | For package maintenance or conversion with conflicts | If the user already supplied a strategy such as "use the highest version," apply it without asking again and record its impact. Otherwise stop after the audit and ask before editing. |
Read references only when needed
Never preload all references.
| Condition | Read |
|---|---|
| Entering conversion baseline or producing the package diff | baseline-comparison.md |
A conflict, conditional reference, shared import, security concern, or VersionOverride is detected |
audit-complexities.md |
Placement is unclear or conditional PackageVersion/VersionOverride is required |
directory-packages-props.md |
| A package version uses an MSBuild property | msbuild-property-handling.md |
| Restore or build fails after conversion | validation-and-errors.md |
| Writing the final report | report-template.md |
Conversion workflow
1. Scope and preflight
- Resolve the project/solution scope. For a solution, list its projects. For a directory, search only beneath that directory and create an explicit target set that covers the full scope: use each applicable
.sln/.slnx, then add each project not covered by a solution. Verify that every in-scope project is covered and avoid duplicate work for projects that occur in more than one target. Ask only when overlapping targets or repository boundaries make the intended coverage ambiguous; never ask the user to select one target when that would omit in-scope projects. - Determine CPM management scopes separately from CLI targets. Group projects that will share one central version policy and place one
Directory.Packages.propsat each group's first common ancestor, while respecting existing nearest-file boundaries. Multiple CLI targets can share one CPM file; independent project groups can require separate files. - Check for
packages.config; if found, switch to Guard mode and stop. - Check the scope and ancestors for
Directory.Packages.props. If CPM is already fully enabled, report that and stop. If a partial file exists, preserve it and as
अक्सर पूछे जाने वाले सवाल
अगर कोई project अब भी packages.config इस्तेमाल करे तो?
स्किल रुककर पहले PackageReference पर जाने की सलाह देती है, और उस समय कोई फ़ाइल नहीं बदलती।
क्या यह सिर्फ़ versions अपडेट करती है?
अगर आप packages अपडेट या एक जैसे करने को कहें, तो यह वह काम करती है और अगले कदम के रूप में central management सुझाती है।
क्या यह .slnx फ़ाइलों के साथ काम करती है?
हाँ। यह .sln और .slnx solution फ़ाइलों के साथ-साथ अलग projects के साथ भी काम करती है।
जानकारी
लेखक का मूल विवरण
Convert .NET projects and solutions (.sln, .slnx) to NuGet Central Package Management (CPM) using Directory.Packages.props. USE FOR: converting to CPM, centralizing or aligning NuGet package versions across multiple projects, inlining MSBuild version properties from Directory.Build.props into Directory.Packages.props, resolving version conflicts or mismatches across a solution or repository, updating or bumping or syncing package versions across projects. Also activate when packages are out of sync, drifting, or inconsistent -- even without the user mentioning CPM. Provides baseline build capt
repo: dotnet/skills
लोकप्रियता
- GitHub स्टार
- 5.8k
- रैंकिंग में स्थान
- #14610
- लाइसेंस
- MIT
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
create-custom-agent
5.8kयह आपके एजेंट को VS Code के custom agent फ़ाइलें बनाने देती है, जिनके अपने tools, निर्देश और दूसरे agents को handoffs होते हैं।
create-skill
5.8kयह आपके एजेंट को सही नाम, साफ़ trigger विवरण और मानक के अनुसार SKILL.md फ़ाइल वाली नई agent skill बनाने में मदद करती है।
csharp-scripts
5.8kयह आपके एजेंट को .NET command line टूल से एक छोटा C# प्रोग्राम एकल फ़ाइल के रूप में चलाने देती है, पूरा प्रोजेक्ट बनाए बिना।
dotnet-pinvoke
5.8kयह आपके एजेंट को .NET से native C या C++ libraries सही तरीके से कॉल करने में मदद करती है, जिसमें signatures, string संभालना, memory और सुरक्षित handles शामिल हैं।
मिलती-जुलती skills
openclaw-update
394kयह आपके एजेंट को चल रहे OpenClaw Gateway को अपडेट करने में मदद करती है, इंस्टॉल के तरीके के अनुसार सही विधि चुनकर और सेशन बनाए रखकर।
diagnose-gateway
394kयह आपके एजेंट को सेटिंग्स, चैनल और पोर्ट जांचकर पता लगाने देती है कि OpenClaw Gateway क्यों फ़ेल हो रहा है, बिना कुछ बदले।
crabbox-apps
394kयह आपके एजेंट को किसी अस्थायी क्लाउड मशीन पर ऐप खोलने और चलाने देती है, फिर उसका व्यू आपके चैट के साइड पैनल में दिखाती है।