On 2026-09-26 an audit of iec-ledger found months of work reported "done" that an accountant could not use: 48 vendor fields in the API schema and 11 in the form; bills with no vendor invoice number; reports with an export and no page; a Pay Bills screen that looped payments client-side. Every one of those PRs had green tests and merged. Nothing in the pipeline had asked whether the person the feature was for could do the job. This convention makes that the question, and a merge-gate hook asks it mechanically.
A change is done only when all of these hold:
npm run lint:parity, a ratchet that fails only on new gaps).## Walkthrough: the story, the screen steps
driven, a Reference: line, and proof. Preferred proof is a
tawa walkthrough page (asserted screenshots, public
link); a screenshot/GIF or a docs/qa/issue-N-*.md execution log also counts.## QA Execution section with real, dated output, or a changed
docs/qa/issue-N-*.md. Mocked unit tests alone do not satisfy this.DoD-exempt: <reason, 20+ characters> in the PR body. The gate allows the merge and
surfaces the reason. For infrastructure, docs, and platform plumbing, not for "UI later".
Docs-only PRs (only .md, docs/, .forgejo/) are exempt automatically.
scripts/pr-merge-gate.sh in this repo is a Claude Code PreToolUse hook on any MCP
tool named *git_pr_merge. It fetches the PR from Forgejo with the machine's stored git
credential and denies the merge when the body lacks the sections above. Install on every
machine that merges:
mkdir -p ~/.claude/hooks && cp scripts/pr-merge-gate.sh ~/.claude/hooks/ && chmod +x ~/.claude/hooks/pr-merge-gate.sh
Then add to ~/.claude/settings.json:
{ "hooks": { "PreToolUse": [ { "matcher": "mcp__.*git_pr_merge",
"hooks": [ { "type": "command", "command": "~/.claude/hooks/pr-merge-gate.sh", "timeout": 45 } ] } ] } }
Decisions are appended to ~/.claude/hooks/pr-merge-gate.log. Test without merging:
echo '{"tool_input":{"repo":"iec-ledger","index":<pr>}}' | ~/.claude/hooks/pr-merge-gate.sh
DOD_GATE_TEST_BODY='## Walkthrough ...' bash -c 'echo ... | ~/.claude/hooks/pr-merge-gate.sh'
The strict QA-log requirement applies to insureco/iec-ledger, iec-ledger-ui and
icap-portal; edit ledger_repos in the script to add a repo.
Repos adopting this carry .forgejo/issue_template/{feature,bug}.md (story,
screen-step acceptance criteria, Reference, API + UI checkboxes, out-of-scope) and
.forgejo/pull_request_template.md (Walkthrough, QA Execution, Not done in this PR).
Copy them from iec-ledger.
DoD-exempt for "UI in a later PR".Last updated: October 6, 2026