Documents the multistage Docker build pattern we now use across repos (chat, pixa, etc.) where a separate lint stage runs make fmt-check and make lint independently from the build stage.
Key additions to REPO_POLICIES.md:
Full Dockerfile template showing the lint → build → runtime stage pattern
Explanation of COPY --from=lint /src/go.sum /dev/null as the BuildKit dependency trick
Handling //go:embed placeholders in the lint stage
CGO/system library notes for the lint stage
Clarification that tests run in the build stage, not the lint stage
Documents the multistage Docker build pattern we now use across repos (chat, pixa, etc.) where a separate `lint` stage runs `make fmt-check` and `make lint` independently from the build stage.
Key additions to REPO_POLICIES.md:
- Full Dockerfile template showing the lint → build → runtime stage pattern
- Explanation of `COPY --from=lint /src/go.sum /dev/null` as the BuildKit dependency trick
- Handling `//go:embed` placeholders in the lint stage
- CGO/system library notes for the lint stage
- Clarification that tests run in the build stage, not the lint stage
Reference implementations: `sneak/chat`, `sneak/pixa`.
Adds detailed documentation of the multistage Docker build pattern
where a separate lint stage runs fmt-check and lint before the build
stage begins. Includes the standard Dockerfile template, the BuildKit
dependency trick (COPY --from=lint), go:embed placeholder handling,
and CGO/system library notes.
clawbot
self-assigned this 2026-03-15 22:09:47 +01:00
Explanation of COPY --from=lint /src/go.sum /dev/null as BuildKit dependency trick
✅ Met
Handling //go:embed placeholders in the lint stage
✅ Met
CGO/system library notes for the lint stage
✅ Met
Clarification that tests run in the build stage, not the lint stage
✅ Met
Build Result
make check: ✅ PASS (prettier formatting check passes, no test failures)
docker build .: ✅ PASS (clean build)
Rebase onto main: Already up to date, build still passes post-rebase.
Content Accuracy
The Dockerfile template correctly demonstrates the three-stage pattern (lint → build → runtime).
The COPY --from=lint /src/go.sum /dev/null explanation is technically accurate — this creates a BuildKit stage dependency forcing lint completion before build proceeds.
The //go:embed placeholder guidance is practical and correct.
The lint stage uses golangci/golangci-lint image directly (includes Go + linter), correctly noted.
Tests in build stage rationale (may need compiled artifacts/heavier deps) is sound.
Template image references use @sha256:... with version/date comments above, consistent with the pinning policy.
Scope
Single file changed (prompts/REPO_POLICIES.md), single commit, documentation only. No scope creep.
Verdict: PASS
Clean documentation addition. All requirements met, no policy violations, build passes, formatting correct. The new section integrates naturally between the existing Dockerfile and CI workflow bullets.
## Review: [PR #18](https://git.eeqj.de/sneak/prompts/pulls/18) — docs: document fail-fast lint stage pattern for Dockerfiles
### Policy Divergences
No policy violations found.
All relevant REPO_POLICIES.md rules checked:
- External references pinned by hash: Template correctly uses `@sha256:...` placeholders with version/date comments. ✓
- YAML front matter `last_modified`: Updated to `2026-03-12`, consistent with commit date. ✓
- Markdown formatting (proseWrap: always, 80-col): Prettier check passes. ✓
- `.golangci.yml` not modified. ✓
- No build artifacts in version control. ✓
- Feature branch used (`update-dockerfile-lint-stage-docs`). ✓
- No linter/CI/test config modified, no assertions weakened. ✓
### Requirements Checklist
| Requirement | Status |
|---|---|
| Full Dockerfile template showing lint → build → runtime stage pattern | ✅ Met |
| Explanation of `COPY --from=lint /src/go.sum /dev/null` as BuildKit dependency trick | ✅ Met |
| Handling `//go:embed` placeholders in the lint stage | ✅ Met |
| CGO/system library notes for the lint stage | ✅ Met |
| Clarification that tests run in the build stage, not the lint stage | ✅ Met |
### Build Result
- `make check`: ✅ PASS (prettier formatting check passes, no test failures)
- `docker build .`: ✅ PASS (clean build)
- Rebase onto `main`: Already up to date, build still passes post-rebase.
### Content Accuracy
- The Dockerfile template correctly demonstrates the three-stage pattern (lint → build → runtime).
- The `COPY --from=lint /src/go.sum /dev/null` explanation is technically accurate — this creates a BuildKit stage dependency forcing lint completion before build proceeds.
- The `//go:embed` placeholder guidance is practical and correct.
- The lint stage uses `golangci/golangci-lint` image directly (includes Go + linter), correctly noted.
- Tests in build stage rationale (may need compiled artifacts/heavier deps) is sound.
- Template image references use `@sha256:...` with version/date comments above, consistent with the pinning policy.
### Scope
Single file changed (`prompts/REPO_POLICIES.md`), single commit, documentation only. No scope creep.
### Verdict: **PASS**
Clean documentation addition. All requirements met, no policy violations, build passes, formatting correct. The new section integrates naturally between the existing Dockerfile and CI workflow bullets.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Documents the multistage Docker build pattern we now use across repos (chat, pixa, etc.) where a separate
lintstage runsmake fmt-checkandmake lintindependently from the build stage.Key additions to REPO_POLICIES.md:
COPY --from=lint /src/go.sum /dev/nullas the BuildKit dependency trick//go:embedplaceholders in the lint stageReference implementations:
sneak/chat,sneak/pixa.Review: PR #18 — docs: document fail-fast lint stage pattern for Dockerfiles
Policy Divergences
No policy violations found.
All relevant REPO_POLICIES.md rules checked:
@sha256:...placeholders with version/date comments. ✓last_modified: Updated to2026-03-12, consistent with commit date. ✓.golangci.ymlnot modified. ✓update-dockerfile-lint-stage-docs). ✓Requirements Checklist
COPY --from=lint /src/go.sum /dev/nullas BuildKit dependency trick//go:embedplaceholders in the lint stageBuild Result
make check: ✅ PASS (prettier formatting check passes, no test failures)docker build .: ✅ PASS (clean build)main: Already up to date, build still passes post-rebase.Content Accuracy
COPY --from=lint /src/go.sum /dev/nullexplanation is technically accurate — this creates a BuildKit stage dependency forcing lint completion before build proceeds.//go:embedplaceholder guidance is practical and correct.golangci/golangci-lintimage directly (includes Go + linter), correctly noted.@sha256:...with version/date comments above, consistent with the pinning policy.Scope
Single file changed (
prompts/REPO_POLICIES.md), single commit, documentation only. No scope creep.Verdict: PASS
Clean documentation addition. All requirements met, no policy violations, build passes, formatting correct. The new section integrates naturally between the existing Dockerfile and CI workflow bullets.