Claude-skill-registry init-pixi-project
Initialize and scaffold a new Pixi-managed Python project, or upgrade an existing one. Use when the user explicitly mentions "init", "initialize", or "setup" in conjunction with "pixi". Handles existing projects by prompting for confirmation before merging.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/init-pixi-project" ~/.claude/skills/majiayu000-claude-skill-registry-init-pixi-project && rm -rf "$T"
manifest:
skills/data/init-pixi-project/SKILL.mdsource content
Initialize Pixi Project
References
- Usage & Commands: See references/pixi-usage.md for details on
,pixi search
, andadd
.run
Workflow
1. Safety Check & Parameters
- Check for Existing Artifacts: Look for
,pixi.lock
, or apixi.toml
containingpyproject.toml
.[tool.pixi] - Prompt if Exists: If any of these exist, PAUSE and ASK the user:
"Existing Pixi configuration detected. Proceeding will scaffold the directory structure and attempt to merge standard dependencies (scipy, ruff, etc.) into the current environment. This might affect existing functionality. Do you want to proceed?"
- Abort if Rejected: If the user declines, stop.
- Determine Parameters (if proceeding):
- Format: Default to
unless user specifies otherwise.pyproject - Python Version: Target one minor version behind latest stable (e.g., 3.12).
- Format: Default to
2. Initialization (Merge/Create)
Attempt to initialize Pixi.
- Run:
pixi init [PATH] --format [pyproject|pixi] -c conda-forge - Handle Existing:
- If the command fails because the project is already initialized, verify that
exists in the manifest.[tool.pixi] - If it exists, skip to the next step.
- If
exists but lacks Pixi config, the agent should try to append the default Pixi configuration or ask the user ifpyproject.toml
didn't do it automatically.pixi init
- If the command fails because the project is already initialized, verify that
3. Post-Initialization Configuration
A. Handle Custom Project Name
If the user specified a project name different from the current directory name:
- Rename Source:
mv src/<dir_name> src/<project_name> - Update Manifest: Edit
to replace the old name with the new one in:pyproject.toml[project] name = "..."
section (rename the key).[tool.pixi.pypi-dependencies]
B. Scaffolding (Idempotent)
Run the scaffolding script. Pass the project name if custom.
python <path_to_skill>/scripts/scaffold_structure.py [PATH] --package-name <project_name>
C. Gitignore
Check
.gitignore. Append the following if not present:
.pixi/ tmp/ .git/
D. Install Python and Dependencies (Smart Merge)
- Check Python: Check if
is already a dependency.python- If yes, respect the existing version (or ask user if they want to override).
- If no, add it:
pixi add python=<version>
- Add Standard Packages:
- Attempt to add the standard stack:
pixi add --pypi scipy mdutils ruff mkdocs-material mypy attrs omegaconf imageio - Conflict Handling: If
fails due to conflicts with existing packages, try to resolve by:pixi add- Installing the non-conflicting subset.
- Reporting specific conflicts to the user and asking for guidance.
- Attempt to add the standard stack:
- Finalize: Run
.pixi install
4. Verification
- Verify the environment is usable (
works).pixi shell - Verify directory structure.