Skip to content

feat(plugin): ship the wt-switch-create skill in the Claude Code plugin - #2737

Merged
max-sixty merged 1 commit into
mainfrom
agent-skill
May 12, 2026
Merged

max-sixty merged 1 commit into
mainfrom
agent-skill

Conversation

@max-sixty

@max-sixty max-sixty commented May 12, 2026 •

Copy link
Copy Markdown
Owner

Adds wt-switch-create as a second skill in the worktrunk Claude Code plugin. It rides the plugin's WorktreeCreate hook, so shipping it here means anyone who installs the plugin gets the /wt-switch-create command.

/wt-switch-create <branch> [task] calls EnterWorktree, which the plugin maps to wt switch --create <name> --no-cd --format=json — so the new worktree lands in worktrunk's sibling layout (<repo>.<branch>/) rather than under .claude/worktrees/, and the current Claude session re-roots into it. Anything after the branch name runs as the task there. wt switch --create is idempotent, so naming an existing branch just re-enters its worktree.

Also in this PR:

  • .claude-plugin/plugin.json — register the new skill dir.
  • .claude-plugin/CLAUDE.md — refresh the directory-layout tree for two skills; fix the stale worktrunk.skills/ label (the plugin root is the repo root).
  • .claude-plugin/README.md and docs/content/claude-code.md — document the new feature. skills/worktrunk/reference/claude-code.md is regenerated by test_docs_are_in_sync.

No Rust code changed; test_docs_are_in_sync and pre-commit pass.

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One correction to the SKILL.md guidance: wt switch --create is not idempotent — it returns Branch <name> already exists when the branch already exists locally (src/commands/worktree/switch.rs:579-586, exercised by test_switch_create_existing_error and the branch_already_exists.snap snapshot). So calling /wt-switch-create my-branch a second time after the worktree was removed but the branch still exists, or against any pre-existing local branch, will fail in the WorktreeCreate hook rather than re-entering. Inline suggestion below.

Comment on lines +23 to +24
- `wt switch --create` is idempotent: if the branch already exists, this
just re-enters its worktree.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `wt switch --create` is idempotent: if the branch already exists, this
just re-enters its worktree.
- If the branch already exists locally, this call fails with `Branch
<name> already exists`. To re-enter an existing worktree, fetch its
path from `git worktree list` and call `EnterWorktree({path: "..."})`
instead.

wt switch --create errors out on existing local branches (see src/commands/worktree/switch.rs:579 and the BranchAlreadyExists test/snapshot).

`/wt-switch-create <branch> [task]` creates (or re-enters) a worktrunk
worktree and re-roots the current Claude session into it via the plugin's
WorktreeCreate hook, then runs the rest of the arguments as the task there.
Shipping it with the plugin means anyone who installs the plugin gets the
command.

Also refresh `.claude-plugin/CLAUDE.md`'s directory tree (it still labelled
the plugin root `worktrunk.skills/`) and document the new feature in the
plugin README and the Claude Code docs page (skill reference regenerated by
`test_docs_are_in_sync`).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 5a07bc0 into main May 12, 2026
31 checks passed
@max-sixty
max-sixty deleted the agent-skill branch May 12, 2026 04:10
max-sixty added a commit that referenced this pull request May 12, 2026
…eys (#2745)

`license` and `compatibility` aren't recognized Claude Code skill
frontmatter keys — Claude Code ignores them. They were copied over from
`skills/worktrunk/SKILL.md`, which carries them for the agent-skills
discovery feed; a plugin-bundled command skill needs neither.
Frontmatter is now just `name`, `description`, `argument-hint`.

Follow-up to #2737.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
max-sixty added a commit that referenced this pull request May 12, 2026
…2747)

Tidies the plugin skills' YAML frontmatter against the [Agent
Skills](https://agentskills.io/specification) spec, and cleans up a
release-skill step the change makes stale.

- `skills/worktrunk/SKILL.md`: drop the top-level `version: 0.49.0` key.
The spec only defines `name`, `description`, `license`, `compatibility`,
`metadata`, `allowed-tools` at the top level (version, if kept, belongs
under `metadata`), and Claude Code's own field set doesn't include
`version` either. Also drop the
`[package.metadata.release].pre-release-replacements` entry in
`Cargo.toml` that existed solely to bump that line on release.
- `skills/wt-switch-create/SKILL.md`: add `license` and `compatibility`
so both plugin skills carry the same spec-valid metadata.
- `.claude/skills/release/SKILL.md`: step 7 no longer applies
`pre-release-replacements`, and `index.json`'s `SKILL.md` digest no
longer goes stale on release (`cargo release` doesn't touch `SKILL.md`
anymore) — drop the parenthetical and the now-no-op digest-resync
sub-step.
- Both `compatibility` lines now say "the `wt` CLI" rather than
"worktrunk CLI".
- `docs/static/.well-known/agent-skills/index.json` digest regenerated
by `test_docs_are_in_sync`.

Follow-up to #2737 / #2745. No `.rs` changes.

---------

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
@max-sixty max-sixty mentioned this pull request May 13, 2026
max-sixty added a commit that referenced this pull request May 13, 2026
Release v0.50.0.

Highlights:

- Experimental Azure DevOps support (#1256, thanks @mikeyroush; fixes
#1144 from @dlecan) — `wt switch pr:<N>`, `wt list --full`, and `wt
config show --full` recognize Azure DevOps via the `az` CLI.
- Experimental Gitea CI-status detection (#2702) on top of the Gitea
`pr:` shortcut (#1320, thanks @SjB).
- Hooks now resolve `.config/wt.toml` from the worktree they act on —
the primary-worktree fallback is gone, and `post-remove` reads the
removed worktree's config (snapshotted before removal). Approval prompts
collect hook commands from the same worktree. Breaking change for setups
that relied on the primary-worktree fallback; the changelog entry has
the recovery action. (#2690, #2703, #2714, #2717, #2701, #2708, #2727,
#2736, #2748)
- The `wt switch` picker's `alt-r` removal no longer runs unapproved
project hooks (#2746) — the picker's removal path is now routed through
`handle_remove_output` and consults the existing approval state
read-only.
- `wt config alias show` with no name lists every alias's full
definition (#2684, #2691); `wt --help` switches to a compact aliases
pointer (#2688).
- `wt list --branches` warm-run perf: SHA-keyed cache for `main↕` and
`Remote⇅` ahead/behind counts; shared push-remote URL and local-branch
scan (#2704, #2718, #2673).
- Claude Code plugin ships the `wt-switch-create` skill (#2737, thanks
@onetom for #2631).

See `CHANGELOG.md` for the full list (8 Improved, 5 Fixed, 5 Internal).

semver-checks reports breaking library-API changes (new enum variants
without `#[non_exhaustive]`, removed `Branch::github_push_url`, new
trait method on `RemoteRefProvider`), which mandates at minimum a minor
bump pre-1.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants