- Reorder README.md queued list to prioritize changelog first, followed by interactive-agent, make, tea, and gotools. - Update priorities in individual queued/*.md files accordingly. - Add detail to changelog.md about using generated CHANGELOG.md for Gitea release notes.
1.6 KiB
1.6 KiB
grokkit agent Go tools integration
Priority: 5 of 12
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) |