跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
开发与测试

using-sync

Use when an Agent needs to synchronize LWC Wiki stores across SSH hosts, resume or abort an interrupted Sync session, or resolve semantic Sync conflicts safely.

JanYork · 已有静态检查记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add JanYork/llm-wiki-cli --skill using-sync

技能说明


name: using-sync description: Use when an Agent needs to synchronize LWC Wiki stores across SSH hosts, resume or abort an interrupted Sync session, or resolve semantic Sync conflicts safely.

Using LWC Sync

Run Sync through the audited CLI only:

lwc sync HOST [ABS_DIRECTORY] --mode merge|pull|push

Every start, resume, resolve, abort, pull, push, or merge can publish or change durable data. Before the first execution in a bounded workflow, present a safety notice containing the exact command, target host, absolute directory, scope, mode, affected stores, impact, risks, recovery path, and reversibility. An explicit user instruction that already names or unambiguously accepts these facts is authorization; do not ask the human to repeat it.

One authorization covers the bounded workflow while its host, directory, scope, mode, publication targets, and disclosed risks remain unchanged. It covers read-only preflight, prerequisite build and installation, the initial Sync, ordinary --resume, continuity or derived recovery, status checks, and an abort before publication. Equivalent command details that do not widen the target or risk do not require reconfirmation.

Reconfirm only when a host, directory, scope, mode, or publication target changes; a new destructive, irreversible, privacy, or data-loss risk appears; or a candidate resolution would discard one side. Preserve-both and idempotent recovery within the same session remain covered. A Skill trigger alone is not authorization.

Choose the scope explicitly before starting:

  • --scope project synchronizes only the active project Wiki. Supply the remote project's absolute directory when it cannot be discovered from the remote login directory.
  • --scope global synchronizes only the global Wiki; omit the directory.
  • --scope all synchronizes project and global stores as one coordinated session. Supply the remote project's absolute directory.

Use merge to publish the reconciled result to both sides, pull to publish it only locally, and push to publish it only remotely. Every mode preserves unique semantic objects from both sides; direction controls the destination, not destructive authority. Scope and mode are session invariants: keep the exact original --scope, HOST, optional ABS_DIRECTORY, and --mode on every continuation.

Continue or stop a session

  • Resume with the original command plus --resume SESSION_ID.
  • Abort without deleting audit state with the original command plus --abort SESSION_ID.
  • Abort is available only before canonical publication. After a receipt reports committed=true or a store as published, follow its next_action or validated recovery command and resume; never restart the semantic publication.
  • Treat lifecycle Hook Sync readiness as a bounded continuity cue. It never contains hosts, directories, credentials, object bodies, or conflict payloads; inspect the session through normal lwc sync output.

An initially missing destination is created only through Sync's staged, validated publication path. For a single project or global scope, push from a missing local source is an explicit local_store_missing no-op; pull from a missing remote source preserves local state and does not create remote canonical state. Pull or merge can safely create a missing local destination, and push or merge can safely create a missing remote destination. --scope all coordinates project and global units and stages every requested unit before it publishes any of them.

Sync moves suspended sparse changesets as validated detached intent, then replays each foreign intent as a fresh local suspended draft with a new changeset ID; it never commits that draft into live knowledge automatically. Queued and running Work remain machine-local. Terminal Work crosses only as a bounded redacted origin audit, never as a raw Work directory, result, path, or execution state. Inspect continuity_local / continuity_remote receipts. If canonical publication succeeded but continuity did not, trust committed=true, keep the same session, and follow next_action=resume_continuity; resume is idempotent.

FTS is refreshed for changed semantic objects. Markdown and an already-enabled document graph use the exact affected identifiers while the selection contains at most 4,096 items and 256 KiB; larger selections keep bounded counts and a digest and deliberately use derived_selection=full. An initialized CodeGraph refreshes only after Git publication. A post-commit derived failure reports committed=true and next_action=resume_derived_rebuild; resume repairs the derived planes without replaying canonical publication.

Resolve semantic conflicts

When Sync reports action=conflicts, treat the returned conflicts array as the current batch. Each batch contains at most 20 conflict objects, and the canonical resolution packet is limited to 256 KiB. Resolve ordinary content conflicts autonomously from current source evidence, then write a packet and resume with the original command plus --resolve PACKET.json:

{"version":1,"decisions":[{"conflict_id":"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef","kind":"page","logical_key":"guide","path":"title","candidate":1}]}

Copy conflict_id, kind, logical_key, and path from the current batch and choose candidate 0 or 1 exactly as listed for every conflicting field. A candidate decision has exactly these five fields:

{"conflict_id":"CURRENT_64_HEX_ID","kind":"page","logical_key":"guide","path":"title","candidate":1}

If evidence cannot justify either candidate for an object, preserve it with this exact four-field object decision:

{"conflict_id":"CURRENT_64_HEX_ID","kind":"page","logical_key":"guide","strategy":"preserve_both"}

That object-level decision covers every conflicting field on the object. For --scope all, wrap only the scopes represented in the current batch, for example `{"v

阅读完整来源 ↗