New to Claude Skills? Learn how to install them →

lijigang on GitHub

LJG Push

Free

Sync your ljg-* skills to GitHub effortlessly.

by lijigang6.8k stars on lijigang/ljg-skills
1 views
Updated Aug 10, 2026
Get this skill

Free · Opens the source repo

What LJG Push does

LJG Push is a Bash-based skill designed for developers and designers who need to synchronize their local ljg-* skills with a GitHub repository. This tool automates the process of pushing updated skills from the local directory ~/.agents/skills/ljg-* to a designated GitHub repository, specifically ljg-skills. The script handles two branches: the master branch for org-mode output and an md branch for markdown output, ensuring that both formats are maintained and updated seamlessly.

When you execute the /ljg-push command, the script checks for changes in your local skills directory and performs a series of operations to update the repository. It first pushes changes to the master branch, then converts the org-mode files to markdown format for the md branch, and finally reports back on the skills that were updated. This workflow not only saves time but also ensures that your skills are consistently documented in both formats.

A notable feature of LJG Push is its built-in consistency check for the README file. Before any push operation, the script verifies that the README is in sync with the local skills. If discrepancies are found, the push is halted, prompting the user to update the README accordingly. This helps maintain accurate documentation and prevents outdated information from being pushed to the repository.

LJG Push is ideal for developers and designers managing multiple skills who want to streamline their workflow and ensure that their documentation is always current. By automating the synchronization and conversion processes, this skill reduces the potential for human error and enhances productivity.

When to use it

Use LJG Push when you have updated skills in your local directory and need to sync them to your GitHub repo quickly and efficiently.

When not to use it

This tool is not suitable for pushing skills that are not part of the ljg-* namespace or for managing arbitrary Git repositories.

What you can build with it

Quick Skill Synchronization

Easily sync updated ljg-* skills to GitHub with a single command, ensuring both org-mode and markdown formats are up to date.

Documentation Consistency Check

Before pushing, verify that your README is in sync with local skills, preventing outdated documentation from being published.

Preview Changes Before Push

Use the dry-run option to see what changes will be made, allowing for a review before executing the actual push.

How to install LJG Push

View source

1. Install with the skills CLI

npx skills add lijigang/ljg-skills/ljg-push --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by lijigang

ljg-push: 推送 ljg-* skills

把本地 ~/.agents/skills/ljg-* 里改过的 skills,一键同步到 github repo,覆盖 master 和 md 两个分支。

仓库路径(硬编码)

SKILLS_REPO="$HOME/code/ljg-skills"     # 本地工作 repo
SKILLS_LOCAL="$HOME/.agents/skills"      # 本地 skill 源
REPO_URL="git@github.com:lijigang/ljg-skills.git"

如果 $SKILLS_REPO 不存在,脚本会自动 clone。如果它存在但不是 ljg-skills 的 git repo,脚本会报错退出(不破坏现有目录)。

两条分支的差异

分支输出格式文件扩展加粗文件头
master(默认)org-mode.org*bold*#+title:
mdmarkdown.md**bold**YAML frontmatter

~/.agents/skills/ 里的 skill 是 master 风格(源版本)。md 分支的差异由脚本自动转换 + 必要时手工补。

脚本推完 md 后会自动切回 master。本地 $HOME/code/ljg-skills 应该始终停在源分支,方便下次查看和安装。

工作流

Workflows/Push.md 步骤执行 → 调用 Tools/Push.sh

README 一致性(硬 gate)

每次 push 前,脚本强制做一件事:把 README 跟 local skills 对一遍

  • 列出 ~/.agents/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:

/ljg-push --skip-readme-check

自动转换的范围

md 分支同步时自动转换(2026-06-12 起含 org 文件本体):

  • org 文件本体:skill 内每个 .org 文件(assets/ 除外)转成同名 .md 并删除原件——org 头块→YAML frontmatter(含 --- 围栏,filetagstags)、* 标题→# 标题(层级保留)、#+ATTR_* 行删除、[[file:x]]![](x)#+begin_src→``` 围栏。Markdown 与运行时文本文件(如 .ts / .js / .json / .sh)里对实际被改名文件的引用同步改写
  • 文件扩展引用:__qa.org__qa.md__paper.org__paper.md 等(denote 命名约定)
  • 关键词:org-modemarkdownOrg-modeMarkdown
  • org 式格式指令:加粗用 *bold*(单星号)…加粗用 **bold**(双星号)标题层级从 * 开始从 # 开始Org 文件头Markdown 文件头、行首 #+title: 等 8 个示例键 → YAML 键行
  • 结构化强调标签:行首 - *标签*:- **标签**:;紧邻这类标签的 org 围栏同步改为 markdown

仍不自动转换(按需手工):

  • 正文里的 *bold* 标记:markdown 里 *x* 是斜体,盲替会破坏文档自身格式;只有「行首 bullet + 全角冒号」标签会安全转换
  • SKILL.md 示例块里转出的 YAML 键行不带 --- 围栏(已知整容项,不影响语义)

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
→ 检测 ~/.agents/skills/ljg-* 中跟 repo 有差异的 skills
→ master: rsync + bump version + commit + push
→ md: rsync + mdize + bump version + commit + push
→ 切回 master
→ 报告:哪些 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
  • org 文件本体已自动转换(2026-06-12 起)——template.org 等会被转成 .md 并删除原件,每次推送重新生成(rsync --delete 冲掉也无妨,幂等)。遗留手工项只剩正文里的 *bold* 标记。新增带复杂构件的 org reference 文件后,先 --dry-run 或沙盒跑一遍 mdize 看转换效果
  • 重命名引用可能藏在运行时代码里——例如测试用 new URL("../Template.org", import.meta.url) 读取模板;只改 Markdown 文档会让 md 分支缺文件。转换器会按本次实际转出的 basename 精确改写 .ts / .js / .json / .sh 等文本消费者,同时保留没有对应实体文件的 Org 测试夹具字符串
  • 结构化标签不能靠枚举示例词——xf(x) 之外还会出现「主体/边界」「代入」等真实标签;转换器按 - *标签*: 的结构识别,发布后仍要扫描 md 文件是否残留单星标签
  • 脚本会自动 bump patch version 在 plugin.json + marketplace.json——如果你想 bump minor / major,先手动改完再跑脚本,脚本只追加 patch
  • 如果 md 分支的远端比本地新(继刚另一台机器推过),脚本会 pull --rebase 失败时尝试一次 reset --hard origin/md 重新应用——这会丢弃本地未推的 md 分支 commit。脚本前会提示
  • 当前路径:skill 源固定在 ~/.agents/skills/,工作 repo 固定在 ~/code/ljg-skills/;不要从历史备份目录读取或推送

Frequently asked questions about LJG Push

Similar skills