Skip to content

feat: LLM-maintained dotfiles workflow, unified CLI, user guide#34

Merged
tieubao merged 10 commits intomainfrom
feat/cloudflare-r2-token
Apr 14, 2026
Merged

feat: LLM-maintained dotfiles workflow, unified CLI, user guide#34
tieubao merged 10 commits intomainfrom
feat/cloudflare-r2-token

Conversation

@tieubao
Copy link
Copy Markdown
Member

@tieubao tieubao commented Apr 14, 2026

Summary

Reposition the repo from "modern dotfiles stack" to "LLM-maintained dotfiles." The core idea: you operate your Mac freely, Claude detects what drifted and syncs it back to the repo on your approval.

LLM-assisted sync (/dotfiles-sync)

  • .claude/commands/dotfiles-sync.md: slash command scans 10 dimensions of drift (brew, casks, configs, VS Code extensions, fish functions, SSH configs, secrets)
  • Reports in plain language, waits for approval, syncs, logs, commits
  • Deployed to ~/.claude/commands/ via chezmoi (works from any directory)
  • docs/sync-log.md: append-only sync history for context

Unified dotfiles CLI

  • Consolidated 5 standalone functions (dfe, dfs, add-secret, rm-secret, list-secrets) into dotfiles subcommands: edit, drift, secret add/rm/list
  • Fish abbreviations: de, dd, ds, dfu
  • Tab completions updated for all new subcommands

Data-driven secrets

  • .chezmoidata/secrets.toml as single source for auto-loaded secret bindings
  • dotfiles secret add auto-creates 1Password items if missing
  • Vault name configurable via chezmoi data (no hardcoded values)

Documentation

  • docs/llm-dotfiles.md: shareable, stack-agnostic pattern doc with setup instructions
  • docs/guide.md: comprehensive user guide (10 sections + cheat sheet)
  • docs/decisions/006-auto-commit-workflow.md: ADR for auto-commit design
  • README: LLM-first pitch, security section, lifecycle table
  • 7 SVG workflow diagrams

Cleanup

  • Removed docs/customization.md (migrated to guide)
  • Removed docs/session_state.md (stale)
  • Removed 5 standalone fish function files
  • Fixed du abbreviation conflict
  • Post-install summary shows /dotfiles-sync hint

Test plan

  • shellcheck passes on all .sh files
  • fish -n passes on all .fish files
  • chezmoi dry-run clean
  • 85 managed files (threshold: 10)
  • No standalone dfe/dfs/add-secret/rm-secret/list-secrets files remain
  • No hardcoded --vault=Developer in dotfiles.fish
  • No "LLM Wiki" references in user-facing docs
  • /dotfiles-sync deploys to ~/.claude/commands/ via chezmoi
  • All doc links verified (README, guide, llm-dotfiles)
  • First real sync run: detected 25 brew packages, 18 casks, 1 config drift, 5 VS Code extensions

🤖 Generated with Claude Code

tieubao and others added 10 commits April 14, 2026 12:48
Inject the R2 API credential into every interactive fish shell at
chezmoi apply time so skills and scripts that need Cloudflare access
pick it up automatically.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace hand-edited template entries with a single registry in
.chezmoidata/secrets.toml. The template iterates the registry and emits
one onepasswordRead per entry at apply time.

Adds three fish helpers:
- add-secret VAR "op://..."  validates via op read, appends, applies,
                             optionally commits
- rm-secret VAR              reverses the above
- list-secrets               dumps current bindings

Updates README "Adding secrets" and CLAUDE.md secret-injection note to
point at the new workflow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When the op:// reference doesn't resolve, prompt for the value (hidden
input) and run `op item create` before registering. Reduces the flow
for a brand-new secret to a single command.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Introduce docs/customization.md: the universal edit-source -> chezmoi
apply -> reload flow, a quick-reference table for every common change
(Brewfile, fish, Starship, Ghostty, Zed, Claude Code, SSH, macOS
defaults), the secrets workflow with a Mermaid flow diagram, and
troubleshooting for common drift.

Ship `dfe PATH` fish function wrapping `chezmoi edit --apply` so editing
a managed file and reapplying is one command. Shrink the README's
"Adding secrets" block to a pointer, and nudge CLAUDE.md to send users
at the new guide.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codify the core requirement: every setting change must be both applied
to the machine AND backed up in the dotfiles repo in one step.

- dfe now commits after apply by default; --no-commit opts out.
- New dfs: detects drifted deployed files via `chezmoi status`, prompts,
  runs `chezmoi re-add`, and commits the re-absorbed source.
- add-secret and rm-secret flip to auto-commit by default; --no-commit
  opts out (renamed from --commit opt-in).
- docs/customization.md gains a "Core requirement" section that pins
  the principle for future reference, and documents dfs + the new
  default commit behavior.

Pushing remains manual; each helper prints the exact git push command.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Consolidate commands:
  - dfe/dfs/add-secret/rm-secret/list-secrets merged into dotfiles
    subcommands: edit, drift, secret add/rm/list
  - 5 standalone fish functions deleted
  - Fish abbreviations added: de, dd, ds, du
  - Completions updated for new subcommands

Documentation:
  - docs/guide.md: comprehensive user guide (8 sections + cheat sheet)
  - docs/customization.md deleted (content migrated to guide)
  - docs/decisions/006-auto-commit-workflow.md: ADR for auto-commit design
  - 6 SVG workflow diagrams: chezmoi model, dfe, dfs, brew, config, secrets
  - README restructured around unified CLI + Claude sync

Claude-assisted sync (S-32):
  - .claude/commands/dotfiles-sync.md: slash command scans 10 dimensions
    of drift, reports plain-language, waits for approval, syncs, logs
  - docs/sync-log.md: append-only sync history

First sync:
  - Re-absorbed Zed settings drift
  - Added 5 VS Code extensions
  - Cleaned up orphaned standalone fish functions from machine

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ening

Reposition the repo narrative: lead with the LLM-maintained workflow,
chezmoi as the backbone that makes it possible.

README:
  - New pitch: "A dotfiles repo maintained by an LLM"
  - How it works section with scan dimension table
  - Security section explaining op:// vault structure visibility
  - Install details, manual commands, architecture moved to guide.md

docs/llm-dotfiles.md (new):
  - Shareable, stack-agnostic doc for the LLM-maintained dotfiles pattern
  - "Setting it up" with 4 concrete steps + reference implementation link
  - Works with any dotfiles manager + any LLM agent

docs/guide.md:
  - Section 1 is now "The LLM workflow" (was chezmoi details)
  - Install details absorbed from README
  - Fixed du abbreviation conflict (dfu for dotfiles update)

Security fixes:
  - Vault name now configurable via chezmoi data (no hardcoded Developer)
  - Post-install summary shows /dotfiles-sync hint

Cleanup:
  - Remove stale docs/session_state.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Deploy dotfiles-sync.md to ~/.claude/commands/ via chezmoi so the
  slash command works from any directory, not just the repo
- Add LLM sync workflow diagram (SVG) embedded in README and
  llm-dotfiles.md
- Update setup instructions in llm-dotfiles.md with two-level install
  (project + user)
- Guide notes that chezmoi apply deploys the command

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Guide section 9: full lifecycle coverage with install steps, update
  methods (LLM + manual + reinstall), and complete uninstall procedure
  (restore shell, remove configs, remove Claude command, optionally
  uninstall Homebrew)
- README: lifecycle quick-reference table
- Architecture renumbered to section 10

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tieubao tieubao changed the title feat(secrets): data-driven secret registration workflow feat: LLM-maintained dotfiles workflow, unified CLI, user guide Apr 14, 2026
@tieubao tieubao merged commit 26aa3f1 into main Apr 14, 2026
2 checks passed
@tieubao tieubao deleted the feat/cloudflare-r2-token branch April 14, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant