ljg-push

ljg-push

Popular

Syncs all updated skills from ~/.agents/skills/ljg-* to the github repo (ljg-skills). First pushes the master branch (org-mode style), then switches to the md branch (markdown style) for basic markdown conversion and push. Use when user says '/ljg-push', 'push skills', '推送 skills', '同步 skills', 'sync ljg', or whenever ljg-* skills get updated and need shipping. NOT FOR pushing non-ljg skills or arbitrary git repos.

6.6Kstars
768forks
Updated 7/17/2026
SKILL.md
readonlyread-only
name
ljg-push
description

Syncs all updated skills from ~/.agents/skills/ljg-* to the github repo (ljg-skills). First pushes the master branch (org-mode style), then switches to the md branch (markdown style) for basic markdown conversion and push. Use when user says '/ljg-push', 'push skills', '推送 skills', '同步 skills', 'sync ljg', or whenever ljg-* skills get updated and need shipping. NOT FOR pushing non-ljg skills or arbitrary git repos.

ljg-push: Push ljg-* skills

One-click sync of modified skills from local ~/.agents/skills/ljg-* to the github repo, covering both master and md branches.

Repo paths (hardcoded)

SKILLS_REPO="$HOME/code/ljg-skills"     # local working repo
SKILLS_LOCAL="$HOME/.agents/skills"      # local skill source
REPO_URL="git@github.com:lijigang/ljg-skills.git"

If $SKILLS_REPO does not exist, the script clones it automatically. If it exists but is not the ljg-skills git repo, the script errors out (does not destroy 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

Skills in ~/.agents/skills/ are master style (source version). Differences on the md branch are handled by automatic conversion plus manual fixes when necessary.

After pushing md, the script automatically switches back to master. Local $HOME/code/ljg-skills should always stay on the source branch for easy future review and installation.

Workflow

Follow steps in Workflows/Push.md → invoke Tools/Push.sh.

README consistency (hard gate)

Before each push, the script enforces one thing: compare README with local skills.

  • List all skill names under ~/.agents/skills/ljg-*
  • grep $SKILLS_REPO/README.md for occurrences of ljg-xxx
  • Find skills present locally but missing from README — almost certainly means README is out of date
  • If found → push aborts, reports differences

Every push is a chance to review the README. Ask yourself:

  1. Added a new skill? Add a line to the README skill list / install command.
  2. Removed a skill? Delete the corresponding line from README.
  3. Significantly changed a skill's description? Update the README summary accordingly.

When you've confirmed the README is reviewed and truly needs no update, bypass the gate:

/ljg-push --skip-readme-check

Scope of automatic conversion

When syncing the md branch, automatic conversion (as of 2026-06-12 includes org file bodies):

  • Org file bodies: each .org file inside a skill (excluding assets/) is converted to a same-named .md and the original is deleted — org header block → YAML frontmatter (with --- fences, filetagstags), * headings → # headings (level preserved), #+ATTR_* lines removed, [[file:x]]![](x), #+begin_src → ``` fences. References to renamed files in other .md files are globally updated.
  • File extension references: __qa.org__qa.md, __paper.org__paper.md, etc. (denote naming convention)
  • Keywords: org-modemarkdown, Org-modeMarkdown
  • Org-style formatting instructions: 加粗用 *bold*(单星号)…加粗用 **bold**(双星号), 标题层级从 * 开始从 # 开始, Org 文件头Markdown 文件头, line-start #+title: and 7 other example keys → YAML key lines

Still not auto-converted (manual as needed):

  • *bold* markers in body text: in markdown *x* is italic, blind replacement would break document formatting.
  • YAML key lines in SKILL.md example blocks without --- fences (known cosmetic issue, does not affect semantics).

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-click push

User: /ljg-push
→ Detects skills in ~/.agents/skills/ljg-* that differ from the repo
→ master: rsync + bump version + commit + push
→ md: rsync + mdize + bump version + commit + push
→ Switch back to master
→ Report: which skills were pushed, new version numbers, remaining manual differences

Example 2: Preview what would be pushed without actually pushing

User: /ljg-push --dry-run
→ Lists skills that would be synced
→ Lists markdown conversions that would be applied
→ Does not execute rsync / commit / push

Gotchas

  • README drift is the most easily overlooked — adding a new skill and pushing directly leaves the README on the old list. The script now has a hard gate to catch this; when it stops you, don't blindly add --skip-readme-check, go review the README first.
  • The script assumes git credentials are already configured (ssh key or PAT) — ljg-push does not handle authentication; it errors out on auth failure.
  • master must be pushed first — the md branch's markdown conversion is based on the master branch's org version. Pushing in reverse order breaks the sequence.
  • Untracked clutter (e.g., assets/measure.js) will be rsynced to the repo — if you don't want to push it, delete it locally or add it to .gitignore.
  • Org file bodies are now auto-converted (since 2026-06-12)template.org etc. will be converted to .md and the original deleted; regenerated on every push (rsync --delete overwrites it anyway, idempotent). Remaining manual items are only *bold* markers in body text. After adding a new org reference file with complex constructs, run --dry-run or test mdize in a sandbox to see the conversion result.
  • The script automatically bumps the patch version in plugin.json + marketplace.json — if you want to bump minor/major, do it manually first, then run the script; the script only increments patch.
  • If the md branch remote is ahead of local (e.g., pushed from another machine), the script will pull --rebase and if that fails, attempt one reset --hard origin/md to reapply — this discards local uncommitted md branch commits. The script will prompt before doing so.
  • Current paths: skill source is fixed at ~/.agents/skills/, working repo at ~/code/ljg-skills/; do not read from or push to historical backup directories.