一键导入
check-git-log-before-refix
Before "fixing" a recurring error, check git log to see if it was already fixed upstream — the working tree may just be stale.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Before "fixing" a recurring error, check git log to see if it was already fixed upstream — the working tree may just be stale.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
A TRefCountPtr/TSharedPtr member in a UE class needs the pointee's full definition, not a forward decl.
When WSL's mirrored networking fails and falls back to "None", plus /etc/wsl.conf has generateResolvConf=false, the distro has no DNS; fix both layers.
When a Windows shell (PowerShell/cmd) feeds a bash script into WSL, CRLF line endings can corrupt the first shell builtin; force LF or pipe via a temp file.
Always add a space after URL brackets in Markdown to prevent 404 errors with special characters.
Plan a Python 3 modernization sweep (f-strings, super(), type hints) as a series of mechanical PRs, not one mega-PR.
Run a quick non-behavioral audit of a Python repo and split findings into bug / dead-code / style PRs.
| name | check-git-log-before-refix |
| description | Before "fixing" a recurring error, check git log to see if it was already fixed upstream — the working tree may just be stale. |
| tags | ["git","workflow","debugging"] |
The user reports an error that looks identical to something you (or another agent) recently fixed. Typical signals:
Before you write a single new line of code, stop and check whether the fix is already on the default branch and you just aren't looking at it.
Agents — and humans in a hurry — default to "I see an error, I write a
patch." When the fix already exists on main/master but you're on a
stale branch or a dirty working tree, that default makes things worse:
The concrete failure mode that motivated this skill:
main.Before modifying anything, run this short check:
Check working tree and branch first.
git status
git branch --show-current
git log --oneline -5
If there are uncommitted changes in the file that "still has the bug", that is a huge red flag — previous agent output may have reverted a real fix locally.
Grep the history for the symptom. Use a keyword from the error message or the affected file:
git log --oneline --all --grep="AutomationCommandlet"
git log --oneline --all -- path/to/affected_file
If something matches, read that commit: git show <sha> -- <file>.
Compare the current branch to the default branch.
git fetch origin
git log --oneline HEAD..origin/main -- path/to/affected_file
Any output here means "main has commits touching this file that
your branch doesn't" — the fix is very likely among them.
If the fix is already on main:
git checkout -- path/to/file.origin/main, or just ask
the user to pull main and re-run. Do not write a new patch.Only if the history shows nothing — then you have a real new bug and can start diagnosing.
Symptom (reported by user):
LogInit: Error: AutomationCommandlet looked like a commandlet, but we
could not find the class.
[FAIL] Editor automation tests failed
Bad flow:
agent: sees error → edits run_testhost.bat → invents a
PROCESSOR_ARCHITECTURE guard that doesn't make sense → leaves
dirty working tree → user re-runs → still broken
Good flow:
$ git status
# On branch feat/old-branch
# Changes not staged for commit:
# modified: run_testhost.bat <-- red flag: previous agent edited it
$ git checkout -- run_testhost.bat # drop the bogus edit
$ git log --oneline --all --grep="ExecCmds\|AutomationCommandlet"
4f0e923 fix(testhost/Windows): use -ExecCmds instead of -Run=Automation (#20)
a44b370 fix(testhost): run automation via -Run=Automation commandlet ...
$ git show 4f0e923 -- run_testhost.bat
# ...confirms the fix exists on main...
$ git checkout main && git pull
# working tree now has the correct run_testhost.bat
Result: zero new code written, problem resolved, user just needed to
pull main.
main but never been merged back into the feature
branch you're on.git status being clean either. The stale commit
on the branch can still be older than the fix on main. Always
compare against origin/<default> after git fetch.run_testhost.bat (or any
file you're about to touch) shows up as modified in git status and
you didn't edit it, read the diff before doing anything else — a
previous agent run may have half-reverted a real fix.main. Use --all so you also catch fixes on
release branches, other feature branches, or still-open PRs.git show <sha>) and confirm the change actually addresses the
current symptom — don't stop at the subject line.