Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Moving a Package to a Dedicated Repository


options: type: guide version: 1.0.0 birth: ‘2026-03-02’ token_size: 721

Moving a Package to a Dedicated Repository

A step-by-step guide for extracting a spoke package from the monorepo into its own repository.

Step 1: Create the new repository

mkdir ~/projects/<package_name>
cd ~/projects/<package_name>
git init

Step 2: Copy package files

# Copy the package contents (not the parent directory)
cp -r /path/to/ai_engineering_book/packages/<package_name>/* ~/projects/<package_name>/

# Remove the local .venv (you'll create a new one)
rm -rf ~/projects/<package_name>/.venv

Step 3: Initialize the new repository

cd ~/projects/<package_name>

# Create .gitignore
cat > .gitignore << 'EOF'
__pycache__/
*.py[cod]
.venv/
dist/
*.egg-info/
.pytest_cache/
.coverage
EOF

# Initialize uv and install dependencies
uv sync
uv pip install -e ".[dev]"

# Verify tests pass
uv run pytest tests/ -v
uv run pytest tests/ --cov=. --cov-report=term-missing -q

Step 4: Create initial commit

git add .
git commit -m "feat: Initial <package_name> package

<Brief description of the package.>

Features:
- <Feature 1>
- <Feature 2>
- <Feature N>"

Step 5: Push to GitHub

# Option A: Using GitHub CLI
gh repo create <package_name> --public --source=. --push

# Option B: Manual
git remote add origin git@github.com:<USERNAME>/<package_name>.git
git push -u origin main

If gh is not installed:

sudo dnf install gh

gh auth login

Step 6: Test installation in target project

Conduct a PoC validation to verify the package installs and works correctly from the new repository.

Step 7: Clean up original location

rm -rf /path/to/ai_engineering_book/packages/<package_name>

Optional: Tag a release

cd ~/projects/<package_name>
git tag v0.1.0
git push origin v0.1.0

Then install a specific version:

uv add "<package_name> @ git+https://github.com/<USERNAME>/<package_name>.git@v0.1.0"

Next Steps