一键导入
fix-issue
Find an actionable GitHub issue and fix it (or scan the TypeScript codebase for common bug patterns), then open or update a pull request.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Find an actionable GitHub issue and fix it (or scan the TypeScript codebase for common bug patterns), then open or update a pull request.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | fix-issue |
| description | Find an actionable GitHub issue and fix it (or scan the TypeScript codebase for common bug patterns), then open or update a pull request. |
| user-invocable | true |
| allowed-tools | ["Bash","Read","Edit","Write","Glob","Grep"] |
Find an open GitHub issue that is actionable and fix it, then open a pull request. If no actionable issues remain, scan the TypeScript codebase for common bug patterns instead.
This repo is MD-VSCode-Utility-Tool, a VSCode extension (TypeScript) that parses Hearts of
Iron IV files and renders previews in webviews. The source is in src/ (extension host) and
webviewsrc/ (webview). GitHub repo: MillenniumDawn/MD-VSCode-Utility-Tool.
Supported arguments: an issue number to fix a specific issue, or none to auto-select one. Requested arguments: $ARGUMENTS
If an issue number is given, fetch it directly:
gh issue view <number> --json title,body,labels,comments
Otherwise, list open issues and pick one that is not already covered by an open PR:
gh issue list --state open --limit 40
gh pr list --state open
Prefer issues labelled bug with a clear reproduction path. The repo also uses domain labels
(Focus Tree Previewer, MIO Previewer) that tell you which subsystem is involved. Skip issues
that already have an open PR, are vague with no reproduction steps, or are pure enhancement
requests with no concrete defect.
If no actionable GitHub issue remains (all too vague, enhancement-only, or already covered),
scan the codebase for common bug patterns instead. Scope searches to src/ and webviewsrc/:
grep -rn "keyword" src/ webviewsrc/ --include="*.ts"
Patterns to look for:
await — an async call whose result is never awaited, so
rejections are swallowed and ordering races (e.g. a preview refresh that fires before its load
resolves).Disposable, event listener, file watcher, or webview panel that
is never pushed to context.subscriptions or otherwise disposed, leaking across preview
reopen.command / message type posted with no matching case
in the handler, or a payload shape that differs between the postMessage sender and the
receiver.JSON.parse or the HOI4 parser run on malformed / unexpected input
without a try/catch, or a new syntax variant the schema or matcher does not handle (cf.
issue #32).\ vs / assumptions instead of
path.join / vscode.Uri.joinPath.new RegExp(...).a.b.c where b may be absent, or an optional schema
field treated as required.parseInt without a radix, or a parseFloat result used without a
NaN check.Map/object where duplicate keys silently
overwrite earlier entries.When fixing a codebase-scanned bug, omit the Closes # line from the PR since there is no issue
to reference.
Read the issue body. Identify the wrong behaviour, the expected behaviour, and any preview type, command, subsystem, or file named in the report.
Search the subsystem that owns the behaviour:
src/previewdef/{focustree,technology,mio,event,gui,gfx,worldmap}/src/hoiformat/src/util/webviewsrc/Use Grep/Glob first. If a named symbol is not found, widen the search:
grep -rn "keyword" src/ webviewsrc/ --include="*.ts" -l
Read the files involved and understand the data flow before touching anything.
Trace the logic to find exactly where the wrong value is produced or the wrong branch is taken. Do not guess; confirm the cause in code before writing a fix.
Make the minimal change. Follow this repo's conventions:
semi).=== / !==, never == / != (eqeqeq).curly).Error objects, never string literals (no-throw-literal).Do not refactor surrounding code or fix unrelated issues in the same commit.
Before committing, run the repo's checks and make sure they pass:
npm run lint
npm test
If types changed, also run npm run compile-ts. If a check fails, fix the cause before
continuing — do not commit failing code.
Never create or switch branches on your own. First check the current branch:
git rev-parse --abbrev-ref HEAD
main: stop and use AskUserQuestion to ask which branch to use. Offer: (a) check
out an existing branch (user supplies the name), (b) create a new branch (user supplies the
name). Only after the user answers, run git checkout <name> or git checkout -b <name>. Do
not invent a branch name.main: commit on the current branch. Do not switch or create a branch.Then stage only the files changed for this fix and commit. Do not add a Co-Authored-By
trailer, a "Generated with Claude Code" footer, or any other reference to Claude Code,
Claude, or Anthropic in the commit message.
git add <files>
git commit -m "Fix <short description> (#<issue number>)
<one or two sentences explaining root cause and fix>"
This repo's changelog-guard.js Stop hook blocks any code-changing turn that lacks a patch bump
and a matching changelog entry, so do both as part of the fix:
version field in package.json by +1 patch
(e.g. 1.1.10 -> 1.1.11).vX.Y.Z section at the top of CHANGELOG.md with that same
version, in the existing style:
Bugfixes: (or Functionality:) subsection header, two-space indent. - [ Component ] ... with a component prefix ([ Focus Tree ],
[ Technology ], [ MIO ], [ Previewer ], [ Build ], [ CI ], [ HTML ],
[ Testing ], ...).package.json version and the CHANGELOG heading identical.If a section for the current unreleased version already exists at the top of the branch's
CHANGELOG.md, append a bullet under it instead of adding a duplicate heading (and leave the
version as-is). Commit the version + changelog change separately from the code fix.
git merge origin/main
Resolve any conflicts before pushing.
Push the branch first:
git push -u origin <branch>
Then check whether an open PR already exists for this branch:
gh pr list --head <branch> --state open --json number,url,body
a. If no open PR exists, create one. Use this repo's PR-body format and apply with a heredoc so the formatting survives:
gh pr create --title "<title>" --body "$(cat <<'EOF'
## Summary
- **<one-line headline>**: <what changed and why>.
Closes #<issue number>
## Test plan
- [ ] <how to reproduce the original bug and confirm it is gone>
- [ ] <any regression check>
EOF
)"
Do not add any "Generated with Claude Code" footer or any other reference to Claude Code, Claude, or Anthropic to the PR body.
Omit the Closes #... line when the fix came from a codebase scan with no issue.
b. If an open PR already exists, rewrite its body to include the new fix; do NOT create a second PR.
Closes #N line, then append a new Closes #<this issue number>.## Summary bullet; append a new bullet, never replace prior ones.## Test plan bullet; append new bullets for the new fix.Apply with a heredoc to keep formatting intact:
gh pr edit <PR#> --body "$(cat <<'EOF'
<full rewritten body>
EOF
)"
Output the PR URL, whether the PR was created or updated, and a one-paragraph summary of the root cause and fix.