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 的机会。问自己:
- 新增 skill 了吗?README 的 skill 清单 / 安装命令需要加一行
- 删了 skill 吗?README 对应行要删
- 某个 skill 的描述大改了吗?README 的简介可能要同步
确认 README 已审、确实不需要更新时,绕过 gate:
/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
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/
More from lijigang/ljg-skills
ljg-card
Content caster (铸). Transforms content into PNG visuals. Seven molds: -l (default) long reading card, -i infograph, -m multi-card reading cards (1080x1440), -v editorial sketchnote (problem→failure→pivot→insight→naming, magazine + archive layout), -c comic (manga-style B&W), -w whiteboard (marker-style board layout), -b big-fonts attachment card (1080x1440, weathered 碑刻 style for 小红书). Output to ~/Downloads/. Use when user says '铸', 'cast', '做成图', '做成卡片', '做成信息图', '做成海报', '视觉笔记', 'sketchnote', '杂志', 'editorial', '漫画', 'comic', 'manga', '白板', 'whiteboard', '大字', '附件图', 'big fonts', '小红书卡片'. Replaces ljg-cards and ljg-infograph.
2.1Kljg-roundtable
>-
2.0Kljg-paper
Paper reader for non-academics. Takes a paper and extracts its ideas for personal use. Focuses on understanding, not academic critique. Use when user shares an arxiv link, paper URL, PDF, or asks to analyze a research paper. Trigger words: '读论文', '分析论文', 'paper', or when user shares an academic paper.
2.0Kljg-travel
Deep travel research workflow for museums and ancient architecture. Input a city name, auto-generates structured knowledge document (org-mode) + portable reference cards (PNG). Covers historical background, museum highlights, archaeological significance, and architectural heritage. Use when user says '旅行研究', '博物馆功课', '古建功课', 'travel research', '出发前功课', or provides a city name with intent to do deep cultural travel preparation.
1.9Kljg-writes
写作引擎。像手术刀剖开一个观点,一层层剥到底。1000-1500 字。
1.9Kljg-plain
Cognitive atom: Plain (白). Rewrites any content so a smart 12-year-old groks it. Structure-free — form follows content. Use when user says '白话说', '说人话', '解释一下', 'plain', 'grok'.
1.9K