From d4a969e997958d0a929fc24ec59ffdf676e025a8 Mon Sep 17 00:00:00 2001 From: Chris Pezza Date: Wed, 12 Aug 2026 16:28:01 -0400 Subject: [PATCH] fix(go-tools): blind-validation doc fixes across three skills; v0.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Blind validation per house standard 5 (issue #11): all five skills run by fresh agents against go-performance-starter@50a8fee (hit) and a minimal non-starter Go module (miss), scored against criteria pinned before any agent launched. 10/10 runs met every pinned criterion. Validation record: - templ-component-scaffold: scaffolded typed-props StatusBadge, templ generate + full task ci green; miss context stopped on the pre-fetch fallback without inventing a view layer. - test-scaffold: table-driven t.Skip stubs beside source, stdlib style, vet+test green in both contexts (miss context is the generic-Go path). - sqlc-query-scaffold: CountUsers :one appended, db:generate round-trip, repository interface + postgres adapter (RLS inScope pattern) + fake updated, build/tests green; miss context stopped on the no-sqlc fallback. - perf-budget-check: ran task test:performance, per-gate verdicts verbatim and byte-identical to the independently pinned run (binary 16341986B, JS 32771B gzipped, CSS 7678B gzipped, all green); miss context stopped and pointed at /perf-audit without running anything. - go-pr-description: master base detected, both commits covered, honest unchecked boxes with env-failure attribution; its ADR step caught a genuine ADR-027 contradiction the probe branch had accidentally seeded (unconditional left-most XFF trust) — unplanned true positive. Doc gaps found by the runs, fixed here (fix the skill, not the test): - templ-component-scaffold: named IsHTMXRequest as a render.go given; the starter ships only Render/CurrentYear — now reads the repo's actual helpers and never references an absent one. - test-scaffold: only checked _test.go for existing coverage; sibling test files can already cover the target funcs — now greps the package's other _test.go files and reports instead of duplicating. - perf-budget-check: hardcoded 'git diff main' twice; the starter itself is master-based — now base-branch-aware (main or master). Closes #11 Co-Authored-By: Claude Fable 5 --- docs/ROADMAP.md | 19 ++++++++++++++----- plugins/go-tools/.claude-plugin/plugin.json | 2 +- .../skills/perf-budget-check/SKILL.md | 4 ++-- .../skills/templ-component-scaffold/SKILL.md | 4 ++-- .../go-tools/skills/test-scaffold/SKILL.md | 2 +- 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index 2103b87..1f0ab67 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -35,6 +35,15 @@ regardless of what it does. test-scaffold, gate-check). All 8 pre-fetch probes and the hook verified in bash+zsh across tunes_protocol/gittunes/unrelated contexts, including workspace-edition detection; hook script shellcheck-clean under the new CI job. +- **`go-tools` blind validation (#11)** — v0.3.1: all five skills validated blind + per house standard 5, 10/10 runs (hit context go-performance-starter@50a8fee + + non-starter miss context each). All pinned criteria met: scaffolds compiled and + passed `task ci`, gates reported verbatim matching an independently pinned run, + miss contexts stopped on the pre-fetch fallbacks with zero invented tooling. + The pr-description hit run's ADR step caught a real ADR-027 contradiction the + probe branch accidentally seeded — an unplanned true positive. Three doc gaps + found and fixed (stale `IsHTMXRequest` reference, sibling-test-coverage check, + hardcoded `git diff main` on a master-based starter). ## Later — worth doing, not yet urgent @@ -47,13 +56,13 @@ Deferred and found work now lives in the issue tracker: decisions ([#4](https://github.com/clownware/plugins/issues/4) Bash-grant experiment), test debt ([#5](https://github.com/clownware/plugins/issues/5) fixture persistence/realism, [#6](https://github.com/clownware/plugins/issues/6) -unvalidated coverage paths), pezza follow-ups +unvalidated coverage paths), and pezza follow-ups ([#7](https://github.com/clownware/plugins/issues/7) generated-file fixes, -[#8](https://github.com/clownware/plugins/issues/8) brand fonts), and -validation follow-through ([#11](https://github.com/clownware/plugins/issues/11) -go-tools blind validation). Resolved 2026-08-12: #2 (renamed the stack variants +[#8](https://github.com/clownware/plugins/issues/8) brand fonts). +Resolved 2026-08-12: #2 (renamed the stack variants to `astro-pr-description`/`go-pr-description`), #3 (dropped the `license` -frontmatter; repo LICENSE governs), #9 (added the `ink-350` ramp step). +frontmatter; repo LICENSE governs), #9 (added the `ink-350` ramp step), +#11 (go-tools blind validation — see Graduated). Summaries below for the decisions; the issues are canonical. - **`Bash` in `allowed-tools` for pre-fetch-only skills** — possibly removable where diff --git a/plugins/go-tools/.claude-plugin/plugin.json b/plugins/go-tools/.claude-plugin/plugin.json index aa4e22d..1d9dc42 100644 --- a/plugins/go-tools/.claude-plugin/plugin.json +++ b/plugins/go-tools/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "clownware-go-tools", "description": "Go + templ + sqlc stack skills: templ component scaffolding, table-driven test scaffolding, sqlc query scaffolding, performance-budget gate checks, and task-ci-aware PR descriptions, following go-performance-starter conventions with fallbacks for other Go projects. Also ships a format-on-edit hook that runs goimports/gofmt and templ fmt on files Claude edits.", - "version": "0.3.0", + "version": "0.3.1", "hooks": "./hooks/hooks.json", "author": { "name": "clownware" diff --git a/plugins/go-tools/skills/perf-budget-check/SKILL.md b/plugins/go-tools/skills/perf-budget-check/SKILL.md index 262e68a..0dda16e 100644 --- a/plugins/go-tools/skills/perf-budget-check/SKILL.md +++ b/plugins/go-tools/skills/perf-budget-check/SKILL.md @@ -40,11 +40,11 @@ Run `task test:performance` (binary size + gzipped asset budgets + the `internal ### 3. Attribute any overage -For a binary overage, the usual movers are a heavy new dependency or dropped `-ldflags="-s -w"` — check `go build` flags and recent `go.mod` additions (`git diff main -- go.mod`). For an asset overage, identify the largest gzipped contributor under the built CSS/JS output. State the basis in every number: binary is raw stripped bytes; JS/CSS budgets are **gzipped** — never mix the two. +For a binary overage, the usual movers are a heavy new dependency or dropped `-ldflags="-s -w"` — check `go build` flags and recent `go.mod` additions (`git diff -- go.mod`, base = main or master, whichever the repo uses). For an asset overage, identify the largest gzipped contributor under the built CSS/JS output. State the basis in every number: binary is raw stripped bytes; JS/CSS budgets are **gzipped** — never mix the two. ### 4. Report -Compact and decision-shaped: **verdict line** (all gates green / N failing) → per-gate table (gate, verdict, actual vs limit, headroom) → what on this branch moved the numbers (`git diff main --stat` when main is local) → next actions, separating "shrink the artifact" from "raise the budget". A budget raise is an ADR-000 change and a halt-worthy decision under this repo's constitution — present it as a decision needing a written why, not a quick edit. +Compact and decision-shaped: **verdict line** (all gates green / N failing) → per-gate table (gate, verdict, actual vs limit, headroom) → what on this branch moved the numbers (`git diff --stat` when the base branch — main or master — is local) → next actions, separating "shrink the artifact" from "raise the budget". A budget raise is an ADR-000 change and a halt-worthy decision under this repo's constitution — present it as a decision needing a written why, not a quick edit. ## Rules diff --git a/plugins/go-tools/skills/templ-component-scaffold/SKILL.md b/plugins/go-tools/skills/templ-component-scaffold/SKILL.md index f9c02aa..1718029 100644 --- a/plugins/go-tools/skills/templ-component-scaffold/SKILL.md +++ b/plugins/go-tools/skills/templ-component-scaffold/SKILL.md @@ -18,7 +18,7 @@ Scaffold a new templ view for this project: $ARGUMENTS ## Before scaffolding 1. Read one existing example of the kind you are creating (from the pre-fetched list) to match style. -2. Read `internal/view/props.go` (`BaseProps`, `NewBaseProps`) and `internal/view/render.go` (`Render`, `IsHTMXRequest`). +2. Read `internal/view/props.go` (`BaseProps`, `NewBaseProps`) and `internal/view/render.go` for the helpers this repo actually ships (`Render` at minimum; an HTMX-request helper may or may not exist — never reference one that isn't there). ## Decide the kind @@ -42,5 +42,5 @@ If the pre-fetched layout differs from this table, follow the existing layout in 1. Add the props struct to `internal/view/props.go` (or alongside the component) with concrete fields. 2. Run the templ generate step from the pre-fetched context to produce the `*_templ.go`. Never hand-edit generated files. -3. If it's a page, wire the handler to call `view.Render(w, r, status, pages.Foo(props))`, branching on `view.IsHTMXRequest(r)` when a partial variant exists. +3. If it's a page, wire the handler to call `view.Render(w, r, status, pages.Foo(props))`, branching on the repo's HTMX-request helper (only if `render.go` ships one) when a partial variant exists. 4. Run `task ci` before claiming done (falls back to `go build ./... && go test ./...` if there is no Taskfile). diff --git a/plugins/go-tools/skills/test-scaffold/SKILL.md b/plugins/go-tools/skills/test-scaffold/SKILL.md index 7ac9274..8b2c73a 100644 --- a/plugins/go-tools/skills/test-scaffold/SKILL.md +++ b/plugins/go-tools/skills/test-scaffold/SKILL.md @@ -31,7 +31,7 @@ Read ONE existing `_test.go` from the pre-fetched list (prefer one in or near th ### 3. Determine the test file location -Go requires the test beside the source: `path/to/foo.go` → `path/to/foo_test.go`. If it already exists, read it and only add missing cases — never overwrite. +Go requires the test beside the source: `path/to/foo.go` → `path/to/foo_test.go`. If it already exists, read it and only add missing cases — never overwrite. Also grep the package's *other* `_test.go` files for existing `Test` coverage of the target's functions — sibling test files sometimes already cover them; report that instead of stubbing duplicates. ### 4. Generate the table-driven test