Repository navigation
multi: add agent skills for backports, releases and Go bumps - #11580
Open
ziggie1984 wants to merge 7 commits into
Open
ziggie1984 wants to merge 7 commits into
ziggie1984 wants to merge 7 commits into
Conversation
Add an agent skill that creates a backport of a merged PR onto a release branch, or repairs a backport-action draft that stopped on a conflict. It rebuilds the backport with one cherry-pick per parent commit, resolves conflicts against the parent commit rather than the incoming hunk, checks that the PR's dependencies are present on the branch, and runs vet and tests on the touched packages. The helper scripts list the parent commits, resolve import-only conflicts caused by master's btcd v2 modules, and compare each backport commit with its parent by patch-id. That comparison feeds a commit-by-commit parity table in the PR description, so reviewers can see every place the backport differs from the parent and why.
Add an agent skill that walks through cutting a release or release candidate. It asks for the version and the release kind, checks that the series is still supported, opens the version bump PR, creates the signed tag with scripts/tag-release.sh, and follows the CI, signing and publish steps.
Add an agent skill that updates the Go toolchain version and the minimum Go version across the Makefile, CI workflows, Dockerfiles, go.mod files and docs/INSTALL.md, using the repo's two-commit convention.
Claude Code reads skills from .claude/skills and Codex reads them from .agents/skills. Point .agents/skills at .claude/skills with a symlink so both tools load the same files, and add a README that lists each skill and how to add a new one.
Release notes now arrive as fragments in docs/release-notes/unreleased and are folded into the version-wide document when a release is prepared. Update cut-release to match. It now does the following: - folds the fragments in the version bump PR, for release candidates and final releases alike, using the fold tool from master, since the release branches don't ship the tool - re-checks unreleased/ on the release branch right before merging the bump PR, so a backport that merged in the meantime doesn't leave an unfolded fragment behind, as happened with v0.21.7 - runs check-release-notes-consistency.sh release before tagging, which tag-release.sh on the release branches doesn't do yet - ports a patch release's notes to master and deletes the fragments it announced
Replace the hand-maintained file list in bump-golang-version with scripts/bump_go.py. The list had already drifted: it missed seven go.mod files, the govulncheck workflow and the mobile build docs. The script finds every toolchain and minimum Go version pin using one rule per pin format, rather than by matching the version string, since the two versions can be equal. It rewrites the pins and takes the docs/INSTALL.md archive checksums from go.dev's release feed instead of leaving them to be typed in. It then checks the result: all pins of a kind agree, the checksums match go.dev, and no file still mentions a replaced version unless it is excluded on purpose. A rule that no longer matches its file makes the script fail rather than skip it. Replaying d67c9ed and aab1e46 from their parent commits reproduces both commits exactly. The skill now drives the script, and its policy and commit conventions follow recent history.
Replaying every Go bump since 2024 against bump_go.py found two gaps.
The setup-go action names the toolchain's major release ("with Go 1.27
only"), which the script didn't rewrite on the 1.26 -> 1.27 bump. Rules
can now pin the major release only. On a major bump, the leftover scan
also looks for mentions of the old major release.
INSTALL.md checksums were matched by line format, and that format
changed in 7fcbbd4. The script now identifies each SHA256 by its
value on go.dev and swaps in the hash of the same archive for the new
version. status rejects any hash that isn't an archive of the minimum.
Pins are now rewritten only where they hold the anchor version:
Makefile GO_VERSION for the toolchain, the root go.mod for the
minimum. --allow-inconsistent bumps a tree whose pins drifted and
reports the pins it leaves alone.
Add replay_history.sh, which replays past bumps from their parent
commits and requires a byte-identical result. It reproduces df48bd5,
b1f9ca6, d67c9ed and aab1e46, and it fails when the major-only
rule is removed. Older bumps don't replay exactly because they also
fixed hand-made drift, and the replay showed pins those PRs had missed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Description
This adds the agent skills we use for lnd's maintenance processes to the repo.
Claude Code and Codex then load the same skills for everyone who works here,
instead of each person keeping a private copy.
lnd-backportcreates a backport of a merged PR, or repairs abackport-action draft that stopped on a
BACKPORT-CONFLICTcommit. Itcherry-picks the parent commits one at a time, resolves conflicts against the
parent commit rather than the incoming hunk (master's btcd v2 imports,
branch-only context, master-only code inside a conflict hunk), checks that
the PR's dependencies are on the branch, and runs vet and tests. Its scripts
compare each backport commit with its parent by
git patch-id, and thatcomparison produces a commit-by-commit parity table for the PR description.
The v0.20/v0.21 backports of sweep: isolate bad inputs on mempool rejection #10842 ([v0.20.x-branch] Backport #10842: sweep: isolate bad inputs on mempool rejection #11578, [v0.21.x-branch] Backport #10842: sweep: isolate bad inputs on mempool rejection #11579) were rebuilt this way.
cut-releasecovers the release flow, from the version bump PR to thesigned tag via
scripts/tag-release.sh, then CI, signing and publishing.bump-golang-versionis driven byscripts/bump_go.py, so no agent editsversion strings or types checksums. The script finds every toolchain and
minimum Go pin using one rule per pin format, rewrites them, and takes the
docs/INSTALL.mdchecksums from go.dev's release feed. It then checks thatall pins agree and that no replaced version is left anywhere. It replaces a
hand-written file list that had already missed seven
go.modfiles.Claude Code reads
.claude/skills/and Codex reads.agents/skills/..agents/skillsis a symlink to.claude/skills, so both tools load the samefiles.
.claude/skills/README.mdlists the skills and explains how to add a newone. General-purpose skills stay in
lightninglabs/agent-skills.
Steps to Test
quick_validate.pyfrontmatter check.codex execfrom the repo root listslnd-backport,cut-releaseand
bump-golang-version.bump_go.pywas checked against lnd's history and with a forward bump:commit reproduces each one since the pins became consistent byte for byte:
df48bd51c6,b1f9ca66d(major 1.26 → 1.27),d67c9edf8andaab1e4661.scripts/replay_history.shruns this as a regression test,and it fails when a rule is removed.
drifted pins by hand. They also show pins the real PRs missed, which the
script updates (
INSTALL.mdandtools/linters/go.modin7bc88e8360,gen_protos_docker.shin1c76c6198c,kvdb/sqldbgo.modin19b5a1fb05).masterchanges15 files. All the Docker tags and URLs it points to exist, and the tree
builds and passes vet and the
build/sweeptests with Go 1.27.4.make lintpasses with the bumped images (0 issues).bump_go.py statuspasses onmaster,v0.21.x-branchandv0.20.x-branch.parent_commits.shandparity.shagainst the sweep: isolate bad inputs on mempool rejection #10842 backports. Theyreproduced the per-commit SAME/DIFF results and the aggregate diff exactly.
No code changes;
no-changelog.