| name | common-tasks |
| description | Common development tasks for Glens. Use this when building, adding modules, CLI flags, config options, or running the change checklist.
|
Skill: Common Tasks
Working in a Module
cd cmd/glens
make all
make build
Adding a CLI Flag (cmd/glens)
cmd.Flags().String("flag-name", "default", "Clear description")
_ = viper.BindPFlag("config.key", cmd.Flags().Lookup("flag-name"))
Adding a New Tool Module
mkdir cmd/tools/<name> && cd cmd/tools/<name>
go mod init glens/tools/<name>
- Add
use ./cmd/tools/<name> to go.work
- Copy
Makefile and .pre-commit-config.yaml from an existing tool.
- Add
.github/workflows/tool-<name>.yml.
- Add binary to
.github/workflows/release.yml.
Adding a Config Option
new_option: "${ENV_VAR}"
File Structure
go.work # workspace root
pkg/logging/ # generic zerolog wrapper
cmd/glens/ # main CLI (cobra commands, internal/ packages)
cmd/tools/demo/ # OpenAPI spec visualiser
cmd/tools/accuracy/ # endpoint accuracy reporter
configs/ # example configuration files
docs/ # user guides and architecture diagrams
test_specs/ # OpenAPI specs used in integration tests
Before Any Change — Checklist
- Is this the simplest solution?
- Will this be easy to maintain in two years?
- Can someone new understand this in five minutes?
- Does this follow Go idioms?
- Does this respect the module isolation rules (
pkg/ vs internal/)?
If any answer is "no", reconsider the approach.