home / skills / tdhopper / dotfiles2.0 / managing-dotfiles

managing-dotfiles skill

/.claude/skills/managing-dotfiles

This skill helps you manage personal dotfiles with yadm, enabling seamless pull, commit, push, and configuration updates across shells, editors, and tools.

npx playbooks add skill tdhopper/dotfiles2.0 --skill managing-dotfiles

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
4.0 KB
---
name: managing-dotfiles
description: Use this skill when working with personal dotfiles managed by yadm. This includes pulling remote changes, committing and pushing dotfile changes, modifying configuration files (shell, editor, terminal, git, etc.), viewing tracked files, resolving merge conflicts, and maintaining the dotfiles repository. For work dotfiles, use the managing-work-dotfiles skill instead.
---

# Managing Personal Dotfiles with Yadm

This skill manages **personal** dotfiles using [yadm](https://yadm.io/) (Yet Another Dotfiles Manager).

> **Note**: For work-specific dotfiles (Spotify GHE), use the `managing-work-dotfiles` skill with `yadm-work` commands.

## Repository Info

- **Remote**: Your dotfiles git repository
- **Work tree**: `$HOME`
- **Yadm repo**: `~/.local/share/yadm/repo.git`

## Getting Current State

Always start by checking the current state:

```bash
yadm status          # Show modified/staged files
yadm ls-files        # List all tracked files
yadm diff            # Show unstaged changes
```

## Managed Files Reference

Run `yadm ls-files` to get the authoritative list. Common categories:

| Category | Files |
|----------|-------|
| **Shell** | `.config/fish/` (config.fish, aliases, env, functions, keybindings, plugins) |
| **Editor** | `.vimrc`, `Library/Application Support/Code/User/` (settings.json, keybindings.json) |
| **Terminal** | `.tmux.conf`, `.config/ghostty/config`, `.config/starship.toml` |
| **Git** | `.gitconfig`, `.gitignore`, `.gitmodules` |
| **Claude** | `.claude/skills/` (commit, creating-pull-requests, managing-dotfiles) |
| **Yadm** | `.config/yadm/` (bootstrap, hooks, README, install-hooks.sh) |
| **Other** | `.config/bat/config`, `.config/ruff/pyproject.toml`, `.duti`, `.hushlogin`, `Caddyfile` |

## Core Operations

### Pull from Remote

```bash
yadm pull
```

If merge conflicts occur:
1. Run `yadm status` to see conflicted files
2. Edit files to resolve conflicts (remove conflict markers)
3. Stage resolved files: `yadm add <file>`
4. Complete the merge: `yadm commit`

### Commit and Push Changes

```bash
yadm add <file>           # Stage specific file
yadm add -u               # Stage all modified tracked files
yadm commit -m "message"  # Commit with message
yadm push                 # Push to remote
```

**Commit conventions** (from commit skill):
- No AI/Claude attribution
- No Co-Authored-By headers

### Modify Configuration Files

When asked to modify a config (e.g., "update tmux to do X"):

1. Find the relevant file: `yadm ls-files | grep -i tmux`
2. Read and understand the current config
3. Make the requested changes
4. Stage, commit, and push:
   ```bash
   yadm add <modified-file>
   yadm commit -m "Update <config> to <what was changed>"
   yadm push
   ```

## Adding/Removing Files

### Add a new file to tracking

```bash
yadm add <new-file>
yadm commit -m "Add <file> to dotfiles"
yadm push
```

### Stop tracking a file (without deleting it)

```bash
yadm rm --cached <file>
yadm commit -m "Stop tracking <file>"
yadm push
```

## Pre-commit Hooks

Pre-commit is configured via `~/.pre-commit-config.yaml`. Hooks check for:
- Private keys and secrets
- Large files (>500KB)
- Trailing whitespace
- Merge conflicts

Run manually:
```bash
yadm enter pre-commit run --all-files
```

If a commit fails due to pre-commit fixes, stage the fixes and retry.

## Self-Management

This skill is itself tracked by yadm at `~/.claude/skills/managing-dotfiles/`.

When updating this skill:
1. Make changes to the skill files
2. Commit with yadm:
   ```bash
   yadm add ~/.claude/skills/managing-dotfiles/
   yadm commit -m "Update managing-dotfiles skill"
   yadm push
   ```

When files are added/removed from yadm tracking, update the "Managed Files Reference" section above if the categories change significantly.

## Useful Commands

See `yadm-command-reference.md` for a quick reference of common yadm commands.

## Bootstrap (New System Setup)

On a new system after cloning:
```bash
yadm bootstrap
```

This runs `~/.config/yadm/bootstrap` which installs Homebrew, uv, vim-plug, and other dependencies.

Overview

This skill manages personal dotfiles using yadm (Yet Another Dotfiles Manager). It covers pulling remote changes, resolving merge conflicts, committing and pushing updates, modifying tracked configuration files, and maintaining the yadm-managed work tree in $HOME. Use it for personal dotfiles only; work-specific dotfiles are handled separately.

How this skill works

It inspects the yadm repository and the work tree by running yadm commands such as yadm status, yadm ls-files, and yadm diff to determine tracked files and current changes. For edits, the workflow is: locate the relevant tracked file, modify it, stage with yadm add, commit with a clear message, and push with yadm push. For merges, resolve conflict markers, stage resolved files, and complete the merge with yadm commit.

When to use it

  • Pull and integrate upstream dotfile changes: yadm pull
  • Make changes to shell, editor, terminal, or git configs tracked by yadm
  • Add new dotfiles to tracking or stop tracking files without deleting them
  • Resolve merge conflicts after a pull or merge
  • Run or debug pre-commit hooks before committing
  • Bootstrap a new system with yadm bootstrap

Best practices

  • Start by running yadm status and yadm ls-files to understand current state
  • Keep commits focused and descriptive, e.g., 'Update tmux to enable mouse support'
  • Run pre-commit hooks (yadm enter pre-commit run --all-files) and fix issues before committing
  • Use yadm add -u to stage all modified tracked files when making bulk tweaks
  • Avoid including AI or Co-Authored-By headers in commit metadata
  • When stopping tracking, use yadm rm --cached <file> to preserve the local copy

Example use cases

  • Enable a new editor setting: find settings.json under tracked files, edit, yadm add, commit, push
  • Add a new shell function to .config/fish/functions and start tracking it with yadm add
  • Resolve merge conflicts after pulling remote changes by editing conflict markers, staging, and committing
  • Run the bootstrap sequence on a new machine with yadm bootstrap to install dependencies
  • Remove sensitive keys from tracking using yadm rm --cached and update pre-commit to detect secrets

FAQ

How do I list all files yadm currently tracks?

Run yadm ls-files to get the authoritative list of tracked files.

What do I do if yadm pull results in conflicts?

Use yadm status to find conflicted files, edit to remove conflict markers, yadm add <file>, then yadm commit to finish the merge.

How can I test pre-commit hooks locally before committing?

Run yadm enter pre-commit run --all-files to execute configured hooks and fix any reported issues, then stage fixes and commit.