Skip to content

chore: add maintainer issue fix skill - #4662

Merged
james-elicx merged 6 commits into
mainfrom
chore/fix-skill
Nov 10, 2026
Merged

james-elicx merged 6 commits into
mainfrom
chore/fix-skill

Conversation

@james-elicx

Copy link
Copy Markdown
Member

Adds a maintainer-only issue fix skill, laid out like the triage skill from #4594. It takes a valid bug from reproduction to a review-ready pull request.

Layout

  • .agents/skills/fix/references/rules.md: the shared rules. They read on their own, so an automated fix run can use the file directly as guidance. They cover:
    • safety, and confirming it's a bug (it reuses the triage rules for the Next.js parity check);
    • reproducing first on checked-in fixtures, then sizing the fix and the hard constraints;
    • the caching, rendering and performance rules;
    • validating with targeted tests only, and the commit and PR;
    • how to handle review findings.
    • An "Automated Runs" section covers runs with no chat: the first fix, review rounds, and when to ask the maintainers instead of stopping.
  • .agents/skills/fix/SKILL.md: the interactive entry point (/fix <issue-url> in Claude Code, $fix in Codex). It covers live state through gh, independent sub-agent review, the draft PR and issue reply, CI, the Big Bonk loop, clanky and marking ready. Everything else lives in the shared rules.
  • .agents/skills/fix/agents/openai.yaml: Codex runs the skill only when it's invoked explicitly.
  • .claude/skills/fix: a symlink to .agents/skills/fix, as for triage.
  • .agents/skills/triage/SKILL.md: "the fix step" now points at the fix skill instead of AGENTS.md.

Not offered to users

SKILL.md sets metadata.internal: true, so npx skills add cloudflare/vinext still offers only migrate-to-vinext.

Validation

  • npx skills@1.7.6 add . --list on this branch lists only migrate-to-vinext.
  • vp fmt --check passes on the new and changed files.

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues
Please review exact head 181d20b5ea48189608f658a5e9f3d77dc2f872cf without modifying or pushing the branch. Report all actionable findings within your 8-minute time limit.

@pkg-pr-new

pkg-pr-new Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@vinext/cloudflare

npm i https://pkg.pr.new/@vinext/cloudflare@4662

create-vinext-app

npm i https://pkg.pr.new/create-vinext-app@4662

@vinext/types

npm i https://pkg.pr.new/@vinext/types@4662

vinext

npm i https://pkg.pr.new/vinext@4662

@cloudflare/workers-response-store

npm i https://pkg.pr.new/@cloudflare/workers-response-store@4662

commit: 401f773

Comment thread .agents/skills/fix/references/rules.md Outdated

## 5. Validate

1. Run the regression test and see it pass. Then prove it fails without the fix: commit first, write the pre-fix implementation files over the fix (`git show <base>:<path> > <path>`), run it, and restore them with `git checkout HEAD -- <path>`. Never use `git stash` for this; the stash is shared across worktrees.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pre-fix proof can destroy unrelated work. If the user already has staged or unstaged edits in one of the implementation files, the redirection overwrites the worktree copy and git checkout HEAD -- <path> replaces both the index and worktree with HEAD, contrary to the skill's instruction to preserve unrelated changes. Run the proof in an isolated temporary worktree (or otherwise save and restore the exact index/worktree contents) instead.

- Stage only the intended paths. Never `git add -A` without checking `git status` first.
- Never create `.changeset/*.md` files. Changesets are generated from the commit subject, so write a Conventional Commit: `fix(<area>): <behavior>`. Use `feat` only for new behavior.
- Write PR bodies and scratch files to unique temporary paths (`mktemp`), never fixed names. Other sessions share `/tmp`.
- Open the PR as a draft. Reference the issue with `Fixes #<number>`, unless it is a private or security report.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The preceding rules explicitly support private/security reports, but this still pushes a branch and opens an ordinary draft PR. In this public repository, draft PRs and their branches are public, so merely omitting Fixes #... can disclose the vulnerability and patch. Security reports need the private advisory workflow, or the skill must stop and hand off to a maintainer before pushing anything.

Comment thread .agents/skills/fix/SKILL.md Outdated

Take `<sha>` from `git rev-parse HEAD` right after pushing, not from `gh pr view`, which lags. Never tell Bonk what changed, what to focus on or which findings to confirm. For transform or analysis PRs prone to edge-case churn, you may add that it should only flag issues affecting real-world usage. Never use `/bonk`, only `/bigbonk`.

2. Before triggering, check `gh run list --workflow bigbonk.yml` for a run in progress. If one is, wait for its review first.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gh run list --workflow bigbonk.yml is repository-wide, so this tells the agent to wait whenever any other PR has a Big Bonk run. The workflow itself scopes concurrency per PR (.github/workflows/bigbonk.yml:9-11), so unrelated runs are safe and common. Identify a run for the current PR/trigger rather than treating the first in-progress repository run as a blocker.


2. Before triggering, check `gh run list --workflow bigbonk.yml` for a run in progress. If one is, wait for its review first.
3. Watch CI in parallel. If CI goes red, fix it before the next round.
4. Watch for the first new ask-bonk comment or new PR review posted after the trigger, and address it the moment it lands. Don't re-trigger a silent run before 10 minutes. If a run's log goes quiet for several minutes, cancel it and re-trigger. A posted verdict wins over a later "cancelled" notice.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This watcher misses clean re-reviews: Bonk updates its existing summary comment on subsequent rounds rather than necessarily creating a new comment or review. Such a run will look silent here and then be cancelled, which also contradicts the hard rule on line 27 that running reviews are never cancelled. Track the current workflow run and the summary comment's update instead of waiting only for a newly created item.

4. Watch for the first new ask-bonk comment or new PR review posted after the trigger, and address it the moment it lands. Don't re-trigger a silent run before 10 minutes. If a run's log goes quiet for several minutes, cancel it and re-trigger. A posted verdict wins over a later "cancelled" notice.
5. Handle every finding as "Review Findings" below. Reply to each declined finding in the next trigger comment, then re-trigger on the new head right away. A decline doesn't end the loop.
6. Continue until the latest review on the latest head approves or reports no actionable findings. There is no round cap while findings stay in scope.
7. After a stack rebase, re-trigger only PRs whose own diff changed (compare `git patch-id --stable`). A rebased PR with an identical diff keeps its LGTM.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An unchanged child patch does not make an old approval valid after its base branch changes: the new parent code can change the behavior of the same child diff. This also conflicts with AGENTS.md, which requires /bigbonk after stacked-refactor rebases. Re-review each rebased child against its new base even when its patch-id is unchanged.

Comment thread .agents/skills/fix/SKILL.md Outdated
- the CI workflow's checks on the latest head are green (fix Deploy Examples failures too; don't hold the PR in draft for one pending slow check once everything else is green and Bonk approved);
- the latest Big Bonk review on the latest head has no actionable findings.

clanky reviews a PR only once it is ready. Read its full review and inline comments (`gh api repos/cloudflare/vinext/pulls/<n>/reviews` and `/comments`), including INFO findings and "approved with comments", and handle them as "Review Findings". Once they are handled, comment `clanky review` to request a fresh review, and treat that as another round.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These API paths are hardcoded to cloudflare/vinext, although the Input section permits fixing an issue in another repository after locating its checkout, so that flow will inspect the wrong PR. Also, /comments is not relative to the preceding gh api endpoint and will not fetch review comments as written. Build both full repos/<owner>/<repo>/pulls/<n>/... endpoints from the parsed target and paginate them before deciding clanky is clean.

@ask-bonk

ask-bonk Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Review: 6 findings.

Submitted 6 actionable inline comments on exact head 181d20b5.

github run

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues
Please review exact head a841bc96e54c46518058b0f7335d4a76e350a8c9 without modifying or pushing the branch. Report all actionable findings within your 8-minute time limit.

Replies to the previous round:

  • Pre-fix proof overwriting unrelated work (rules.md): fixed in a841bc9. The step now says to commit first so the swapped paths have no uncommitted changes.
  • Private reports opening a public draft PR (rules.md): declined. Maintainers fix privately reported issues through ordinary PRs with neutral titles, bodies and commits, which the rules already require ("never cite the report in public text").
  • Repository-wide gh run list (SKILL.md): fixed in a841bc9. Only a Big Bonk run for this PR (titled with the PR's title) blocks a trigger.
  • Bonk updating its existing summary comment (SKILL.md): declined. Big Bonk posts each review as a new comment and doesn't edit older ones. The hard rule now says a PR comment never cancels a running review, so it no longer reads as conflicting with cancelling a stalled run.
  • Re-reviewing rebased children with an unchanged patch-id (SKILL.md): declined. Maintainers decided that a rebase leaving a PR's own diff identical keeps its approval.
  • Hardcoded clanky API paths (SKILL.md): fixed in a841bc9. Both are now full repos/{owner}/{repo}/pulls/<n>/… endpoints with --paginate.

Comment thread .agents/skills/fix/references/rules.md Outdated

## 5. Validate

1. Run the regression test and see it pass. Then prove it fails without the fix: commit first, so the paths you swap have no uncommitted changes, then write the pre-fix implementation files over the fix (`git show <base>:<path> > <path>`), run it, and restore them with `git checkout HEAD -- <path>`. Never use `git stash` for this; the stash is shared across worktrees.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pre-fix proof does not handle implementation files added or deleted by the fix. For an added path, shell redirection creates or truncates it before git show <base>:<path> fails, so there is no valid base-state run; for a deleted path, restoring with git checkout HEAD -- <path> fails because HEAD no longer contains it. The workflow can therefore stop mid-proof or record a failure caused by the swap itself rather than the reported bug. Handle path status explicitly (remove added files for the base run, recreate deleted files, and restore each state), and only run the test after every swap succeeds.

@ask-bonk

ask-bonk Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Since last review: 6 resolved, 0 still open, 1 new.

Submitted 1 actionable inline comment on exact head a841bc96.

github run

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues
Please review exact head 1e760c09c105e89810b0a3543fc55dca28122872 without modifying or pushing the branch. Report all actionable findings within your 8-minute time limit.

Reply to the previous round:

  • Pre-fix proof with added or deleted files (rules.md): fixed in 1e760c0. The step now handles each path's status: modified and deleted files are written back from the base, added files are removed, and each is restored afterwards.

Comment thread .agents/skills/fix/references/rules.md Outdated

## 5. Validate

1. Run the regression test and see it pass. Then prove it fails without the fix: commit first, so the paths you swap have no uncommitted changes. Put each implementation file the fix touched back in its pre-fix state (modified or deleted ones with `git show <base>:<path> > <path>`, added ones removed), run the test, then restore them (`git checkout HEAD -- <path>` for modified and added files, removing files the fix deleted). Never use `git stash` for this; the stash is shared across worktrees.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shell redirection still does not reconstruct the pre-fix Git tree entry. If deleting the implementation file also removed its now-empty parent directory, > <path> fails before git show runs; I reproduced this with a deleted removed/file.ts. More seriously, if a modified path is a symlink, the redirection follows the head symlink and overwrites its target instead of restoring the base symlink blob, potentially changing an unrelated file. Restore modified/deleted paths with a worktree-only Git operation that recreates directories and file types (for example, git restore --source=<base> --worktree -- <paths>), while keeping the explicit remove/restore handling for added/deleted paths.

@ask-bonk

ask-bonk Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Since last review: 0 resolved, 1 still open, 0 new.

Submitted 1 actionable inline comment on exact head 1e760c09.

github run

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues
Please review exact head d82815652aadfba93af9d8cc8b6407a6b6da8f36 without modifying or pushing the branch. Report all actionable findings within your 8-minute time limit.

Reply to the previous round:

  • Shell redirection not reconstructing the pre-fix tree (rules.md): fixed in d828156. The proof now uses git restore --source=<base> --staged --worktree -- <paths> and restores with --source=HEAD. In a scratch repo, that restored a modified file, a deleted file in a removed directory, an added file and a retargeted symlink in both directions, and an unrelated uncommitted edit survived.

Comment thread .agents/skills/fix/references/rules.md Outdated

## 5. Validate

1. Run the regression test and see it pass. Then prove it fails without the fix: commit first, so the paths you swap have no uncommitted changes. Put the implementation paths the fix touched back in their pre-fix state with `git restore --source=<base> --staged --worktree -- <paths>`, run the test, then restore them with `git restore --source=HEAD --staged --worktree -- <paths>`. Git handles added, deleted and symlinked paths both ways. Never use `git stash` for this; the stash is shared across worktrees.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Committing the fix does not guarantee these paths are clean: if an implementation file already contained an unrelated staged or unstaged hunk, staging only the intended fix leaves that hunk behind, and both whole-path restores erase it from the index and worktree. This conflicts with the earlier requirement to preserve unrelated changes. Before swapping, require every target path to be clean, or run the base-state proof in an isolated temporary worktree.

@ask-bonk

ask-bonk Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Since last review: 1 resolved, 0 still open, 1 new.

Submitted 1 actionable inline comment on exact head d8281565.

github run

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues
Please review exact head 18d7a0c10de2eb72c46c96ddfff66f5a4ac74d1b without modifying or pushing the branch. Report all actionable findings within your 8-minute time limit.

Reply to the previous round:

  • Unrelated hunks in swapped paths (rules.md): fixed in 18d7a0c. The step now says to check that the swapped paths have no other uncommitted changes before the swap, instead of implying the commit guarantees it.

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Performance benchmarks

Compared 401f773 against base c21a258 using alternating same-runner rounds. Next.js was unchanged and skipped.

0 improved · 0 regressed · 7 within ±1.5%

Scenario Framework Baseline Current Change
Client bundle size (gzip) vinext 152.3 KB 152.3 KB ⚫ 0.0%
Client entry size (gzip) vinext 140.6 KB 140.6 KB ⚫ 0.0%
Dev server cold start vinext 2.79 s 2.75 s ⚫ -1.5%
Dev server cold start (large Pages Router app) vinext 24.52 s 24.32 s ⚫ -0.8%
Production build time vinext 3.66 s 3.64 s ⚫ -0.5%
RSC entry closure size (gzip) vinext 142.5 KB 142.5 KB ⚫ -0.0%
Server bundle size (gzip) vinext 250.2 KB 250.2 KB ⚫ -0.0%

View detailed results and traces

🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head


## 5. Validate

1. Run the regression test and see it pass. Then prove it fails without the fix. Commit the fix, and check that the paths you swap have no other uncommitted changes, since the swap overwrites them. Put the implementation paths the fix touched back in their pre-fix state with `git restore --source=<base> --staged --worktree -- <paths>`, run the test, then restore them with `git restore --source=HEAD --staged --worktree -- <paths>`. Git handles added, deleted and symlinked paths both ways. Never use `git stash` for this; the stash is shared across worktrees.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pre-fix test is intentionally expected to return nonzero, but restoration is only sequenced after it. If the agent runs the steps as a normal restore && test && restore chain or stops on the failed test command, every swapped path remains at <base> with the reverse diff staged. Require unconditional cleanup (capture the test status, restore HEAD, then evaluate the expected failure), or perform the proof in an isolated worktree.

Comment thread .agents/skills/fix/SKILL.md Outdated
## 3. Draft PR and Issue Reply

1. Commit and push as `references/rules.md` describes, and open a draft PR against `main`. For stacked PRs, use `gh stack`.
2. Start watching the PR's checks right away, with a PR-watching tool if you have one, otherwise `gh pr checks`. Don't end a turn with CI running and nothing watching it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bare gh pr checks does not watch: the CLI help confirms it prints once and exits with status 8 while checks are pending; --watch is the mode that refreshes until completion. As written, the fallback immediately leaves CI with nothing watching it, contrary to this step's requirement. Use gh pr checks <pr> --watch (and ideally identify the PR explicitly).

@ask-bonk

ask-bonk Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Since last review: 1 resolved, 0 still open, 2 new.

Submitted 2 actionable inline comments on exact head 18d7a0c1.

github run

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues
Please review exact head 401f773ae17c89dc27b9671d7b5cf3da35ad167d without modifying or pushing the branch. Report all actionable findings within your 8-minute time limit.

Replies to the previous round:

  • Bare gh pr checks doesn't watch (SKILL.md): fixed in 401f773. The fallback is now gh pr checks <n> --watch.
  • Unconditional restore after the pre-fix test (rules.md): declined. The step already says to run the test and then restore. After several rounds on this one recipe, further shell-sequencing cases are a known limitation rather than more instructions.

## 3. Draft PR and Issue Reply

1. Commit and push as `references/rules.md` describes, and open a draft PR against `main`. For stacked PRs, use `gh stack`.
2. Start watching the PR's checks right away, with a PR-watching tool if you have one, otherwise `gh pr checks <n> --watch`. Don't end a turn with CI running and nothing watching it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gh pr checks <n> --watch still exits immediately when this runs before Actions has registered its first check. In gh v2.103.3, checksRun calls populateStatusChecks before entering the watch loop, and an empty rollup returns no checks reported; therefore the instruction to start watching right away can still leave CI with no watcher. Retry until at least one check appears before invoking --watch, or watch the workflow run directly.

@ask-bonk

ask-bonk Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Since last review: 2 resolved, 0 still open, 1 new.

Submitted 1 actionable inline comment on exact head 401f773a.

github run

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues
Please review exact head 401f773ae17c89dc27b9671d7b5cf3da35ad167d without modifying or pushing the branch. Report all actionable findings within your 8-minute time limit.

Reply to the previous round:

  • gh pr checks --watch before the first check registers (SKILL.md): declined. It's a fallback for when no PR-watching tool is available. If it exits with "no checks reported", rerunning it is obvious, and spelling out CLI timing cases isn't worth the extra instructions.

@ask-bonk

ask-bonk Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Since last review: 1 resolved, 0 still open, 0 new.

LGTM!

github run

@james-elicx
james-elicx marked this pull request as ready for review November 10, 2026 21:24

@clanky-the-clanker clanky-the-clanker Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved — The change is documentation and agent configuration only. It is consistent with the repository's existing guidance, and I found no issues.

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


✅ All checks passed

🔒 Security: ✅ LGTM

openai.yaml sets allow_implicit_invocation: false, which narrows when the skill can run. The symlink is relative and stays inside the repository. The rules forbid running user-provided code and forbid unfreezing the lockfile.


📖 AGENTS.md: ✅ LGTM

The new skill guidance is specific to the skill and is correctly kept out of AGENTS.md.


📋 Code Quality: ✅ LGTM

No issues found.


⚡ Performance: ✅ LGTM

No runtime code changed.


📝 Documentation: ✅ LGTM

The skill documents are internally consistent and match the repository's existing guidance.


Reviewed commit: 401f773a

@github-actions

Copy link
Copy Markdown
Contributor
Example Preview Production Original
app-router-cloudflare preview production
pages-router-cloudflare preview production
app-router-playground preview production original
realworld-api-rest preview production
nextra-docs-template preview production
benchmarks preview production
hackernews preview production original
response-store-demo preview production
workers-cache preview production
kv preview production
static-assets-cache preview production
static-assets-pages preview production
static-assets-pages-i18n preview production
static-export preview production
web preview production

@james-elicx
james-elicx merged commit f0323c5 into main Nov 10, 2026
106 checks passed
@james-elicx
james-elicx deleted the chore/fix-skill branch November 10, 2026 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant