fetch-yuque-doc
Use when Codex needs to fetch the content of a single Yuque page from a user-provided yuque.com link through a local logged-in Chrome-family browser, especially for private-space documents where token-based API access is unavailable or undesirable.
- License 许可
- MIT
- 最近更新
- 2026-11-03
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- fetch-yuque-doc
- description
- Use when Codex needs to fetch the content of a single Yuque page from a user-provided yuque.com link through a local logged-in Chrome-family browser, especially for private-space documents where token-based API access is unavailable or undesirable.
02 资源文件 3
- 参考文档agents/openai.yaml244 B
- 参考文档references/browser-notes.md1.8 KB
- 脚本scripts/fetch_yuque_doc.py25.3 KB
03 SKILL.md 正文
Fetch Yuque Doc
Overview
Fetch one Yuque document from a page URL through a local logged-in Chrome-family browser. On macOS, prefer the current running Chrome instance through AppleScript so enterprise SSO sessions can be reused directly; fall back to Playwright plus a copied browser profile when needed.
Quick Start
Use scripts/fetch_yuque_doc.py.
python3 -m pip install --user playwright
python3 <skill_path>/scripts/fetch_yuque_doc.py \
"https://hellobike.yuque.com/<group>/<repo>/<doc>"
JSON output:
python3 <skill_path>/scripts/fetch_yuque_doc.py \
--format json \
"https://hellobike.yuque.com/<group>/<repo>/<doc>"
Workflow
- Confirm the user gave a full Yuque document URL on
yuque.comor*.yuque.com. - Ensure the local browser profile is already logged in to the target Yuque space.
- Run the bundled script with the page URL once. The script performs URL validation, browser detection, and profile checks as part of the normal fetch path.
- On macOS, keep the default
--strategy auto: try the current Chrome instance through AppleScript first, then fall back to Playwright if needed. - Return the fetched title, page TOC, metadata, and body to the user.
- If the request fails, surface the exact reason: bad URL, browser not found, profile not found, launch failure, or inaccessible page.
URL Rules
The script expects links in this shape:
https://<host>.yuque.com/<group_login>/<repo_slug>/<doc_slug>
It ignores query strings and fragments, but it does not try to crawl a directory, homepage, or knowledge-base root URL. This skill is intentionally scoped to a single page per invocation.
Browser Rules
- Prefer the default local Chrome profile first.
- On macOS, prefer
--strategy autoso the script can reuse the current Chrome session through AppleScript. - Auto-detect Google Chrome, Chromium, and Microsoft Edge when possible.
- Allow overrides with
--browser-path,--user-data-dir, and--profile-directory. - Prefer the default profile-copy behavior to avoid live profile locks.
Output Rules
- Default output is Markdown for direct reading in the terminal.
- Default to a single real fetch. Do not run
--dry-runas part of the standard workflow. - Use
--dry-runonly for debugging link parsing or browser/profile detection issues. - Use
--format jsonwhen the result will be piped into another tool or needs structured fields. - JSON output includes
body_html, which is useful when downstream tooling needs structure beyond plain text.
Error Handling
- Browser detection error: no compatible browser installation or user data directory was found.
- Profile error: the selected profile directory does not exist.
- Browser launch error: Playwright is missing, or the browser profile could not be opened.
- Extraction error: the page loaded, but the document body could not be extracted.
Resources
- Script:
scripts/fetch_yuque_doc.py - Reference:
references/browser-notes.md
Read references/browser-notes.md only when you need the exact browser/profile assumptions or want to confirm the extraction strategy.
Do Not Expand Scope
Do not turn this skill into a generic Yuque crawler, exporter, synchronization tool, or session-token extractor unless the user explicitly asks for that broader behavior in a separate task.
04 同仓库更多 Skills
reconstructing-ui-from-screenshots
Use when implementing or correcting an app or web UI from a design image, screenshot, mockup, or reference PNG where accurate size, spacing, color, typography, assets, and alignment matter.
question-answer
Use when the user wants a read-only explanation of existing code behavior, architecture, control flow, data flow, dependencies, or implementation decisions and has not requested project changes.
java-to-swift
Use when converting Java 1.8 classes to Swift 5.0+ Codable structs - handling type mapping, nullability, inheritance flattening, BaseReq exclusions, and property naming conventions.
java-to-nextjs
Use when converting Java 1.8 classes to Next.js TypeScript interface definitions - handling type mapping, nullability, inheritance, naming conventions, and BaseReq/BaseResponse exclusions.
ios-i18n-workflow
Use when iOS apps using SwiftGen L10n need localization work - adding keys, checking missing translations, or cleaning unused entries. Triggered by hardcoded strings, missing L10n references, incomplete translations across multiple languages, or unused localization cleanup requests.
improve-codebase-architecture
Use when the user wants architectural deepening opportunities for a codebase or named files, shown as a visual HTML report, and when they then pick candidates from that report to implement in the code already reviewed.