Conversation
…` task delimiter The skill now accepts `<branch> [<repo>] [-- <task>]`. The optional second token names a different repository to create the worktree in; the skill `cd`s there before calling `EnterWorktree` (which has no repo parameter), then verifies the new worktree landed under the requested repo. The `--` cleanly separates the task. Without one, the second token is the repo when it's path-shaped (absolute, `~`-relative, `./`/`../`-relative, or an existing directory), otherwise it starts the task — so the old shorthand `<branch> <task...>` keeps working. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
worktrunk-bot
left a comment
There was a problem hiding this comment.
The skill grammar reads cleanly and the new safety check for the nested-different-repo case is a nice catch.
One out-of-diff observation: docs/content/claude-code.md still describes the command as `/wt-switch-create <branch> [task...]`, which won't reflect the new optional repo arg or -- delimiter after this lands. Since that file is the primary source for skills/worktrunk/reference/claude-code.md via test_docs_are_in_sync, the published docs page will lag the skill. Happy to push a follow-up commit updating the public docs page if useful.
…ammar The public docs page still showed `/wt-switch-create <branch> [task...]`, which would have lagged the skill spec from the previous commit. Update the signature to `<branch> [<repo>] [-- <task>]` and add a sentence describing the optional repo token and the `--` task delimiter. `skills/worktrunk/reference/claude-code.md` re-synced via `test_docs_are_in_sync`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Thanks — pushed
|
The
/wt-switch-createskill now accepts<branch> [<repo>] [-- <task>]. The optional second token names a different repository to create the worktree in (instead of the session's current one); the skillcds into that repo with aBashcall before invokingEnterWorktree(which has no repo parameter), then verifies the new worktree landed under the requested repo as a safety check.The
--cleanly separates the task from the rest. Without one, the parser treats a path-shaped second token (absolute,~-relative,.//../-relative, or an existing directory) as the repo and the remaining tokens as the task — anything else after the branch is task text, so the old shorthand/wt-switch-create my-branch fix the bugkeeps working.Examples in the skill:
Also tidied existing prose: the nesting + different-repo case now stops rather than silently running the task in the wrong repo, and the scope note mentions the repo arg.
The follow-up commit updates the public docs page (
docs/content/claude-code.md) so the/wt-switch-createsignature shown at worktrunk.dev matches the new grammar;skills/worktrunk/reference/claude-code.mdre-synced viatest_docs_are_in_sync.No code or test changes.