convert-to-cpm
하는 일
이 스킬은 개별 프로젝트에 흩어진 NuGet 패키지 버전을 중앙 파일 하나로 옮깁니다. 이 설정을 중앙 패키지 관리(Central Package Management)라고 합니다. 패키지 버전이 서로 어긋난 프로젝트가 여럿인 팀을 위한 스킬입니다.
사용하는 경우
- ✓한 솔루션의 여러 프로젝트가 같은 NuGet 패키지의 다른 버전을 쓸 때.
- ✓Directory.Packages.props 파일로 중앙 패키지 관리를 도입하고 싶을 때.
- ✓저장소 전체의 패키지 버전을 맞춰야 할 때.
스킬 링크
https://github.com/dotnet/skills/blob/main/plugins/dotnet-nuget/skills/convert-to-cpm/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 솔루션의 프로젝트 10개가 서로 다른 Newtonsoft.Json 버전을 씁니다. 하나의 파일로 모아 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트가 프로젝트가 PackageReference를 쓰는지 확인하고, 버전 변경을 계획한 뒤 중앙 파일을 만들고, 빌드로 프로젝트가 여전히 동작하는지 확인합니다.
기술 내용 (원본 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
자주 묻는 질문
프로젝트가 아직 packages.config를 쓰면 어떻게 하나요?
이 스킬은 먼저 PackageReference로 옮기라고 권하고, 그 시점에는 파일을 바꾸지 않습니다.
버전만 업데이트하나요?
패키지 업데이트나 맞추기를 요청하면 그 작업을 하고, 다음 단계로 중앙 관리를 추천합니다.
.slnx 파일과도 되나요?
네. .sln과 .slnx 솔루션 파일, 그리고 개별 프로젝트 모두에서 동작합니다.
상세 정보
작성자의 원본 설명
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
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
create-custom-agent
5.8k에이전트가 자체 도구, 지침, 다른 에이전트로의 핸드오프를 가진 VS Code 커스텀 에이전트 파일을 만들도록 돕습니다.
create-skill
5.8k에이전트가 올바른 이름, 명확한 트리거 설명, 표준을 따르는 SKILL.md 파일로 새 에이전트 스킬을 만들도록 돕습니다.
csharp-scripts
5.8k에이전트가 .NET 명령줄 도구로 작은 C# 프로그램을 전체 프로젝트 없이 단일 파일로 실행하도록 돕습니다.
dotnet-pinvoke
5.8k에이전트가 .NET에서 네이티브 C나 C++ 라이브러리를 올바르게 호출하도록 돕습니다. 시그니처, 문자열 처리, 메모리, 안전 핸들을 다룹니다.
비슷한 스킬
openclaw-update
394k에이전트가 설치 방식에 맞는 방법을 골라 기존 OpenClaw Gateway를 업데이트하고, 세션이 계속 작동하도록 돕습니다.
diagnose-gateway
394k에이전트가 설정, 채널, 포트를 확인해 OpenClaw Gateway가 왜 실패하는지 찾되, 아무것도 바꾸지 않도록 돕습니다.
crabbox-apps
394k에이전트가 임시 클라우드 머신에서 앱을 열고 실행한 뒤, 그 화면을 채팅의 측면 패널에 보여 주도록 돕습니다.