diff --git a/.claude/skills/dotbot-validate/SKILL.md b/.claude/skills/dotbot-validate/SKILL.md new file mode 100644 index 0000000..33c0024 --- /dev/null +++ b/.claude/skills/dotbot-validate/SKILL.md @@ -0,0 +1,38 @@ +--- +name: dotbot-validate +description: >- + Validate Dotbot install.conf.yaml files after editing. + Apply when writing or modifying any install.conf.yaml. +user-invocable: false +allowed-tools: Bash, Read +--- + +After editing any `install.conf.yaml` file, validate it: + +## 1. YAML syntax + +```bash +yamllint -d relaxed +``` + +If yamllint is not available, fall back to: + +```bash +python3 -c "import yaml; yaml.safe_load(open(''))" +``` + +## 2. Link target verification + +For each `link` entry, verify the source path exists relative +to the repo root. Report any missing source files. + +## 3. Host-specific configs + +Files in `hosts//install.conf.yaml` overlay the +global config. Verify that any `include` directives reference +existing files. + +## Key locations + +- `install.conf.yaml` — global config +- `hosts/*/install.conf.yaml` — per-host overlays diff --git a/.claude/skills/host-override/SKILL.md b/.claude/skills/host-override/SKILL.md new file mode 100644 index 0000000..775b05b --- /dev/null +++ b/.claude/skills/host-override/SKILL.md @@ -0,0 +1,58 @@ +--- +name: host-override +description: >- + Create or extend host-specific config overlays + in hosts// for machine-specific settings. +user-invocable: true +allowed-tools: Bash, Read, Write, Edit +--- + +When creating host-specific configuration overrides: + +## 1. Determine hostname + +```bash +hostname -s +``` + +## 2. Directory structure + +Host overrides live in `hosts//` mirroring the +global layout: + +``` +hosts// + base/ -> ~/.* + config/ -> ~/.config/ + install.conf.yaml +``` + +## 3. Create install.conf.yaml + +If it doesn't exist, create `hosts//install.conf.yaml` +following the Dotbot format. Use `include` to layer on top of +the global config: + +```yaml +- defaults: + link: + create: true + relink: true + force: true +``` + +## 4. Git config overrides + +The most common override is `hosts//config/git/overrides/config`. +This is where host-specific git user, signing keys, and credential +helpers go. Always `[include]` the shared config: + +```ini +[include] + path = ~/.dotfiles/config/git/shared +``` + +## 5. Test + +Run `./install` to apply. Dotbot processes +`hosts//install.conf.yaml` after the global config. diff --git a/.claude/skills/new-fish-function/SKILL.md b/.claude/skills/new-fish-function/SKILL.md new file mode 100644 index 0000000..1036c53 --- /dev/null +++ b/.claude/skills/new-fish-function/SKILL.md @@ -0,0 +1,40 @@ +--- +name: new-fish-function +description: >- + Scaffold a new fish function in config/fish/functions/ + with proper conventions and event handling. +user-invocable: true +allowed-tools: Bash, Read, Write, Edit +--- + +When creating a new fish function in `config/fish/functions/`: + +## 1. Create the function file + +Create `config/fish/functions/.fish`: + +```fish +function --description '' + # Function logic here +end +``` + +- One function per file, filename must match function name +- Always include `--description` +- Use `--argument-names` for named parameters + +## 2. Conventions + +- Do NOT use `_tide_` prefix (reserved for tide prompt plugin) +- Use `--wraps` if the function wraps an existing command +- For abbreviation-like functions, prefer fish abbreviations + in `config/fish/alias.fish` instead + +## 3. Validate + +Run the fish-validate skill checks: + +```bash +fish --no-execute config/fish/functions/.fish +fish_indent --check config/fish/functions/.fish +``` diff --git a/.claude/skills/new-script/SKILL.md b/.claude/skills/new-script/SKILL.md new file mode 100644 index 0000000..62d96e8 --- /dev/null +++ b/.claude/skills/new-script/SKILL.md @@ -0,0 +1,53 @@ +--- +name: new-script +description: >- + Scaffold a new helper script in local/bin/ with proper + boilerplate, msgr sourcing, and documentation tag. +user-invocable: true +allowed-tools: Bash, Read, Write, Edit +--- + +When creating a new script in `local/bin/`, follow this template: + +## 1. Script file + +Create `local/bin/` with: + +```bash +#!/usr/bin/env bash +# @description + +set -euo pipefail + +# shellcheck source=msgr +. "$(dirname "$0")/msgr" + +# Script logic here +``` + +- Use `msgr` functions for output: `msgr msg`, `msgr run`, + `msgr yay`, `msgr err`, `msgr warn` +- The `@description` tag is required — `dfm scripts` discovers + scripts by it +- POSIX scripts (`/bin/sh`) should NOT source msgr + +## 2. Make executable + +```bash +chmod +x local/bin/ +``` + +## 3. Generate docs + +Run `dfm docs script ` or manually create `local/bin/.md` +with a usage summary. + +## 4. Validate + +Run the shell-validate skill checks (syntax + shellcheck). + +## Naming conventions + +- `x-` prefix for standalone utilities (e.g., `x-ssl-expiry-date`) +- Short names for frequently used commands (e.g., `a`, `ad`, `ae`) +- `git-` prefix for git subcommands (e.g., `git-dirty`)