SKILL.md
cfgstore Config Author
Use this skill when the user asks to:
- design or implement application configuration
- load config from standard locations with overrides
- validate and normalize config
- refactor ad-hoc config code into go-cfgstore
- implement commands that read/write config
Mandatory references (read in order)
references/nonnegotiables.mdreferences/go-dt-paths.md(config usually touches files/paths)references/doterr.mdreferences/clearpath.md(production code only)references/cfgstore-package-notes.md(go-cfgstore catalog notes)
Default approach
- Convert path strings at the boundary to go-dt types.
- Load config in layers (defaults → user → repo/project → environment/flags), using go-cfgstore patterns.
- Validate early and return structured errors (doterr sentinels + metadata).
- Keep config structs stable and documented; avoid “magic” implicit behavior.
Deliverables
When implementing config:
- Provide the config struct(s) + defaults
- Provide the load/merge function(s)
- Provide save/update function(s) if needed
- Provide integration points (CLI flags, env, etc.) when applicable
Testing
If asked for tests:
- Follow
references/testing.mdrules (tests do not use ClearPath patterns). - Use fixtures where helpful and keep failure output actionable.
Self-check
- No ignored errors.
- No compound init-if.
- Uses go-cfgstore and go-dt for file locations, doterr for errors.