Skip to content
Back to skills

Agent Config Sync

ASecurity

Commit + push changes to Simon's ~/.agents config repo (his config source of truth — a public GitHub repo) SAFELY. Review the diff, NEVER commit secrets, write a conventional commit, push, confirm in sync. Use whenever ~/.agents has uncommitted config changes (the SessionStart hook flags them), right after editing any config under ~/.agents (CLAUDE.md, a hook, an sk/sk-work skill, settings.json), or when Simon says "sync my config" / "commit my config".

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
ai-agentspythonshellbashgitapiperformance

Works with

  • api

Security analysis

A100/100

Scanned December 3, 2026

npx -y skills add skowalskidev/dotagents --skill agent-config-sync --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Agent Config Sync?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Agent Config Sync
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/skowalskidev-agent-config-sync/badge)](https://www.skillsdirectory.com/skills/skowalskidev-agent-config-sync)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: agent-config-sync
description: Commit + push changes to Simon's ~/.agents config repo (his config source of truth — a public GitHub repo) SAFELY. Review the diff, NEVER commit secrets, write a conventional commit, push, confirm in sync. Use whenever ~/.agents has uncommitted config changes (the SessionStart hook flags them), right after editing any config under ~/.agents (CLAUDE.md, a hook, an sk/sk-work skill, settings.json), or when Simon says "sync my config" / "commit my config".
allowed-tools: 
  - Bash(git -C ~/.agents *)
---

# Sync Simon's agent config repo

**Run only on the home machine.** Check `python3 ~/.agents/bin/config_home.py is-home` first; on any other machine stop with "config lands only on the home machine" and queue the lesson for its end-of-session learning (`references/session-performance.md` § End-of-session learning).

## Resolve the checkout

DO resolve `sync_root` to the owned config-update worktree for this task, or `~/.agents` when the
owned change is already there. Verify its common Git directory matches `~/.agents` and inspect its
origin before staging. Read status, the full diff and recent commits from that same checkout.
Never stage the live checkout while the task's changes are in a worktree.

`~/.agents` is a git repo and Simon's **single source of truth** for his agent setup, mirrored to a
**public** GitHub repo. An uncommitted change there = out of sync. This
skill commits + pushes those changes safely.

## Absolute rules
- **NEVER commit a secret.** Not an API key, token, private key, password, `.env`, `*.credentials*`,
  service-account JSON, cookie, or anything that authenticates. Two automated gates exist (the allowlist
  `.gitignore` + a `gitleaks`/grep pre-commit hook), but they are a backstop, not a licence to stop
  looking — **read the diff yourself.** If anything looks secret-like, or you're unsure, **STOP and ask
  Simon** rather than commit it.
- **The remote is PUBLIC: a push publishes.** Besides secrets, STOP on any real account, org name,
  project name or email in the diff. Those belong in the untracked overlay (`identity.local.json`,
  the connector registry roots, `work/`), and tracked text stays generic ("your work org").
- **Authority:** apply `rules/self-healing-config.md`. Its standing scope authorizes validated own-config
  repairs through commit, merge, push, activation and cleanup; do not request those approvals again.
  Never force-push, rewrite published history or use this authorization for another repository.
- **Scope:** only Simon's own config (CLAUDE.md, hooks/, settings.json, contracts/, skills/sk,
  references/ (shared on-demand catalogs), rules/ (if present), dotfiles/, README/AGENTS, .githooks/).
  Never add third-party skills or runtime data — the allowlist `.gitignore` handles this; don't fight it.
  **`skills/sk-work` and `work/` are deliberately untracked** (job-specific, see README). They will
  never appear in a diff; if they ever do, something force-added them and that is a bug to report,
  not a change to commit.

## Steps
1. **See what changed:** inspect `git -C "$sync_root" status -sb` and the full owned diff.
   Account for every changed file and exclude unrelated WIP.
2. **Eyeball for secrets** in the diff (see the rules above). This step reads the REAL diff, not the
   summary — `--stat` shows names and line counts, never content, so it cannot clear a file of
   secrets. If clean, continue; if not, stop and ask.
3. **Stage only the reviewed owned paths:** `git -C "$sync_root" add -- <paths>`.
   Review the staged diff and run the secret scanner before committing.
4. **Commit with the message in a FILE, never `-m`:** write it with the Write tool, then
   `git -C "$sync_root" commit -F <file>`. The shell interprets `-m` and heredocs (a backtick runs, a
   `$VAR` expands) and it fails SILENTLY, which is why `~/.agents/references/git-pr-deploy.md` makes
   `-F` absolute at any length. That catalog also owns the subject and body shape — read it there
   rather than composing a message from scratch. Two hooks gate the result: `.githooks/commit-msg`
   rejects a non-conforming subject, and the pre-commit hook runs `gitleaks` (or the grep fallback)
   and **blocks on any secret**. If either blocks, surface the reason to Simon and fix it; never
   bypass with `--no-verify`, which skips the secret gate too.
5. **Land:** follow the worktree flow below for a config-update branch. For an already integrated
   live change, push its verified destination without changing another branch by assumption.
6. **Confirm in sync:** verify the landed branch and `origin/main` have zero commits on either side,
   then activate and clean up as below. Apply `rules/config-repo.md` § Return to main after completed
   work and record the final local/origin head inventory. Preserve unrelated WIP.

**A branch from a worktree:** inspect the full `origin/main..<branch>` diff, its evidence and owner.
For a validated repair within standing scope, commit with `-F` if needed, then land it automatically,
with no question to Simon and no `AGENT_ALLOW_MAIN_COMMIT` prefix:
1. `/usr/bin/python3 ~/.agents/bin/config-land-check.py --root <literal worktree path> --diff`; read
   the whole diff it prints (the change since the branch left `origin/main`).
2. `/usr/bin/python3 ~/.agents/bin/config-land-check.py --root <path> --reviewed <diff-sha256>`, run in
   the background. It takes the machine-wide landing lock, then fetches and merges `origin/main`, runs
   the contract suite and the range secret scan on that exact head, records it and pushes it to main.
   A second lander queues on the lock instead of racing: while it waits it prints the holder and since
   when, and after 30 min (`--lock-wait SECONDS`) it exits 75 naming the holder; rerun step 2 then.
   Exit 1 on a merge conflict or a hash mismatch (main changed the reviewed lines): resolve the
   conflict within the owned change, then steps 1-2 again. A new commit needs steps 1-2 again.
A rejected push means something landed outside the lock: run steps 1-2 again; never force-push. Ask
Simon only for an excluded decision under `rules/self-healing-config.md`. Verify
`git rev-list --left-right --count origin/main...<branch>` returns `0 0`.
DO run that check as its own command and remove the worktree and branches only after it prints `0 0`.
DON'T pipe the landing through `tail`/`head` or chain cleanup behind it with `&&`: the pipe masks a
rejected push (the fix for a non-fast-forward push whose worktree and remote branch were deleted anyway
and had to be recovered from a dangling merge). TEST: no cleanup command runs in the same shell line as
the landing. A manual `git -C <literal path> push origin HEAD:main` of a recorded head still passes
`hooks/git-commit-guard.py`; a `$VAR` or force keeps its block.

DO activate in `~/.agents` only with a clean tracked tree and no merge/rebase in progress. Preserve its
branch: fast-forward to `origin/main` when possible; otherwise merge it without discarding unrelated
commits. On a conflict, preserve all work and record the exact activation blocker. Re-read current
rules and verify the changed files are present in the live checkout before claiming active.

DO remove the owned temporary worktree and its merged local branch after the commit is on
`origin/main` and activation is verified. If this task published its temporary branch, delete that
owned remote ref after verifying its tip is on main. Check Git registration and disk absence. Keep only
intentional report artifacts; never delete another session's workspace or unmerged unique work.
A pending branch is resumed against evidence and ownership, not blindly landed because it exists.
TEST: a completed sync has a remote commit, verified live files and no owned temporary worktree;
a blocked sync names its exact blocker without another generic commit/merge question.

## Notes
- Manual one-shot equivalent: `bash ~/.agents/dotfiles/sync-config.sh` (stages, secret-scans, commits with
  a timestamp message, pushes). Prefer a descriptive commit via the steps above for real changes; the
  script is the catch-all.
- If `gitleaks` flags a genuine false positive (e.g. a detection pattern in a scanner file), add a narrow
  allowlist to a repo `.gitleaks.toml` rather than disabling the gate.
- If a secret was *already* committed, don't just delete it — tell Simon; it needs history rewrite +
  rotation of the exposed credential.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.