// TL;DR

Before you declare a task done: always run a build and verify there are no compile or build errors. Never call something "done" without this check.

Why the rule exists

Type errors, missing imports, and broken template references don't show up in a simple diff read. They surface only when the compiler runs. Hooks and CI catch them too — but by then it's too late: the user has already received a "done" message based on a false premise.

A local build typically takes 10–60 seconds. Skipping it costs far more when it means the user has to discover the problem themselves.

Stack-specific build commands

.NET
dotnet build <solution.sln> — verify 0 warnings, 0 errors in the output.
Flutter
flutter analyze (zero issues), then flutter build <platform> (zero warnings).
Blazor / ASP.NET
dotnet build — Blazor templates compile as part of the build, so Razor errors are caught here.
Node / Vite / npm
npm run build for prod compatibility, not just npm run dev.
Static HTML
Validate in browser: open the file, check the console for 404 / parse errors. (No "build" as such, but an open-and-verify test.)

Where build errors hide

Build first, tests after

Tests run on top of the build. If the build fails, tests fail for the wrong reasons — you're chasing a symptom instead of the cause. Always run the build to green first, then tests.

# Correct order
dotnet build RestPartiDK.sln
dotnet test
# Green build first, then green tests

When the build says "done" but something is still wrong

A green build only says the code compiles — not that it works. Build-check is necessary, not sufficient. After a green build you still need to:

// Anti-pattern

"It compiled on my machine — I'm calling it done." If you haven't actually run the build in this session — only assumed it's fine — that isn't build-check. Run it explicitly every time.


Related rules