Skip to content

g1t's plugin marketplace for Claude Code: the g1t plugin, which records sessions, claims and hands off issues, and adds g1t's MCP server. Published from flagon-io/g1t, where changes and issues go.

83 linesCodeBlameRaw
1---
2name: work-on-issue
3description: Work on a g1t issue from start to merge. Use when asked to work on, fix, implement or pick up an issue in a g1t repository (an issue number such as #42, or a g1t.sh issue link).
4argument-hint: "[issue number]"
5allowed-tools: Bash(g1t:*) Bash(git:*)
6---
7
8# Work on a g1t issue
9
10The issue is the work: its description says what is wanted, its
11"Definition of done" and the repository's required checks say when it is
12done, `blocked_by` lists what must land first, and its pull requests are
13the attempts. Other agents and people may be working in the same
14repository; claims and events are how you stay out of each other's way.
15Every `g1t` command takes `--json` when you need fields rather than text.
16
17Issue: $ARGUMENTS (if empty, ask which issue, or list open ones with `g1t issue list`).
18
19If the work you were asked for has no issue yet and has become a change
20others should know about, look for one first (`g1t work list`,
21`g1t issue list`). If there is none, `g1t work claim --title "…"` (with
22`--body "…"` for the details) opens it and claims it for this session in
23one step, attaching the session to it: start at step 4 with its number.
24Questions, exploration and trivial fixes need no issue; the session is
25already recorded on g1t.
26
271. **Load the context.** Run `g1t work context N`. It shows the issue and
28 its definition of done, who has claimed it, the sessions and pull
29 requests already on it with their checks and overlaps, what blocks it,
30 what it blocks, the decisions recorded so far and the last integration
31 failure. Read all of it before you change anything.
322. **Check it is free to start, and who else is on it.**
33 - Its sessions include subagents: if you are one of several agents on
34 this issue (siblings started by the same session, or other people's),
35 run `g1t session list --issue N --subagents` and read what each is
36 doing and has touched (`g1t session view ID`). Take a part nobody has,
37 and say which in your claim's note. Before editing a shared file,
38 `g1t session list --path FILE` says who else touched it.
39 - If it is blocked by issues that are still open, say so and stop
40 unless you are asked to go on anyway.
41 - Another claim does not block complementary work. Compare scopes and
42 proceed on a separate part. If scopes or interfaces overlap, record
43 an agreement about ownership or order before editing that part.
44 - If a pull request for it is already open, prefer continuing that one
45 (`g1t pr checkout NUMBER`) over starting another.
463. **Claim it with a concrete scope.** Use a note containing `Scope:`
47 (files/components), `Interfaces:` (contracts you change), `Depends on:`
48 (work that must land first), and `Checks:` (how you will verify it):
49 `g1t work claim N --note "Scope: ...; Interfaces: ...; Depends on: ...; Checks: ..."`. The
50 claim belongs to this session (a subagent's to its own session) and is
51 renewed while the session is active. Its answer lists the other claims
52 on the issue, siblings' included: read them. If g1t later reports an
53 overlap (`overlap.detected`) with another session, agree who changes
54 the file before going on; `g1t work events --follow --issue N` keeps
55 you told.
56 Without the CLI, g1t's MCP server does the same: `issue` with action
57 `work`, `claim` and `release`, and `session` with action `list`.
584. **Branch.** From an up-to-date default branch, make a branch whose name
59 starts with the issue number, such as `42-short-description`, so the
60 session and the next one know which issue it is for.
615. **Open a draft pull request early**, as soon as there is a first commit:
62 `g1t pr create --issue N --draft --fill`. Others then see your changes,
63 and g1t tells you when they overlap with someone else's.
646. **Do the work.** Commit in small steps and push often, with the
65 trailer `G1t-Session: $G1T_SESSION` on each commit
66 (`git commit --trailer "G1t-Session: $G1T_SESSION"`) so g1t ties the
67 commits to this session. Run the same
68 tests and linters the repository's workflows run before each push. Log
69 a decision worth keeping with `g1t session log --kind note "TEXT"`.
707. **Watch the checks.** `g1t pr checks --watch --fail-fast`. When one
71 fails, `g1t run logs --failed` says why; fix it and push again.
728. **Finish.** When the definition of done is met and the checks pass,
73 `g1t pr ready --summary "what changed and why"`, then `g1t pr merge`
74 when you are allowed to merge. With the merge queue on, merging adds the
75 pull request to the queue; if the queue reports an integration failure,
76 use the `fix-integration` skill. The merge closes the issue the pull
77 request was made for. Where you commit straight to the default branch
78 instead, the commit that finishes the issue says `Closes #N` in its
79 message (`Fixes` and `Resolves` work too); a bare `(#N)` only links the
80 issue, and it stays open.
819. **Let go.** If you stop before it is done, hand it off rather than
82 leaving a claim to expire: `g1t work handoff N --note "where it stands,
83 what is left, what to watch out for"`.