with one click
code-quality-gate
// Build, test, format, and lint requirements that must pass before code review. Load when checking implementation completeness or running the quality gate.
// Build, test, format, and lint requirements that must pass before code review. Load when checking implementation completeness or running the quality gate.
| name | code-quality-gate |
| description | Build, test, format, and lint requirements that must pass before code review. Load when checking implementation completeness or running the quality gate. |
| compatibility | ["claude-code","opencode","github-copilot"] |
| metadata | {"version":"1.0","author":"team"} |
Before invoking reviewers, all checks must pass. Run make ci to execute the full pipeline.
| Check | Command | What It Verifies |
|---|---|---|
| Tidy | go mod tidy | Dependencies are clean |
| Format | go fmt ./... | Code is formatted |
| Vet | go vet ./... | Common mistakes caught |
| Lint | make lint | golangci-lint rules pass |
| Deps | make deps-check | No prohibited dependencies |
| Test | go test ./... | All tests pass |
| Build | go build -o bin/reference | Binary compiles |
| Autofix audit | โ (procedure below) | Every design-doc-autofix record stays within bounds; every uncommitted change to a design-doc path is covered by a design-doc-autofix or design-block record since last commit. |
Run this before declaring the gate passed. The audit enforces the protocol in review-checklist ยง Root-Applied Autofix on Design Docs. No script โ the coordinator runs the checks the same way it follows the validation gates in pipeline-handoff.
Step 1 โ Static re-validation of every autofix record. Read .scratch/handoff.jsonl. For each record where type == "design-doc-autofix", verify:
| Check | Rule |
|---|---|
| File scope | file matches one of the design-doc paths declared in doc-review ยง Autofix on Design-Doc Paths (docs/system-design.md or any docs/adr/*.md). |
| Category | category is writing-standards or structural. Any other value fails. |
| Size bounds | lines_changed โค 5 AND chars_changed โค 200. |
| No heading touch | Neither old_content nor new_content contains a ## line. |
| No anchor change | <a id="..."> values in old_content are identical to those in new_content. |
| No REQ-ID change | REQ-ID tokens (regex REQ-[A-Z]+-\d{3}) in old_content are identical to those in new_content. |
| No code-fence touch | Neither old_content nor new_content contains a ``` line. |
| No link-target change | Markdown link targets (the URL inside ](...)) in old_content are identical to those in new_content. |
| Verbatim fix | new_content equals source_finding.fix byte-for-byte. |
Any failure: do NOT declare gate-pass. Append a review-feedback finding under your own coordinator role naming the failing record by handoff.jsonl line number, then route to system-design-expert with the failing record and instructions to revert the autofix and either redo it correctly or convert it to a substantive design-block.
Step 2 โ Direct-edit detection. Run git diff --name-only HEAD -- docs/system-design.md docs/adr/. For each path returned:
.scratch/handoff.jsonl. Confirm at least one of the following exists with ts later than the last commit's timestamp (git log -1 --format=%cI):
design-doc-autofix record whose file equals the path, ordesign-block record listing the path in primary_paths or supporting_paths.Step 3 โ Result. Only declare the autofix-audit check green when Steps 1 and 2 both pass. Record the outcome alongside the other quality-gate results.
| Check | Command | When Required |
|---|---|---|
| Race detector | go test -race ./... | When concurrency is involved (requires gcc) |
| Container build | make podman-build | When project uses containers |
A feature is complete when:
tdd-workflow ยง Self-Review Pass โ a clause walk, not a record)go test ./...)go fmt ./...)make lint)make deps-check)Once every box above is checked, stop. Polish past the bar โ extra refactors, additional tests for the same behavior, prose tightening on a passing PR โ spends tokens without raising quality and is explicitly out of scope. The eight-clause bar is defined across docs/tdd-principles.md, docs/testing-principles.md, and docs/ddd-principles.md, with the canonical slug list in review-checklist ยง Quality-Bar Clause Mapping; if the diff meets the eight clauses, the work is done.