Imported from kemalozansayin/ai-boilerplate (
claude/skills/sync/SKILL.md). Install upstream withnpx skills add kemalozansayin/ai-boilerplate --skill sync. Copyright stays with the author.
Sync — User-Scope Config ↔ ai-boilerplate
Keeps this machine's Claude/Codex user-scope config in sync with
https://github.com/kemalozansayin/ai-boilerplate (branch: master), so the whole system —
rules, skills, agents, hooks, settings, and the Codex AGENTS.md mirror — can be carried to
another machine.
Local clone: D:\Projects\ai-boilerplate on this machine (adjust to wherever this machine
keeps its projects if different — sibling to the other project directories).
Push mode is restricted to the repo owner (
kemalozansayin) — see the ownership check that opens push mode below. If this isn't your own fork ofkemalozansayin/ai-boilerplate, don't run push mode against this origin; fork the repo and update the remote URL/local clone path above first. Setup mode (cloning + copying into~/.claude/and~/.codex/) works for anyone, regardless of who owns the repo.
Repo layout mirrors the live locations 1:1, just without the leading dot so they read normally in a GitHub file tree:
ai-boilerplate/
├── claude/
│ ├── settings.json ← templated, see "Portable settings.json" below
│ ├── rules/*.md
│ ├── skills/**/* ← deploy/, new-project/ (+ references/), sync/
│ ├── agents/*.md
│ └── hooks/*.mjs
└── codex/
└── AGENTS.md
Two modes. If the request doesn't make the mode obvious, ask which one — this is a live, per-run decision, not something to assume from a previous invocation.
Portable settings.json
The live ~/.claude/settings.json registers hooks with absolute paths
(C:/Users/Lenovo/.claude/hooks/lint-gate.mjs, …) — specific to this machine and this user
account, and would silently break on another one. The repo's copy is templated instead: every
occurrence of the live home-relative Claude root is replaced with the literal token
{{CLAUDE_HOME}}, e.g.:
"args": ["{{CLAUDE_HOME}}/hooks/lint-gate.mjs"]
Push mode resolves the real path back out to {{CLAUDE_HOME}} before writing the repo copy.
Setup mode does the reverse: resolves {{CLAUDE_HOME}} → the new machine's real ~/.claude
path (forward slashes, matching the existing convention) before writing the live file. Never
commit the resolved (machine-specific) form to the repo.
Push mode — local → repo → GitHub
Push mode is owner-restricted by design, not just by GitHub permissions: this repo's write
access belongs to kemalozansayin alone (public repo, no collaborators — GitHub already refuses
a push from anyone else), but push mode checks this itself first too, so a non-owner gets a clear
explanation instead of a confusing git/auth failure partway through.
- Confirm ownership before touching anything:
gh api user --jq .loginand compare againstkemalozansayin. If it doesn't match, orghisn't authenticated, stop — report that this repo's push mode is restricted to its owner, and that anyone else wanting to sync their own config should fork the repo and repoint the remote URL / local clone path (see Local clone above and the README's Make It Yours) rather than push here. Do not attempt the git push. - Copy the current state into the local clone, overwriting what's there (the live
~/.claude/~/.codex/AGENTS.mdis always the source of truth; the clone is a mirror):~/.claude/rules/*.md→claude/rules/~/.claude/skills/**→claude/skills/**~/.claude/agents/*.md→claude/agents/~/.claude/hooks/*.mjs→claude/hooks/~/.claude/settings.json→claude/settings.json, templated per above~/.codex/AGENTS.md→codex/AGENTS.md- Never copy
~/.claude/settings.local.json,~/.claude/.credentials.json, or anything under~/.claude/projects/,~/.claude/cache/,~/.claude/shell-snapshots/,~/.claude/tasks/,~/.claude/plans/,~/.claude/backups/,~/.claude/ide/— none of that is portable config, and some of it (credentials, session transcripts) must never leave the machine.
git status --shortin the clone and review what actually changed.- Stage, then propose a commit in the house format (
icon | [PREFIX] | Message, seecommit-standards) — usually🔧 | [INFRA] | ...for a routine config sync, or a more specific prefix if the underlying change was e.g. a new rule/skill/agent worth calling out. Wait for the user's explicit approval of that commit — this flow has no standing exception to Commit Approval. - Once approved, commit and
git push origin master. - Report what was synced.
Setup mode — bring a (new) machine up to date
Invoking this mode is the go-ahead to install the two CLIs below and copy these files into place — a per-invocation authorization, not a standing permission for unrelated installs.
- Preflight: check for
git,node/npm,claude,codex,gh,pnpm. Report the full picture before changing anything. - Install what's missing and CLI-installable:
- Claude Code:
npm install -g @anthropic-ai/claude-code(Node 18+). - Codex CLI:
npm install -g @openai/codex(Node 22+). pnpmmissing butcorepackavailable (ships with modern Node):corepack enable.git,nodeitself, andghare OS-level installs — report if missing and let the user install those themselves; don't attempt to.
- Claude Code:
- Get the repo: clone
https://github.com/kemalozansayin/ai-boilerplate.git(branchmaster) to the local projects root if not already present there;git pullif it is. - Before overwriting anything, check whether
~/.claude/{rules,skills,agents,hooks}or~/.codex/AGENTS.mdalready have content on this machine. A truly fresh machine has none of this — but if something is already there, surface what would be overwritten and confirm with the user first rather than silently clobbering possibly-unrelated existing config. - Copy into place:
claude/rules/*.md→~/.claude/rules/claude/skills/**→~/.claude/skills/**claude/agents/*.md→~/.claude/agents/claude/hooks/*.mjs→~/.claude/hooks/claude/settings.json→~/.claude/settings.json, resolving{{CLAUDE_HOME}}to this machine's real path first (see Portable settings.json). Leave any existing~/.claude/settings.local.jsonalone — it's machine-local and not part of this repo.codex/AGENTS.md→~/.codex/AGENTS.md(create~/.codex/if it doesn't exist).
- Report: what got installed, what got copied, and what still needs the user's own action
(
claudelogin / API auth,codexlogin,gh auth login, confirming the projects-root path if this machine's convention differs).
Keeping this skill itself in sync
Like every other user-scope flow, changes here follow the agents-md-sync rule — mirror any
edit to this skill into ~/.codex/AGENTS.md's Sync (push / setup) section in the same change.