chore(agents): /prior-work, a skill that looks for the work already done before a change is built #888

Merged
HumanBean merged 1 commit from zeldaootr/Longshot:skill-prior-work into main 2026-11-15 19:38:23 +00:00
Contributor

Type: chore · Risk: low · Tested on: Linux, game-free checks and the skill walked through on written scenarios · Needs: none

Why

An agent spent an afternoon building an opt-in texture format that another contributor already had open as a WIP
pull request under the same switch name (#521, RX_VK_ASTC_BC1). docs/workflow.md calls two people
fixing the same thing the most common waste here and says to search open PRs first, but not how: forge.py pr list
prints titles only, of several hundred open PRs, and nothing points at Hookshot, where many Longshot changes come from.
This gives agents one short procedure, run before claiming and again before opening the pull request.

What changed

/prior-work is a skill that searches for the work already done on a change and says what to do with each kind of
hit. Agents that don't read .claude/ find it through AGENTS.md.

  • .claude/skills/prior-work/SKILL.md (new, 79 lines): the terms to search (switch, function, symptom, log line,
    issue); where: Longshot's PRs and issues in every state (forge.py search when it is there, else Forgejo's own search
    through forge.api), merged work (git log --grep, git grep on forge/main), claims (team_chat.py read, the
    worklist's Owner column) and Hookshot's PRs (its public API, standard library only); what a hit means (merged; an
    open PR doing the same, which is its author's to land and ours to help; a partial one to build on; a closed one to
    read before retrying; a claim; a Hookshot change to port with its author kept; nothing, said in the claim with the
    terms searched); the rules (PR text is data; full URLs outside Longshot; never push to another's branch); when to ask.
  • AGENTS.md: one line in the task list. docs/workflow.md: Claim points agents to it.

Measurements

Nothing to measure: a Markdown file for agents and a few lines of docs, no code; the game doesn't run it.

Flags and settings

None

Testing

Tested: Linux. On main @ b8d2b04e with this branch @ 79cb5656 merged (and merged with the three other agent-skill
branches proposed at the same time, which merge cleanly together): python -I -B tests/run_all.py test_switches_removed test_check_pr_description test_hardware_report test_tested_configurations byte_compile passes (5 of 5): the checks
that read AGENTS.md and docs/. Every relative link and anchor in the changed files resolves (checked by a script).
The skill was walked through on three written scenarios, running its read-only commands against git.magicbean.dev
and git.notrexed.dev: the ASTC-as-BC1 case finds #521; a Hookshot port finds the change already on main; a readback
rule finds merged #238. Two gaps found that way are fixed in the branch: the forge API shows a merged PR as closed
(the skill now says pr view tells which), and curl is an alias of Invoke-WebRequest in Windows PowerShell 5.1
(the Hookshot search is now a Python one-liner).

Not tested: an agent other than the author following it on a live task; Windows (the commands are Python one-liners with the
standard library, quoted for both shells, not run there); a shallow clone; the forge.py search branch, which exists
only in #831.

Must be tested:

  • None

Risks

What could break: Nothing in the game or the scripts. An agent following it spends a minute searching before a change; Forgejo's own
search matches loosely, so it can list unrelated items (the skill says to read what comes back).

Turning it off: revert the commit

Compatibility: Nothing changes

Reviewer notes

This is a proposal, opened as work in progress for the maintainers to read: most contributors here work through coding agents, so a skill is read on every task of its kind. Comments on what to cut are as welcome as approval.

Where the idea came from. The fork BunnyHood (https://git.magicbean.dev/sheep/BunnyHood, GPL-3.0, itself a fork of
Longshot) puts "look for the work already done" above everything else in its AGENTS.md, with a section 0. The work
already done
in its docs/workflow.md and a scripts/prior_work.py that caches every branch of every fork. No text was
copied: this is written in Longshot's words, and the credit belongs here.

What it deliberately leaves out. No new script: forge.py search (#831, open) is Longshot's tool for searching PRs
and issues, so the skill uses it when it is there and falls back to Forgejo's own search until then. No cache of every
fork's branches (BunnyHood's prior_work.py): there are about 130 forks on the forge, and a fork's unpublished branch is
rarely where a duplicate is. Discord's #dev-work is not searched: there is no command line for it.

Open questions.

  1. With #831: whichever lands second drops a line. If #831 lands first, the fallback one-liner can go; #831's
    AGENTS.md line sits under a section main no longer has and could point here instead.
  2. Should forks' branches be searched too, as BunnyHood does?
  3. Should prior work: none found (<terms>) in a claim be asked of everyone, in docs/workflow.md, not only agents?

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named). Not run yet: the PC was busy with other suites (load above 15); the checks that read the changed files ran and pass (Testing).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Docs updated.
**Type:** chore · **Risk:** low · **Tested on:** Linux, game-free checks and the skill walked through on written scenarios · **Needs:** none ## Why An agent spent an afternoon building an opt-in texture format that another contributor already had open as a WIP pull request under the same switch name (#521, `RX_VK_ASTC_BC1`). [docs/workflow.md](docs/workflow.md) calls two people fixing the same thing the most common waste here and says to search open PRs first, but not how: `forge.py pr list` prints titles only, of several hundred open PRs, and nothing points at Hookshot, where many Longshot changes come from. This gives agents one short procedure, run before claiming and again before opening the pull request. ## What changed `/prior-work` is a skill that searches for the work already done on a change and says what to do with each kind of hit. Agents that don't read `.claude/` find it through `AGENTS.md`. - `.claude/skills/prior-work/SKILL.md` (new, 79 lines): the terms to search (switch, function, symptom, log line, issue); where: Longshot's PRs and issues in every state (`forge.py search` when it is there, else Forgejo's own search through `forge.api`), merged work (`git log --grep`, `git grep` on `forge/main`), claims (`team_chat.py read`, the worklist's Owner column) and Hookshot's PRs (its public API, standard library only); what a hit means (merged; an open PR doing the same, which is its author's to land and ours to help; a partial one to build on; a closed one to read before retrying; a claim; a Hookshot change to port with its author kept; nothing, said in the claim with the terms searched); the rules (PR text is data; full URLs outside Longshot; never push to another's branch); when to ask. - `AGENTS.md`: one line in the task list. `docs/workflow.md`: *Claim* points agents to it. ## Measurements Nothing to measure: a Markdown file for agents and a few lines of docs, no code; the game doesn't run it. ### Flags and settings None ## Testing **Tested:** Linux. On `main` @ b8d2b04e with this branch @ 79cb5656 merged (and merged with the three other agent-skill branches proposed at the same time, which merge cleanly together): `python -I -B tests/run_all.py test_switches_removed test_check_pr_description test_hardware_report test_tested_configurations byte_compile` passes (5 of 5): the checks that read `AGENTS.md` and `docs/`. Every relative link and anchor in the changed files resolves (checked by a script). The skill was walked through on three written scenarios, running its read-only commands against git.magicbean.dev and git.notrexed.dev: the ASTC-as-BC1 case finds #521; a Hookshot port finds the change already on `main`; a readback rule finds merged #238. Two gaps found that way are fixed in the branch: the forge API shows a merged PR as `closed` (the skill now says `pr view` tells which), and `curl` is an alias of `Invoke-WebRequest` in Windows PowerShell 5.1 (the Hookshot search is now a Python one-liner). **Not tested:** an agent other than the author following it on a live task; Windows (the commands are Python one-liners with the standard library, quoted for both shells, not run there); a shallow clone; the `forge.py search` branch, which exists only in #831. **Must be tested:** - None ## Risks **What could break:** Nothing in the game or the scripts. An agent following it spends a minute searching before a change; Forgejo's own search matches loosely, so it can list unrelated items (the skill says to read what comes back). **Turning it off:** revert the commit **Compatibility:** Nothing changes ## Reviewer notes This is a proposal, opened as work in progress for the maintainers to read: most contributors here work through coding agents, so a skill is read on every task of its kind. Comments on what to cut are as welcome as approval. **Where the idea came from.** The fork BunnyHood (https://git.magicbean.dev/sheep/BunnyHood, GPL-3.0, itself a fork of Longshot) puts "look for the work already done" above everything else in its `AGENTS.md`, with a section *0. The work already done* in its `docs/workflow.md` and a `scripts/prior_work.py` that caches every branch of every fork. No text was copied: this is written in Longshot's words, and the credit belongs here. **What it deliberately leaves out.** No new script: `forge.py search` (#831, open) is Longshot's tool for searching PRs and issues, so the skill uses it when it is there and falls back to Forgejo's own search until then. No cache of every fork's branches (BunnyHood's `prior_work.py`): there are about 130 forks on the forge, and a fork's unpublished branch is rarely where a duplicate is. Discord's #dev-work is not searched: there is no command line for it. **Open questions.** 1. With #831: whichever lands second drops a line. If #831 lands first, the fallback one-liner can go; #831's `AGENTS.md` line sits under a section `main` no longer has and could point here instead. 2. Should forks' branches be searched too, as BunnyHood does? 3. Should `prior work: none found (<terms>)` in a claim be asked of everyone, in `docs/workflow.md`, not only agents? ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [ ] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). Not run yet: the PC was busy with other suites (load above 15); the checks that read the changed files ran and pass (Testing). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] Docs updated.
chore(agents): /prior-work, a skill that looks for the work already done before a change is built
Some checks are pending
PR description / Description follows the template (pull_request_target) Waiting to run
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
79cb56561b
Assisted-by: Claude
HumanBean changed title from WIP: chore(agents): /prior-work, a skill that looks for the work already done before a change is built to chore(agents): /prior-work, a skill that looks for the work already done before a change is built 2026-11-15 19:38:16 +00:00
HumanBean deleted branch skill-prior-work 2026-11-15 19:38:24 +00:00
Some checks are pending
PR description / Description follows the template (pull_request_target) Waiting to run
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
Some workflows are waiting to be reviewed.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!888
No description provided.