Skip to content
Agentmart
Submit a tool

clone-config

Use when bootstrapping a fresh Mac/server, managing dotfiles, tracking shell configs, refreshing a Brewfile, adding ~/.zshrc to a dotfiles repo, or asking how…

Skill by danmestas

IndexedMIT★ 4
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/danmestas-clone-config

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Use when bootstrapping a fresh Mac/server, managing dotfiles, tracking shell configs, refreshing a Brewfile, adding ~/.zshrc to a dotfiles repo, or asking how to replicate a machine's config to a new device. Manages macOS (and Linux-compatible) machine config via chezmoi — install once, apply on every machine, edit source not target.

Use cases: backend, writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/clone-config

What's inside

Skill name
clone-config
Description
Use when bootstrapping a fresh Mac/server, managing dotfiles, tracking shell configs, refreshing a Brewfile, adding ~/.zshrc to a dotfiles repo, or asking how to replicate a machine's config to a new device. Manages macOS (and Linux-compatible) machine config via chezmoi — install once, apply on every machine, edit source not target.
License
MIT
Instructions
230 lines in SKILL.md · view on GitHub

Before installing

  • Instructions call the network
  • Instructions read files in your home folder (~/.ssh, ~/.aws…)

Files (1)

  • SKILL.md

SKILL.md (first lines)

# clone-config — chezmoi dotfile workflow

chezmoi gives dotfiles a single source of truth: one Git repo, applied to every
machine with one command. Files in the source dir are named with prefixes
(`dot_`, `private_`) that map to locations in `$HOME`. You edit the source,
apply to `$HOME`; the target is always derived, never the authority.

The patterns below reflect the actual setup in `~/projects/dotfiles`:
`.zshrc`, `.zprofile`, `.p10k.zsh`, `.tmux.conf`, Yazi config, Kaku config,
Ghostty config, a `Brewfile`, and an install script that re-runs whenever
the Brewfile hash changes.

---

## Bootstrap a fresh machine

```bash
# 1. Install Homebrew (if missing)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# 2. Install chezmoi and apply the dotfiles repo
brew install chezmoi
chezmoi init --apply git@github.com:YOUR_USER/dotfiles.git
```

One `chezmoi init --apply` does everything:

1. Writes all tracked source files to `$HOME`
2. Clones externals (oh-my-zsh, fzf-tab) declared in `.chezmoiexternal.toml`
3. Runs `run_onchange_install-packages.sh` → `brew bundle`, uv tools, npm globals, yazi plugins

After that the machine is fully provisioned. No separate install scripts to
remember, no manual symlinks.

---

## Layout conventions

| Source path | Applied to `$HOME` | Notes |
|---|---|---|
| `dot_zshrc` | `~/.zshrc` | `dot_` prefix → leading `.` |
| `dot_config/yazi/` | `~/.config/yazi/` | Nested `dot_config` works recursively |
| `private_Library/` | `~/Library/` | `private_` → chmod 0700 on the dir, 0600 on files |
| `.chezmoiexternal.toml` | — | Declares upstream repos cloned on apply (oh-my-zsh, fzf-tab) |
| `.chezmoiignore` | — | Paths inside source that chezmoi skips at apply time |
| `run_onchange_<name>.sh.tmpl` | — | Re-runs whenever file content (post-template) changes |
| `run_once_<name>.sh.tmpl` | — | Runs only on the very first apply |
| `Brewfile` | — | Consumed by the install script; not applied to `$HOME` directly |

**Key convention**: `dot_` → leading dot, `private_` → restricted permissions.
Both prefixes can be combined: `private_dot_ssh/` → `~/.ssh/` (mode 0700).

---

## Daily workflow

| Task | Command | Notes |
|---|---|---|
| Preview pending changes | `chezmoi diff` | Read-only; see what would change in `$HOME` |
| Apply pending changes | `chezmoi apply` | Write source state to `$HOME` |
| Edit a tracked file | `chezmoi edit ~/.zshrc` | Opens the **source**, not the target — critical |
| Jump into source repo | `chezmoi cd` | Drops you in `~/.local/share/chezmoi` |
| Pull remote + apply | `chezmoi update` | Equivalent to `git pull` + `chezmoi apply` |
| Reconcile after target edit | `chezmoi re-add ~/.zshrc` | Rescue: pulls target back into source |
| Track a new file | `chezmoi add ~/path/to/file` | Copies file into source with correct prefix |

The source repo lives at `~/.local/share/chezmoi` by default. `chezmoi cd`
is the fastest way in; treat it like any Git repo once there.

---

## Adding a new file

```bash
# 1. Tell chezmoi to track the file (copies it into source)
chezmoi add ~/some/config

# 2. Commit from inside the source repo
chezmoi cd
git add -A && git commit -m "track some/config"
git push  # or: open a PR if the dotfiles repo enforces review
```

After `git push`, any other machine running `chezmoi update` picks up the file.

---

## The run_onchange installer pattern

This is the high-leverage part of the setup. A single templated script
orchestrates all package management and re-runs automatically whenever its
content changes — including whenever the embedded Brewfile hash changes.

Actual content of `run_onchange_install-packages.sh.tmpl`:

```bash
#!/usr/bin/env bash
# Re-runs whenever this file changes (including Brewfile hash below).
# Manages: homebrew, uv tools, npm globals, yazi plugins.
set -euo pipefail

# Brewfile hash: {{ include "Brewfile" | sha256sum }}

echo "==> brew bundle"
brew bundle --no-lock --file="{{ joinPath .chezmoi.sourceDir "Brewfile" }}"

echo "==> uv tools"
for tool in claude-code-telegram fb-idb specify-cli; do
    uv tool install --quiet "$tool" || true
done

echo "==> npm globals (requires an fnm-managed node on PATH)"
if command -v npm >/dev/null 2>&1; then
    npm install -g --silent \
        @cometix/ccline \
        @openai/codex \
        agent-browser \
        clawhub \
        eas-cli \

From danmestas/wardrobe, MIT.

More from danmestas/wardrobe

Signals

Stars
4
Forks
0
Open issues
1
Last commit (this folder)
Apr 30, 2026 (6 months ago)
Last release
Apr 27, 2026 (6 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from danmestas

Cite this page

clone-config skill. Agent Mart. https://agentmart.dev/skills/danmestas-clone-config (last updated 2026-10-24)