work-start
Work start
Put the session in the right worktree with the full picture of what is asked, and stop before implementing. Run every wt and gt command from the repo the user is in; wt acts on the clone, so any worktree of it works.
Steps
-
Parse the target.
pr <n>(or a PR URL) is a pull request; a bare number is an issue. Done when you hold one number and its kind. Without a number, ask for one. -
Read it.
- Issue:
df-ti <n>. Whengt issue view <n> --json kind --jq .kindprintspull, the number is a pull request: switch to the PR branch of every later step. - PR:
df-tpr <n>prints its state, base and head branch, body, comments, inline review comments, and review bodies. Read each issue its body lists underresolves:orRelated to.
When the issue or PR has an image you cannot fetch, ask the user to paste it. Done when every ask, every unresolved review comment, and every linked issue has been read.
- Issue:
-
Find existing work. List the worktrees with
wt list --format=jsonand the PRs withgt pr list --state all -L 200 --json number,state,head,title,body.- Issue: a candidate is a worktree or PR whose branch starts with
jd-<n>(eitherjd-<n>-orjd-<n>/), or a PR whose body resolves#<n>. - PR: the candidate is the worktree whose
branchequals the PR's head branch.
wt list --format=jsonprints an object (schema,repo,items, …), not an array; the worktrees are underitems:jq -c '.items[] | select(.branch == "<branch>") | {branch, path: .worktree.path}'. On PR #925 a script that iterated the top level crashed with'str' object has no attribute 'get'. - Issue: a candidate is a worktree or PR whose branch starts with