Prepare Worktree

Set up an isolated git worktree for implementing a plan, via `mage dev:prepare-worktree`. Use when asked to "prepare a worktree", "set up a worktree for this plan", or to implement something in a separate workspace rather than on the current branch.

go-vikunja 21e6f7c 1.5 KB Updated

File contents

Preparing a Worktree for Implementation

mage dev:prepare-worktree <name> <plan-path>

Arguments:

  • <name> - Required. Becomes both the folder name and branch name. Use conventions like fix-<description> for bug fixes or feat-<description> for new features.
  • <plan-path> - Required. Path to a plan file (relative to repo root) that will be copied to the new worktree's plans/ directory. Pass "" to skip copying a plan.

This will initialize a new worktree in the parent directory and copy some files over — config.yml with an updated rootpath, and the frontend gets initialized.

Example:

# Create worktree for a bug fix with a plan
mage dev:prepare-worktree fix-position-healing plans/fix-position-healing.md

# Create worktree for a new feature without a plan
mage dev:prepare-worktree feat-dark-mode ""

Result:

parent-directory/
├── main/                    # Original workspace
├── fix-position-healing/    # New worktree
│   ├── config.yml           # With updated rootpath
│   └── plans/
│       └── fix-position-healing.md
└── ...

After creation, tell the user where they can find the new worktree.

go-vikunja/vikunja/tree/main/.agents/skills/prepare-worktree commit 21e6f7cb82

Frequently asked questions

npx skillmds@latest add go-vikunja/prepare-worktree