feat(config): rename agent.yaml to moat.yaml#204
Conversation
📦 Previous Review (superseded by newer review)Claude finished @dpup's task in 2m 15s —— View job Code ReviewThe implementation is clean and straightforward. The core logic is correct and the test coverage is good. A few minor issues to flag: 1. Doctor label shows "moat.yaml overrides" when displaying
|
…e fallback Rename the config file from agent.yaml to moat.yaml to align with the CLI name. The config loader now checks moat.yaml first and silently falls back to agent.yaml if not found, so existing projects continue to work without changes. Changes: - config.Load() tries moat.yaml first, falls back to agent.yaml - Export ConfigFilename and LegacyConfigFilename constants - Rename SourceAgentYAML to SourceMoatYAML - Update all CLI help text, error messages, and comments - Rename all 19 example agent.yaml files to moat.yaml - Rename docs reference page to 02-moat-yaml.md - Update all documentation (guides, concepts, reference, plans) - Add tests for legacy fallback and moat.yaml precedence - Fix pre-existing "agent deps" command name in help text
|
Claude finished @dpup's task in 1m 27s —— View job Code Review
The implementation is clean and well-structured. The backwards-compatibility fallback in One issue from the previous review remains unfixed:
|
| if hasClaudeConfig { | ||
| fmt.Fprintf(tw, " 5. agent.yaml overrides:\t%s %s (has claude config)\n", agentYamlPath, ui.OKTag()) | ||
| fmt.Fprintf(tw, " 5. moat.yaml overrides:\t%s %s (has claude config)\n", configPath, ui.OKTag()) | ||
| } else { | ||
| fmt.Fprintf(tw, " 5. agent.yaml overrides:\t%s %s\n", agentYamlPath, ui.OKTag()) | ||
| fmt.Fprintf(tw, " 5. moat.yaml overrides:\t%s %s\n", configPath, ui.OKTag()) | ||
| } |
There was a problem hiding this comment.
The label is still hardcoded as "moat.yaml overrides" even when configPath was updated to agent.yaml above. All three Fprintf calls need to use the dynamic label:
| if hasClaudeConfig { | |
| fmt.Fprintf(tw, " 5. agent.yaml overrides:\t%s %s (has claude config)\n", agentYamlPath, ui.OKTag()) | |
| fmt.Fprintf(tw, " 5. moat.yaml overrides:\t%s %s (has claude config)\n", configPath, ui.OKTag()) | |
| } else { | |
| fmt.Fprintf(tw, " 5. agent.yaml overrides:\t%s %s\n", agentYamlPath, ui.OKTag()) | |
| fmt.Fprintf(tw, " 5. moat.yaml overrides:\t%s %s\n", configPath, ui.OKTag()) | |
| } | |
| label := filepath.Base(configPath) + " overrides" | |
| if hasClaudeConfig { | |
| fmt.Fprintf(tw, " 5. %s:\t%s %s (has claude config)\n", label, configPath, ui.OKTag()) | |
| } else { | |
| fmt.Fprintf(tw, " 5. %s:\t%s %s\n", label, configPath, ui.OKTag()) | |
| } |
Summary
agent.yamltomoat.yamlto align with the CLI nameagent.yamlis still supported as a silent fallback for backwards compatibilitymoat.yaml>agent.yaml(if both exist,moat.yamlwins)Changes
Core logic (
internal/config/config.go):Load()triesmoat.yamlfirst, falls back toagent.yamlConfigFilename("moat.yaml") andLegacyConfigFilename("agent.yaml") constantsSettings (
internal/providers/claude/settings.go):SourceAgentYAML→SourceMoatYAMLCLI (8 files in
cmd/moat/cli/):agent deps→moat depsin help textExamples: All 19
agent.yamlfiles renamed tomoat.yamlDocumentation (50+ files):
02-agent-yaml.md→02-moat-yaml.mdTests:
moat.yamlTestLoadLegacyAgentYaml(verifies fallback works)TestLoadMoatYamlPreferred(verifies precedence when both exist)Test plan
go build ./...compilesmake lintpasses with 0 issuesgo test -race ./internal/config/ ./internal/providers/claude/ ./internal/run/all passmoat runworks withmoat.yamlmoat runworks with onlyagent.yaml(fallback)🤖 Generated with Claude Code