# Skill Sync Manager

> Manage local Codex or ChatGPT skill folders with Git and GitHub. Use when the user wants to initialize a skills repository, audit which skills are tracked, protect system or sensitive files, pull skill updates on another computer, commit skill changes, push skills to GitHub, package a skill zip, or resolve Git sync conflicts for ~/.codex/skills.

- Skill: `xiaozhen-y/skill-sync-manager` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add xiaozhen-y/skill-sync-manager`
- Raw SKILL.md: https://api.skillmd.com/api/skills/xiaozhen-y/skill-sync-manager/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Security
- Author: XiaoZhen-Y (https://skillmd.com/u/xiaozhen-y)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/xiaozhen-y/skill-sync-manager

---


# Skill Sync Manager

Use this skill to manage custom Skill upload and pull workflows for `~/.codex/skills` or another user-specified skills directory. Treat this as repository maintenance: inspect first, protect system files, then run the smallest needed Git operation.

## Default Targets

- Default skills directory: `~/.codex/skills`.
- Custom skills are normal child directories such as `project_maintainer/` or `skill-sync-manager/`.
- Exclude system-managed and generated content by default:
  - `.system/`
  - `*.zip`
  - `__pycache__/`
  - `.DS_Store`
  - `.env`
  - credential, token, key, and secret files

## Start Protocol

1. Identify the requested action: audit, initialize repo, connect remote, pull, push, package zip, repair conflict, or explain setup.
2. Resolve the skills directory. Use `~/.codex/skills` unless the user names another path.
3. Run `scripts/audit_skill_repo.py` or equivalent checks before changing anything.
4. Report the current state briefly: repo status, remote, branch, custom skills found, risky tracked files, and blockers.
5. Ask before destructive or identity-changing actions, including deleting files, overwriting local changes, force pushing, changing remotes, or rewriting history.

## Common Workflows

Read `references/git-workflows.md` when performing a Git workflow or when exact commands are needed.

### Initialize GitHub Sync

Use when the skills directory is not a Git repo or has no remote.

1. Ensure `.gitignore` protects `.system/`, generated archives, caches, and secrets.
2. Initialize Git only if no repo exists.
3. Stage only intended custom skill folders and `.gitignore`.
4. Commit with a concise message.
5. Add the GitHub remote only after the user provides or confirms the URL.
6. Pull/rebase or push according to whether the remote already has commits.

### Pull Skills On Another Computer

Use when the user wants to sync down skills.

1. Audit local changes first.
2. If local changes exist, recommend committing or stashing before pulling.
3. Pull with rebase for a linear history when appropriate.
4. Re-run the audit and report new or changed skills.

### Push Skill Changes

Use when the user wants to upload local skill edits.

1. Audit first.
2. Review `git status --short` and avoid staging `.system/`, archives, caches, or secrets.
3. Commit only intended files.
4. Pull/rebase before push if the remote may have changed.
5. Push to the configured branch.

### Package A Skill

Use when the user needs an uploadable zip for one skill.

1. Package the contents of the skill folder, not the parent folder unless the target platform requires otherwise.
2. Do not include `.git/`, caches, or generated archives.
3. Validate the zip entries after packaging.

## Safety Rules

- Never commit `.system/` unless the user explicitly insists after a warning.
- Never commit credentials, `.env`, private keys, API keys, access tokens, or machine-local secrets.
- Never run `git reset --hard`, `git clean`, force push, or delete conflict files without explicit user approval.
- Do not assume GitHub authentication is configured. If authentication fails, report the exact failure and suggest `gh auth login` or credential setup.
- Prefer non-interactive Git commands.

## Output Protocol

For every operation, give a short conclusion and evidence:

- 完成内容
- 当前状态
- 依据：关键命令结果或文件路径
- 下一步建议

If the environment cannot access the filesystem or Git, provide copyable command blocks for the user to run locally.

