AgentSkillsCN

organizing-dotfiles-configs

在将工具配置添加至 dotfiles 仓库、决定目录结构,或重新梳理现有配置时使用。常见症状包括:“按照现有模式进行整理”、“对扁平化与嵌套式结构心存疑虑”、“不确定该将哪些文件纳入版本控制”、“重新组织后符号链接路径失效”。

SKILL.md
--- frontmatter
name: organizing-dotfiles-configs
description: Use when adding tool configurations to dotfiles repo, deciding directory structure, or reorganizing existing configs. Symptoms: "organize like existing pattern", uncertainty about flat vs nested structure, unsure which files to version-control, symlink paths breaking after reorganization.

Decision framework for structuring tool configs in dotfiles with symlinks.

When to Use

  • Adding new tool to dotfiles
  • Deciding structure (flat vs nested)
  • Choosing what to version-control
  • Symlink issues

Decision Framework

Config TypeStructureExample
Simple executablesFlathooks/*.sh
Complex with metadataNestedskills/*/SKILL.md

Include: configs, scripts, preferences Exclude: cache, logs, credentials

Quick Reference

Hooks reorganization example:

  • Before: ~/.claude/hooks/ (local only)
  • After: ~/.dotfiles/claude/hooks/ + symlink
  • Install: link_config "${BASEDIR}/claude/hooks" ~/.claude/hooks
  • Verify: ls -la ~/.claude/hooks

Common Mistakes

  • Over-nesting simple scripts
  • Forgetting install.sh update
  • Path confusion (symlink resolves from target)