Manage monorepo and multi-package Python projects with uv workspaces. Covers workspace configuration, member dependencies, shared lockfiles, and building. Use when user mentions uv workspaces, Python monorepo, multi-package projects, workspace members, or shared dependencies across packages.
/plugin marketplace add laurigates/claude-plugins/plugin install python-plugin@lgates-claude-pluginsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
REFERENCE.mdQuick reference for managing monorepo and multi-package projects with UV workspaces.
my-workspace/
├── pyproject.toml # Root workspace config
├── uv.lock # Shared lockfile
├── packages/
│ ├── core/
│ │ ├── pyproject.toml
│ │ └── src/core/
│ ├── api/
│ │ ├── pyproject.toml
│ │ └── src/api/
│ └── cli/
│ ├── pyproject.toml
│ └── src/cli/
└── README.md
[tool.uv.workspace]
members = [
"packages/*",
]
# Or explicit:
members = [
"packages/core",
"packages/api",
"packages/cli",
]
# Exclude patterns
exclude = [
"packages/experimental",
]
[project]
name = "my-core"
version = "0.1.0"
dependencies = []
# Depend on workspace member
[project]
dependencies = ["my-utils"]
[tool.uv.sources]
my-utils = { workspace = true }
# Install all workspace members
uv sync
# Build specific package
uv build --package my-core
# Run in package context
uv run --package my-api python script.py
# Add dependency to specific member
cd packages/my-core
uv add requests
# Lock entire workspace
uv lock
[tool.uv.workspace]
# Glob patterns
members = ["packages/*"]
# Explicit paths
members = [
"packages/core",
"apps/web",
"tools/cli",
]
# Mixed
members = [
"packages/*",
"apps/special",
]
# Exclusions
exclude = ["packages/archived"]
Depend on another workspace member:
# packages/api/pyproject.toml
[project]
name = "my-api"
dependencies = [
"my-core", # Workspace member
"fastapi", # PyPI package
]
[tool.uv.sources]
my-core = { workspace = true }
Development dependencies in root:
# Root pyproject.toml
[dependency-groups]
dev = [
"pytest>=7.0",
"ruff>=0.1.0",
"mypy>=1.7",
]
# All members can use these
Member-specific dependencies:
# packages/api/pyproject.toml
[project]
dependencies = [
"fastapi>=0.110.0",
]
[dependency-groups]
test = [
"pytest-asyncio", # Only for this member
]
# Single lockfile for entire workspace
uv.lock
# Update lockfile
uv lock
# Upgrade specific package across workspace
uv lock --upgrade-package requests
# Sync all members
uv sync
# Build all packages
uv build
# Build specific package
uv build --package my-core
uv build --package my-api
# Build multiple packages
uv build --package my-core --package my-api
# Create root
mkdir my-workspace && cd my-workspace
# Create root pyproject.toml
cat > pyproject.toml << 'EOF'
[tool.uv.workspace]
members = ["packages/*"]
EOF
# Create first package
mkdir -p packages/core
cd packages/core
uv init core
# Create second package
cd ../..
mkdir -p packages/api
cd packages/api
uv init api
# Configure workspace dependency
# Edit packages/api/pyproject.toml to depend on core
# In packages/api/
uv add ../core
# Or manually edit pyproject.toml:
# [project]
# dependencies = ["my-core"]
#
# [tool.uv.sources]
# my-core = { workspace = true }
# Test all packages
uv run pytest packages/*/tests/
# Test specific package
uv run --package my-core pytest
# Run with coverage
uv run pytest --cov=packages
[tool.uv.sources]
my-package = { workspace = true }
[tool.uv.sources]
my-package = { path = "../my-package" }
uv-project-management - Managing individual packagesuv-advanced-dependencies - Path and Git dependenciespython-packaging - Building and publishing workspace packagesThis skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.