Token导航 LogoToken导航TokenDH.com
运维和基础设施需要联网github未标认证来源可访问许可证需确认审计异常

uv-project-migrationuv 项目迁移

Agent Skill

uv-project-migration 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

218

周安装

9

GitHub Stars

1

下载量

71
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:uv-project-migration(uv 项目迁移)
来源仓库:https://github.com/dawiddutoit/custom-claude
仓库路径:skills/uv-project-migration
安装命令:
npx skills add https://github.com/dawiddutoit/custom-claude --skill uv-project-migration
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/dawiddutoit/custom-claude --skill uv-project-migration

简介

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态、代码变更或协作事项进行整理。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装并使用。
  • 安装前需确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写操作。
  • uv-project-migration 属于运维和基础设施类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

uv Project Migration

Purpose

Migrate existing Python projects to uv from pip, Poetry, Pipenv, or Conda. Transfer all dependencies, preserve development configurations, validate functionality, and roll out changes to your team.

Quick Start

Convert an existing project to uv in three commands:

# From pip/requirements.txt project
cd my-legacy-project
uv init --requirements requirements.txt

# From Poetry project
cd my-poetry-project
uv init --pyproject

# Verify everything works
uv run pytest

Your project now uses uv with all original dependencies preserved.

Instructions

Step 1: Understanding When and Why to Migrate

Benefits of migrating to uv:

  • 10-100x faster dependency resolution
  • Simpler syntax than Poetry or Pipenv
  • Single tool replaces pip, poetry, pipenv, virtualenv
  • Better lock file format
  • Excellent cross-platform support

When to migrate:

  • Legacy pip + requirements.txt projects
  • Poetry projects wanting better performance
  • Pipenv projects needing simplified tooling
  • Teams standardizing on one package manager

When to NOT migrate:

  • Projects with complex Poetry features (build backends)
  • Legacy Conda-dependent projects
  • Projects with platform-specific wheels

Step 2: Prepare Your Existing Project

For pip/requirements.txt projects:

cd my-project
ls -la
# Should have: requirements.txt, src/, tests/, setup.py or pyproject.toml

For Poetry projects:

cd my-poetry-project
cat pyproject.toml | head -20
# Should have: [tool.poetry] section with name, version, dependencies

For Pipenv projects:

cd my-pipenv-project
ls -la
# Should have: Pipfile, Pipfile.lock

Backup your project:

git add .
git commit -m "Backup before uv migration"
git branch backup-pre-uv-migration

Step 3: Automatic requirements.txt Conversion

For pip projects with requirements.txt:

# Navigate to project
cd my-project

# Initialize uv with existing requirements
uv init --requirements requirements.txt

# This creates:
# - pyproject.toml (from requirements.txt)
# - .python-version (from current Python)
# - uv.lock (resolved lock file)

Verify pyproject.toml was created:

cat pyproject.toml
# Should contain all your dependencies from requirements.txt

Complex requirements files:

# If you have multiple requirements files
uv init
uv add --dev -r dev-requirements.txt
uv add -r prod-requirements.txt

Step 4: Migrate from Poetry

For Poetry projects (pyproject.toml):

cd my-poetry-project

# Option A: Automatic conversion
uv init --pyproject

If automatic fails, manual conversion:

# 1. Create uv project
uv init

# 2. Copy dependencies from Poetry to uv
# Edit pyproject.toml:
# Change [tool.poetry] section → [project] section
# Change "poetry" dependencies format → standard format

# Before (Poetry):
[tool.poetry.dependencies]
python = "^3.11"
fastapi = "^0.104.0"

# After (uv/standard):
[project]
requires-python = ">=3.11"
dependencies = [
    "fastapi>=0.104.0,<1.0.0",
]

# 3. Add Poetry dev dependencies as uv groups
[dependency-groups]
dev = [
    "pytest>=8.0.0",
    "black>=23.0.0",
]

Resolve dependencies:

uv sync --all-groups

Step 5: Migrate from Pipenv

For Pipenv projects (Pipfile/Pipfile.lock):

cd my-pipenv-project

# 1. Read Pipfile to understand structure
cat Pipfile

# 2. Create uv project
uv init

# 3. Convert Pipfile to pyproject.toml
# Edit pyproject.toml following this pattern:

# From Pipfile:
[packages]
django = ">=3.2"
requests = "~=2.31.0"

[dev-packages]
pytest = "*"
black = "*"

# To pyproject.toml:
[project]
dependencies = [
    "django>=3.2",
    "requests>=2.31.0,<2.32.0",
]

[dependency-groups]
dev = [
    "pytest",
    "black",
]

Resolve dependencies:

uv sync --all-groups

Step 6: Testing and Validation

Verify migration worked:

# Check dependencies resolved
uv tree

# Run existing tests
uv run pytest

# Run linting/type-checking if applicable
uv run mypy src/
uv run ruff check src/

# Run application if applicable
uv run python -m myapp

Compare lock files (if migrating from Poetry/Pipenv):

# List dependencies from uv
uv tree > /tmp/uv-deps.txt

# Compare counts
wc -l /tmp/uv-deps.txt
# Should be similar to old package manager

Performance comparison:

# Original tool (e.g., poetry)
time poetry install

# New tool (uv)
time uv sync
# uv should be significantly faster

Step 7: Team Onboarding and Rollout

Prepare team documentation:

# Create MIGRATION_GUIDE.md or update README.md
# Include:
# 1. Why we're migrating
# 2. What changed (commands, workflow)
# 3. Installation instructions
# 4. Common troubleshooting

Update project documentation:

## Installation and Setup

### Prerequisites
- uv installed: `curl -LsSf https://astral.sh/uv/install.sh | sh`

### Setup Development Environment

cd project-directory uv sync --all-groups # Install all dependencies uv run pytest # Run tests


### Commands Changed

| Old Command | New Command | Notes |
| --- | --- | --- |
| poetry install | uv sync | No equivalent needed |
| poetry add requests | uv add requests | Simpler syntax |
| poetry run pytest | uv run pytest | Shorter prefix |
| pipenv install | uv sync | Automatic resolution |
| pip install -r requirements.txt | uv sync | All in pyproject.toml |

Rollout strategy:

# Step 1: Merge migration to main branch
git add pyproject.toml uv.lock
git commit -m "Migrate project to uv package manager"
git push

# Step 2: Team pulls and verifies
git pull
uv sync --all-groups
uv run pytest  # Verify tests pass

# Step 3: Update CI/CD pipelines
# (See uv-ci-cd-integration skill for details)

# Step 4: Optional: Remove old tool files
rm requirements.txt      # If migrating from pip
rm Pipfile Pipfile.lock  # If migrating from Pipenv
git add -A
git commit -m "Remove old package manager files"

Examples

Example 1: Migrate Simple pip Project

# Original project structure
ls -la
# pyproject.toml (minimal)
# requirements.txt (your dependencies)
# src/
# tests/

# Migrate
cd ~/my-project
uv init --requirements requirements.txt

# Verify
cat pyproject.toml
uv tree

# Test
uv run pytest

# Commit
git add .
git commit -m "Migrate to uv"

Example 2: Migrate Poetry Project to uv

# Original Poetry project
cd ~/poetry-project
cat pyproject.toml | grep -A 10 "\[tool.poetry\]"

# Migrate (automatic)
uv init --pyproject

# If automatic fails, manual steps:
# Edit pyproject.toml to convert [tool.poetry] → [project]
# Ensure all dependencies are listed correctly

# Verify migration
uv sync --all-groups
uv tree
uv run pytest

Example 3: Migrate Pipenv Project

# Original Pipenv project
cd ~/pipenv-project
cat Pipfile

# Convert Pipfile → pyproject.toml manually
# Edit Pipfile, copy/transform dependencies

# Create uv project
uv init

# Edit pyproject.toml with converted dependencies
# Run
uv sync --all-groups

# Verify
uv tree
uv run pytest

Example 4: Multi-Stage Migration with Testing

# Step 1: Create feature branch
git checkout -b feature/migrate-to-uv

# Step 2: Setup uv
uv init --requirements requirements.txt

# Step 3: Validate thoroughly
uv sync --all-groups
uv run pytest
uv run mypy src/
uv run ruff check src/

# Step 4: Check for differences
uv tree
# Compare with original project structure

# Step 5: Commit and PR
git add pyproject.toml uv.lock
git commit -m "chore: migrate to uv package manager"
git push origin feature/migrate-to-uv

# Step 6: After merge, notify team
# - Update README.md with new commands
# - Create documentation for team setup
# - Remove old requirement files after validation

Example 5: Rollback if Issues Found

# If migration has problems, rollback
git checkout main
git reset --hard HEAD~1  # Undo last commit

# Or restore from backup branch
git checkout backup-pre-uv-migration

# Debug the issue
# - Check pyproject.toml for syntax errors
# - Verify all dependencies listed
# - Try uv sync --all-groups again

Example 6: Monorepo Migration

# Monorepo structure
ls -la
# project-a/
# project-b/
# shared-lib/

# Migrate project-a
cd project-a
uv init --requirements requirements.txt

# Add shared library as path dependency
uv add --editable ../shared-lib

# Migrate project-b
cd ../project-b
uv init --requirements requirements.txt

# Add shared library
uv add --editable ../shared-lib

# Sync everything
cd ..
uv sync --all-groups

Requirements

  • uv installed (install: curl -LsSf https://astral.sh/uv/install.sh | sh)
  • Existing Python project with dependencies (pip, Poetry, Pipenv, or Conda)
  • Git repository (recommended for backup/rollback)
  • Python 3.8+ available
  • Access to package index (PyPI) during migration

See Also

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.95%
按下载量换算26

Claude

31.05%
按下载量换算22

Cursor

21.37%
按下载量换算15

Gemini CLI

9.36%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

未通过

Snyk

未通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills