Agent skill
drift
Detect configuration drift using hash-based verification
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/drift-abl030-nixosconfig
SKILL.md
Configuration Drift Detection
Verify refactors produce no unintended changes by comparing derivation hashes.
Quick Commands
# Compare all hosts against baseline (shows nix-diff for changes)
./scripts/hash-compare.sh
# Run the full quality gate including drift detection (slow)
check --drift
# Quick summary without detailed diffs
./scripts/hash-compare.sh --summary
# Check specific host
./scripts/hash-compare.sh framework
# Update baselines after intentional changes
./scripts/hash-capture.sh
How It Works
NixOS's deterministic builds mean identical system.build.toplevel hashes guarantee identical systems. No need for complex test logic.
- MATCH: Hash unchanged - pure refactor, no functional changes
- DRIFT: Hash differs - configuration changed, nix-diff shows what
Typical Workflow
Before Refactoring
# Ensure baselines are current
./scripts/hash-compare.sh --summary
# Should show: Matched: 15, Drifted: 0
During Refactoring
# Check frequently
./scripts/hash-compare.sh --summary
# DRIFT is expected if you're changing configs
After Refactoring
# Full comparison with diffs
./scripts/hash-compare.sh
# If changes are intentional, update baselines
./scripts/hash-capture.sh
Key Features
- Processes ALL hosts - never bails on first error
- nix-diff integration shows exact root cause of changes
- Baselines auto-update in nightly CI
Files
| File | Purpose |
|---|---|
scripts/hash-capture.sh |
Capture current hashes |
scripts/hash-compare.sh |
Compare against baselines |
hashes/*.txt |
Stored baseline hashes |
docs/hash-verification.md |
Full documentation |
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?