Documentation
¶
Overview ¶
Package guards turns institutional gotchas into candidate enforcement: for a gotcha with a concrete anti-pattern, the BYOAI LLM proposes a grep-style pre-commit check (pattern + file globs + message). The human pastes the ones that fit into the hook, closing the loop from "we learned this" to "the repo enforces it". BYOAI via the existing llm.Client (claude -p); the model proposes, the human decides.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ShellSnippet ¶
ShellSnippet renders applicable guards as a copy-paste bash block for a pre-commit hook: each greps the staged-relevant globs for its pattern and fails with the message. Only guards that applies==true and have a pattern + globs are emitted.
Types ¶
type Guard ¶
type Guard struct {
GotchaID string `json:"gotcha_id"`
Title string `json:"title"`
Applies bool `json:"applies"` // false = not mechanically checkable (judgment/architecture)
Pattern string `json:"pattern"` // RE2/grep -E regex flagging the anti-pattern
Globs string `json:"globs"` // comma file globs the check applies to (e.g. "*.go,*.ts" or "Dockerfile")
Message string `json:"message"` // one-line failure message
Severity string `json:"severity"` // block | warn
Reason string `json:"reason"` // why applies is true/false
}
Guard is a proposed enforcement for a gotcha.