## Lesson — Validate JSON shapes during configuration scrubbing

**Tags:** json, defensive-programming
**Scope:** packages/cli/src/commands/**/*.ts, !**/*.test.*, !**/*.spec.*

Perform defensive shape validation on parsed JSON (e.g., checking if roots are objects) before manipulation to ensure the CLI degrades gracefully instead of crashing on unexpected structures.
