Skip to content
Back to skills

Self Update

ASecurity

Use for Rust binary self-update under cli/src/domains/dotfiles/self_update* (release selection/cache, download verification, binary replacement, smoke tests, restart integration) and for dotfiles.sh / dotfiles.ps1 wrapper bootstrap, verification, --build handling, and argument forwarding. Not for Git repository synchronization, package upgrades, managed shell startup (use shell-configuration), or Git hooks (use git-hooks-patterns).

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 9, 2026
toolsrustshellbashtestinggit

Works with

  • cli

Security analysis

A100/100

Scanned December 3, 2026

npx -y skills add sneivandt/dotfiles --skill self-update --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Self Update?

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

Security grade badge for Self Update
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/sneivandt-self-update/badge)](https://www.skillsdirectory.com/skills/sneivandt-self-update)

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: self-update
description: >
  Use for Rust binary self-update under cli/src/domains/dotfiles/self_update*
  (release selection/cache, download verification, binary replacement, smoke
  tests, restart integration) and for dotfiles.sh / dotfiles.ps1 wrapper
  bootstrap, verification, --build handling, and argument forwarding. Not for
  Git repository synchronization, package upgrades, managed shell startup
  (use shell-configuration), or Git hooks (use git-hooks-patterns).
---

# Self Update and Wrapper Bootstrap

Wrappers (`dotfiles.sh`, `dotfiles.ps1`) own bootstrap before a binary exists;
Rust (`cli/src/domains/dotfiles/self_update.rs` and `self_update/`) owns normal
binary self-update. Git checkout sync is separate (`cli/src/domains/repository/`).

## Rust binary self-update

- Preserve dev-build/installed-path applicability, explicit skip policy, release
  ordering (do not treat arbitrary tags as newer), and offline-discovery vs
  failed-install distinction.
- Trust and recovery sequence (`self_update/install.rs`):
  1. Verify SHA-256 checksum and required provenance on the staged download
     before touching the working binary—never silently weaken attestation policy.
  2. Smoke-test **both** the staged binary before swap and the installed binary
     after swap against the exact expected release string (`dotfiles <tag>`),
     not merely exit code 0, so a runnable wrong release cannot become eligible
     for launcher recovery.
  3. Install from the same verified staged bytes, keep the old binary for
     rollback, and preserve both the original failure and any rollback failure.
- Preserve guarded restart and forwarded arguments so execution never loops or
  continues with stale process-generation inputs.

## Wrapper bootstrap

- Wrappers own only production download/bootstrap, checksum/provenance
  verification, `--build` source mode, pre-binary flags, and verbatim
  forwarding of all other arguments—domain behavior belongs in Rust.
- Keep `dotfiles.sh` (POSIX `#!/bin/sh`, no Bashisms) and `dotfiles.ps1`
  (explicit native exit-code checks—`$ErrorActionPreference = 'Stop'` does not
  catch every non-zero native exit) in parity.
- Never reconstruct forwarded arguments via `eval` or string interpolation;
  verify downloads before execution or cache replacement and preserve the
  working binary on failure. Cover consumed `--build`, empty arguments, spaces,
  arguments after `--`, stdout/stderr routing, and child exit code.
- Wrapper progress uses the CLI's compact ` · `-separated style; keep warnings
  and errors on stderr with their existing prefixes.

Use injected HTTP/provenance fixtures and wrapper tests from
[Testing](../../../docs/content/development/testing.md#choosing-coverage); never
replace the live `bin/dotfiles` to test a patch. Use `ci-cd-patterns` when
changing release asset/tag/provenance production.

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 tools →

Comments

Loading comments…

Newsletter

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