
Ljg Push
Sync updated ~/.claude/skills/ljg-* skills to the ljg-skills GitHub repo on master (org-mode) and md (markdown) branches with a README consistency gate.
Overview
ljg-push is an agent skill for the Operate phase that syncs local ljg-* skills to GitHub on master and md branches with a mandatory README match check before push.
Install
npx skills add https://github.com/lijigang/ljg-skills --skill ljg-pushWhat is this skill?
- Hard-coded paths: ~/.claude/skills source, $HOME/code/ljg-skills working repo, git@github.com:lijigang/ljg-skills.git
- Dual-branch publish: master preserves org-mode .org sources; md branch converts to YAML-frontmatter Markdown
- README hard gate aborts push if any local ljg-* skill is missing from README skill list
- Auto-clone when SKILLS_REPO missing; refuses to run if directory exists but is not the ljg-skills git repo
- Invoked via /ljg-push or phrases like push skills, sync ljg, 推送 skills
- Publishes to 2 branches: master (org-mode) and md (markdown)
- README gate compares all ~/.claude/skills/ljg-* names against README mentions before push proceeds
Adoption & trust: 1.7k installs on skills.sh; 5.5k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You updated multiple ljg-* skills locally but dual-branch org/markdown publishing and README accuracy are easy to get wrong in one rushed git push.
Who is it for?
Maintainers of the lijigang ljg-skills repo who use /ljg-push after editing ~/.claude/skills/ljg-* and need org plus markdown branches kept in sync.
Skip if: Pushing non-ljg skills, unrelated git repositories, or teams without SSH access to git@github.com:lijigang/ljg-skills.git.
When should I use this skill?
User says /ljg-push, push skills, 推送 skills, 同步 skills, sync ljg, or after ljg-* skill updates need shipping—not for non-ljg repos.
What do I get? / Deliverables
Local ljg-* changes land on master and md with converted markdown on md, and push aborts until README lists every local ljg-* skill.
- Updated master branch with org-mode .org skill tree
- Updated md branch with markdown-converted skills and YAML frontmatter
- README verified to list every local ljg-* skill or push aborted with diff report
Recommended Skills
Journey fit
Shipping skill updates to a public repo is ongoing maintainer operations after local iteration, not initial product build or launch. Iterate covers repeatable publish loops—here pushing dual-branch skill packs and keeping README aligned with local ljg-* sources.
How it compares
A opinionated skill-publish pipeline with README gate—not a generic git release or monorepo versioning tool.
Common Questions / FAQ
Who is ljg-push for?
Authors maintaining lijigang/ljg-skills who store source skills as ljg-* under ~/.claude/skills and publish to master and md branches.
When should I use ljg-push?
After updating any ljg-* skill locally when you need Operate/iterate shipping—run when the user says /ljg-push, push skills, sync ljg, or 同步 skills.
Is ljg-push safe to install?
It runs shell/git workflows against a fixed repo path; review the Security Audits panel on this page and verify Push.sh before executing on your machine.
SKILL.md
READMESKILL.md - Ljg Push
# ljg-push: 推送 ljg-* skills 把本地 `~/.claude/skills/ljg-*` 里改过的 skills,一键同步到 github repo,覆盖 master 和 md 两个分支。 ## 仓库路径(硬编码) ``` SKILLS_REPO="$HOME/code/ljg-skills" # 本地工作 repo SKILLS_LOCAL="$HOME/.claude/skills" # 本地 skill 源 REPO_URL="git@github.com:lijigang/ljg-skills.git" ``` 如果 `$SKILLS_REPO` 不存在,脚本会自动 clone。如果它存在但不是 ljg-skills 的 git repo,脚本会报错退出(不破坏现有目录)。 ## 两条分支的差异 | 分支 | 输出格式 | 文件扩展 | 加粗 | 文件头 | |------|---------|---------|------|--------| | `master`(默认) | org-mode | `.org` | `*bold*` | `#+title:` 等 | | `md` | markdown | `.md` | `**bold**` | YAML frontmatter | `~/.claude/skills/` 里的 skill 是 *master 风格*(源版本)。md 分支的差异由脚本自动转换 + 必要时手工补。 ## 工作流 按 `Workflows/Push.md` 步骤执行 → 调用 `Tools/Push.sh`。 ## README 一致性(硬 gate) 每次 push 前,脚本强制做一件事:*把 README 跟 local skills 对一遍*。 - 列出 `~/.claude/skills/ljg-*` 全部 skill 名 - grep `$SKILLS_REPO/README.md` 里出现的 `ljg-xxx` - 找出 local 有但 README 没有的——*几乎肯定意味着 README 漏更新* - 命中 → push 中止,报告差异 每次 push 都是检视 README 的机会。问自己: 1. *新增 skill 了吗*?README 的 skill 清单 / 安装命令需要加一行 2. *删了 skill 吗*?README 对应行要删 3. *某个 skill 的描述大改了吗*?README 的简介可能要同步 确认 README 已审、确实不需要更新时,绕过 gate: ```bash /ljg-push --skip-readme-check ``` ## 自动转换的范围 md 分支同步时自动替换的字符串: - 文件扩展引用:`__qa.org` → `__qa.md`、`__paper.org` → `__paper.md` 等(denote 命名约定) - 模板引用:`template.org` → `template.md` - 关键词:`org-mode` → `markdown`、`Org-mode` → `Markdown` *不会自动转换* 的内容(脚本不动,需要手工维护): - `*bold*` → `**bold**`:在 markdown 文件里 `*bold*` 是斜体,自动替换会破坏文档自身格式 - org 头 `#+title:` `#+date:` → YAML frontmatter:太复杂,留人工 - 文件本体重命名:如 `references/template.org` 文件 → `references/template.md` 碰到这些差异,脚本推完 md 分支后会列出 *仍有差异* 的文件清单,给一个 review checklist。 ## Voice Notification ```bash curl -s -X POST http://localhost:31337/notify \ -H "Content-Type: application/json" \ -d '{"message": "Running Push in ljg-push"}' \ > /dev/null 2>&1 & ``` 输出文本:`Running **Push** in **ljg-push**...` ## Examples *Example 1: 一键推送* ``` User: /ljg-push → 检测 ~/.claude/skills/ljg-* 中跟 repo 有差异的 skills → master: rsync + bump version + commit + push → md: rsync + mdize + bump version + commit + push → 报告:哪些 skills 推了,新版本号,剩余手工差异 ``` *Example 2: 看会推什么但不真推* ``` User: /ljg-push --dry-run → 列出会被同步的 skills → 列出会做的 markdown 化转换 → 不执行 rsync / commit / push ``` ## Gotchas - *README 漂移是最容易被忽略的*——加完新 skill 直接推,README 还停在老清单。脚本现在有硬 gate 拦这一刀;拦下来时不要无脑加 `--skip-readme-check`,先去看一下 README - *脚本前提是 git credentials 已配好*(ssh key 或 PAT)—— ljg-push 不处理认证,认证失败时直接报错 - *master 必须先推*——md 分支的 markdown 化基于 master 的 org 版本做转换。反过来推会破坏顺序 - *untracked 杂物(如 `assets/measure.js`)会被 rsync 同步到 repo*——如果不想推,先在本地删掉,或加进 `.gitignore` - *自动 markdown 化只动字符串*——`*bold*` 和 org 头不动。md 分支的复杂差异(如 ljg-paper 的 `template.org` → `template.md`)需要继刚手工维护 - *脚本会自动 bump patch version 在 plugin.json + marketplace.json*——如果你想 bump minor / major,先手动改完再跑脚本,脚本只追加 patch - *如果 md 分支的远端比本地新(继刚另一台机器推过)*,脚本会 `pull --rebase` 失败时尝试一次 `reset --hard origin/md` 重新应用——这会丢弃本地未推的 md 分支 commit。脚本前会提示 - *搬迁记录*:repo 历史曾在 `~/.claude.backup-20260502/ljg-skills-repo/`(路径名带 backup 是历史遗留),2026-05-02 搬到 `~/code/ljg-skills/` #!/bin/bash # ljg-push: sync updated ljg-* skills to github repo (ljg-skills), # pushing to master (org-mode style) then md (markdown style). # # Usage: # bash Push.sh # detect + push both branches # bash Push.sh --dry-run # show what would happen, don't push # bash Push.sh --force # skip detect, sync all ljg-* skills set -euo pipefail # === Configuration (HARDCODED) === SKILLS_REPO="$HOME/code/ljg-skills" SKILLS_LOCAL="$HOME/.claude/skills" REPO_URL="git@github.com:lijigang/ljg-skills.git" # === Args === DRY_RUN=0 FORCE=0 SKI