Skip to content

Add worktree create/remove VSCode tasks#24

Merged
sean-parent merged 7 commits into
mainfrom
worktree-worktree-vscode-tasks
Jul 16, 2026
Merged

Add worktree create/remove VSCode tasks#24
sean-parent merged 7 commits into
mainfrom
worktree-worktree-vscode-tasks

Conversation

@sean-parent

@sean-parent sean-parent commented Jul 16, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds worktree: create / worktree: remove VS Code tasks to templates/.vscode/tasks.json, matching the pattern from github.com/stlab/cel-rs: creates a git worktree at .claude/worktrees/<name> on branch worktree-<name>, syncs it with tokensave, and opens it in a new editor window (remove reverses this).
  • Unlike the cel-rs reference, the tokensave calls are wrapped to be best-effort on both bash and Windows (cmd.exe) forms — the worktree still gets created/removed and the editor still opens even if tokensave isn't installed or errors, so the primary git operation is never blocked by an optional integration.
  • Converts templates/.vscode/tasks.json from strict JSON to JSONC (adds // section-divider comments); all 11 pre-existing tasks and 14 inputs are preserved byte-identical.
  • Adds .claude/worktrees/ and .tokensave to templates/.gitignore.
  • No changes needed to cmake/cpp-library-setup.cmake — both files were already registered for template copying.

Test plan

  • cmake -P tests/install/CMakeLists.txt, tests/install/test_provider_merge.cmake, tests/setup/test_setup_version_resolution.cmake all pass (unchanged baseline)
  • JSONC validated via comment-tolerant parser (13 tasks, 15 inputs)
  • Template copies byte-identical into a scratch CPM consumer project
  • worktree: create / worktree: remove command strings tested directly (bash and Windows/cmd.exe forms) with tokensave both present and simulated-absent
  • Independent whole-branch review: pre-existing task/input content confirmed unchanged via semantic diff; tokensave short-circuit logic re-derived and confirmed correct in all 4 variants

🤖 Generated with Claude Code


Note

Low Risk
Template-only and documentation changes; no CMake or runtime library behavior. Shell tasks run git locally in dev environments only.

Overview
Consumer projects get worktree: create and worktree: remove VS Code tasks in templates/.vscode/tasks.json, aligned with cel-rs: prompt for a name, add/remove a worktree under .claude/worktrees/<name> on branch worktree-<name>, optionally sync via tokensave, and open a new window on create.

Unlike the reference, tokensave is best-effort on bash and Windows (cmd.exe overrides): git worktree and code --new-window still run if tokensave is missing or fails. The template tasks.json is JSONC (section // comments); existing CMake/cleanup tasks are unchanged aside from comments and moving inputs to the top with a new worktreeName prompt.

templates/.gitignore now ignores .claude/worktrees/ and .tokensave. Design and implementation plan docs were added under docs/superpowers/.

Reviewed by Cursor Bugbot for commit 0c92a11. Bugbot is set up for automated code reviews on this repo. Configure here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds consumer-template VS Code tasks to create/remove git worktrees under .claude/worktrees/<name> (with best-effort tokensave integration) and updates the template ignore list accordingly, with accompanying design/plan documentation under docs/superpowers/.

Changes:

  • Converted templates/.vscode/tasks.json to JSONC and added worktree: create / worktree: remove tasks plus a worktreeName prompt input.
  • Updated templates/.gitignore to ignore .claude/worktrees/ and .tokensave generated by the new tasks.
  • Added design + implementation plan docs describing the intended behavior and validation approach.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
templates/.vscode/tasks.json Adds worktree create/remove tasks (with Windows overrides) and reorganizes file as JSONC with section comments.
templates/.gitignore Ignores worktree directory and tokensave state generated by the new tasks.
docs/superpowers/specs/2026-07-16-worktree-vscode-tasks-design.md Design spec documenting intended VS Code task behavior and best-effort tokensave wrapping.
docs/superpowers/plans/2026-07-16-worktree-vscode-tasks-plan.md Implementation/verification plan for the template changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/superpowers/plans/2026-07-16-worktree-vscode-tasks-plan.md Outdated
Comment thread docs/superpowers/plans/2026-07-16-worktree-vscode-tasks-plan.md
Comment thread docs/superpowers/plans/2026-07-16-worktree-vscode-tasks-plan.md
…elds

The Step 1 "exactly this content" snippet had gone stale relative to the
shipped templates/.vscode/tasks.json after the final-review detail-field
addition (7be049a). Also relabels the code fence jsonc since it contains
// comments, not strict JSON.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@sean-parent
sean-parent merged commit 92c7daf into main Jul 16, 2026
4 checks passed
@sean-parent
sean-parent deleted the worktree-worktree-vscode-tasks branch July 16, 2026 19:46
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