AI Agent Hub
Back to skills
Yuque Document Sync icon

Yuque Document Sync

Knowledge Management Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Install @user_924c5114/yuque-docs-skill by following https://skillhub.cn/install/skillhub.md.

About this skill

Problem

When syncing local Markdown into Yuque, the hard part is not one API call. It is resolving doc IDs and slugs, attaching new docs to the TOC, choosing stable titles, rewriting local links, avoiding repeated pushes, and handling remote drafts or conflicts. This skill narrows the surface area to one Yuque knowledge base and exposes yuque_cli.py for list, get, create, update, delete, toc, sync, pull, and status, with results that include doc ID, title, and slug for verification.

How It Works

  • Core CRUD: Operate on documents inside a single Yuque knowledge base through OpenAPI. create appends the document to the TOC by default, while get, update, and delete accept either an integer ID or a more readable slug.
  • Sync state: sync records local content hashes and remote latest_version_id values in .yuque-sync.json, pushing only changed documents and skipping unchanged ones instead of performing blind full updates.
  • Local layouts: Supports flat, nested, and frontmatter Markdown arrangements. In frontmatter mode, files can declare slug and optional title; the YAML block is stripped before push.
  • Body transformations: Rewrites inter-document links for Yuque, fixes bold-close spacing patterns such as **Label:** value, and reverses slug links back to local file links on pull.
  • Safety rules: The token is passed only to setup and stored in .env; it is not echoed, hardcoded, or committed. Remote deletion requires explicit user confirmation.

Boundaries

This is best for managing Markdown documents and TOC state in one knowledge base. It does not own Yuque team, member, or repository management, and it does not perform cross-repo migration. TOC insertion appends to the repository root as a child node and cannot choose a parent or position. sync compares published versions using latest_version_id, so unpublished remote drafts may be overwritten. Ambiguous layouts, conflicts, and missing locally tracked files require explicit human choices rather than automatic action.

Use Cases

  • Maintain local Markdown notes and use `sync` to compare body changes before updating only modified docs in one Yuque knowledge base.
  • Publish a new Yuque note by running `create` with a title and body, letting the skill append the new doc to the current TOC.
  • Audit whether a knowledge base TOC is complete using `toc`, then confirm targets with `list` or `get` by doc ID, slug, and body.
  • Handle a tracked local file being deleted after sync, follow the confirmation block, and choose `pull`, `delete`, or `forget`.

Best For

  • Engineers maintaining a team Yuque knowledge base who want CLI-based verification, update, and deletion of specific Markdown docs.
  • Technical writers syncing local doc repos to Yuque who want changed-file pushes and stable slug mapping.
  • Product managers running release workflows who need to inspect TOCs, create docs, and verify doc IDs and slugs.
  • Automation engineers integrating Yuque OpenAPI who need setup, token configuration, and `list`/`toc` validation.