Skip to content

Conventions

Go

Baseline: the kit's go-code-style skill. rig's own deltas:

  • Dispatch is hand-rolled in cmd/rig/main.go; no cobra or flag framework.
  • main parses, calls an internal/<feature> package and prints; logic beyond parse, call, print belongs in that package.
  • Test doubles and conformance suites live in one <pkg>test package per domain package, no fake/ (task 64 brings the tree in line).
  • User-facing output goes to injected io.Writers, never a logger.
  • All process execution goes through internal/proc.
  • Only internal/store imports rig-eventlog.
  • internal/workflow imports neither internal/git nor a store backend.
  • rig stays agnostic to any LLM or agent harness.
  • golangci-lint blocks new issues only (new-from-merge-base: origin/main); task 68 clears the existing backlog.

Shared guards

Tests that sweep declarations; a new change must keep them in step.

  • cmd/rig/usage_test.go with cmd/rig/testdata/usage.golden: asserts the usage text lists every command.
  • cmd/rig/help_test.go with the help goldens in cmd/rig/testdata/*.golden: asserts each command's help output matches its golden.
  • internal/workflow/imports_test.go: asserts the workflow engine imports neither internal/git nor a store backend.
  • internal/workflow/schema_test.go: asserts schema/workflow.schema.json covers every workflow key.