agentleFS
alunduilalunduil/alunduil-chezmoi/CLAUDE.md

alunduil-chezmoi

CLAUDE.md2 starsChanged 2 months ago0BSDView on GitHub

Chezmoi source directory. Files deploy to $HOME via chezmoi apply; names follow chezmoi rules (dot_ → ., executable_ → +x, .tmpl → Go template, .chezmoiscripts/run_*_before_NN-… → ordered convergent bootstrap). docs/tutorials/bootstrap.md has the bootstrap walkthrough; docs/explanation/architecture.md has the human-facing rationale. chezmoi diff/apply read the applied clone at ~/.local/share/chezmoi, not this working tree. Edits here don't take effect on apply until committed and pulled into the apply clone. Use chezmoi diff --source-path . to preview from this checkout. - Bootstrap scripts live…

  • Commits and pushes

The file

We split this CLAUDE.md into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

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

    Every apt package lives in .chezmoidata/packages.yaml, in one list, so one pass makes one apt transaction.

    line 40
  2. Very specific:

    Every *_VERSION pin carries a # renovate: datasource=… depName=… line directly above it (order: datasource, depName, packageName, …

    line 54

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “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
CLAUDE.md

alunduil-chezmoi

Chezmoi source directory. Files deploy to $HOME via chezmoi apply; names follow chezmoi rules (dot_ → ., executable_ → +x, .tmpl → Go template, .chezmoiscripts/run_*_before_NN-… → ordered convergent bootstrap). docs/tutorials/bootstrap.md has the bootstrap walkthrough; docs/explanation/architecture.md has the human-facing rationale.

Source vs. apply path

chezmoi diff/apply read the applied clone at ~/.local/share/chezmoi, not this working tree. Edits here don't take effect on apply until committed and pulled into the apply clone. Use chezmoi diff --source-path . to preview from this checkout.

Invariants

  • Bootstrap scripts live in .chezmoiscripts/ and converge: they run on every apply and each checks host state before acting (dpkg-query status, pinned --version, cmp before sudo install), so drift heals. Guards stay local and reach no sudo when the host already matches — one that costs a network round-trip or prompts for a password belongs behind run_onchange_ instead. run_*_before_NN-* install/config passes carry a numeric prefix that orders them (dependencies); run_*_after_* passes are order-independent and named by concept, not numbered.
  • Helpers shared across passes live in script/lib/bootstrap.sh, which each pass sources.
  • run_onchange_ is only for passes whose trigger is genuinely content, not host state: _07 (its claude mcp list guard costs a network round-trip per server) and run_onchange_after_register-*-mcp (rotating secrets must re-register on change). Everything else is plain run_. No run_once_ — it keys off script content, so it cannot see drift.
  • after is for passes that consume something chezmoi apply deploys: a user unit from dot_config/systemd/user/, a decrypted token, an external binary. That dependency is the only thing that forces the phase — everything else is before. Enabling a service the package itself shipped (tailscaled) forces nothing, so it stays in the pass that installed it rather than splitting one concern across two.
  • Every apt package lives in .chezmoidata/packages.yaml, in one list, so one pass makes one apt transaction. Later passes configure what it installed rather than installing their own.
  • pre-commit shellchecks .sh.tmpl files unrendered, so a {{ … }} expression must sit inside quotes or a comment. That is why the package lists arrive via read -ra <<<'{{ … }}' rather than an array literal.
  • Release binaries are chezmoi externals in .chezmoiexternal.toml, each pinned by the version in its URL; bootstrap and CI (.github/actions/setup-chezmoi) both apply them. Renovate bumps every copy of a version in a URL, so write it out in full and leave it unannotated. ADR 0008 names the tools that stay script/install/* scripts, each pinning its own *_VERSION. Zellij plugins (zellaude, zjstatus) pin their version inside the release URL in the plugins block of dot_config/zellij/config.kdl.
  • Every *_VERSION pin carries a # renovate: datasource=… depName=… line directly above it (order: datasource, depName, packageName, versioning, extractVersion). One generic manager in renovate.json reads them all — a new pinned tool needs no Renovate config change. An unannotated pin is invisible to Renovate rather than an error, so script/checks/renovate-pins (a pre-commit hook) fails the build on one.
  • The repo requires every action pinned to a full-length SHA, including the actions a third-party action calls. Renovate's digest pinning stops at our own uses: line. Before adopting or bumping a third-party action, read its action.yml at the new SHA and confirm every uses: under runs.steps is a full-length SHA.
  • dot_local/bin/executable_gh shadows system gh to enforce --draft on gh pr create. PRs Claude opens go through this wrapper.

Pull request descriptions

This repo squash-merges with squash_merge_commit_message: PR_BODY, so the description lands in git log verbatim and the branch commits go with the squash. Write it as a commit message: prose wrapped at 72 columns, no H1 repeating the title, no ## section headings, no checkbox lists. A trailer that has to persist goes in the description, since the ones on branch commits are discarded.

The pr-create skill still composes Summary/Gotchas/Verification headings; #778 tracks the divergence. This file wins here.

Sensors

CI is authoritative. Run all sensors locally before claiming done:

just check                     # runs every sensor below, reports all failures

Each runs in its own CI workflow and can be invoked alone:

pre-commit run --all-files     # shellcheck, shfmt, check-json
bats --recursive dot_local dot_claude script  # unit tests
script/checks/zellij-config    # zellij KDL validation (needs zellij)
script/checks/chezmoi-apply    # apply round-trip (needs chezmoi + age)

Two CLAUDE.md files

  • This file: rules for AI editing the chezmoi source.
  • dot_claude/CLAUDE.md → deploys to ~/.claude/CLAUDE.md. Edits there change Claude's host-wide behaviour on next chezmoi apply.

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.