Zig bindings for all 506 operations of the Forgejo API, generated from its own description, and zfj, a command line built on them.
zfj docs agents issue-tracker.md
4.3 kB · 89 lines
Markdown
at main

Issue tracker: Forgejo #

Issues and specs for this repo live as issues on Forgejo at https://git.jcollie.dev/jeff/zfj/issues. Use this repository's own CLI, zfj, for all operations — nix run .# --, or the zfj that zig build leaves in zig-out/bin/. Inside a clone it reads jeff/zfj off the origin remote and reaches the instance logged in to on that remote's host (zfj login jcollie https://git.jcollie.dev once, with a token); -R jeff/zfj names the repository explicitly.

Global options (--paginate, --instance, --debug) go before the command: zfj --paginate issue list, never zfj issue list --paginate.

Conventions #

  • Create an issue: zfj issue create -t "..." -F body.md, or -b - with a heredoc on stdin. Add -l <label> (repeatable) to label it on creation. A title that begins with - is written --title=-....
  • Read an issue: zfj issue view <number> --comments --json; --web opens it in the browser instead, for a person to look at.
  • List issues: zfj --paginate issue list --state open --json, with -l <label>, -a <user> or -S <text> to filter.
  • Comment on an issue: zfj issue comment <number> -b "..."
  • Apply / remove labels: zfj issue edit <number> --add-label "..." / --remove-label "..."
  • List / create labels: zfj label list --json; zfj label create <name> -c <hex> -d "...", adding --force to update a label that already exists rather than fail.
  • Assign: zfj issue edit <number> --add-assignee jeff
  • Close: zfj issue close <number> -c "..." (or -F <file>), which posts the comment saying why and then closes the issue.
  • Reopen: zfj issue reopen <number> -c "...", the same way.
  • Anything zfj issue has no command for: zfj op <operation> performs any operation of the Forgejo API by its operationId, with its params as --name value flags and any request body as JSON on stdin. zfj op lists them, and zfj op <operation> --help describes one.

Forgejo has no sub-issues. To make an issue part of a parent, put Part of #<parent> at the top of the child's body and add the child to a task list (- [ ] #<child>) in the parent's body.

Pull requests as a triage surface #

PRs as a request surface: no. (Set to yes if this repo treats external PRs as feature requests; /triage reads this flag.)

When set to yes, PRs run through the same labels and states as issues. Read them with zfj pr view <n> --comments --json, zfj --paginate pr list --state open --json and zfj pr diff <n>, and comment, label and close them with the issue commands, which take a pull request's number too. Forgejo shares one number space across issues and PRs, so a bare #42 may be either: zfj issue view 42 --json answers for both, with a pull_request field set when it is a PR.

When a skill says "publish to the issue tracker" #

Create a Forgejo issue.

When a skill says "fetch the relevant ticket" #

Read it as in Read an issue above.

Wayfinding operations #

Used by /wayfinder. The map is a single issue with child issues as tickets.

  • Map: a single issue labelled wayfinder:map, holding the Notes / Decisions-so-far / Fog body. zfj issue create -l wayfinder:map ....
  • Child ticket: an issue with Part of #<map> at the top of its body and a task-list entry in the map's body. Labels: wayfinder:<type> (research/prototype/grilling/task). Once claimed, the ticket is assigned to the driving dev.
  • Blocking: Forgejo's native issue dependencies, which are enabled on this repo. Record that <child> is blocked by <blocker> with zfj issue block <child> --by <blocker>, and read a ticket's blockers with zfj issue blockers <child> --json. A ticket is unblocked when every blocker is closed.
  • Frontier query: list the map's open children, drop any that has an open blocker or an assignee; first in map order wins.
  • Claim: zfj issue edit <n> --add-assignee jeff, the session's first write.
  • Resolve: zfj issue close <n> -c "<answer>", then append a context pointer (gist + link) to the map's Decisions-so-far.