---
name: config-diff-5f243fb251c6
description: Compare config files semantically, highlight differences, and
  suggest merge strategies.
---


# Config Diff

Semantically compare and merge configuration files (YAML, JSON, TOML, INI, .env).

## Instructions

1. **Detect format** from file extension or content
2. **Semantic diff** — parse structure, don't just compare text:
   ```bash
   # JSON: normalize and diff
   jq -S . a.json > /tmp/a.json && jq -S . b.json > /tmp/b.json
   diff --unified /tmp/a.json /tmp/b.json

   # YAML: convert to sorted JSON first
   yq -o=json -S '.' a.yml | diff - <(yq -o=json -S '.' b.yml)

   # .env files
   diff <(sort a.env) <(sort b.env)
   ```
3. **Classify changes**:
   - 🟢 **Added**: New keys in target
   - 🔴 **Removed**: Keys missing from target
   - 🟡 **Changed**: Same key, different value
   - ⚪ **Unchanged**: Same key and value
4. **Report format**:
   ```
   📋 Config Diff: config.yml vs config.prod.yml
   | Key Path | Source | Target | Change |
   |----------|--------|--------|--------|
   | db.host  | localhost | db.prod.internal | 🟡 Changed |
   | db.pool  | —      | 20     | 🟢 Added |
   | debug    | true   | —      | 🔴 Removed |
   ```
5. **Merge suggestions**: For conflicts, recommend which value to keep based on environment context

## Security

- Flag sensitive values (passwords, tokens, keys) — never display in full; mask as `****`
- Warn if secrets differ between environments (may indicate misconfiguration)

## Edge Cases

- **Comments**: Text diff preserves comments; semantic diff ignores them — note this
- **Key ordering**: Semantic diff ignores order; flag if order matters (INI sections)
- **Nested objects**: Flatten key paths with dot notation for clear reporting

## Requirements

- `diff` (pre-installed)
- Optional: `jq` (JSON), `yq` (YAML)
- No API keys needed


---
Source attribution: modbender
Original project: https://github.com/modbender/skill-library-mcp/blob/d9c8fe903b5b4e82237dbe8d0df8567783022e18/data/config-diff/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Dave AI.

## Upstream license notice

MIT License

Copyright (c) 2025 skill-library-mcp contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Dave AI resource metadata

Creator / publisher: modbender
Original project: https://github.com/modbender/skill-library-mcp/blob/d9c8fe903b5b4e82237dbe8d0df8567783022e18/data/config-diff/SKILL.md
Attribution basis: Source repository record

Fields of work: Development & Engineering
Roles: Backend Developer, Data Engineer, DevOps / SRE
Specialties: Backend
Tools: Jq, Yq
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 8d09cfce73546688dbecd307df0ea09ae91f3bcfbdc2c7295e1ded030b770d59
