agentleFS
heytcassheytcass/claudeos/.claude/skills/deploy/SKILL.md

deploy

Skill1 starsChanged 5 months agoMITView on GitHub

Validate, build, and deploy NixOS configuration to a target host

100 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use azure-kusto-graph, azure-kusto-irql and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • MicrosoftSkill

    azure-kusto-graph

    Build and query Kusto graphs from natural language. Covers transient graphs (make-graph), persistent graph models/snapshots, pattern matching (graph-match), shortest paths, connected components, and graph-to-table export. Generates the edges-first thinking: define edges, define node lookups, union, make-graph. WHEN: make-graph, graph-match, graph-shortest-paths, graph-to-table, graph-mark-components, persistent graph, graph model, graph snapshot, build a graph from data, find paths between nodes, pattern matching in graph, connected components, transient graph, Kusto graph, KQL graph.

    Also in 3 projects that use this

  • MicrosoftSkill

    azure-kusto-irql

    Compose IRQL (Incident Response Query Language) queries for Kusto cybersecurity investigations. Translates natural language hunting questions into composable IRQL pipelines using Get_*, Extract_*, and Enrich_* functions. WHEN: IRQL query, security hunt, threat hunting KQL, incident response query, compose hunting pipeline, failed logins, phishing investigation, lateral movement, process execution, file creation events.

    Also in 3 projects that use this

  • pvnarpSkill

    incident

    Guides incident response and post-mortem analysis. Covers triage, mitigation, root cause analysis, and prevention. Use when responding to active incidents, writing post-mortems, or improving incident processes.

    Also in 7 projects that use this

  • ww-w-aiSkill

    starter

    Static web development guide for beginners. Covers HTML/CSS/JavaScript and Next.js App Router basics. Project initialization with "init starter". Triggers: static website, portfolio, landing page, HTML CSS, beginner, 정적 웹, 포트폴리오, 초보자, 静的サイト, 初心者, 静态网站, 初学者, sitio web estático, site statique, statische Website, sito web statico Do NOT use for: fullstack apps (use $dynamic), enterprise (use $enterprise).

    Also in 3 projects that use this

  • +8 more from microsoft

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 85 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If no host specified, default to $(hostname) (current machine).

    line 18
  2. Distinctive:

    Check first, and confirm with the user before touching their work:

    line 48
  3. Very specific:

    If that prints dirty, resolve it — commit the changes if they are ready, or park unrelated work-in-progress for the duration of the deploy:

    line 55
  4. Distinctive:

    Stop on failure: Do not proceed to apply.

    line 71
  5. Very specific:

    If deploying to a host other than $(hostname), confirm with user first.

    line 79

“Common” is measured: kept by at least 6 in 10 of the 85 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Deploy NixOS Configuration

Full deployment pipeline: validate → build → apply.

Usage

/deploy or /deploy <hostname>

Steps

1. Determine Target

If no host specified, default to $(hostname) (current machine). If deploying to a different host, confirm with user. List available hosts from hosts/ directory.

2. Validate (stages untracked files itself)

claudeos-validate is the canonical validation — it stages untracked files (flakes only see tracked ones), runs nix flake check, and dry-run-builds every host the flake defines:

claudeos-validate
nix fmt -- --ci .

Stop on failure. Fix before continuing.

--ci is the formatting gate, not --check — treefmt has no --check flag, so that spelling makes it print its help and exit 1 on every run, whether or not anything is misformatted. --ci implies --no-cache --fail-on-change: exit 0 when the tree is clean, 1 when a file would change. Read the N changed count in its output, not a piped $? — cmd | tail reports tail's status and will mask a real failure.

3. Deploy from a clean tree

flake.nix sets system.configurationRevision = self.shortRev or "dirty". Nix omits shortRev entirely when the working tree is dirty, so the fallback fires and the generation is stamped dirty instead of a commit — nixos-rebuild list-generations then can't tell you what is actually running, and neither can the other host.

Check first, and confirm with the user before touching their work:

git status --short
nix eval --raw .#nixosConfigurations.<host>.config.system.configurationRevision

If that prints dirty, resolve it — commit the changes if they are ready, or park unrelated work-in-progress for the duration of the deploy:

git stash push -m "wip: <what>" -- <paths>   # ... deploy ... then:
git stash pop

Restore the stash in the same turn, even if the build or switch fails.

4. Build

nix build .#nixosConfigurations.<host>.config.system.build.toplevel

Stop on failure. Do not proceed to apply.

5. Apply

sudo nixos-rebuild switch --flake ~/.config/claudeos#<host>

If deploying to a host other than $(hostname), confirm with user first.

6. Verify

nixos-rebuild list-generations | head -3

Report the new generation number and its Configuration Revision — the revision is the check that step 3 held. It should be the commit you deployed; dirty means the generation does not correspond to anything committed, so nothing can reproduce or roll back to it by hash.

Confirm the switch's final store path matches what step 4 built, then ask the user to verify the target functionality. Prefer checking whatever the build could not: nix build only evaluates Nix, so Hyprland config and Quickshell QML are unverified by everything above (see CLAUDE.md).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.