본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)5.8k · #14610

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/dotnet/skills/blob/main/plugins/dotnet-nuget/skills/convert-to-cpm/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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.

  1. Guard mode -- If any in-scope project uses packages.config, stop. Explain that CPM requires PackageReference and recommend migrating first. Do not create or modify files.
  2. 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 modify Directory.Packages.props, remove versions for CPM, or capture conversion artifacts. Complete the package work, then recommend CPM as the durable follow-up.
  3. 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.props at 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.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬