Skip to content

/ship

The ultimate command for shipping code. Runs quality checks, creates commits, and generates pull requests in one streamlined workflow.

Complete end-to-end workflow that:

  • Reviews your code for quality and security
  • Runs the test suite
  • Creates a well-formatted commit
  • Pushes changes to remote
  • Generates a pull request ready for review
Terminal window
/ship [commit message]

Quick mode (skip review):

Terminal window
/ship quick
ArgumentDescription
[commit message]Your commit message - used as the commit subject line
quickSkip code review and auto-generate commit message

The /ship command follows a comprehensive 5-phase workflow:

First, the command validates your changes:

Terminal window
git status
git diff --staged

Automatic validation:

  • No secrets or API keys in code
  • No debug statements (console.log, print())
  • No large blocks of commented-out code
  • Identifies all modified, added, and deleted files

Phase 2: Code Review (unless ‘quick’ mode)

Section titled “Phase 2: Code Review (unless ‘quick’ mode)”

Runs an automated self-review:

  • Code quality: Checks style compliance and best practices
  • Security: Identifies potential vulnerabilities
  • Type safety: Verifies TypeScript types, Python type hints
  • Critical issues: Must be fixed before proceeding
  • Recommendations: Noted but don’t block the ship

Executes your test suite and validates coverage:

Python projects:

Terminal window
pytest -v

TypeScript/JavaScript projects:

Terminal window
pnpm test

Validation checks:

  • All tests must pass
  • No new warnings introduced
  • Code coverage not decreased
  • New code has test coverage

Creates a conventional commit with auto-generated message:

Terminal window
git add -A
git commit -m "type(scope): subject
body explaining the changes
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>"

The commit message follows Conventional Commits format.

Pushes your branch and creates a pull request:

Terminal window
git push -u origin [branch-name]
gh pr create --title "type(scope): description" --body "[PR body]"

The PR includes:

  • Summary of changes
  • Test plan checklist
  • Manual testing notes
  • Link to related issues

Ship a new authentication feature:

Terminal window
/ship "add OAuth2 login support"

Generated commit:

feat(auth): add OAuth2 login support
- Implement Google OAuth provider
- Implement GitHub OAuth provider
- Add session token generation
- Update user model for OAuth data
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>

For small changes where you want to skip the review:

Terminal window
/ship quick

Auto-generates everything and creates the PR immediately.

Terminal window
/ship "fix null user crash in profile endpoint"

Generated commit:

fix(api): handle null user in profile endpoint
The profile endpoint crashed when accessing deleted users.
Added null check and proper 404 response.
Fixes #456
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>

After successful completion, you’ll see a comprehensive ship report:

## Ship Complete
### Commit
**Hash**: `abc1234`
**Message**: `feat(auth): add password reset functionality`
### Changes
| File | Change |
|------|--------|
| `src/auth/reset.ts` | Added |
| `src/auth/routes.ts` | Modified |
| `tests/auth/reset.test.ts` | Added |
### Checks
- [x] Code review passed
- [x] Tests passing (42 tests)
- [x] Coverage: 85% (+3%)
- [x] No security issues
### Pull Request
**URL**: https://github.com/org/repo/pull/123
**Title**: feat(auth): add password reset functionality
**Base**: main
**Status**: Ready for review
### Next Steps
1. Request review from team
2. Address any feedback
3. Merge when approved

The command auto-generates appropriate commit messages based on your changes:

feat(scope): add [feature]
- Added [component/function]
- Implemented [functionality]
- Added tests for [scenarios]
fix(scope): resolve [issue]
- Fixed [bug description]
- Added null check for [case]
- Updated tests
refactor(scope): improve [area]
- Extracted [logic] to [location]
- Renamed [old] to [new]
- Simplified [complex code]
docs(scope): update [documentation]
- Added [section]
- Fixed [errors]
- Updated [examples]

The command automatically validates:

  • All changes are staged
  • No unintended files included
  • Tests pass
  • No secrets in code
  • No debug statements
  • Commit message is descriptive
  • PR description is complete
FlagDescriptionExample
--mode=[mode]Override behavioral mode/ship --mode=token-efficient "fix bug"
--format=[fmt]Output format (concise/detailed)/ship --format=concise quick
--skip-testsSkip test execution/ship --skip-tests "docs update"
  • /commit - Create a commit without PR
  • /pr - Create PR from existing commits
  • /review - Run code review separately
  • /test - Run tests separately

For small changes: Use /ship quick to skip the review and speed up the process.

For critical changes: Let the full workflow run to catch potential issues before they reach reviewers.

For documentation: Use --skip-tests to avoid running the full test suite.

Customization: Modify ship behavior in CLAUDE.md under “Agent Behavior Overrides”.