Dotfiles
できること
このスキルは、シェルの設定と選んだ設定フォルダーを、プライベートな GitHub リポジトリにバックアップし続けます。どのマシンでも同じ環境を使いたいが、秘密情報を漏らしたくない人向けです。
使う場面
- ✓シェルの設定をプライベートな GitHub リポジトリにバックアップしたいとき。
- ✓以前のバックアップから設定ファイルを復元したいとき。
- ✓ローカルの設定がリポジトリと異なるかを確認したいとき。
スキルのリンク
https://github.com/danielmiessler/LifeOS/blob/main/LifeOS/install/skills/Dotfiles/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“私のシェルの設定と、リストに入れた設定フォルダーを、プライベートな dotfiles リポジトリにバックアップしてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
スキルは、GitHub のリポジトリがプライベートであるかを確認し、プッシュされるものをトークンなどの秘密情報がないかスキャンします。あなたが選んだファイルだけがコピーされ、復元はタイムスタンプ付きのバックアップから始まります。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
System Dotfiles Management Skill
Contents: Ideal State · Intent Routing · Data & Config · Tool contract · Gotchas · Examples
Manages ~/.zshrc and ~/.config/ against a private GitHub dotfiles repo; the directories under ~/.config that Backup and Restore copy are the ones you list in Config.md (DOTFILES_CONFIG_DIRS). Push local config up, pull it down, sync two-way, restore from a timestamped backup, or check status — with a gitleaks content scan of the staged diff and of every unpushed commit that stops the push on any secret, or when gitleaks is not installed.
The working clone lives at $DOTFILES_DIR and tracks the private remote $DOTFILES_REPO. Push is the default intent; Pull, Sync and Status only compare, Restore is the one intent that overwrites local files, and Backup makes a local copy that never leaves the machine.
Ideal State
- Every push lands only in
$DOTFILES_REPO, after GitHub reported it private (gh repo view --json isPrivateprintedtrue) both before any other Push step and again just before the push, and after gitleaks exited 0 on the staged diff and on every unpushed commit; any failed check, or gitleaks missing, stopped the run before a commit or push. - Only configs enter the repo or a backup: Push copies and stages the files the repo already tracks, a new config enters by name, every local backup (Backup, and Restore's backup before it overwrites) copies the
DOTFILES_CONFIG_DIRSdirectories with secret files excluded, and Restore's also copies every tracked.configfile it will overwrite, and the whole~/.configis never copied or staged. - Every comparison of local and repo (Pull, Sync, Status, and Restore's check after it copies) covers
.zshrcand the filesgit ls-files .configlists, so a report names only real dotfile differences and a clean machine reports none. - No local file is overwritten before a timestamped backup exists in
$DOTFILES_BACKUPSand the user confirmed; Pull, Sync and Status leave every local file unchanged. - Every run reports the files it changed, the repository it verified, the security check result, the commit hash when it committed, and the next intent to run.
Intent Routing
| Intent | Trigger | File |
|---|---|---|
| Push | "push dotfiles", "update dotfiles" (default) | Intents/Push.md |
| Pull | "pull dotfiles", new machine setup | Intents/Pull.md |
| Sync | "sync dotfiles", unsure of direction | Intents/Sync.md |
| Restore | "restore dotfiles", recover config | Intents/Restore.md |
| Status | "check dotfiles status", "dotfiles status" | Intents/Status.md |
| Backup | "backup dotfiles", local timestamped copy | Intents/Backup.md |
| File | Read when |
|---|---|
Setup.md |
first-time setup, or Tools/Config.ts stopped on a missing Config.md or key |
Data & Config
This skill ships no personal data. All private values live in the USER tree at
<configRoot>/LIFEOS/USER/CUSTOMIZATIONS/SKILLS/Dotfiles/Config.md (configRoot is $CLAUDE_CONFIG_DIR when set, else ~/.claude):
the keys DOTFILES_DIR, DOTFILES_BACKUPS, DOTFILES_REPO, DOTFILES_REPO_SLUG and
DOTFILES_CONFIG_DIRS. Every intent opens with this Config command, which runs
Tools/Config.ts, exports those keys and exits non-zero (stopping the intent) when the
file or a required key is missing. Nothing has a built-in default. First-time setup: Setup.md.
DOTFILES_ENV="$(bun ~/.claude/skills/Dotfiles/Tools/Config.ts)" || exit 1; eval "$DOTFILES_ENV" # exports DOTFILES_DIR, DOTFILES_BACKUPS, DOTFILES_REPO, DOTFILES_REPO_SLUG, DOTFILES_CONFIG_DIRS
Tool contract
Recipes two or more intents share. Each runs after the Config command.
Remote check — the remote is the configured repo AND GitHub says it is private
Push runs it before any other step and again before the push. Status runs it inside a subshell, ( … ), so a STOP line becomes the report's remote warning and the rest of the report still runs. In Push, any STOP line ends the intent: no pull, no commit, no push.
cd "$DOTFILES_DIR" || { echo "STOP: no dotfiles clone at $DOTFILES_DIR"; exit 1; }
REMOTE=$(git remote get-url origin) || { echo "STOP: the clone has no origin remote"; exit 1; }
[ "$REMOTE" = "$DOTFILES_REPO" ] || { echo "STOP: origin is $REMOTE, expected $DOTFILES_REPO"; exit 1; }
PRIVATE=$(gh repo view "$REMOTE" --json isPrivate -q .isPrivate) || { echo "STOP: cann
よくある質問
公開リポジトリにプッシュしますか?
いいえ。プッシュの前にリポジトリがプライベートかを確認し、そうでなければ止まります。
シークレットが見つかったらどうなりますか?
プッシュはブロックされ、.env ファイルやトークンのような秘密情報がマシンの外に出ることはありません。
選んでいないファイルにも触れますか?
いいえ。コピーされるのは、あなたのシェルのファイルと、あなたがリストに入れた設定フォルダーだけです。
詳細
作者による元の説明
Manage ~/.zshrc and a chosen set of ~/.config/ directories (you name them in Config.md) against a private GitHub dotfiles repo. Intents: Push (verify private remote, scan secrets), Pull (clone/diff), Sync, Restore (timestamped backup), Status, Backup (local timestamped copy). Security scan blocks .env, secrets, tokens before push. NEVER commits to public repos. USE WHEN dotfiles, push/pull/sync dotfiles, zshrc, restore config, backup config, new machine setup. NOT FOR app configs unrelated to shell/editor/terminal.
repo: danielmiessler/LifeOS
人気
- GitHubのスター
- 20k
- ランキング
- #10422
- ライセンス
- MIT
- 更新日
- 2026/10/28
コメント
- …
このリポジトリの他のスキル
LifeOS
20kインタビューとダッシュボードを通じて、現在の状態を理想の状態へ結びつける個人システム LifeOS を、エージェントが設定するのを支援します。
AnnualReports
20k主要ベンダーのサイバーセキュリティの年次レポートを探して比較し、侵害やランサムウェアの傾向などをまとめます。すべての数字に出典を付けます。
ApertureOscillation
20k一つの設計上の問いを、狭い範囲と広い範囲の両方でテストし、構築する前に二つの答えが食い違う箇所を指摘するよう、エージェントに教えます。
Aphorisms
20k新聞の編集テーマに合う、出典の確かな引用を、キュレーションされたコレクションから見つけ、照合し、最近使ったものを避けて管理するよう、エージェントを支援します。
似ているスキル
openclaw-update
394k既存のOpenClaw Gatewayを更新するようエージェントを支援します。インストール方法に合った更新方法を選び、セッションを動かし続けます。
diagnose-gateway
394k設定、チャンネル、ポートを確認して、OpenClaw Gatewayが失敗している理由を、何も変更せずに突き止めるようエージェントを支援します。
crabbox-apps
394k一時的なクラウドマシン上でアプリを開いて実行し、そのビューをチャットのサイドパネルに表示するようエージェントを支援します。