| name | s-ship |
| description | Ship workflow - sync, test, version bump, commit, push, and create PR in one command |
/s:ship - Ship Workflow
One command to go from local branch to open PR. Handles sync, tests, versioning, commit, push, and PR creation.
Prerequisites
- You must be on a feature branch (not
main or master)
- All work should be committed or staged
- Tests should be passing locally before running this skill
Instructions
Step 1: Pre-flight Checks
- Run
git status to check for uncommitted changes
- If there are uncommitted changes, warn the user:
- Show the list of modified/untracked files
- Ask: "You have uncommitted changes. Should I commit them first, or do you want to handle this manually?"
- If user says commit, create a conventional commit with appropriate message
- Verify you are NOT on
main or master branch. If you are, stop and suggest creating a feature branch first
- Check that a remote named
origin exists: git remote get-url origin
Step 2: Sync with Main Branch
- Fetch latest from origin:
git fetch origin
- Rebase onto main:
git rebase origin/main
- If rebase conflicts occur:
- Show the conflicting files
- Ask user how to resolve
- Do NOT force-continue or abort without user input
- After resolution, continue rebase:
git rebase --continue
Step 3: Run Full Test Suite
- Detect the project test runner:
- If
package.json exists with scripts.test: run npm test
- If
Makefile exists with test target: run make test
- If
pytest.ini or pyproject.toml with pytest config: run pytest
- If
Cargo.toml exists: run cargo test
- If none found, check for any test files and suggest a runner
- STOP if tests fail. Do not proceed to shipping.
- Show the failure output clearly
- Suggest: "Fix the failing tests, then run
/s:ship again"
- Exit the skill
Step 4: Version Bump (if applicable)
- Check if a
VERSION file exists in the project root
- If it exists, read the current version (expected format:
MAJOR.MINOR.PATCH)
- Bump based on flag or default:
- Default (no flag): bump PATCH (e.g., 1.2.3 -> 1.2.4)
- If user passed
--minor: bump MINOR (e.g., 1.2.3 -> 1.3.0)
- If user passed
--major: bump MAJOR (e.g., 1.2.3 -> 2.0.0)
- Write the new version back to
VERSION
Step 5: Update CHANGELOG (if applicable)
- Check if
CHANGELOG.md exists
- If it exists, add a new entry at the top under
## Unreleased or create a new version section:
## [X.Y.Z] - YYYY-MM-DD
### Changes
- {summary of changes from git log since last tag}
- Extract change summaries from
git log --oneline since the last tag or last CHANGELOG entry
Step 6: Create Commit
- Stage all changes: version bump, changelog updates, any remaining files
- Create a commit with conventional message format:
- Detect the primary change type from recent commits and diff:
feat: for new features
fix: for bug fixes
chore: for maintenance
refactor: for refactoring
docs: for documentation
test: for test-only changes
- Use the branch name or latest commit message to derive a concise description
- Example:
feat: add user authentication flow
Step 7: Push to Remote
- Push the branch with upstream tracking:
git push -u origin HEAD
- If push is rejected (e.g., force push needed), warn the user and ask for confirmation before proceeding
Step 8: Create Pull Request
- Use
gh pr create to open a PR:
- If
gh CLI is not available, provide the manual PR URL and instructions
Step 9: Update State
- Update
.planning/STATE.md if it exists:
- Add a decision entry:
| {DATE} | Shipped: {branch-name} | PR #{number} created |
- Update status if this completes a phase
Step 10: Next Steps
Output to the user:
Shipped successfully!
- Branch: {branch-name}
- PR: {pr-url}
- Version: {version} (if applicable)
Next: Run `/s:compound` to capture learnings from this work.
Flags
| Flag | Effect |
|---|
--minor | Bump minor version instead of patch |
--major | Bump major version instead of patch |
--draft | Create PR as draft |
--no-version | Skip version bump even if VERSION exists |
Error Handling
- Tests fail: Stop immediately, show output, suggest fix
- Rebase conflicts: Pause for user resolution
- Push rejected: Warn and ask before force-pushing
- No remote: Suggest adding a remote first
- gh not installed: Provide manual PR URL