Home / All Skills / Workflow & Core Tools / ljg-push
Workflow & Core Tools · lijigang/ljg-skills

ljg-push

Synchronize all updated skills in ~/.agents/skills/ljg-* to the GitHub repo (ljg-skills). First pushes to the master branch (org-mode output style), then switches to the md branch (markdown output style) to perform basic markdown conversion before pushing. 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.

L4 High-Privilege · Graded auth & full auditV1 Commit-PinnedExecute CommandNetwork AccessWrite FileDual-pass Audit
Author lijigangGitHub lijigang/ljg-skills ↗License MIT(仓库根 LICENSE)Commit 9e75497a95
Control levels describe skill capabilities and suggested control measures; they do not represent quality or safety certifications, nor do they dictate usability. Usage decisions rest entirely with users and administrators. Different agent hosts apply varying constraints; do not assume hosts provide automatic protection. Third-party skill copyrights belong to their original authors. Use at your own risk.

1How It Works & Mechanism

The core action is a one-click synchronization of local updates from ~/.agents/skills/ljg-* to the GitHub repo, covering both the master (org style) and md (markdown style) branches.

skills/ljg-push/SKILL.md
把本地 `~/.agents/skills/ljg-*` 里改过的 skills,一键同步到 github repo,覆盖 master 和 md 两个分支。
What it does here: Defines the single responsibility of the skill—pushing local skill sources into a dual-format remote repository.

Repository paths are hardcoded; if $SKILLS_REPO does not exist, it will automatically run git clone. If it exists but origin is not ljg-skills, it exits with an error without damaging existing directories.

skills/ljg-push/SKILL.md
如果 `$SKILLS_REPO` 不存在,脚本会自动 clone。如果它存在但不是 ljg-skills 的 git repo,脚本会报错退出(不破坏现有目录)。
What it does here: Provides a safety prerequisite—preferring to abort rather than overwrite the wrong directory.

Change detection and synchronization share the same file boundary: compared by checksums; pure timestamps, directory metadata, or empty directories do not trigger it; the ignore list contains only .git/, node_modules/, and .DS_Store.

skills/ljg-push/SKILL.md
检测与同步共用同一文件边界:按校验和比较内容,可靠识别文件新增、删除、内容和可执行位变化;纯时间戳、目录元数据、空目录不会单独触发发布
What it does here: Ensures that 'what is detected is what gets synced', preventing false releases caused by mtime jitter or extraneous files.

README consistency is a hard gate: before pushing, it lists local skill names and runs grep against the README, aborting if a local skill is missing in the README; use --skip-readme-check to bypass when no update is confirmed necessary.

skills/ljg-push/SKILL.md
找出 local 有但 README 没有的——*几乎肯定意味着 README 漏更新*
What it does here: Replaces the manual mindfulness of 'remembering to update README' with a mechanical check, directly blocking releases upon drift.

Automatic conversion is executed before releasing to the md branch: org files are converted to .md with the same name and originals are removed, embedded org examples are converted to markdown/YAML, extension references and keywords are rewritten, and evals/*.json output contracts are switched to Markdown.

skills/ljg-push/SKILL.md
md 分支同步时自动转换(2026-06-12 起含 org 文件本体):
What it does here: Delegates the discrepancies between 'org ↔ markdown dual formats' to the converter, reducing manual patching.

The push order is enforced as master first, md second, and then switching back to master, because the markdown conversion of md is based on the org version from master.

skills/ljg-push/SKILL.md
*master 必须先推*——md 分支的 markdown 化基于 master 的 org 版本做转换。反过来推会破坏顺序
What it does here: Formulates branch dependencies into a strict order to prevent conversions based on outdated content.

The script automatically bumps the patch version (plugin.json + marketplace.json); minor/major versions must be changed manually beforehand, as the script only increments the patch.

skills/ljg-push/SKILL.md
*脚本会自动 bump patch version 在 plugin.json + marketplace.json*
What it does here: Integrates version number maintenance into the release workflow while constraining the scope of automation.

When remote md is ahead of local, it runs pull --rebase first; if it fails, it attempts a single reset --hard origin/md and reapplies—this will discard unpushed local md commits, which is prompted before execution.

skills/ljg-push/SKILL.md
脚本会 `pull --rebase` 失败时尝试一次 `reset --hard origin/md` 重新应用——这会丢弃本地未推的 md 分支 commit。脚本前会提示
What it does here: Offers a recovery path for multi-machine collaboration while explicitly exposing a destructive rollback point.

Supports --dry-run (lists skills and conversions to be synced without executing rsync/commit/push) and --force (skips change detection and syncs all), accompanied by a local curl voice notification.

skills/ljg-push/SKILL.md
不执行 rsync / commit / push
What it does here: Provides both dry-run and forced modes; the voice notification is triggered externally by the host via curl to a local service.

2Core Capabilities

01One-click dual-branch synchronization (master=org output / md=markdown output, switching back to master after push)
02Change detection: checksum-based + strict file boundaries + ignore list (.git/, node_modules/, .DS_Store)
03README consistency hard gate (bypassable via --skip-readme-check)
04Automatic org→markdown conversion: org file bodies, embedded org templates, denote extension references, keywords, and formatting instructions
05Output contract coverage: format expectations in evals/*.json and defaults in runtime code are rewritten together
06Pre-commit residue audit (scans output instructions, Org markers, and lingering .org files)
07Automatic patch version bump (plugin.json + marketplace.json)
08--dry-run / --force operating modes (preview and skip detection)
09Multi-machine collaboration recovery: single reset --hard origin/md reapplication upon pull --rebase failure

3External Dependencies

KindDependency / Endpoint
cligit(clone / commit / push / pull --rebase / reset --hard,凭据由用户预先配置的 ssh key 或 PAT 提供)
clirsync(按校验和同步 skill 目录,含 --delete)
clibun(运行 mdize 转换器与测试)
networkGitHub 远端仓库(硬编码,作为 push 目标)
network本地语音通知服务(宿主/工作流用 curl 触发,非脚本内)

4Recommended Governance & Evidence

Suggested Controls for Safe Operation
For Agent Runtime
Graded/per-use authorization, sandbox recommended
For Administrators
Approval workflow, rollback support, full audit
Evidence & Triggers (File Paths & Excerpts)
  • scripts/: Local script or command execution: Tools/Push.sh (bash script; rsync sync, git clone/commit/push/pull --rebase/reset --hard)
  • 网络端点: Declared external network access: git push/clone/pull to hardcoded remote git@github.com:lijigang/ljg-skills.git (via user pre-configured credentials)
  • 本地工作目录: File read/write and artifact output: $HOME/code/ljg-skills (rsync syncs skill directories, git commit/push; deletes .org and generates .md on the md branch)
Audit Notes: Yellow: Use with caution. Evaluation targets this skill directory only: It includes Push.sh, which actively executes rsync/git/sed/awk and initiates outbound traffic (git push to a hardcoded GitHub remote), and Workflows/ contains curl calls to local port 31337 for notifications, making it ineligible for pure local Blue. Compared to github-ops precedents: It avoids Orange because it lacks credential-reading code—all 52 hits under §3 'Credentials/Environment Variables' were verified to be path variables like $HOME/$SKILLS_REPO and notes stating 'git credentials already configured... ljg-push does not handle authentication', completely delegating auth to external SSH keys/PAT. It avoids Green because it alters remote state over the network and carries aggressive write operations (rsync --delete / deleting .org on the md branch). Real reasons for Yellow: Predictable network calls (fixed GitHub remote + localhost notification) + high-risk irreversible write surfaces (remote master/md branches and version numbers) + a destructive fallback point (reset --hard origin/md upon pull --rebase failure, discarding unpushed local md commits), balanced by the absence of credential harvesting or third-party remote packages, with the README gate and --dry-run serving as manual safety valves.

5Second-Pass Verification

  • [ok] URL 命中性质 — 4 条:2 条 SKILL.md/Workflows 的本地 curl http://localhost:31337/notify,2 条 MdizeEmbeddedOrg.test.ts 的 https://example.com 测试字面量;无对公网 API 的查询端点,网络面是 git 远端 + 本地通知。
  • [ok] 「凭证」命中非凭证读取 — 52 条命中均为 $HOME/$SKILLS_REPO/$SKILLS_LOCAL 变量、路径与 README/日志文案;SKILL.md 明写「脚本前提是 git credentials 已配好…ljg-push 不处理认证」,credential_reads=[] 成立。
  • [ok] 外部程序确为执行面 — 8 条:SKILL.md/Workflows 的 curl、Push.test.ts 的 Bun.spawnSync(bash) 测试驱动;Push.sh 另有 rsync/git/awk/sed 调用,scripts_executed 已列。
  • [ok] 写盘面与破坏性动作有原文 — 检测/同步边界、sed 改 plugin.json/marketplace.json、md 分支删 .org、reset --hard origin/md 均在 SKILL.md 原文;file_writes 与 risks 表述有据。
  • [ok] README gate 与 dry-run 作为人工闸门 — SKILL.md 的硬 gate 段落与 --skip-readme-check 说明、Example 2 的 --dry-run 行为(不执行 rsync/commit/push)为原文,判级理由引用成立。
  • [ok] 功能声明未夸大 — description「把本地 ~/.agents/skills/ljg-* 里改过的 skills 一键同步…覆盖 master 和 md 两个分支」与 SKILL.md 的两分支差异表、工作流一致;NOT FOR 亦与脚本硬编码范围相符。

6Verdict & Scenarios

  • Streamlines dual-format publishing (org source + markdown artifact) into a single push: branch sequence, conversion, version bump, and switching back to master are fully automated, reducing manual patching.
  • README drift is mechanically blocked: a skill existing locally but missing in the README halts the push immediately, rather than just raising a warning.
  • Detection and synchronization share the exact same file boundary with an intentionally minimal ignore list (only .git/, node_modules/, .DS_Store); even .bak files remain visible to avoid hiding publishable content.
  • Markdown conversion covers four classes of consumers and audits residues before committing (output instructions/Org markers/lingering .org), treating format contract consistency as a strict check.
  • Provides two manual safety gates (--dry-run and the README gate) with prompts prior to destructive actions.
  • Best for: Ideal for lijigang maintaining the ljg-* skill collection, where local org sources need to be synced to GitHub in dual master (org) / md (markdown) formats; also serves as a pipeline reference for 'dual-format publishing + README consistency + version bumping'.
    Not for: Not suitable for pushing non-ljg skills or arbitrary git repositories (per description NOT FOR; script paths and remotes are hardcoded); not suitable for users without configured git credentials or those unwilling to allow automated reset --hard / version bumps.
    Install Agent-Ready
    ① Verified Mirror 2026-10-10
    Option A · Direct DownloadDownload ljg-push.tar.gz
    sha256: 76457b2903899638…
    Option B · Copy Guide for Agent
    install.json
    Agents automatically download and verify mirrors from this JSON guide.
    ② Upstream GitHub
    GitHub Repo ↗
    Pinned to commit 9e75497a95.