- Removed priority lines from various TODO markdown files - Added new admin.md for grokkit admin tool - Updated README.md with new entry
1.6 KiB
1.6 KiB
grokkit agent Go tools integration
Description: Wrappers for go subcommands: mod tidy, generate, vet, fmt. Ensures hygiene post-agent edits.
Problem It Solves
Agent changes may break deps/fmt/vet—manual fixes. Auto-run + fix loops.
Benefits
- Hygiene auto: Tidy deps, fmt code, vet issues.
- Generate: Run go:generate for boilerplate.
- Safe mutations: Preview changes (git diff).
- Workflow: Edit → gotools tidy → test.
Agent Tool Examples
grokkit agent "Add new import, tidy mods, vet all"
# Grok: edits → go mod tidy → go vet → reports clean
High-Level Implementation
- Detect:
go version. - Tool schemas:
tidy() → changesvet(path?) → issuesgenerate() → outputfmt_diff() → diff
- Wrappers in
internal/tools/gotools.go:func Tidy(ctx context.Context, args map[string]any) (string, error) - Agent integration: Post-edit hygiene step.
- Safety:
- Dry-run where possible (go fmt -d).
- Whitelist subcmds.
- Config:
[tools.gotools.enabled].
Flags / Config
| Key | Description |
|---|---|
tools.gotools.enabled |
Enable Go tools |
Implementation Notes
- Commands:
go mod tidy,go vet ./...,go generate ./.... - Parsing: Diff output, error lists.
- Errors: GoToolError.
- Tests: Mock, table-driven.
- Effort: Low (~130 LOC).
- Prereq: Go workspace.
ROI
High. Go-specific polish:
| Stage | Covered |
|---|---|
| Hygiene | gotools ← new |
| Search | rg (sibling) |
| Build | make (sibling) |