Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ Shipkit is a layered content system for Claude Code. Skills and guidelines flow
## Quick Start

```bash
# 1. Install shipkit
pip install shipkit
# 1. Install shipkit (uv recommended, pip also works)
uv tool install shipkit # or: pip install shipkit

# 2. Run the interactive installer
shipkit install
Expand Down
2 changes: 1 addition & 1 deletion shipkit/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def uninstall(yes: bool):
click.echo()
click.echo("✅ Shipkit uninstalled successfully.")
click.echo()
click.echo("To reinstall later: pip install shipkit && shipkit install")
click.echo("To reinstall later: uv tool install shipkit && shipkit install")


@main.command()
Expand Down
2 changes: 1 addition & 1 deletion shipkit/core/hooks/update_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def _output_update_message(latest: str, current: str) -> None:
"""Print the update notification for agent context injection."""
print(f"INSTRUCTION: shipkit {latest} is available (current: {current}). "
f'Mention once at a natural pause: "💡 By the way: There\'s a new shipkit version ({latest}) available. '
f"Run /update-shipkit or pip install --upgrade shipkit to update.\" "
f"Run /update-shipkit to update.\" "
f"Then don't mention it again this session.")


Expand Down
67 changes: 49 additions & 18 deletions shipkit/core/skills/update-shipkit/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: update-shipkit
description: Update shipkit to the latest version from PyPI. Handles pip upgrade and core content refresh. Use when update notification appears or user wants latest features.
description: Update shipkit to the latest version from PyPI. Handles uv/pip upgrade and core content refresh. Use when update notification appears or user wants latest features.
---

# Update Shipkit Skill
Expand All @@ -9,7 +9,7 @@ Automated shipkit upgrade workflow.

## When To Use

- When you see: "💡 There's a new shipkit version available"
- When you see: "There's a new shipkit version available"
- When user says: "update shipkit", "upgrade shipkit", "get latest shipkit"
- Periodically to stay current with new features

Expand All @@ -21,15 +21,32 @@ Automated shipkit upgrade workflow.
shipkit --version
```

### Step 2: Check Available Version on PyPI
### Step 2: Detect Installation Method

Determine how shipkit was installed so we use the right upgrade command:

```bash
# Check if installed via uv tool
uv tool list 2>/dev/null | grep shipkit

# Check if installed in a uv-managed environment
pip show shipkit 2>/dev/null | grep Location
```

- If `uv tool list` shows shipkit: it's a **uv tool install**
- If location is inside a `.venv`: it's a **uv/pip project install**
- Otherwise: it's a **regular pip install**

### Step 3: Check Available Version on PyPI

```bash
pip index versions shipkit
# Prefer uv if available
uv pip index versions shipkit 2>/dev/null || pip index versions shipkit
```

Compare current vs available.
Compare current vs available. If already on latest, tell user and stop.

### Step 3: Confirm Upgrade
### Step 4: Confirm Upgrade

Show user:
```
Expand All @@ -42,35 +59,48 @@ New in 0.1.5:
Would you like to upgrade?
```

### Step 4: Upgrade
### Step 5: Upgrade

Use the method matching the installation:

**uv tool install (recommended):**
```bash
uv tool upgrade shipkit
```

**uv pip (project venv):**
```bash
uv pip install --upgrade shipkit
```

**pip fallback:**
```bash
pip install --upgrade shipkit
```

### Step 5: Refresh Core Content
### Step 6: Refresh Core Content

After pip upgrade, refresh core content in ~/.config/shipkit/:
After upgrading the package, refresh core content in ~/.config/shipkit/:

```bash
shipkit upgrade
```

This copies latest core/experimental/advanced from pip package to user space.
This copies latest core/experimental/advanced from the updated package to user space and recreates symlinks.

### Step 6: Verify
### Step 7: Verify

```bash
shipkit --version
```

Should show new version.

### Step 7: Next Steps
### Step 8: Next Steps

Tell user:
```
Shipkit upgraded: 0.1.2 0.1.5
Shipkit upgraded: 0.1.2 -> 0.1.5

Changes take effect:
- New skills: Available immediately (already symlinked)
Expand All @@ -83,17 +113,18 @@ Restart Claude Code to activate new hooks.
## Error Handling

**"No newer version available"**
"Already on latest version (0.1.5)"
-> "Already on latest version (0.1.5)"

**"pip upgrade failed"**
Show error, suggest: pip install --upgrade --force-reinstall shipkit
**"Upgrade failed"**
-> Show error, suggest: `uv pip install --upgrade --force-reinstall shipkit` or `pip install --upgrade --force-reinstall shipkit`

**"shipkit upgrade failed"**
Show error, may need manual cleanup
-> Show error, may need manual cleanup of ~/.config/shipkit/

## Key Principles

- Detect installation method before upgrading (uv tool vs uv pip vs pip)
- Always show what's changing (version numbers)
- Run shipkit upgrade after pip (refreshes core)
- Run `shipkit upgrade` after package upgrade (refreshes core content)
- Remind to restart Claude (hooks)
- Test that upgrade worked (verify version)
4 changes: 3 additions & 1 deletion shipkit/core/skills/update/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ Find the shipkit installation and determine the update path.
- Run `python -c "import shipkit; import pathlib; print(pathlib.Path(shipkit.__file__).parent.parent)"` to find the package root
- Check if it's a git repo: look for `.git/` in the package root
- If git clone: update via git (proceed to step 2)
- If installed via uv/pip: tell user to run `uv pip install --upgrade shipkit` or `uv sync --upgrade-package shipkit`, then skip to step 5
- If installed via uv tool: update with `uv tool upgrade shipkit`, then skip to step 5
- If installed via uv/pip in a venv: update with `uv pip install --upgrade shipkit`, then skip to step 5
- If installed via pip: update with `pip install --upgrade shipkit`, then skip to step 5
- Check for uncommitted local changes to the shipkit repo and warn

### 2. Check for Updates
Expand Down
Loading