.qwen/skills/repo-hygiene/references/fix.md
You are the fix phase. A previous scan-phase job already wrote
<workdir>/findings.json (and <workdir>/report-only.md when report-only
findings exist). Read the findings,
apply the accepted fixes on one branch, and write the PR files. Do NOT
re-scan — trust the existing findings, but re-verify each one's evidence
against this checkout before touching code.
<workdir>/findings.json. If its fixes array is empty, stop —
that is a valid, silent outcome (step 8 applies): do not create a branch
and do not write failure.md.fixes entries — the most certain, lowest-risk, easiest to
explain. Selecting none is valid. No cap on count.git checkout -b <branch>.fixes to reportOnly in findings.json with "status": "dropped" and
the reason (evidence stale on this checkout) appended to minimalFix,
then continue with the next finding.
b. Make the minimal change. Add or update a focused regression test that
fails before the fix and passes after it whenever the fix is
test-coverable. If a test is impossible, the finding must carry static
proof (every caller, read/write point, default-value chain, or a
docs-vs-behavior contradiction, all grep-able in the repo) — otherwise
move the entry from fixes to reportOnly in findings.json with
"status": "dropped" and the drop reason (no regression test possible,
no static proof) appended to minimalFix, and move on.
c. Run focused verification for the touched package, plus
npm run generate:settings-schema when the fix touched a settings
source — the regenerated schema belongs in the same commit (Shared
Rules). If it fails and you
cannot make it pass confidently, revert this finding's edits
(git checkout -- <paths>; delete untracked files you created), move
the entry from fixes to reportOnly in findings.json with
"status": "dropped" and the drop reason appended to minimalFix, and
move on. A dropped finding must surface in the consolidated issue, not
vanish. Never commit a finding whose verification failed.
d. Commit as ONE Conventional Commit whose subject ends with the
finding's id in brackets, e.g. fix(cli): summary [<id>], then mark
"status": "committed". The workflow correlates commits to findings by
that bracketed id — a commit without it cannot be tracked when dropped.npm run build, npm run typecheck, npm run lint,
and focused Vitest runs for every touched package (plus
npm run generate:settings-schema if a settings source changed). If any
fails and you cannot fix it confidently, write <workdir>/failure.md and
stop — do not leave a half-verified branch.git status --short clean.<workdir>/pr-title.txt and <workdir>/pr-body.md following
.qwen/skills/prepare-pr/SKILL.md. The body's "What this PR does" must
walk each committed finding with its root cause and evidence summary, and
"Why it's needed" must state these are real test gaps, behavior
inconsistencies, or contract mismatches — not style cleanup. No issue
number applies; omit the Fixes # line.Update <workdir>/findings.json to its final state (per-finding statuses
included) as your last write.