bianhaifeng789-hue/openclaw-config/backward-compatible-schema-pattern
Claude Code and agent skill by bianhaifeng789-hue/openclaw-config
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Install
npx vskill@latest install bianhaifeng789-hue/openclaw-config/backward-compatible-schema-patternSKILL.md
The same SKILL.md was published earlier as bianhaifeng789-hue/openclaw-config/backward-compatible-schema-pattern.
Backward-Compatible Schema Pattern
Source
Claude Code: utils/settings/types.ts (header comment + SettingsSchema)
Pattern
Zod schema designed for backward compatibility - new fields optional, old fields preserved.
Code Example
Key Concepts
- All Fields Optional: Never break by making required
- .passthrough(): Preserve unknown keys in nested objects
- Union Migration: z.union([oldType, newType]) for gradual change
- Deprecate Not Remove: Keep old fields, mark deprecated
- Backward-Compat Tests: Dedicated test file for regression
Benefits
- Old settings files continue to work
- Users can upgrade CLI without editing configs
- Invalid fields preserved for user to fix manually
When to Use
- User-editable configuration schemas
- Long-lived settings files
- CLI tools with version upgrades
Related Patterns
- Lazy Schema Pattern (lazySchema.ts)
- Zod Error Formatting (validation.ts)
- Validation Tips Matcher (validationTips.ts)
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills-experimental/backward-compatible-schema-pattern/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/bianhaifeng789-hue/openclaw-config/backward-compatible-schema-pattern)