Skip to content

qdentity/herdr-worktree-lifecycle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Herdr Worktree Lifecycle

Herdr plugin that dispatches worktree lifecycle events to repo-owned wrappers:

  • worktree.created and worktree.opened run scripts/worktree-setup.
  • worktree.removed runs scripts/worktree-teardown.
  • setup output is captured to private logs under HERDR_PLUGIN_STATE_DIR.
  • setup reports setup... while running, clears it on success, and leaves setup failed on failure when Herdr can attach metadata to the worktree pane.
  • setup completion shows one Herdr notification with the result and duration.

Install:

herdr plugin install qdentity/herdr-worktree-lifecycle

Each onboarded repo must expose executable wrappers with this positional ABI:

scripts/worktree-setup <branch> <worktree> <primary>
scripts/worktree-teardown <branch> <worktree> <primary>

branch may be empty. Resource identity belongs to the repo wrappers and must be derived from the lexical worktree path hash, not the branch. Wrappers inherit cwd from the plugin root (Herdr's install dir), not the worktree or primary checkout; use only the explicit <branch> <worktree> <primary> args, never cwd or $PWD.

Herdr runs plugin hooks asynchronously and concurrently. This plugin serializes events per worktree path and writes setup status markers under HERDR_PLUGIN_STATE_DIR, but a newly opened worktree may still be setting up when an agent starts.

Open the setup log for the current worktree:

herdr plugin action invoke open-setup-log --plugin io.qdentity.worktree-lifecycle

The action opens a new Herdr tab using less +F when available, with a hold-open fallback. If there is no current worktree log, it opens the latest failed setup log. The plugin keeps the latest 20 setup logs per worktree.

About

Herdr plugin: dispatch worktree lifecycle events to repo-owned setup/teardown wrappers

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages