本文へ移動
cccskills
無料GitHub で公開日本語紹介

Dotfiles

シェルやターミナルの設定を非公開のGitHubリポジトリと同期し、変更確認や復元、ローカルバックアップを行います。プッシュ前には機密情報を検査します。

原文原文の説明を見る

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.

danielmiessler/LifeOSスター 19,636(GitHub 19,636 + cccskills 0)
連携ツールGitHub

実行スコア 未検証

インストール方法を見る

こんなときに便利

  • 新しいマシンに設定を移したいとき
  • 変更された設定を確認したいとき
  • バックアップから設定を復元したいとき
  • 編集した設定をリポジトリへ送るとき

日本語での紹介

できること

~/.zshrcと、Config.mdで指定した~/.config/内のディレクトリを、非公開のGitHubリポジトリと管理します。設定のプッシュ、取得、双方向の差分確認、状態確認、ローカルバックアップ、タイムスタンプ付きバックアップからの復元に対応します。プッシュ時はリモートが非公開であることを確認し、ステージした変更と未送信コミットをgitleaksで検査します。検査に失敗した場合やgitleaksがない場合は、処理を止めます。

こんなときに便利

新しいマシンへ設定を移したいときや、複数の環境でシェル設定を保ちたいときに使えます。どの設定が異なるか調べたい場合や、変更前にローカルへ退避してから復元したい場合にも向いています。対象はシェル、エディター、ターミナル関連の設定です。

使い方の例

  • 「dotfilesの状態を確認して」
  • 「変更した設定を非公開リポジトリにプッシュして」
  • 「新しいマシンに設定を取得して」
  • 「指定したバックアップから設定を復元して」

注意点

初回利用時はConfig.mdにリポジトリやバックアップ先、対象ディレクトリなどの設定が必要です。GitHub CLIでリポジトリの非公開状態を確認し、プッシュ前の機密情報検査にはgitleaksを使います。復元ではローカルファイルを上書きするため、先にバックアップを作成し、利用者の確認を得ます。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

資料チェック

SKILL.md の記述から、注意が要る操作と導入の前提を AI が確認しました。点数は実際に動かした結果(実行検証)だけで付けています。

安全面送信・削除・コマンド実行などの扱いが明示されているか
A良好公開状態とgitleaksを確認し、復元前のバックアップと利用者確認を定める。
導入のしやすさ必要なツールや API キーが少ないか、書かれているか
B一部不足Config.mdの複数キー、GitHub CLI、gitleaksが必要だが初回設定先を示す。

点数には入れていません。 2026年10月28日 時点で AI(OpenAI Codex)が判定しました。目安なので、入れる前に原文も確認してください。

評価が違うと思ったら、見直しを依頼する

どの項目が、なぜ違うと思うかを書いてください。ログインは不要です。内容を SKILL.md と照らし合わせて評価を作り直し、この欄に反映します。

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

含まれるファイル(9)

  • SKILL.md10.6 KB
  • Intents/Backup.md4.4 KB
  • Intents/Pull.md3.1 KB
  • Intents/Push.md7.6 KB
  • Intents/Restore.md7.4 KB
  • Intents/Status.md4.0 KB
  • Intents/Sync.md4.0 KB
  • Setup.md3.7 KB
  • Tools/Config.ts3.2 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

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 isPrivate printed true) 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_DIRS directories with secret files excluded, and Restore's also copies every tracked .config file it will overwrite, and the whole ~/.config is never copied or staged.
  • Every comparison of local and repo (Pull, Sync, Status, and Restore's check after it copies) covers .zshrc and the files git ls-files .config lists, 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_BACKUPS and 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

IntentTriggerFile
Push"push dotfiles", "update dotfiles" (default)Intents/Push.md
Pull"pull dotfiles", new machine setupIntents/Pull.md
Sync"sync dotfiles", unsure of directionIntents/Sync.md
Restore"restore dotfiles", recover configIntents/Restore.md
Status"check dotfiles status", "dotfiles status"Intents/Status.md
Backup"backup dotfiles", local timestamped copyIntents/Backup.md
FileRead when
Setup.mdfirst-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: cannot read the repo's visibility from GitHub (gh auth status?)"; exit 1; }
[ "$PRIVATE" = "true" ] || { echo "STOP: $REMOTE is not private (isPrivate=$PRIVATE)"; exit 1; }
echo "OK: origin is $REMOTE, private"

The visibility check is the one that matters: the equality line only proves origin matches the configured URL, not that the repo is private. gh repo view accepts the SSH, HTTPS, or OWNER/REPO form of the remote.

Compare local and repo — tracked files only

Run from $DOTFILES_DIR. Prints one line per .zshrc or tracked .config file that is missing at home or differs from the clone; no output means they match. Never diff -qr ~/.config/ .config/: the repo tracks a subset, so a whole-directory diff lists every app's data and never comes back clean.

{ echo .zshrc; git ls-files .config; } | while IFS= read -r f; do
  if [ ! -e "$HOME/$f" ]; then echo "missing locally: $f"
  elif ! cmp -s "$HOME/$f" "$f"; then echo "differs: $f"; fi
done

Backup copy — Backup, and Restore before it overwrites

Sets $timestamp and $backup_dir, copies ~/.zshrc and the DOTFILES_CONFIG_DIRS directories, and leaves secret files out. It sets $backup_ok to 1 only when every copy succeeded; Restore overwrites nothing unless $backup_ok is 1.

timestamp=$(date +%Y%m%d_%H%M%S)
backup_dir=$DOTFILES_BACKUPS/$timestamp
backup_ok=1
mkdir -p "$backup_dir/.config" || backup_ok=0
if [ -f ~/.zshrc ]; then
    if cp ~/.zshrc "$backup_dir/.zshrc"; then echo "✅ Backed up .zshrc"; else echo "❌ .zshrc backup failed"; backup_ok=0; fi
fi
# Backup the directories named in Config.md (not entire .config to save space).
# $(printf ...) word-splits in zsh and bash alike; a bare $DOTFILES_CONFIG_DIRS is one word in zsh.
for dir in $(printf '%s' "$DOTFILES_CONFIG_DIRS"); do
    if [ -d ~/.config/$dir ]; then
        # No secrets in a backup: a tool's directory can hold its own .env or token
        # files, and every backup would be another plaintext copy.
        rsync -a --exclude='.env' --exclude='.env.*' --exclude='*.oauth' --exclude='*oauth*.json' \
            --exclude='*token*.json' --exclude='client_secret*.json' --exclude='credentials*' \
            --exclude='auth.json' ~/.config/$dir "$backup_dir/.config/" \
            && echo "✅ Backed up .config/$dir" || { echo "❌ .config/$dir backup failed"; backup_ok=0; }
    fi
done
if [ "$backup_ok" = 1 ]; then echo "Backup complete at: $backup_dir"; else echo "❌ Backup INCOMPLETE at: $backup_dir. Do not restore or overwrite anything."; fi

Restore from a backup — rollback

The one rollback recipe; Restore and Backup point here. It overwrites local files, so it follows the same rule as Restore: a fresh backup of the current files first, then the user's yes.

  1. Pick the backup to roll back to, before taking the fresh one (which becomes the newest):
ls -lt "$DOTFILES_BACKUPS"/
backup=$DOTFILES_BACKUPS/YYYYMMDD_HHMMSS   # the chosen timestamp
[ -d "$backup" ] || { echo "STOP: no backup at $backup"; exit 1; }
  1. Run the Backup copy above, so the current files can be recovered from $backup_dir.
  2. Show the user $backup (the source), $backup_dir (the fresh backup) and the files that will be overwritten (.zshrc and each DOTFILES_CONFIG_DIRS directory present under $backup/.config), and wait for their yes.
  3. Only after that yes:
[ "$backup_ok" = 1 ] || { echo "STOP: the fresh backup is incomplete; nothing restored"; exit 1; }
[ -f "$backup/.zshrc" ] && cp "$backup/.zshrc" ~/.zshrc
# Only the configured directories: the fresh backup covers those and nothing else.
for dir in $(printf '%s' "$DOTFILES_CONFIG_DIRS"); do
    [ -d "$backup/.config/$dir" ] && cp -R "$backup/.config/$dir" ~/.config/
done
echo "Rolled back from $backup; previous files saved at $backup_dir"

Reloading in the agent's shell changes nothing for the user. Tell them to run exec zsh (or source ~/.zshrc) in their own terminal.

Gotchas

  • Dotfiles holds configs only, and the repo's tracked list decides what counts. Push copies tracked files and stages tracked files; a new config is added by name. The config directory can also hold application data and credentials, so never stage or copy it whole; ignore data and credential directories in .config/.gitignore.

Examples

Example 1: Push dotfiles after config changes

User: "push dotfiles"
→ Verifies private repo, checks for sensitive files
→ Copies .zshrc and the tracked .config/ files to repo
→ Stages tracked files only, commits, pushes to GitHub

Example 2: Set up a new machine

User: "pull dotfiles"
→ Clones/pulls latest from private repo
→ Shows diff between local and repo versions; local files stay unchanged
→ Then the Restore intent copies them home, after a timestamped backup and the user's yes

Example 3: Check what's changed

User: "check dotfiles status"
→ Compares local .zshrc and .config/ with repo
→ Shows uncommitted changes and sync status
→ Verifies remote is correct private repo

Example 4: Unsure which direction to sync

User: "sync dotfiles"
→ Sync intent: shows the tracked files that differ and which side changed each one, changes nothing
→ Recommends Push or Restore

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

AnnualReports

無料概要あり

複数ベンダーの年次サイバーセキュリティ報告書を探して取得し、脅威やランサムウェア、侵害統計の傾向を出典付きで比較・分析します。

  • 脅威レポートをカテゴリ別に探したいとき
  • 特定ベンダーの報告書を取得したいとき
  • ランサムウェア動向を複数社で比較したいとき
danielmiessler/LifeOS2万2026年10月28日 更新

ApertureOscillation

無料概要あり

個別の機能や部品の設計と、システム全体の目的を同じ問いで比較し、両者の食い違い、適切な実装範囲、全体との整合性を3段階で整理するスキルです。

  • サービスやライブラリの分割判断
  • 機能要求と製品方針を比較したいとき
  • 新しい部品と既存システムの整合性確認
danielmiessler/LifeOS2万2026年10月28日 更新

Aphorisms

無料概要あり

文章のテーマに合う格言や引用を探し、著者・出典と選定理由を添えて提案します。引用の追加、思想家の調査、利用履歴の管理を通じて、同じ引用の繰り返しも防ぎます。

  • ニュースレター向けの引用探し
  • 出典付きの引用を重複なく保存
  • 思想家の言葉をテーマ別に調査
danielmiessler/LifeOS2万2026年10月28日 更新

Art

無料概要あり

ブログの挿絵や技術図解、比較図、マンガ、アイコンなどを用途別の手順で制作します。形式に合う構図や配色を組み立て、確認用の画像を出力します。

  • ブログの見出し画像を作りたいとき
  • システムの仕組みを図解したいとき
  • 比較や時系列を可視化したいとき
danielmiessler/LifeOS2万2026年10月28日 更新

ArtDirection

無料概要あり

画像や映像、スライド、サイト画面の品質を複数の判定役で評価し、修正点の整理から基準を満たした成果物の引き渡しまで進めます。

  • 画像の修正点を優先順に整理したいとき
  • 映像やスライドを基準に沿って評価したいとき
  • 公開前に見た目が基準を満たすか確認したいとき
danielmiessler/LifeOS2万2026年10月28日 更新

ArXiv

無料概要あり

arXivの論文をテーマ・分野・論文IDで探し、著者や要旨、リンクをまとめます。新着論文の確認や、用意されている場合はAlphaXivのAI生成概要の取得にも対応します。

  • AI・機械学習の新着論文の確認
  • 特定テーマの論文を探したいとき
  • 論文IDやarXivのURLで照会
danielmiessler/LifeOS2万2026年10月28日 更新

danielmiessler のスキルをすべて見る

このスキルの問題を報告する