Skip to content

feat(branch): add --clickup to create a branch from a ClickUp task - #175

Merged
baldurpan merged 6 commits into
mainfrom
feature/129-clickup-support
Oct 27, 2026
Merged

baldurpan merged 6 commits into
mainfrom
feature/129-clickup-support

Conversation

@baldurpan

Copy link
Copy Markdown
Contributor

Summary

Adds worktree branch --clickup <ID>, which starts a worktree from a ClickUp task, with clickup.apiToken and clickup.workspaceId config keys set by worktree config. The plan is #129.

Phases

  1. ClickUp client, config keys and token redaction (6f37585)
  2. worktree config ClickUp prompt group (069bf9e)
  3. --clickup on worktree branch (0e0fe7f)
  4. Documentation, skill and the guide (b1b1510)

The release note is .changeset/clickup-support.md (minor). The final commit adds it and removes the branch's context/notes.md.

Not yet checked against a real ClickUp Workspace

Nothing in the repository can call ClickUp, so every response and error shape comes from its documentation. Four owner checks are filed: #171 (live run), #172 (tag rules), #173 (id shapes), #174 (error responses).

Closes #129

…action

Phase 1 of #129. src/integrations/clickup.ts parses short and custom task
ids, fetches a task with the bare personal token under a 15 s bound, maps
401/403, 404, 429, other non-2xx and malformed bodies to distinct ClickUp
messages, and derives the branch name from the typed id and the task's tags.
clickup.apiToken (secret) and clickup.workspaceId join the config keys and
validators, and redactSecrets masks the pk_ token shape.

Gate 1: pnpm check, typecheck, docs typecheck, build, test (1286),
docs:test (69) and the test-marker grep all exit 0.
Gate 2: reviewer subagent, PASS WITH NOTES after one loopback (a test
pinning that the branch segment follows the typed id).
Phase 2 of #129. worktree config gains a ClickUp group: one confirm, the
clickup.apiToken prompt (no default or prefill; an empty answer keeps the
stored token; non-interactive runs name `worktree config clickup.apiToken
<token>`) and an optional clickup.workspaceId prompt that an empty answer
skips. config --list masks the token.

Landed from the round's phase tree (base 6f37585, tip a4da4e7).
Gate 1: pnpm check, typecheck, docs typecheck, build, test (1301),
docs:test (69) and the test-marker grep all exit 0.
Gate 2: reviewer subagent, PASS WITH NOTES.
Phase 3 of #129. worktree branch gains --clickup <task-id> (-c), exclusive
with --github, --jira and --linear. It requires clickup.apiToken, derives
the branch from the task (CU-<id> for a short id, the custom id for a custom
one, prefix from tags), and reports issue {provider:"clickup", key, url} in
--json. --assign --clickup warns that assignment is not supported yet.

Landed from the round's phase tree (base 6f37585, tip 4b19a93), plus one
loopback test in this tree.
Gate 1: pnpm check, typecheck, docs typecheck, build, test (1317),
docs:test (69) and the test-marker grep all exit 0.
Gate 2: reviewer subagent, PASS WITH NOTES after one loopback (a test
pinning that issue.key is the task's custom_id, not the typed id).
Phase 4 of #129. A new ClickUp integration guide (both id kinds, how names
are built, the tag rule, token and workspace id setup, and what is not
verified yet), plus ClickUp beside Linear in the README, the shipped
worktree skill, the branch, config and configuration pages, the guides
index, the chat route map (docs-routes.generated.ts regenerated) and
context/stack.md. The README's ClickUp checkbox is checked.

No changeset: context/release.md writes the note once per feature, at
/feature-close, which overrides the plan's Phase 4 Files line.

Gate 1: pnpm check, typecheck, docs typecheck, build, test (1317),
docs:test (69) and the test-marker grep all exit 0.
Gate 2: reviewer subagent, PASS WITH NOTES after one loopback (custom ids
are sent to ClickUp as typed, not "in any case"); two follow-up one-line
doc fixes from its notes read by the host.

@baldurs-reviewer baldurs-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

code-reviewer: minor issues

This adds worktree branch --clickup <ID> with its ClickUp client, the clickup.apiToken and clickup.workspaceId config keys, the wizard group, token redaction, and docs, skill and README updates. The change is sound. The base URL is fixed, so the token only ever goes to ClickUp; ids are checked against a closed pattern and encoded before any request; the workspace id is encoded in the query; and a missing token or workspace id fails as missing_value before anything is created. The new paths have thorough tests, and the documentation surfaces listed in context/stack.md were all updated in the same change. My only point is minor: a body read that times out is reported under the wrong error code.


Reviewed 2fb611b for baldurpan · claude-opus-5-5 · 26 files · $0.71

Comment thread src/integrations/clickup.ts
The fetch signal also bounds reading the body, so a response whose headers
arrive in time but whose body stalls rejects response.json() with a
TimeoutError. readBody swallowed it and the user saw 'Unexpected response'
with code failed, where the docs promise timeout. It now rethrows the same
'did not answer within 15s' error fetchClickUp raises.

@craig-o-curtis craig-o-curtis 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.

Approving. Read the diff against 2fb611b; CI is green so I didn't rerun the gates.

Checked specifically:

  • Token goes only to the fixed https://api.clickup.com/api/v2 base; ids are matched against a closed pattern and encodeURIComponent'd; workspaceId is digits-only in both the wizard and config <key> <value>, and encoded in the query.
  • Missing token fails as missing_value before the worktree exists; missing workspace id for a custom id also fails before gitCreateWorktree.
  • clickup.apiToken is in SECRET_CONFIG_NAMES and pk_… is in the redaction shapes; the wizard never echoes the stored token as a default.
  • -c doesn't collide with any other flag on branch or the base command.
  • minor is right: new flag and new config keys.
  • Docs surfaces from context/stack.md are all touched (README, command/config/configuration pages, new guide, _meta, chat route map + generated routes, skill).

Non-blocking:

  • The body-read timeout the review bot raised is shared by all four integrations (replied on the thread). Worth one follow-up issue rather than a ClickUp-only fix.
  • A short task id that happens to look like ABC-123 is parsed as a custom id. ClickUp shows short ids as CU-<id> in some places, so someone pasting CU-8675309 would hit the custom-id path and be asked for a workspace id. Probably fine and #173 covers id shapes, but worth confirming there.

@baldurpan

Copy link
Copy Markdown
Contributor Author

@craig-o-curtis on the CU-8675309 point in your review: #173 already lists that case ("CU- followed by an all-digit id (CU-123) parses as a custom id rather than a refusal"), as part of the live-workspace check of id shapes. So it gets confirmed there along with the rest of the D3 grammar, and nothing changes in this pull request.

@craig-o-curtis

Copy link
Copy Markdown
Contributor

@baldurpan Thanks, both settled. Leaving the CU-<digits> parse to #173 is right, and #176 now covers Linear, GitHub and Jira. Nothing else from me; the approval stands on 9611a77.

@baldurpan
baldurpan merged commit 230bee3 into main Oct 27, 2026
2 checks passed
@baldurpan
baldurpan deleted the feature/129-clickup-support branch October 27, 2026 19:43
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.

clickup-support

2 participants