Spec a Rust config loader with useful errors

Vibe codingMedium25 min

Your task

Your Rust CLI tool reads its settings from config.yaml. Users keep filing bugs like "my timeout setting does nothing", and a broken file makes the tool panic with an unreadable message. An agent will rewrite the loader: parse the file, check it, apply defaults and report errors.

Write the spec you would hand the agent.

What you know:

  • Rust 2021, with serde and serde_yaml already dependencies
  • server.host is required, and server.port defaults to 8080
  • timeout_secs defaults to 30 and must be 1 to 300, and retries defaults to 3
  • region is a short lowercase code such as us, de or no

Then, in a few sentences: what does a vague "parse the YAML config" prompt get wrong here?