Go config
My personal pi harness configuration.
npx -y skills add nyquistwilder/personal-pi --skill go-configAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Greenfield Go configuration workflow for flags, environment variables, config files, precedence rules, typed config structs, validation, secrets, and test isolation.
SKILL.md
2.0 KB, as published. Nobody here has run it
Go Config
Rule
Configuration must be explicit, typed, validated, and testable. Keep loading at application edges and pass typed config into packages.
Hard Stops
Ask before:
- Changing config precedence, names, defaults, file locations, or environment variable contracts.
- Reading global machine files, user home config, real secrets, or production env by default.
- Adding config libraries for simple flags/env needs.
- Logging config that may contain secrets.
Defaults
- Prefer stdlib
flag,os.LookupEnv, and typed structs for simple apps. - Use
caarlos0/env/v11only when env parsing and validation become repetitive and approved. - Use TOML/YAML/JSON config files only when the app needs file-based configuration; choose one format intentionally.
- Define clear precedence, commonly: defaults < config file < environment < CLI flags.
- Validate config once at startup and fail fast with actionable errors.
- Redact secrets in logs, errors, and
%+vdumps.
Workflow
- Define settings, types, defaults, required values, validation, and precedence.
- Implement loaders that accept explicit args/env/file readers for tests.
- Avoid package-level config reads outside
mainor app initialization. - Add tests for defaults, overrides, validation errors, precedence, and redaction.
- Run targeted tests,
go test ./..., lint, andjust check.
Antipatterns
- Reading environment variables deep inside domain code.
- Hidden defaults that differ between tests and production.
- Global mutable config objects.
- Viper-style broad configuration stacks for small services unless explicitly approved.
- Printing full config structs that contain secrets.
Completion
Report config contract, precedence, secret handling, dependency choices, tests, and validation results.