From 5e5faf1aca304598302c5f50a2dd88ce84e332bf Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 22 Jun 2026 09:00:08 +0300 Subject: Update --- fish/conf.d/supersync.fish | 2 +- prompts/skills/go-best-practices/SKILL.md | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/fish/conf.d/supersync.fish b/fish/conf.d/supersync.fish index f042853..bfa3100 100644 --- a/fish/conf.d/supersync.fish +++ b/fish/conf.d/supersync.fish @@ -44,7 +44,7 @@ function supersync::prompts end function supersync::is_it_time_to_sync - set -l max_age 86400 + set -l max_age 86400 set -l now (date +%s) if test -f $SUPERSYNC_STAMP_FILE set -l diff (math $now - (cat $SUPERSYNC_STAMP_FILE)) diff --git a/prompts/skills/go-best-practices/SKILL.md b/prompts/skills/go-best-practices/SKILL.md index e0e384b..c03e91d 100644 --- a/prompts/skills/go-best-practices/SKILL.md +++ b/prompts/skills/go-best-practices/SKILL.md @@ -43,6 +43,7 @@ When writing or modifying Go code in the current project, follow all of the conv ### Errors and interfaces * Use error wrapping (`fmt.Errorf` with `%w`) to provide context for errors +* Never silently ignore returned errors—check them, or discard them explicitly with `_ =`. Run `errcheck ./...` to catch silently ignored errors (install and usage: `references/errcheck.md`) * Prefer explicit interface satisfaction for public types: `var _ MyInterface = (*MyType)(nil)` * Keep interfaces small and focused; accept interfaces, return concrete types @@ -65,6 +66,13 @@ When writing or modifying Go code in the current project, follow all of the conv * Avoid large functions; split into smaller, focused helpers (max ~50 lines per function) * Avoid code duplication where reasonable +### AI-assisted tools and guardrails + +When writing or modifying Go code (especially with an AI agent), run static-analysis guardrails as part of verification, not just `go build`/`go test`. + +* **errcheck:** Run `errcheck ./...` to catch silently ignored errors—one of the most common Go bugs. Treat findings as defects: check the error (wrap with `%w`) or discard it explicitly with `_ =`. Do not silence it by deleting the check. See `references/errcheck.md` for install instructions, flags, exclude files, and how to wire it into the Magefile / CI / pre-commit hooks. +* Be honest about what actually ran: if errcheck (or any tool) is not installed or could not run, say so rather than implying the code was checked. + ### Environment preflight and verification honesty Before claiming any verification, confirm the local toolchain can actually build and run the relevant tests. A *missing or incomplete* toolchain (not slow tests) is common: e.g. CGO headers absent (`bpf/bpf.h` for eBPF code), or external tools not installed (`flutter`/`dart` for a companion app). -- cgit v1.2.3