| 1 | --- |
| 2 | description: Claim a g1t work item for this session and load its work context, or open one for the work in hand and claim it |
| 3 | argument-hint: "<work item number> [note] | <title of a new work item>" |
| 4 | allowed-tools: Bash(g1t:*) |
| 5 | --- |
| 6 | |
| 7 | Claim a g1t work item for this session: $ARGUMENTS |
| 8 | |
| 9 | If the first argument is a work item number: |
| 10 | |
| 11 | 1. Run `g1t work view $1` and read it: the definition of done, the |
| 12 | repositories it is linked to and which have landed, who else has |
| 13 | claimed it, its pull requests and what blocks it. |
| 14 | 2. Run `g1t work claim $1`, adding `--note "..."` with the rest of the |
| 15 | arguments if there are any. |
| 16 | 3. Tell me in a few lines what the work item asks for, which repositories |
| 17 | it still needs to land in, whether anyone else holds a claim on it (the |
| 18 | claim command lists them), and anything that blocks it. If someone else |
| 19 | is on it, ask me before starting work. |
| 20 | |
| 21 | If there is no number (or no arguments), this is the work in hand, which |
| 22 | has no work item yet: |
| 23 | |
| 24 | 1. Look for a work item that already covers it: `g1t work list`. If one |
| 25 | does, claim that one as above. |
| 26 | 2. Otherwise run `g1t work claim --title "TITLE"`, with the arguments as the |
| 27 | title (or, with none, a short title for what this session is doing), and |
| 28 | `--body "..."` saying what the change is. It opens the work item in this |
| 29 | repository's workspace, with this repository as its origin, claims it |
| 30 | for this session and attaches the session to it. |
| 31 | 3. Tell me the work item's number and title. |