@ship-cli/core 0.1.7 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/bin.js +134 -215
  2. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -186442,7 +186442,10 @@ var checkVcsAvailability = () => gen2(function* () {
186442
186442
  return { available: false, error: isRepoResult.error };
186443
186443
  }
186444
186444
  if (!isRepoResult.isRepo) {
186445
- return { available: false, error: "Not a jj repository" };
186445
+ return {
186446
+ available: false,
186447
+ error: "Not a jj repository. Run 'jj git init --colocate' to set up jj for stacked changes."
186448
+ };
186446
186449
  }
186447
186450
  return { available: true, vcs };
186448
186451
  });
@@ -190352,7 +190355,10 @@ var checkVcsAvailability2 = () => gen2(function* () {
190352
190355
  return { available: false, error: isRepoResult.error };
190353
190356
  }
190354
190357
  if (!isRepoResult.isRepo) {
190355
- return { available: false, error: "Not a jj repository" };
190358
+ return {
190359
+ available: false,
190360
+ error: "Not a jj repository. Run 'jj git init --colocate' to set up jj for stacked changes."
190361
+ };
190356
190362
  }
190357
190363
  return { available: true, vcs };
190358
190364
  });
@@ -191232,7 +191238,7 @@ var command = ship.pipe(
191232
191238
  prCommand
191233
191239
  ])
191234
191240
  );
191235
- var version = "0.1.7" ;
191241
+ var version = "0.1.9" ;
191236
191242
  var run9 = run8(command, {
191237
191243
  name: "ship",
191238
191244
  version
@@ -192796,268 +192802,181 @@ name: ship-cli
192796
192802
  description: Work management system replacing built-in todos with tracked tasks and stacked changes
192797
192803
  ---
192798
192804
 
192799
- ## When to use
192800
-
192801
- **Always use ship instead of the built-in TodoWrite/TodoRead tools.**
192802
-
192803
- Ship provides real task tracking that persists across sessions, supports dependencies between tasks, and integrates with stacked changes for clean PR workflows.
192804
-
192805
- ---
192806
-
192807
- ## Ship Tool Guidance
192808
-
192809
- **IMPORTANT: Always use the \`ship\` tool, NEVER run \`ship\` or \`pnpm ship\` via bash/terminal.**
192805
+ ## Rules
192810
192806
 
192811
- The \`ship\` tool replaces built-in todo management. Use it for all task tracking.
192812
-
192813
- ---
192814
-
192815
- ## Available Actions
192816
-
192817
- ### Task Management
192818
-
192819
- | Action | Description | Required params |
192820
- |--------|-------------|-----------------|
192821
- | \`ready\` | Tasks you can work on (no blockers) | - |
192822
- | \`blocked\` | Tasks waiting on dependencies | - |
192823
- | \`list\` | All tasks (with optional filters) | - |
192824
- | \`show\` | Task details | taskId |
192825
- | \`start\` | Begin working on task | taskId |
192826
- | \`done\` | Mark task complete | taskId |
192827
- | \`create\` | Create new task | title |
192828
- | \`update\` | Update task | taskId + fields |
192829
- | \`block\` | Add blocking relationship | blocker, blocked |
192830
- | \`unblock\` | Remove blocking relationship | blocker, blocked |
192831
- | \`relate\` | Link tasks as related | taskId, relatedTaskId |
192832
- | \`status\` | Check configuration | - |
192833
-
192834
- ### Stack Operations (VCS)
192835
-
192836
- | Action | Description | Required params |
192837
- |--------|-------------|-----------------|
192838
- | \`stack-log\` | View stack of changes from trunk to current | - |
192839
- | \`stack-status\` | Show current change status | - |
192840
- | \`stack-create\` | Create a new change | message (optional), bookmark (optional), taskId (optional) |
192841
- | \`stack-describe\` | Update change description | message |
192842
- | \`stack-sync\` | Fetch, rebase, auto-abandon merged changes | - |
192843
-
192844
- ### Milestone Actions
192845
-
192846
- | Action | Description | Required params |
192847
- |--------|-------------|-----------------|
192848
- | \`milestone-list\` | List project milestones | - |
192849
- | \`milestone-show\` | Get milestone details | milestoneId |
192850
- | \`milestone-create\` | Create new milestone | milestoneName |
192851
- | \`milestone-update\` | Update milestone | milestoneId |
192852
- | \`milestone-delete\` | Delete milestone | milestoneId |
192853
- | \`task-set-milestone\` | Assign task to milestone | taskId, milestoneId |
192854
- | \`task-unset-milestone\` | Remove task from milestone | taskId |
192807
+ 1. **NEVER run via bash:** \`jj\`, \`gh pr\`, \`git\`, \`ship\`, \`pnpm ship\` - use the \`ship\` tool instead
192808
+ 2. **ALWAYS use \`workdir\` parameter** for all commands when in a workspace
192809
+ 3. **NEVER ask user to \`cd\`** - use \`workdir\` instead
192810
+ 4. **On webhook events:** Notify user and ask confirmation BEFORE acting
192855
192811
 
192856
192812
  ---
192857
192813
 
192858
192814
  ## Workflow
192859
192815
 
192860
- 1. Check available work: \`ship\` tool with action \`ready\`
192861
- 2. Start a task: \`ship\` tool with action \`start\` and taskId
192862
- 3. Do the work
192863
- 4. Mark complete: \`ship\` tool with action \`done\` and taskId
192864
-
192865
- ---
192866
-
192867
- ## Task Identifiers
192816
+ ### Start Task
192868
192817
 
192869
- Task IDs use the format \`PREFIX-NUMBER\` where PREFIX is the Linear team key (e.g., \`ENG-123\`, \`PROD-456\`).
192870
-
192871
- To find the correct prefix for your project, use ship tool with action=\`status\`. The team key shown is your task prefix.
192872
-
192873
- **Never hardcode or guess prefixes like \`BRI-\`.** Always get the actual task IDs from \`ready\`, \`list\`, or \`show\` actions.
192874
-
192875
- ---
192876
-
192877
- ## Task Dependencies
192878
-
192879
- Use blocking relationships to track dependencies between tasks.
192880
-
192881
- ### Add a blocker
192882
-
192883
- Use ship tool: action=\`block\`, blocker=\`<task-id>\`, blocked=\`<task-id>\`
192884
-
192885
- Example: If ENG-100 blocks ENG-101, then ENG-100 must be completed before ENG-101 can start.
192886
-
192887
- ### Remove a blocker
192888
-
192889
- Use ship tool: action=\`unblock\`, blocker=\`<task-id>\`, blocked=\`<task-id>\`
192890
-
192891
- ### View blocked tasks
192892
-
192893
- Use ship tool: action=\`blocked\`
192818
+ \`\`\`
192819
+ ship: action=stack-sync # Get latest trunk
192820
+ ship: action=ready # Find work
192821
+ ship: action=start, taskId=<id> # Mark In Progress (Linear only)
192822
+ ship: action=stack-create, message="<type>: <short description>", bookmark="user/<id>-slug"
192823
+ # Store workspace path from output, use for all subsequent workdir params
192824
+ bash: command="pnpm install", workdir=<workspace-path>
192825
+ \`\`\`
192894
192826
 
192895
- ### Link related tasks
192827
+ ### Do Work
192896
192828
 
192897
- Use ship tool: action=\`relate\`, taskId=\`<task-id>\`, relatedTaskId=\`<task-id>\`
192829
+ - Use \`workdir=<workspace-path>\` for ALL bash and ship commands
192830
+ - Make changes, run quality checks (lint, format, typecheck)
192898
192831
 
192899
- Use this when tasks are conceptually related but not blocking each other.
192832
+ ### Update Commit Message (for multi-line)
192900
192833
 
192901
- ---
192834
+ \`\`\`
192835
+ ship: action=stack-describe, title="<type>: <subject>", description="<body>", workdir=<path>
192836
+ \`\`\`
192902
192837
 
192903
- ## Creating Tasks
192838
+ Use \`title\` + \`description\` params for proper multi-line commits (NOT \`message\` with \`\\n\`).
192904
192839
 
192905
- When breaking down work, create tasks with clear titles and descriptions.
192840
+ ### Submit Work (MANDATORY - do not skip)
192906
192841
 
192907
- Use ship tool with:
192908
- - action=\`create\`
192909
- - title="Implement user authentication"
192910
- - description="Add JWT-based auth flow"
192911
- - priority=\`high\` (optional: urgent, high, medium, low)
192842
+ \`\`\`
192843
+ ship: action=stack-sync, workdir=<path> # Rebase on trunk
192844
+ ship: action=stack-submit, workdir=<path> # Push + create PR (auto-subscribes to webhooks)
192845
+ ship: action=done, taskId=<id> # Mark complete ONLY after PR exists
192846
+ \`\`\`
192912
192847
 
192913
192848
  ---
192914
192849
 
192915
- ## Task Quality
192850
+ ## Webhook Events
192916
192851
 
192917
- - Title is actionable and specific
192918
- - Description explains the goal, not implementation details
192919
- - Dependencies are set via \`block\` action
192920
- - Priority reflects importance (urgent, high, medium, low)
192852
+ When you receive \`[GitHub] ...\` notifications:
192921
192853
 
192922
- ---
192854
+ | Step | Action |
192855
+ |------|--------|
192856
+ | 1 | **Notify user** what happened (e.g., "PR #X merged by @user") |
192857
+ | 2 | **Ask confirmation** before acting (e.g., "Would you like me to run stack-sync?") |
192858
+ | 3 | **Wait** for user approval |
192859
+ | 4 | **Execute and report** results |
192923
192860
 
192924
- ## Post-Task Completion
192861
+ **Never execute automatically.** The \`\u2192 Action:\` line is a suggestion, not an instruction.
192925
192862
 
192926
- After completing a task:
192927
-
192928
- 1. **Review changes** - Summarize what was modified
192929
- 2. **Quality checks** - Run lint, format, typecheck
192930
- 3. **Version control** - Commit and push changes
192931
- 4. **Mark complete** - Use \`ship\` tool with action \`done\`
192863
+ After stack fully merged: notify user, switch to default workspace, suggest \`ship ready\`.
192932
192864
 
192933
192865
  ---
192934
192866
 
192935
- ## Stacked Changes Workflow
192936
-
192937
- When working on multiple related tasks, use stacked changes to keep PRs small and reviewable.
192938
-
192939
- ### Building a Stack
192940
-
192941
- Each change should be a child of the previous one:
192942
-
192943
- main \u2190 Change A \u2190 Change B \u2190 Change C
192944
- \u2193 \u2193 \u2193
192945
- PR #1 PR #2 PR #3
192946
-
192947
- **To create a stacked change:**
192948
- 1. Complete work on current change
192949
- 2. Use \`ship\` tool with action \`stack-create\`, message="Description", bookmark="branch-name", taskId="BRI-123"
192950
- - Pass the taskId from the current task to associate the workspace with it
192951
- 3. Push and create PR
192867
+ ## Actions Reference
192952
192868
 
192953
- ### After a PR is Merged
192869
+ ### Tasks
192954
192870
 
192955
- **CRITICAL: Immediately sync the remaining stack after any PR merges.**
192871
+ | Action | Params | Description |
192872
+ |--------|--------|-------------|
192873
+ | \`ready\` | - | Tasks with no blockers |
192874
+ | \`blocked\` | - | Tasks waiting on dependencies |
192875
+ | \`list\` | filter (optional) | All tasks |
192876
+ | \`show\` | taskId | Task details |
192877
+ | \`start\` | taskId | Mark In Progress |
192878
+ | \`done\` | taskId | Mark complete |
192879
+ | \`create\` | title, description, priority?, parentId? | Create task (see template below) |
192880
+ | \`update\` | taskId + fields | Update task |
192881
+ | \`block\` | blocker, blocked | Add dependency |
192882
+ | \`unblock\` | blocker, blocked | Remove dependency |
192883
+ | \`relate\` | taskId, relatedTaskId | Link related tasks |
192956
192884
 
192957
- Use \`ship\` tool with action \`stack-sync\`
192958
-
192959
- This will:
192960
- 1. Fetch latest from remote
192961
- 2. Rebase remaining stack onto updated trunk
192962
- 3. **Auto-abandon merged changes** - Changes that become empty after rebase (their content is now in trunk) are automatically abandoned
192963
- 4. **Auto-cleanup workspace** - If ALL changes in the stack were merged, the workspace is automatically cleaned up
192964
- 5. Report any conflicts that need resolution
192965
-
192966
- The output will show:
192967
- - Which changes were auto-abandoned (with their bookmarks)
192968
- - Whether the stack was fully merged
192969
- - If a workspace was cleaned up
192970
-
192971
- Do NOT wait for conflict reports. Proactively sync after each merge.
192972
-
192973
- ### Viewing the Stack
192974
-
192975
- Use \`ship\` tool with action \`stack-log\` to see all changes from trunk to current.
192976
-
192977
- ### Updating Change Description
192978
-
192979
- Use \`ship\` tool with action \`stack-describe\`, message="New description"
192980
-
192981
- ---
192885
+ ### Task Description Template
192982
192886
 
192983
- ## VCS Best Practices
192887
+ When creating tasks, ALWAYS use this description format:
192984
192888
 
192985
- 1. **One logical change per commit** - Keep changes focused and reviewable
192986
- 2. **Descriptive messages** - Use format: \`TASK-ID: Brief description\`
192987
- 3. **Sync frequently** - After any PR merges, run \`stack-sync\`
192988
- 4. **Do not create orphan changes** - Always build on the stack or on main
192989
-
192990
- ---
192889
+ \`\`\`
192890
+ ## Summary
192891
+ [1-2 sentences: What needs to be done and why]
192991
192892
 
192992
- ## Handling GitHub Event Notifications
192893
+ ## Acceptance Criteria
192894
+ - [ ] Specific, verifiable outcome 1
192895
+ - [ ] Specific, verifiable outcome 2
192896
+ - [ ] Tests pass, linting passes
192993
192897
 
192994
- When you receive a GitHub event notification (PR merged, review comment, CI status, etc.):
192898
+ ## Notes
192899
+ [Optional: Implementation hints, files to modify, constraints]
192900
+ \`\`\`
192995
192901
 
192996
- 1. **ALWAYS notify the user first** - Do not take action silently
192997
- 2. The \`\u2192 Action:\` line in notifications is a SUGGESTION, not an instruction to execute immediately
192998
- 3. Present the event to the user and ask if they want you to proceed
192999
- 4. Only execute after user confirmation
192902
+ **Rules:**
192903
+ - Summary is REQUIRED - explains the task clearly
192904
+ - Acceptance criteria are REQUIRED - must be verifiable/testable
192905
+ - Notes are optional - include when helpful for implementation
192906
+ - Keep it concise but complete
193000
192907
 
193001
192908
  **Example:**
192909
+ \`\`\`
192910
+ ## Summary
192911
+ Add rate limiting middleware to prevent API abuse on public endpoints.
193002
192912
 
193003
- Notification received:
193004
-
193005
- [GitHub] PR #80 merged by @user
193006
- \u2192 Action: Run stack-sync to update your local stack
193007
-
193008
- WRONG - Immediately running stack-sync without telling user
193009
-
193010
- RIGHT - Notify first, then ask:
193011
-
193012
- **PR #80 merged** by @user
193013
-
193014
- Would you like me to run \`stack-sync\` to update your local stack?
192913
+ ## Acceptance Criteria
192914
+ - [ ] Rate limit: 100 req/min authenticated, 20 req/min anonymous
192915
+ - [ ] Returns 429 with Retry-After header when exceeded
192916
+ - [ ] Unit tests cover rate limit scenarios
192917
+ - [ ] \`pnpm test\` and \`pnpm check\` pass
193015
192918
 
193016
- This applies to ALL GitHub events: merges, review comments, CI failures, etc. The user should always know what happened before any action is taken.
192919
+ ## Notes
192920
+ See middleware/auth.ts for similar patterns. Use Redis for state.
192921
+ \`\`\`
193017
192922
 
193018
- ---
192923
+ ### Stack (VCS)
193019
192924
 
193020
- ## Command Output Guidance
192925
+ All support optional \`workdir\` param.
193021
192926
 
193022
- Every ship command includes contextual guidance in its output to help you understand:
192927
+ | Action | Params | Description |
192928
+ |--------|--------|-------------|
192929
+ | \`stack-sync\` | - | Fetch + rebase onto trunk |
192930
+ | \`stack-restack\` | - | Rebase onto trunk (no fetch) |
192931
+ | \`stack-create\` | message?, bookmark?, noWorkspace? | New change (creates workspace by default) |
192932
+ | \`stack-describe\` | title, description? OR message | Update description (use title+description for proper multi-line commits) |
192933
+ | \`stack-submit\` | draft? | Push + create/update PR |
192934
+ | \`stack-status\` | - | Current change info |
192935
+ | \`stack-log\` | - | View stack |
192936
+ | \`stack-squash\` | message | Squash into parent |
192937
+ | \`stack-abandon\` | changeId? | Abandon change |
192938
+ | \`stack-up\` / \`stack-down\` | - | Navigate stack |
192939
+ | \`stack-undo\` | - | Undo last operation |
192940
+ | \`stack-bookmark\` | name, move? | Create/move bookmark |
192941
+ | \`stack-workspaces\` | - | List workspaces |
192942
+ | \`stack-remove-workspace\` | name, deleteFiles? | Remove workspace |
192943
+ | \`stack-update-stale\` | - | Fix stale working copy |
193023
192944
 
193024
- 1. **Next actions** - Suggested next steps based on the command result
193025
- 2. **Workdir** - Explicit working directory path when it has changed (critical for workspace operations)
193026
- 3. **Skill reminder** - Prompt to read this skill when encountering complex situations
192945
+ ### Pull Requests
193027
192946
 
193028
- ### Guidance Format
192947
+ Use these for advanced PR workflows. Note: \`stack-submit\` handles basic PR creation automatically.
193029
192948
 
193030
- \`\`\`
193031
- [Command Output]
192949
+ | Action | Params | Description |
192950
+ |--------|--------|-------------|
192951
+ | \`pr-create\` | draft?, open? | Create PR with Linear task context |
192952
+ | \`pr-stack\` | dryRun? | Create stacked PRs for entire stack |
192953
+ | \`pr-review\` | prNumber? (optional), unresolved?, json? | Fetch PR reviews and comments |
193032
192954
 
193033
- ---
193034
- Next: <suggested actions>
193035
- Workdir: <path> # Only shown when working directory changed
193036
- IMPORTANT: Load skill first \u2192 skill(name="ship-cli") # Only on entry points or complex situations
193037
- Note: <contextual message>
193038
- \`\`\`
192955
+ **\`pr-create\`**: Creates a PR for current bookmark, auto-populating title and body from Linear task. Use when you need rich task context in PR description.
193039
192956
 
193040
- ### Critical: Workspace Deletion
192957
+ **\`pr-stack\`**: Creates PRs for all changes in your stack with proper base targeting. First PR targets main, subsequent PRs target previous bookmark.
193041
192958
 
193042
- When \`stack-sync\` detects a fully merged stack, it automatically:
193043
- 1. Cleans up the workspace (deletes directory)
193044
- 2. Provides the **main repo path** in the \`Workdir:\` line
192959
+ **\`pr-review\`**: Fetches reviews and comments in AI-friendly format. Shows verdicts (APPROVED, CHANGES_REQUESTED), inline code comments with file:line, and conversation threads. Use \`--unresolved\` to filter to actionable items only.
193045
192960
 
193046
- **You MUST use the provided workdir for all subsequent commands**, as the previous workspace directory no longer exists.
192961
+ ### Milestones
193047
192962
 
193048
- Example output:
193049
- \`\`\`
193050
- Stack fully merged! All changes are now in trunk.
193051
- Cleaned up workspace: bri-123-feature
192963
+ | Action | Params | Description |
192964
+ |--------|--------|-------------|
192965
+ | \`milestone-list\` | - | List milestones |
192966
+ | \`milestone-show\` | milestoneId | Milestone details |
192967
+ | \`milestone-create\` | milestoneName, milestoneDescription?, milestoneTargetDate? | Create milestone |
192968
+ | \`task-set-milestone\` | taskId, milestoneId | Assign task |
192969
+ | \`task-unset-milestone\` | taskId | Remove from milestone |
193052
192970
 
193053
192971
  ---
193054
- Next: action=done (mark task complete) | action=ready (find next task)
193055
- Workdir: /Users/dev/project
193056
- IMPORTANT: Load skill first \u2192 skill(name="ship-cli")
193057
- Note: Workspace 'bri-123-feature' was deleted. Use the workdir above for subsequent commands.
193058
- \`\`\`
193059
192972
 
193060
- After seeing this output, use \`workdir=/Users/dev/project\` for the next ship command.
192973
+ ## Troubleshooting
192974
+
192975
+ | Problem | Solution |
192976
+ |---------|----------|
192977
+ | "Working copy is stale" | \`stack-update-stale\` |
192978
+ | Bookmark lost after squash/rebase | \`stack-bookmark\` with \`move=true\` |
192979
+ | Accidentally used jj/gh directly | \`stack-status\` to check, \`stack-undo\` if needed |
193061
192980
  `;
193062
192981
 
193063
192982
  // src/adapters/driven/config/ConfigRepositoryLive.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ship-cli/core",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Linear + jj workflow CLI for AI agents",