Skip to content
Back to skills

Switch

ASecurity

Build a machine definition, show the closure diff, and activate only on confirmation. Prints the rollback on failure.

  • 2 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 7, 2026
ai-agents

Security analysis

A100/100

Scanned November 7, 2026

npx -y skills add samuel-stidham/smithy --skill switch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Switch?

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

Security grade badge for Switch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/samuel-stidham-switch-smithy/badge)](https://www.skillsdirectory.com/skills/samuel-stidham-switch-smithy)

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: switch
description: Build a machine definition, show the closure diff, and activate only on confirmation. Prints the rollback on failure.
disable-model-invocation: true
---

# /anvil:switch

Build and activate a machine definition, with the diff shown in
between. Activation is the one hard-to-reverse thing anvil does.
Showing the closure diff before the confirmation is the whole design
of this verb, never a nicety.

## Scope

Machine definitions only: a `flake.nix` declaring
`homeConfigurations` or `nixosConfigurations`, or a
`configuration.nix`. A devenv-only repo is out of scope here, since
direnv owns its activation. Getting a machine definition wrong logs
you out, which is why every step below gates the next.

## Workflow

1. Evaluate. Stop on any evaluation error.
2. Build the activation package. A build failure ends the run.
3. Diff the built closure against the current generation and print
   what would change: packages added, removed, and version-changed,
   plus changed files and units.
4. Activate only after the user confirms. Never activate as a side
   effect of anything.
5. On failure, print the rollback command before any diagnosis.

## Boundaries

Home-manager first. No `sudo`, no package installs, no bootstrap:
anvil proposes those steps and a human runs them. Whether this verb
grows `nixos-rebuild` support is an open question recorded in the
plugin README.

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.

View all in ai-agents →

Comments

Loading comments…

Newsletter

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