Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
646eb49
feat(provider): run a custom issue provider command and validate its …
baldurpan Nov 24, 2026
e3d4900
feat(config): issueProvider.name and issueProvider.command team keys …
baldurpan Nov 24, 2026
8dab5e6
feat(config): per-person approval of an issue provider command from t…
baldurpan Nov 24, 2026
e5176f6
feat(branch): --issue names a branch from a custom issue provider (#357)
baldurpan Nov 24, 2026
da7abb2
feat(branch): assign and start through a custom issue provider (#357)
baldurpan Nov 24, 2026
460ed25
docs(guides): the custom issue provider guide page (#357)
baldurpan Nov 24, 2026
dc2b219
fix(branch): --assign, --start and --dry-run errors name --issue (#357)
baldurpan Nov 24, 2026
fd7481b
fix(branch): refuse an empty --issue as invalid_value (#357)
baldurpan Nov 24, 2026
049add6
fix(config): report issueProvider.name as the pair the resolver reads…
baldurpan Nov 24, 2026
bd34000
docs(config): make the provider's docs and approval message say what …
baldurpan Nov 24, 2026
8e730fd
fix(provider): cut a start answer's from, to and state to 200 charact…
baldurpan Nov 24, 2026
7db7e95
chore(release): note for custom issue providers, retire branch notes …
baldurpan Nov 24, 2026
0ca9e2f
docs(branch): say what --issue does to assign, start and the JSON's a…
baldurpan Nov 24, 2026
74653ea
fix(provider): answer craig's review of the custom issue provider (#357)
baldurpan Nov 24, 2026
3ca529a
docs(branch): name --issue in What It Does and the skill's bounded ca…
baldurpan Nov 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/quiet-trackers-name.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@northguild/worktree": minor
---

Added `--issue`, which names a branch from your own issue tracker through a command you configure as `issueProvider`; `--assign` and `--start` work through it too.
29 changes: 17 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,20 @@ The setup flow can configure:
- `postCreate` for a command to run in each new worktree, such as `pnpm install` (otherwise the steps in `.worktree.yml`, which you approve first with `worktree config --approve`, then the steps in your user config file, else inferred from the lockfile)
- `linear.agentToken`, `linear.webhookSecret`, `linear.agentAllow` and `linear.agentContext` for a Linear agent that starts worktrees: the app's OAuth token and the webhook signing secret (both secret, shown as `***` by `worktree config --list`), the Linear user ids allowed to delegate an issue to it, and `true` to also hand the issue's text to the agent (off by default). `worktree linear-listen` reads them; the wizard never asks for any of them, and a `.worktree.yml` cannot set them

The wizard never asks for `issueProvider.command`, the command that reads issues from your own tracker; set it by name, such as `worktree config issueProvider.command "verk-provider --json"` (from a `.worktree.yml` it needs your approval first, with `worktree config --approve`; from your git config or user config file it needs none).

A repository can also commit a `.worktree.yml` that supplies the team's `defaultSourceBranch`, `branchPrefix.*`,
`jira.host`, `jira.deployment`, `clickup.workspaceId`, `github.repository` and `github.host`, read from the default branch; your own git config overrides it. The
`jira.host`, `jira.deployment`, `clickup.workspaceId`, `github.repository`, `github.host`, `issueProvider.name` and `issueProvider.command`, read from the default branch; your own git config overrides it. The
wizard skips what the file answers, `worktree config --list` marks each value `(.worktree.yml)` or
`(overrides .worktree.yml: <file value>)`, and `worktree config --project` writes a `.worktree.yml` from the
`(overrides .worktree.yml: <file value>)` (an `issueProvider.name` is read from the same place as its command, so one from another place is listed as not in effect), and `worktree config --project` writes a `.worktree.yml` from the
team keys in your git config (never a personal or secret one), uncommitted. See
[Project Configuration](https://northguild.dev/worktree/project-configuration/).

A user config file, `~/.config/worktree/config.yml` (or `$XDG_CONFIG_HOME/worktree/config.yml`, or the path in
`WORKTREE_USER_CONFIG`), holds your personal keys and a fallback for the team keys, for every repository; write it
with `worktree config --user <key> <value>`. It ranks below `.worktree.yml`: the order is a flag, git config,
`.worktree.yml`, the user file, then the built-in default. `worktree config --list` marks its values
`(user config)` or `(overrides user config: <value>)`, and `worktree config <key>` prints the resolved value. A
`(user config)` or `(overrides user config: <value>)`, and `worktree config <key>` prints the resolved value (for `issueProvider.name`, the one in effect). A
secret in it is refused with exit `2`. Its `postCreate` steps run without approval, so keep the file as private
as a shell profile, and mind what a dotfiles sync carries into it. See
[Configuration](https://northguild.dev/worktree/configuration/#user-config-file).
Expand Down Expand Up @@ -273,7 +275,7 @@ worktree help branch

Configuration is stored in Git config under the `northguild.worktree.*` namespace. A committed
`.worktree.yml` can supply the team keys (`defaultSourceBranch`, `branchPrefix.*`, `jira.host`, `jira.deployment`,
`clickup.workspaceId`, `github.repository`, `github.host`); your git config wins over it, and it wins over your user config file and the built-in default. A file's
`clickup.workspaceId`, `github.repository`, `github.host`, `issueProvider.name`, `issueProvider.command`); your git config wins over it, and it wins over your user config file and the built-in default. A file's
`jira.host` receives every teammate's Jira credentials, so review a change to it like code. See
[Project Configuration](https://northguild.dev/worktree/project-configuration/).

Expand Down Expand Up @@ -330,26 +332,28 @@ line, `worktree: no default for <value>; pass <flag>`.
| `--no-open` | `branch` | create the worktree and print its path; call none of Herdr, Rex or the editor |
| `--no-agent` | `branch` | open as usual, start no agent |
| `--install` / `--no-install` | `branch` | force the dependency install on or off for this run |
| `--assign` / `--no-assign` | `branch` | assign the `--github`, `--jira` or `--clickup` issue to you, or not (a Jira issue someone else holds is left alone; a ClickUp task keeps its other assignees) |
| `--start` / `--no-start` | `branch` | move the `--linear` issue to its team's started state, the `--clickup` task to its List's first in-progress status, or the `--jira` issue through its workflow's in-progress transition (the one to the status named In Progress where there are several), once the worktree exists, or not; only a backlog or unstarted Linear issue, an open-status ClickUp task and a Jira issue in the To Do category move (one already in progress is reported, a finished one is left alone, and a Jira workflow with no in-progress status, or several with none named In Progress, is left alone with a warning), and it needs a key with the Write permission (Linear), edit access to the task (ClickUp) or the Transition Issues permission (Jira); a `--start` with no issue flag exits `2` |
| `--issue <reference>` (`-i`) | `branch` | name the branch from an issue in your own tracker: runs the `issueProvider.command` you configured, passes it the reference on stdin and reads the issue it prints; a command from `.worktree.yml` needs your approval first; cannot be combined with `--github`, `--jira`, `--linear` or `--clickup` |
| `--assign` / `--no-assign` | `branch` | assign the `--github`, `--jira` or `--clickup` issue to you, or not (a Jira issue someone else holds is left alone; a ClickUp task keeps its other assignees); with `--issue` it asks your provider, when the provider says it can assign, and warns and does nothing when it cannot |
| `--start` / `--no-start` | `branch` | move the `--linear` issue to its team's started state, the `--clickup` task to its List's first in-progress status, or the `--jira` issue through its workflow's in-progress transition (the one to the status named In Progress where there are several), once the worktree exists, or not; only a backlog or unstarted Linear issue, an open-status ClickUp task and a Jira issue in the To Do category move (one already in progress is reported, a finished one is left alone, and a Jira workflow with no in-progress status, or several with none named In Progress, is left alone with a warning), and it needs a key with the Write permission (Linear), edit access to the task (ClickUp) or the Transition Issues permission (Jira); a `--start` with no issue flag exits `2`; with `--issue` it asks your provider, when the provider says it can start an issue, and warns and does nothing when it cannot |
| `--linear` with no identifier | `branch` | list your own unstarted and started Linear issues (title and state, escaped) and pick one, then carry on as if you had typed its identifier; it needs a terminal, so `--json`, `--yes`, `--non-interactive`, CI, no terminal and `--dry-run` refuse with exit `2` and `missing_value` before any request |
| `--dry-run` | `branch` | with an issue flag (a `--linear` needs its identifier): print the branch name, the rule behind its prefix and the issue's fields with ids and paste-ready `when:` lines, and create, assign, save and ask nothing; `--json` prints its own document (`dryRun`, `branch`, `issue`, `kind`, `match`, `fields`, `warnings`) |
| `-f`, `--force` | `remove` | skip the confirmation; required when non-interactive |

### Defaults when non-interactive

- **Branch name** from `--github`: by default `<prefix><number>-<slug>` (a `branchName` template in `.worktree.yml` changes the shape), the slug cut to 48 characters at the last dash.
- **Branch name** from `--github` (or `--issue`, whose provider supplies the key and title): by default `<prefix><number>-<slug>` (a `branchName` template in `.worktree.yml` changes the shape), the slug cut to 48 characters at the last dash.
With no issue, the name is required.
- **Assignment:** `--assign`/`--no-assign`, then `github.autoAssign`, `jira.autoAssign` or `clickup.autoAssign`, then assign. The default is never saved.
- **Start (Linear, ClickUp, Jira):** `--start`/`--no-start`, then `linear.autoStart`, `clickup.autoStart` or `jira.autoStart`, then start: a non-interactive `--linear` run moves a backlog or unstarted issue to started, a non-interactive `--clickup` run moves an open-status task to the List's first in-progress status, and a non-interactive `--jira` run moves a To Do issue to its in-progress status, unless `--no-start` or the key is `false`. The default is never saved, and a failed move warns and changes no exit code.
- **Assignment:** `--assign`/`--no-assign`, then `github.autoAssign`, `jira.autoAssign`, `clickup.autoAssign` or `issueProvider.autoAssign`, then assign. The default is never saved.
- **Start (Linear, ClickUp, Jira, your provider):** `--start`/`--no-start`, then `linear.autoStart`, `clickup.autoStart`, `jira.autoStart` or `issueProvider.autoStart`, then start: a non-interactive `--linear` run moves a backlog or unstarted issue to started, a non-interactive `--clickup` run moves an open-status task to the List's first in-progress status, and a non-interactive `--jira` run moves a To Do issue to its in-progress status, unless `--no-start` or the key is `false`. The default is never saved, and a failed move warns and changes no exit code.
- **Install:** on. The command is your `postCreate`, else the steps under `postCreate` in `.worktree.yml`, else the
steps in your user config file (no approval), else inferred from the lockfile (`pnpm-lock.yaml`, `package-lock.json`, `yarn.lock`, `bun.lock`). Steps from the
file need your approval first; unapproved, a non-interactive run exits `2` (`missing_value`) before anything is
created, naming `worktree config --approve` (in a terminal) and `--no-install`. It never prints a value to approve with. With nothing to run it says so and carries on. A failure keeps
the worktree, starts nothing and exits `1`.
- **Issue provider command:** a command from `.worktree.yml` runs only once you have approved that exact command line, with `worktree config --approve` in a terminal. Unapproved, a non-interactive run and `--dry-run` exit `2` (`missing_value`) before the provider starts, naming `worktree config --approve` and printing no value to approve with. A command from your git config or user config file needs no approval.
- **Source branch:** `defaultSourceBranch` (git config, else `.worktree.yml`, else your user config file), else `origin/main` with a warning.
- **Removal** has no default: `remove <branch> -f`.
- **Bounded calls:** GitHub, Jira, Linear and ClickUp requests 15 s, `git fetch` 60 s, `gh auth token` and the session listing
- **Bounded calls:** GitHub, Jira, Linear and ClickUp requests 15 s, an `--issue` provider call 15 s (and at most 1 MiB of output), `git fetch` 60 s, `gh auth token` and the session listing
10 s, the install 10 min. A command still running at its bound is sent SIGTERM, then SIGKILL 2 s later, so
one that ignores SIGTERM cannot hold the run open.

Expand All @@ -373,8 +377,8 @@ worktree branch --github 42 --json --agent-file brief.md
"warnings":[]}
```

- `issue` is `{provider:"github",number,url}`, `{provider:"jira",key,url}`, `{provider:"linear",key,url}`, `{provider:"clickup",key,url}`, or `null`.
- `assigned` is `true` when the issue is yours after the run, `false` when it is not (the attempt failed, a Jira issue is held by someone else, or Jira does not show a Jira issue's assignee), and `null` when no assignment was attempted. `started` is `true` when the `--linear` issue, `--clickup` task or `--jira` issue is in a started state after the run (moved, or already there), `false` when it is not (left alone, no started state to move to, or the attempt failed), and `null` when none was attempted. `herdr`, `rex` and `agent` are `null` when skipped (`rex` is `{session,block}`, with `block` `null` when the session was found rather than reported by `rex new`: one that was already open, or one whose `rex new` timed out and turned up after; `agent` says whether an agent started), and
- `issue` is `{provider:"github",number,url}`, `{provider:"jira",key,url}`, `{provider:"linear",key,url}`, `{provider:"clickup",key,url}`, `{provider:"custom",name,key,url}` (`--issue`; `name` is `issueProvider.name` or `null`), or `null`.
- `assigned` is `true` when the issue is yours after the run (assigned, or already yours), `false` when it is not (the attempt failed, an issue is held by someone else, or Jira does not show a Jira issue's assignee), and `null` when no assignment was attempted (no issue, `--no-assign`, a configured `false`, or a `--issue` provider that does not assign). `started` is `true` when the `--linear` issue, `--clickup` task, `--jira` issue or `--issue` issue is in a started state after the run (moved, or already there), `false` when it is not (left alone, no started state to move to, or the attempt failed), and `null` when none was attempted (no issue flag that starts, `--no-start`, a configured `false`, a `--issue` provider that does not start, or a declined prompt). `herdr`, `rex` and `agent` are `null` when skipped (`rex` is `{session,block}`, with `block` `null` when the session was found rather than reported by `rex new`: one that was already open, or one whose `rex new` timed out and turned up after; `agent` says whether an agent started), and
`agent.command` leaves the brief out. `agent.name` is `null` where this CLI named nothing (a detached start).
- `installed` is `{ran:false,reason}` when skipped. `steps` are the commands that ran, in order; `command` is the
one that failed, else the last that ran; `from` is `"git-config"`, `"project"`, `"user"` or `"lockfile"`. A failed install still prints the whole document, with
Expand Down Expand Up @@ -533,3 +537,4 @@ MIT
- [x] Integrate with JIRA for automated branch naming
- [x] Integrate with Linear for automated branch naming
- [x] Integrate with ClickUp for automated branch naming
- [x] Integrate with your own issue tracker through a custom issue provider command (`--issue`; the [guide](https://northguild.dev/worktree/guides/custom-issue-provider/) is its contract)
4 changes: 2 additions & 2 deletions context/stack.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ scripts/ version-sync script, run by `pnpm sync-version`; `release-
.changeset/ Changesets config and pending release notes (`.changeset/<name>.md`)
skills/ the usage skill, `skills/worktree/SKILL.md`; hand-written, shipped inside the npm package (package.json `files`) and installable with `npx skills add`. Nothing on npm discovers it since TanStack Intent went (`skills add` reads GitHub); it stays in `files` so an `npm i -g` install has a copy matching its own version on disk
docs/ Astro 7 + Starlight docs site, React 19 islands, Base UI; own package.json, `astro.config.mjs`
docs/src/content/docs/ Starlight pages (28 pages: `index.mdx` is the landing at `/worktree/`, `getting-started.mdx` is Getting Started at `/worktree/getting-started/`, plus `commands/` (9 command pages and an index), `guides/` (11 guides and an index), `configuration`, `project-configuration`, `faq` and `changelog`)
docs/src/content/docs/ Starlight pages (29 pages: `index.mdx` is the landing at `/worktree/`, `getting-started.mdx` is Getting Started at `/worktree/getting-started/`, plus `commands/` (9 command pages and an index), `guides/` (12 guides and an index), `configuration`, `project-configuration`, `faq` and `changelog`)
docs/src/ chat client, site metadata, styles; the chat is the page `/dox` (`pages/dox.astro`, one React island, `chat/components/DoxPage.tsx`), reached by plain links only: the header's "Chat with Dox" crystal (`components/Header.astro`, repeated in the mobile menu by `components/MobileMenuFooter.astro`) and the landing's "Ask Dox" (`components/Hero.astro`); `components/DoxMark.astro` draws the crystal, and no page but `/dox` loads chat code; the header's right group ends with the settings gear (`components/SettingsControl.astro`, wired by `lib/settings-control.ts`: a native `[popover]` holding the "Dark theme" switch, whose rule is `lib/theme.ts`; it shows at every width, below 50rem as the only chip of the right group that does, and the mobile menu has no copy); sound is `lib/sound/` (GMT's engine, cut down: `settings.ts` is the reader's choice in the `dox:sound` key shared with GMT and northguild.dev, `cue.ts` is loaded on every page by `components/Head.astro`, and the engine is a chunk only its dynamic `import()` reaches, once a reader has unmuted, and on the landing alone it imports `lib/sound/leaves.ts`, the leaves' voices, driven by the last landing and the sampled landing places `hero/flight.ts` computes, only while sound is on, from the particles' own timings; no press makes a sound but the chat's Send and "Try again"); `components/Hero.astro` puts the landing's copy beside `HeroLeaves.astro` (the leaf-particle hero: a still SVG, a canvas and a small loader script; the effect itself, in `hero/` with OGL, is a chunk only the loader's dynamic `import()` reaches, so the landing alone ships hero script; its CSS is in the shared stylesheet)
docs/src/styles/northguild/ the NorthGuild theme, vendored unedited from `northguild/northguild.dev` `packages/theme/` (each file's header names the commit); `docs/src/styles/theme.css` is this site's own `--gmt-*` → `--sl-*` mapping. To refresh, see `docs/README.md` (Theme)
docs/wrangler.jsonc the docs site's Worker config (assets from `docs/.deploy`, the build staged under `worktree/` and `docs/deploy/_headers` at its root by `stage:deploy`); `docs/scripts/` holds `audit-dist.mjs`, `theme-contrast.mjs` (measures the theme's contrast pairs), `build-legacy-pages.mjs` (writes the gitignored `docs/legacy/`), `deploy-smoke.mjs` and `web-vitals.mjs` (measures Core Web Vitals by hand, not a gate)
Expand Down Expand Up @@ -84,7 +84,7 @@ untrue on one of these surfaces is fixed by the phase that makes it untrue, not
| Surface | Who reads it | What has to reach it |
|---|---|---|
| [`README.md`](../README.md) | someone deciding whether to install; npm renders it as the package page | the fast path — a new command, a renamed flag, a change to what the tool is for |
| `docs/src/content/docs/` | users looking something up, at https://northguild.dev/worktree/ | any user-visible CLI behaviour. One page per command under `commands/` (9), plus `configuration.mdx`, `project-configuration.mdx`, `index.mdx` (the landing), `getting-started.mdx`, `faq.mdx`, and `guides/` (11) |
| `docs/src/content/docs/` | users looking something up, at https://northguild.dev/worktree/ | any user-visible CLI behaviour. One page per command under `commands/` (9), plus `configuration.mdx`, `project-configuration.mdx`, `index.mdx` (the landing), `getting-started.mdx`, `faq.mdx`, and `guides/` (12) |
| [`docs/README.md`](../docs/README.md) | someone working on the docs app | how the docs app is run or built |
| [`docs/worker/README.md`](../docs/worker/README.md) | someone working on the chat proxy | the Worker's routes, secrets or deploy |
| `skills/worktree/SKILL.md` | agents that install the skill with `npx skills add`; shipped in the npm package; its sections are also the docs chat's vocabulary, searched per question | a command or flag change that the skill describes — **but see the caveat below** |
Expand Down
Loading