Yuque Document Sync
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.
createappends the document to the TOC by default, whileget,update, anddeleteaccept either an integer ID or a more readableslug. - Sync state:
syncrecords local content hashes and remotelatest_version_idvalues in.yuque-sync.json, pushing only changed documents and skipping unchanged ones instead of performing blind full updates. - Local layouts: Supports
flat,nested, andfrontmatterMarkdown arrangements. Infrontmattermode, files can declareslugand optionaltitle; 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.
Related Skills
Turns Taleb's antifragility, barbell strategy, and via negativa into executable prompts for risk analysis in career, investing, health, and other domains.
Keyword news search over ZAKER’s corpus with optional time filtering, returning up to 20 titles, authors, and summaries.
A generic knowledge review skill that generates role-based checklists, rrule-based reminders, and on-demand reviews without storing personal data.
A knowledge-management skill for layered retrieval across information sources.