Skip to content
Back to skills

Config Validation

ASecurity

Use for Config::validate aggregation, domain validate() functions, diagnostic codes/severity, check-command validation tasks, or cli/tests/config_drift.rs. Not for ordinary TOML parsing alone.

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added August 31, 2026
toolsgo

Works with

  • cli

Security analysis

A100/100

Scanned September 20, 2026

npx -y skills add sneivandt/dotfiles --skill config-validation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Config Validation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Config Validation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/sneivandt-config-validation/badge)](https://www.skillsdirectory.com/skills/sneivandt-config-validation)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: config-validation
description: >
  Use for Config::validate aggregation, domain validate() functions, diagnostic
  codes/severity, check-command validation tasks, or cli/tests/config_drift.rs.
  Not for ordinary TOML parsing alone.
---

# Config Validation

## Validation boundary

- Serde rejects unknown keys and structural/type errors.
- Domain `validate()` functions return semantic `Vec<Diagnostic>`.
- Startup loads and reports diagnostics before publishing the immutable config
  snapshot; a repository restart repeats this in a fresh process, not a mutable
  in-process reload.
- Warning and error diagnostics both fail `dotfiles check`; severity communicates
  meaning and rendering. Reporting a diagnostic during ordinary startup does
  not itself abort every mutation: preserve structural preflight checks and
  resource-level safety guards.
- `app/config/error.rs::reject_conflicts` formats fatal desired-state conflicts
  in encounter order. Pass conflict diagnostics only; do not funnel ordinary
  `Config::validate()` findings through it.

Each diagnostic has a source, item, stable dotted code, severity, and actionable
message. Reuse `Validator` and its `check_each`, `warn`, `warn_if`, and
`check_conflicts` methods, plus the free `check` / `check_error` helpers.
Their predicate is true when the input is invalid, not when it passes.

## Add a rule

1. Add or extend the domain's `validate()` function.
2. Define a stable `DiagnosticCode::new(domain, rule)` constant.
3. Use error severity for structurally unsafe or unusable values.
4. Wire the validator into `Config::validate()`.
5. Test valid, invalid, and boundary cases, asserting code, severity, source,
   and item identity as well as the actionable message.

Validation tasks live under `cli/src/app/validation/`; the `check` command owns
their inventory. Missing required tools must follow existing task policy, not
silently pass.

## Cross-file drift

Use `cli/tests/config_drift.rs` for invariants across real `conf/` and
`symlinks/` data, such as source existence and cross-file ownership. Keep these
tests self-contained and report every offending item.

Do not replace `validation_symlinks` / `validation_chmod` with the active-profile
lists: source checks intentionally include inactive categories. Test merged
public/overlay conflicts using synthetic fixtures, not private content.

Start with [validation helpers](../../../cli/src/infra/config/validation.rs),
[structural preflight](../../../cli/src/app/config/preflight.rs), and
[check tasks](../../../cli/src/app/validation/checks.rs).
Use `toml-configuration` when the schema or loader also changes.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.