Sync the modified skills in local ~/.claude/skills/ljg-* to the github repo with one command, covering both the master and md branches.
Repo path (hardcoded)
SKILLS_REPO="$HOME/code/ljg-skills" # 本地工作 repo
SKILLS_LOCAL="$HOME/.claude/skills" # 本地 skill 源
REPO_URL="git@github.com:lijigang/ljg-skills.git"
If $SKILLS_REPO does not exist, the script will clone it automatically. If it exists but is not a git repo for ljg-skills, the script will error out and exit (without damaging the existing directory).
Differences between the two branches
| Branch | Output format | File extension | Bold | File header |
|---|---|---|---|---|
master(default) |
org-mode | .org |
*bold* |
#+title: etc. |
md |
markdown | .md |
**bold** |
YAML frontmatter |
~/.claude/skills/ The skill in master style(source version). The differences in the md branch are converted automatically by the script + manually supplemented when necessary.
Workflow
Follow the Workflows/Push.md steps → call Tools/Push.sh。
README consistency (hard gate)
Before every push, the script enforces one thing:Check the README against the local skills。
- List all skill names
~/.claude/skills/ljg-*all skill names - grep
$SKILLS_REPO/README.mdtheljg-xxx - Find ones that exist locally but are not in the README—almost certainly means the README was not updated
- Hit → push is aborted and the differences are reported
Every push is an opportunity to review the README. Ask yourself:
- Did you add a new skill? The README's skill list / install command needs a new line
- Did you delete a skill? The corresponding line in the README must be deleted
- Was a skill's description significantly changed? The README's summary may need to be synced
When you have confirmed the README has been reviewed and truly does not need updating, bypass the gate:
/ljg-push --skip-readme-check
Scope of automatic conversion
Strings automatically replaced when syncing the md branch:
- File extension references:
__qa.org→__qa.md、__paper.org→__paper.mdetc. (denote naming convention) - Template references:
template.org→template.md - Keywords:
org-mode→markdown、Org-mode→Markdown
Will not automatically convert Contents (the script does not touch these; manual maintenance is required):
*bold*→**bold**: in markdown files,*bold*is italic; automatic replacement would break the document's own formatting- Org header
#+title:#+date:→ YAML frontmatter: too complex, leave it to manual work - Renaming the file itself: e.g.,
references/template.orgfile →references/template.md
When encountering these differences, after pushing the md branch the script will list still differ and provide a review checklist.
Voice Notification
curl -s -X POST http://localhost:31337/notify \
-H "Content-Type: application/json" \
-d '{"message": "Running Push in ljg-push"}' \
> /dev/null 2>&1 &
Output text:Running **Push** in **ljg-push**...
Examples
Example 1: One-command push
User: /ljg-push
→ 检测 ~/.claude/skills/ljg-* 中跟 repo 有差异的 skills
→ master: rsync + bump version + commit + push
→ md: rsync + mdize + bump version + commit + push
→ 报告:哪些 skills 推了,新版本号,剩余手工差异
Example 2: See what will be pushed without actually pushing
User: /ljg-push --dry-run
→ 列出会被同步的 skills
→ 列出会做的 markdown 化转换
→ 不执行 rsync / commit / push
Gotchas
- README drift is the easiest thing to overlook—after adding a new skill and pushing directly, the README is still stuck on the old list. The script now has a hard gate to stop this; when it is blocked, do not blindly add
--skip-readme-check, first go look at the README - The script assumes git credentials are already configured(ssh key or PAT)—ljg-push does not handle authentication; when authentication fails it just errors out
- master must be pushed first——markdownization of the md branch is based on converting the org version of master. Pushing back would break the order
- untracked miscellany (e.g.
assets/measure.js) will be synced by rsync to the repo——if you don't want to push them, delete them locally first, or add them to.gitignore - automatic markdownization only touches strings——
*bold*and org headers are untouched. Complex differences in the md branch (e.g. ljg-paper'stemplate.org→template.md) require Jigang to maintain manually - the script will automatically bump the patch version in plugin.json + marketplace.json——if you want to bump minor / major, change it manually first and then run the script; the script only appends patch
- if the remote of the md branch is newer than local (pushed from another of Jigang's machines), the script will
pull --rebaseon failure, try oncereset --hard origin/mdto reapply——this will discard local unpushed md branch commits. The script will prompt beforehand - Relocation record: the repo history was once at
~/.claude.backup-20260502/ljg-skills-repo/(path names containing backup are historical leftovers), moved to on 2026-05-02~/code/ljg-skills/