Cookbook: x-dotfiles-script¶
Step-by-step guides for the x-dotfiles-script skill. Copy-paste prompts: Recipes. Agent rules (naming, bash conventions): SKILL.md.
Who this is for¶
| Reader | Use this cookbook to |
|---|---|
| You (human) | Invoke the skill correctly, know what files to expect, and run stow/PATH steps yourself. |
| Agent | Follow ordered workflows without skipping manifest, chmod, or stow confirmation rules in SKILL.md. |
How to load the skill in Cursor¶
- @ mention (recommended):
@x-dotfiles-scriptin Composer or chat so the model loads the skill. - Natural language: Describe the task using phrases from Recipes or the skill description (new
x_script, migrate to dotfiles, stow install-ready).
If the model does not pick up the skill, paste one line from a recipe verbatim.
New x_ tool from a description¶
Goal: A new executable x_<name> in the scripts stow package, indexed in _x_manifest.
Steps
- Choose
x_<snake_case>name (verb_noun or domain-specific); avoid colliding with existing manifest names. - Create
stow/scripts/.local/bin/x_<name>with header# x_<name> - …,usage()using the real binary name, and-h/--helpwhere practical. - Append one line to
_x_manifestunder the best## Category(use Utilities if unsure):x_<name>|Short description (key flags). chmod +xthe script file.- Stow from dotfiles root (see Stow and PATH) when the user wants it live; confirm before writing under
$HOMEif they did not ask.
Success: File exists, manifest line present, executable bit set, help text says x_<name>.
Recipe: Greenfield template
Migrate an existing script to x_ style¶
Goal: Rename and normalize a script already living elsewhere or pasted into chat.
Steps
- Rename to
x_<name>; replace every usage string and comment so the public name isx_<name>. - Align shebang /
set -euo pipefailwith script complexity (seeSKILL.md). - Fix paths that break under stow; use script-dir resolution for bundled files beside the script.
- Add or update
_x_manifest; remove stale names if replacing a tool. chmod +x; offer stow if install-now.
Success: No leftover old script names in help; manifest matches filename.
Recipe: Migrate pasted script
Install-ready audit (no new code)¶
Goal: An existing x_* in the repo is runnable from anywhere after stow.
Steps
- Confirm file path:
stow/scripts/.local/bin/x_<name>. - Confirm
_x_manifestcontainsx_<name>|…. chmod +xif missing.- Run stow (user-approved):
- Remind:
$HOME/.local/binonPATH(e.g.x_installin same toolset).
Recipe: Install-ready audit
Stow and PATH¶
| Step | Command / note |
|---|---|
| Stow scripts package | cd "$HOME/_dotfiles" && stow --dir=stow --target="$HOME" scripts |
| Verify symlink | ls -l "$HOME/.local/bin/x_<name>" → should point into repo |
| PATH | export PATH="$HOME/.local/bin:$PATH" in shell rc, or use x_install |
Dotfiles root may differ from $HOME/_dotfiles; substitute the user’s actual repo root.
Sidecar files (CSS, data next to the script)¶
Goal: Bundled assets resolve correctly when the tool is a symlink.
Steps
- Keep assets under the same stow package tree as the script (e.g. beside
x_foounder.local/bin/or a sibling dir included in the package). - In bash, resolve the real directory of the script (
resolve_script_dirpattern—match neighboringx_*tools). - Do not assume cwd is the script directory.
Recipe: Bundled files
Categories in _x_manifest¶
Use existing sections: Core, Utilities, Docker, Git, SSH, Python, Node, Certs, Project bootstrap. Utilities is the default when no section fits.
Format: x_toolname|Short description (flags or behavior) — one tool per line, no unrelated helpers.
What not to do (quick)¶
- Do not add tools under
~/.cursor/skills-cursor/. - Do not edit STRUCTURE.md / README.md in dotfiles unless the user asks.
- Do not stow into
$HOMEwithout confirmation when the user only wanted file contents.
Full list: SKILL.md — What not to do.
See also¶
| Doc | Purpose |
|---|---|
| Skill page | Overview, quickstart, links |
| Recipes | Copy-paste prompt templates |
examples.md (repo) |
Worked examples, troubleshooting, usage() patterns |