agentleFS
DonaldMurilloDonaldMurillo/gofastr/CLAUDE.md

gofastr

CLAUDE.md16 starsChanged 2 months agoMITView on GitHub

**Before writing any UI, runtime, framework/uihost, OR code that emits UI, read core-ui/ARCHITECTURE.md. Emitting UI covers the blueprint generator (cmd/gofastr), batteries, and anything that produces markup or CSS. This is mandatory. Emitting a styled <div> is writing UI. A generator that ships CSS is a generator writing UI badly.** Before adding, moving, or extracting anything under framework/, read framework/ARCHITECTURE.md. It captures the package layout, the layering rules, the cycle-breaking interfaces (entity.Registry, db.Executor), and the recipe for new extractions. The architecture…

The file

We split this CLAUDE.md into the rules it gives an agent

12 rules. About 0 are common, 3 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    SSR-first: Every page is fully server-rendered on initial load.

    line 40
  2. Distinctive:

    Never make in-page state changes (sort, paginate, expand) into routes.

    line 60
  3. Very specific:

    Never re-implement pagination/sort/filter math in JS.

    line 62
  4. Very specific:

    Never use SSE to deliver responses to user actions.

    line 63
  5. Very specific:

    Never add location.href = … or full reloads as a "fix".

    line 70
  6. Very specific:

    Never add new data-cui-* attributes without updating core-ui/ARCHITECTURE.md and the runtime test suite.

    line 71
  7. Very specific:

    Never expose an entity holding per-user data via auto-CRUD without setting EntityConfig.Scope.OwnerField.

    line 73
  8. Very specific:

    Survey before you build: Before hand-rolling any UI markup or CSS, grep framework/ui + core-ui for an existing primitive.

    line 93
  9. Distinctive:

    Pixels, not probes, and dogfood the flagship: Never claim a UI "works / polished / verified" from a DOM dump, a11y tree, or computed-style …

    line 100
  10. Very specific:

    Read the PR's line-level review comments before merging: After opening a PR and after every push to it, run ./scripts/pr-review-findings.sh …

    line 109
  11. Very specific:

    UPDATE/DELETE needs its own fence — a token predicate, a claimed_at <= $n staleness bound, or a terminal status guard.

    line 271
  12. Very specific:

    Every registration is wrapped in allow.Guard (internal/analyzers/allow): a site that is the shape ON PURPOSE carries …

    line 393

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

Claude / agent instructions for the GoFastr repo

Before writing any UI, runtime, framework/uihost, OR code that emits UI, read core-ui/ARCHITECTURE.md. Emitting UI covers the blueprint generator (cmd/gofastr), batteries, and anything that produces markup or CSS. This is mandatory. Emitting a styled <div> is writing UI. A generator that ships CSS is a generator writing UI badly.

Before adding, moving, or extracting anything under framework/, read framework/ARCHITECTURE.md. It captures the package layout, the layering rules, the cycle-breaking interfaces (entity.Registry, db.Executor), and the recipe for new extractions.

The architecture document is the contract. It captures failure classes caught the hard way so they don't repeat:

  • Navigation: three wrong attempts before the SSR/island/SSE model was written down.
  • Styling/structure ownership: caught 2026-06 building the Meridian flagship. The blueprint generator accreted ~70 bespoke CSS rules (.mrd-*, .gofastr-*, a BlueprintBaseCSS string) and hand-rolled markup that duplicated, or worked around, components that already existed (ui.Grid, ui.Stack, ui.ThemeToggle, the --font-heading token). The fix was to delete all of it and compose/extend the design system. The blueprint now ships zero CSS. See Hard rules 7–9.

Before adding, renaming, or removing any exported API, route, CLI subcommand, JSON field, or auto-generated artifact, the gofastr-docs skill at .claude/skills/gofastr-docs/SKILL.md auto-loads. Docs ship in the same commit as the code change, not a follow-up. The docs live in framework/docs/content/*.md and are embedded into the gofastr binary at build time. gofastr docs browses them; the MCP tools framework_docs_list / framework_docs_get / framework_docs_search (framework.WithMCPTools(mcptools.Register) from framework/docs/mcptools; package framework never imports the corpus) expose them to agents connected to a live app.

TL;DR of the architecture (read the full doc anyway)

  • SSR-first. Every page is fully server-rendered on initial load.
  • Hydration, not re-render. runtime.js attaches handlers to the existing DOM after first paint.
  • Cross-page nav is client-side with cache. No hard refreshes when going from /a to /b.
  • In-page state changes are islands: a click fires an RPC, the server returns new island HTML, the runtime swaps just that island.
  • Passive freshness is polled, not pushed: data-cui-poll / widget Builder.Poll for dashboards/counters/statuses. No held connection, no fanout dependency.
  • Server-pushed updates (SSE, the single /__gofastr/sse bus) are the last resort: presence, collaboration, sub-second updates. Genuine background events, never user actions. The full ladder is framework/docs/content/reactivity.md.
  • The interactive layer is stateless: state lives in the DB or the client signal store, never in server RAM. Sessions are signed tokens (WithSecret / GOFASTR_SECRET); any replica serves any request.

Hard rules

  1. Never make in-page state changes (sort, paginate, expand) into routes. They are islands.
  2. Never re-implement pagination/sort/filter math in JS. Server-side.
  3. Never use SSE to deliver responses to user actions. SSE is push-only, lives on the single /__gofastr/sse bus (never a bespoke EventSource on app surfaces. Dev-mode tooling like framework/dev livereload and kiln's build-mode reload ships its own, and that's the whole exception class), and is reserved for presence/collab/sub-second semantics. Passive freshness polls instead (data-cui-poll).
  4. Never add location.href = … or full reloads as a "fix".
  5. Never add new data-cui-* attributes without updating core-ui/ARCHITECTURE.md and the runtime test suite.
  6. Never expose an entity holding per-user data via auto-CRUD without setting EntityConfig.Scope.OwnerField. See framework/docs/content/entity-declarations.md → "Per-user scoping".
  7. One styling surface. Generators and apps ship ZERO bespoke CSS and ZERO hand-rolled structural markup. ALL styling + layout lives in the design system: framework/ui components (CSS via registry.RegisterStyle), core-ui/app layouts, core-ui/style tokens. A surface that needs styling the design system doesn't provide is a MISSING component / layout / token: add it upstream and compose it. Tripwires that mean STOP, you're drifting: a *BaseCSS string accreting rules; an invented .mrd-*/.gofastr-* class; setting a CSS property where a var(--*) token belongs; overriding a component's internals from outside instead of giving the component a config/variant. The one app-side surface is the owned style sheet (<name>.style.css
    • gofastr gen styles): scoped to its own markup, tokens only, and barred from kit internals. It is how an app draws what the kit deliberately does not ship: its site header, footer and docs page (examples/acme-site/{siteheader,sitefooter,helpdocs}; the blueprint writes the same packages into generated apps). It is never a patch for a component that should have a variant.
  8. Survey before you build. Before hand-rolling any UI markup or CSS, grep framework/ui + core-ui for an existing primitive. The catalog is large (Hero, Grid, Stack, Cluster, DetailList, Form, FormField, AuthCard, Sidebar, ThemeToggle, Card, Section, DataTable, StatCard, charts, PageHeader, …). Reinventing or CSS-overriding an existing component is the #1 failure mode here. If it's genuinely missing, add it to the design system, not locally.
  9. Pixels, not probes, and dogfood the flagship. Never claim a UI "works / polished / verified" from a DOM dump, a11y tree, or computed-style probe: those cannot see layout or composition. Screenshot the rendered page and read it (use chromedp → FullScreenshot to a PNG if Playwright hangs on the SSE connection). For any framework/design-system change, verify examples/meridian end-to-end: marketing, app, auth, admin, mobile, light + dark. Meridian is the design-system completeness canary: a surface there that needs CSS the components don't provide is a gap to fix upstream, never a patch.
  10. Read the PR's line-level review comments before merging. After opening a PR and after every push to it, run ./scripts/pr-review-findings.sh <N> — it collects line comments, review bodies, and issue comments (paginated) from every reviewer, and --gate exits non-zero while any review thread is unresolved, so triage is enforced, not remembered: reply to each thread with the accept/reject disposition, resolve it, and only then merge. The raw calls behind it, for when you need them: gh api --paginate repos/DonaldMurillo/gofastr/pulls/<N>/comments. The --paginate is load-bearing: without it the fetch silently stops at the first page, so a multi-page review (exactly the miss this rule exists to catch) looks empty. The line-level review lives there, NOT in repos/DonaldMurillo/gofastr/issues/<N>/comments, which returns only issue-level comments. Read /pulls/<N>/reviews too, and read the BODY, not just its "Actionable comments posted" count: findings the bot could not attach to a line sit there under "Outside diff range comments", and PR #206 hid five that way, including a Major on the change set's own anti-vacuity gate. A review bot showing pass in gh pr checks means it RAN, not that it found nothing: PR #198 showed CodeRabbit pass while holding 12 unread comments, six of them Major. Triage every finding on merit and say which you rejected and why. Silence is not triage.
  11. Prove the guard, don't reason about it. A condition you argued was correct is untested until you have watched it fail. Break it, run the test, put it back. v0.67.0's review found three guards written that same week that nobody had made fail: a DSN check that read a bare key as consent nobody gave, a scope exemption where a cross-tenant grant cleared an owner refusal, and an anti-vacuity gate that skipped its own assertion on a populated table. Each took one mutation to expose and none had cost more than a minute to prove.

Common operations

  • Build / run the example website: ./scripts/dev-watch.sh (auto-rebuild + livereload, port :8082). Dev-watch writes to /tmp/ because the watched tree must stay clean.
  • Build canonical binaries: make build (→ dist/gofastr, dist/kiln) or make build-all (also builds every example into dist/examples/). The dist/ directory is the only sanctioned build output location and is gitignored.
  • Test what you changed: make test. Every local gate (make test, make analyze, make test-race, make test-pg, the pre-commit and pre-push hooks, make red-tests, scripts/coverage-floors.sh) and CI's pull-request run scope to the AFFECTED packages: go run ./cmd/affected walks the import graph from what differs between the working tree and origin/main (staged, unstaged, untracked and deleted files; a file under testdata or an embedded asset marks its owning package) and prints the closure, or runs the command after -- with it appended. Changing go.mod, go.sum or cmd/affected widens to everything, as does a base ref that cannot be resolved: the tool degrades to the full run, never to a skipped one.
  • Test everything: ./scripts/test-all.sh (or make test-all), or GOFASTR_TEST_ALL=1 in front of any of the gates above. Pushes to main and the merge queue always run everything in CI.
  • Repo analyzers (type-aware invariants as vet checks): make analyze builds cmd/vettool and runs it over the tree; it also runs in the pre-commit hook and CI's vet step. Registered: mapwriter (never range a map while writing output — iterate slices.Sorted(maps.Keys(m)), so SSR/email/prompt bytes are deterministic), unboundedbody, errleak, fieldtypeswitch, reqparamlimit, discardmutator, and the two hygiene passes. Each analyzer's own doc comment carries the bug that produced it and the postures it deliberately stays silent on. New invariants go in internal/analyzers/ ONLY when they need type information; pattern-shaped rules belong in the contracts pipeline (framework/contracts, gofastr verify), which already owns bespoke CSS, hard navigation, bespoke EventSource, and inline style/script. Twelve more arrived with the 2026-09 adversarial probe audit, one per bug SHAPE the 419 probes kept finding; each fires on the pre-fix site and stays quiet on the fix: controlbytes (request-derived strings pass a scrub before slog/otel/header/stdio sinks — name the helper scrub/sanitize/… or byte-index the value), callbackunderlock (never invoke func-typed fields or map callbacks between Lock and Unlock — snapshot under the lock, call outside), recovercallback (registry callbacks on goroutine/read-loop paths need a recover guard), compositekey (never key a map or keyed store on a control-character-joined concatenation — struct keys or length prefixes), emitident (never Sprintf an ungated name into an identifier slot of emitted code — Go declarations, SQL DDL, CSS string slots, route paths; toCamelCase transforms but does not validate), asciifold (never key a registry lookup on strings.ToLower/ToUpper — Unicode folding maps homoglyphs onto ASCII, ſ → S; refuse non-ASCII first), laxcoerce (a failed type assertion on a map[string]any entry is not absence — split presence from type, or return an error), rootwrite (writes under a root contained by filepath.Join + prefix only, with no EvalSymlinks on the chain, and zip entry names with no path.Clean), divlimit (integer division by a caller-supplied limit/pageSize/n with no zero-or-one guard), intwrap (unsigned→signed conversion and MinInt negation without a dominating bound check), reflectset (reflect Set* on a Field-derived value with no CanSet), and discardederr (an error dropped from a three-plus-result method call while the kept results march on). Five more came from the 2026-09-03 red-probe round, again one per repeated bug shape: worldreadable (state or secret files and dirs created with group/other bits — 0644/0755/os.Create — where the repo's discipline is 0600/0700; public artifacts prove it by path provenance, never by content guessing), fixedtmp (a constant or pid-named path under the shared temp root reaching mkdir/create/ exec; a pid is not entropy, use MkdirTemp/CreateTemp), secretcompare (a credential-named string compared with ==/!= against another credential or an input read; use subtle.ConstantTimeCompare or hmac.Equal), timestampid (an id/token/session/key minted from time.Now() formatted into a string, rand-failure fallbacks included; mint from crypto/rand), and discardeddecode (_ = json.Unmarshal, _ = Decode, _ = ParseForm: the zero value marches on as data). The same round widened unboundedbody (ParseForm/FormValue with no MaxBytesReader on the request), controlbytes (SMTP envelope and header-line writes, slog attrs built in battery/log, child-stderr detail strings, http.Redirect Location; a helper counts as a scrub only when its body walks the C0 range), and recovercallback (interface-method callbacks on host-installed fields and the func results they return, on dispatch paths). The 2026-09-04 round split the filesystem-root shape in two. rootwrite widened to the sinks the storage symlink probe slipped past (battery/storage Save/Delete): a same-package helper that RETURNS the root-joined path counts as root-derived at the caller, os.Rename/Link/Symlink DESTINATIONS, os.Remove, and MkdirAll of filepath.Dir(<such path>). New rootread is the read twin: os.Open/ReadFile/Stat/Remove and read-only OpenFile under a root-joined path, plus caller-supplied fs.FS reads (.Open, fs.ReadFile, fs.Stat) in HTTP-serving functions. The same round's reviewer mutation (core/upload Save with both EvalSymlinks removed stayed silent behind sanitizeKey) stripped the sanitizer shield from rootwrite too: in EITHER twin only resolution postures gate — EvalSymlinks on the chain or its Dir, symlink-named guards, an O_NOFOLLOW flag, or an Lstat+ModeSymlink leaf check — and a sanitized join is never one (the upload probes escaped through exactly one). os.Root is the fix spelling of first resort on Go 1.27: os.OpenRoot plus root.Open/ReadFile/Stat/Create/OpenFile/ Mkdir(All)/Remove/Rename confines reads and writes in the kernel — no symlink escape, no TOCTOU — and both rules are quiet on it. The 2026-09-04 round widened emitident with the JS/TS declaration slots (export const %s, readonly %s:, interface %s, type %s, function %s(, class %s, and unquoted object keys at line start, each demanding code evidence after the name so prose stays quiet): the generated client.d.ts emitted camelCased table names with only toCamelCase — a transform, not a gate — in front, while the .js had already moved to the quoted this[%q] spelling; the package field memo is now type-qualified (a check on one struct's Table field no longer silences a different struct's Table), and a composite of constants gates like the constants it holds. The same round added negdur (d <= 0 substituting a default, or a d > 0/d != 0 decision arming expiry — an ExpiresAt/expiry/ deadline assignment or a time.After/.Add(d) call — on a caller-supplied time.Duration, with or without an accompanying "0 means default" arm: an unrejected negative silently becomes the strongest setting, default-or-forever; reject d < 0 or clamp to zero/expired first). "Caller-supplied" means parameter-rooted: receiver fields and config/options-named struct fields are developer configuration (a host footgun, not an attacker-reachable inversion) and stay quiet, as do a diverging refusal, a dominating negative check — including one inside a package-local validator the function calls with the same value (IssueToken → validateTokenSpec) — a max(d, 0) clamp, a zero/disabled-sentinel substitution, and an override-only-when-positive option setter whose skipped arm keeps the pre-set default. Three more came from the 2026-09-04 red-probe round, two of them in the contracts pipeline because they read SQL strings, not types: GOFASTR1408 absattempts (never write a retry counter from a host-side value — attempts = $1 in an UPDATE SET; overlapping claimants both read N and both write N+1, so the attempt budget under-counts. Increment in SQL at claim, attempts = attempts + 1, the battery/queue spelling, and let settle write state, not arithmetic) and GOFASTR1409 unfencedclaim (on a table whose completion paths match claim_token = $n, every claim-state UPDATE/DELETE needs its own fence — a token predicate, a claimed_at <= $n staleness bound, or a terminal status guard; the v0.66 fencing reached Ack/Nack and missed release). The third is the vet analyzer credfetch: an http.Client with no CheckRedirect carrying a credential-bearing request (a client_secret/token/code form, an Authorization header, or a token-endpoint URL) re-sends the credential to whatever host a redirect names — refuse redirects the way battery/auth oidcNoRedirect does. Its unbounded-decode arm (a json.NewDecoder(resp.Body) / io.ReadAll(resp.Body) with no io.LimitReader on such a fetch's response) was lifted into unboundedresp by the 2026-09-07 round-5 rules, which fires on any client; credfetch owns redirects only. Both postures skip _test.go files outright (2026-09-04 posture): a test client POSTing a fixture code to an httptest.Server is not a credential flow, and a client assignment in a test file must not decide a production field's verdict — battery/auth/oauth2_test.go:657/:679 kept firing after the oidcNoRedirect fix because the test's bare-client field note won the merge and the report node pointed into the test file. Three shapes shipped from the 2026-09-05 red-probe round (ten were prototyped; the seven that fired on correct-by-design sinks were dropped, their target bugs covered by the fixes): the vet analyzer laxenvelope (within one package a type decoded through handler.UnmarshalStrict at one transport and json.Unmarshal / Decoder.Decode at another — the lax site executes the duplicate/case-folded/duplicate-id envelope the strict transport refuses; decode both strictly), the vet analyzer nonfinite (a strconv.ParseFloat result stored or returned with no math.IsNaN/math.IsInf gate — "NaN"/"Inf" parse cleanly and every v < min || v > max bound is false for NaN, so a handler's range check silently passes; reject non-finite first, the way core/schema validateFloat does. Parameter-rooted like negdur; YAML-spec .inf/.nan scalar literals and a DSL value bound for a SQL comparison rather than a range guard carry the allow marker), and the contracts rule GOFASTR1410 keyfold (a local-filesystem Save/Put/Write naming its stored object on a type with a BaseDir/Root/Dir field reaches os.OpenFile/os.Create/ os.Rename with no fold-refusal call in the file — TenantA/x and tenanta/x alias on a case-insensitive filesystem; share the battery/storage refuseFoldedKey walk). The 2026-09-04 red-probe round grew the browser-runtime lint family in core-ui/check/runtimeshapes.go to eight: storagekeyraw fires when a Web-storage key (localStorage/sessionStorage setItem/getItem/removeItem, or a document.cookie write) uses a data-cui-* attribute value raw — injected markup then writes or clobbers any key on the origin; the fix is namespace AND component- encode spelled at the sink (PREFIX + encodeURIComponent(v), banner.js's dismissKey shape; encoding alone leaves dots and hyphens alive, so the prefix is load-bearing). Its live-tree probe is TestStorageKeysEncodeAttrValues in core-ui/runtime/ runtime_security_test.go. The same round added the generated-code gate TestGeneratedCLIPassesRepoVettool (cmd/gofastr): it regenerates a CLI from a fixture spec into a temp module and runs the repo vettool over the EMITTED code, plus a direct check that terminal-control summaries never ship live — that round's control-bytes sink exists only inside the Go source template in generate_cli.go (printUsage prints command.summary raw), so no analyzer over this repo can see it. The 2026-09-07 round-5 red probes shipped five more vet analyzers and four contracts rules. recoverlog (a recover() value, or an fmt.Sprint/%v of it, reaching a log sink unscrubbed — route it through textsafe.Recovered, which strips control bytes and truncates), nowaitdelay (exec.CommandContext with captured output, Output/CombinedOutput/StdoutPipe, started with no WaitDelay — a child that never closes the pipe wedges Wait), unboundedresp (an io.ReadAll or JSON decode of an http.Response body with no io.LimitReader/MaxBytesReader, on ANY client — credfetch's decode arm lifted to every fetch), nostore (a 2xx body written on a path that resolved a principal with no Cache-Control set — RFC 9111's storage restriction covers Authorization headers, not cookie-authenticated requests, so every per-caller response suppresses storage itself; ack bodies built from constants and request scalars, header pass-throughs, and bodyless 2xx stay quiet), and unseated (a long-lived stream — text/event-stream, websocket Upgrade, Hijack — with a park loop reachable in the package and no seat acquisition on the path — admit through core/stream's seat policy). The contracts rules: GOFASTR1411 fetchmetadata (reading Sec-Fetch-Site outside handler.IsCrossSiteRequest, the one shared cross-site form guard), GOFASTR1412 urlattrescape (an href/src/action attribute filled by render.Escape, which escapes markup but not schemes — urlsafe.Clean), GOFASTR1413 varyset (Header().Set on Vary clobbers what an upstream middleware already wrote — Add), and GOFASTR1414 dialectdrift (sibling Postgres/SQLite query pairs on the same table set whose WHERE predicate tokens differ after placeholder normalization — the v0.84.1 outbox lease shape). Widened the same round: GOFASTR1407 rawjsonbodydecode names core/stream's zero-arg (WebSocketConn).Read and line scanners over a child StdoutPipe/os.Stdin as raw-JSON sources; laxenvelope exports the "type T is strict-decoded" fact across packages (go/analysis facts), treats a json.RawMessage field of a strict envelope as a strict carrier, and refuses CheckTopLevelKeys as strict evidence when a nested decode of the same bytes follows; clienttimeout fires on the bare http.Get/Post/Head/PostForm sugar and http.DefaultClient; errleak adds the JSON-RPC arm (a call carrying an Internal-named error-code constant plus an .Error() argument); worldreadable adds the os.WriteFile owner-mode arm — the 0600 literal only applies at CREATE, so overwriting an existing 0644 file keeps 0644; the fix spelling is fileperm.WriteOwnerOnly (open, chmod the handle, write); laxcoerce adds the x, _ := param.(T) discarded-assertion arm on an any-typed parameter whose result feeds a callback or return with no error; emitident adds the CSS selector and custom-property slots (.%s {, --%s:) and the identifier run continuing after the verb (func %sMiddleware(, type %sPlugin struct); and recovercallback canonicalizes generic type instantiations (Named.Origin), the blind spot that hid StateChannel's host-callback dispatch. The runtimeshapes JS lint family in core-ui/check grew to ten: decodeuriraw (decodeURIComponent of a data-cui- value outside every try — decodeURIComponent('%E0%A4') throws URIError out of the delegated handler; wrap it, or route through a same-file safeDecode helper) and protokey (a bracket write keyed by a data-cui- value with no reserved-key guard — reject proto/constructor/prototype first, or key the store by Map). Two gates landed with them: the docs corpus gate runs the contracts security rules (GOFASTR1404 cookie attrs, the referer-redirect shape) over the assembled compile-marked snippets in framework/docs, and the emitted-code gate runs the repo vettool over the --from-openapi CLI render and the blueprint e2e_test.go template. The //gofastr:allow marker and the check-csp ignore directive are anchored comment-initial now: prose that merely mentions either no longer silences anything.

    Every registration is wrapped in allow.Guard (internal/analyzers/allow): a site that is the shape ON PURPOSE carries //gofastr:allow(<analyzer>) <why> on its line or the line above, the same marker spelling the contracts pipeline uses; the reason is mandatory and a bare marker silences nothing. That is the only exception mechanism — never add a per-site silent posture to a rule for one caller. An analyzer package that is written but not registered must say why in cmd/vettool/main.go — TestEveryAnalyzerIsWiredOrExplained fails on one that is neither registered nor explained.

  • Run the adversarial red probes: make red-tests (or scripts/red-tests.sh Red to run only the probes). Red probes are *_red_test.go files tagged //go:build red that assert the SECURE behaviour and fail while the finding is open; go test ./... never sees them. A fix converts its probe into a permanent *_security_test.go; a probe that is deleted says why in the commit message and beside the sibling test that carries the contract. The raw go test output is kept at .gofastr/red-tests.log.
  • Check for duplicated code: make dupl (dupl at threshold 100 over the repo's Go files, examples/evals/testdata/*.gen.go excluded). Fails when the clone-group count grows past scripts/dupl-baseline.txt; re-baseline with scripts/dupl.sh --rebaseline and commit the baseline with the change that moved the number.
  • Run the FULL repo suite (build + vet + test, no cache, generous timeout): ./scripts/test-all.sh. Use this before/after large refactors: it covers the slow chromedp suite (examples/site) and kiln/integration. RACE=1, SHORT=1, and a trailing package path are all supported.
  • Test the site end-to-end (chromedp): go test ./examples/site/ -run TestE2E.
  • Clean build artifacts: make clean (wipes dist/, bin/, gen/, .gofastr/).
  • Audit no-binaries-committed: find . -maxdepth 3 -type f -size +500k ! -path "./.git/*" ! -path "./dist/*" ! -name "*.go" ! -name "*.md". Anything in the result is a stray binary in the source tree; either move it to dist/ or remove it before commit.

Where to look first

  • Reviewing maturity or choosing roadmap work? Check docs/agent-notes.md before trusting an older status section at face value.
  • New UI / any styling decision? It goes in the design system, full stop (Hard rules 7–8). Start in framework/ui/ if it composes intent (PageHeader, FormField, DataTable, Hero, AuthCard). Use core-ui/html if it maps 1:1 to an HTML tag, framework/headless for the unstyled structure + accessibility contract a styled component renders through, framework/ui for page frames (ui.Stack{Screen: true}, ui.ContentRow, ui.Container: the page column, the sidebar row, the centered container), and core-ui/style for tokens (incl. DarkColors).
  • Using a general design skill (/impeccable, /shape)? Its "implement working code with aesthetic detail" means extend framework/ui + the theme tokens here: never inline CSS into a page, an app, or the generator. Aesthetics ship as components + tokens, so every surface inherits them.
  • New island? Use core-ui/widget builder.
  • Theme tokens? framework/ui/theme for the canonical theme; core-ui/style for the underlying machinery.
  • Entity model, columns, relations, validators, EntityDeclaration? framework/entity/. Most other framework subpackages depend on it.
  • HTTP CRUD handler / batch / cursor / stream / upload / typed query / MCP tool generator / eager loading / includes? framework/crud/.
  • Filtering, sorting, pagination, DSL parsing? framework/filter/, framework/pagination/, framework/dsl/ (each is its own pkg).
  • Lifecycle hooks (BeforeCreate/AfterUpdate/etc.)? framework/hook/.
  • Auto-migration / schema diffing / dialect detection? framework/migrate/.
  • Multi-tenancy, soft delete, RBAC? framework/{tenant,softdelete,access}/.
  • Cron, events, file-field upload helper, slow-query logger? framework/{cron,event,file,slowquery}/.
  • App lifecycle, plugins, registry, typed hooks? Stay in framework/ root. These are the App spine. See framework/ARCHITECTURE.md for why each remaining root file is glued to App.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.