grokkit/todo/queued/gotools.md
Greg Gauthier b884f32758
All checks were successful
CI / Test (push) Successful in 33s
CI / Lint (push) Successful in 25s
CI / Build (push) Successful in 19s
chore(todo): add priorities to queued items and new tool integration plans
- Added priority markers (e.g., "Priority: X of 12") to existing queued TODOs like audit, changelog, profile, scaffold.
- Introduced new detailed TODO markdowns for agent integrations: cnotes, git-chglog, gotools, make, pprof, rg, tea.
- Enhances planning for grokkit agent tooling ecosystem.
2026-03-02 23:42:06 +00:00

1.6 KiB

grokkit agent Go tools integration

Priority: 7 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

  1. Detect: go version.
  2. Tool schemas:
    • tidy() → changes
    • vet(path?) → issues
    • generate() → output
    • fmt_diff() → diff
  3. Wrappers in internal/tools/gotools.go:
    func Tidy(ctx context.Context, args map[string]any) (string, error)
    
  4. Agent integration: Post-edit hygiene step.
  5. 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)