agentleFS
HeathWangHeathWang/hw-cc-plugin/skills/fetch-yuque-doc/SKILL.md

fetch-yuque-doc

Skill1 starsChanged 3 months agoMITView on GitHub

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.

  • Installs packages

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 7 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Ensure the local browser profile is already logged in to the target Yuque space.

    line 33
  2. Distinctive:

    Run the bundled script with the page URL once.

    line 34
  3. Distinctive:

    If the request fails, surface the exact reason: bad URL, browser not found, profile not found, launch failure, or inaccessible page.

    line 37
  4. Distinctive:

    Prefer the default local Chrome profile first.

    line 51
  5. Distinctive:

    Prefer the default profile-copy behavior to avoid live profile locks.

    line 55
  6. Distinctive:

    Default output is Markdown for direct reading in the terminal.

    line 59
  7. Very specific:

    Default to a single real fetch.

    line 60
  8. Very specific:

    Use --dry-run only for debugging link parsing or browser/profile detection issues.

    line 61
  9. Very specific:

    Use --format json when the result will be piped into another tool or needs structured fields.

    line 62
  10. Very specific:

    Read references/browser-notes.md only when you need the exact browser/profile assumptions or want to confirm the extraction strategy.

    line 77
  11. Distinctive:

    Do not turn this skill into a generic Yuque crawler, exporter, synchronization tool, or session-token extractor unless the user explicitly …

    line 81

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
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

  1. Confirm the user gave a full Yuque document URL on yuque.com or *.yuque.com.
  2. Ensure the local browser profile is already logged in to the target Yuque space.
  3. 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.
  4. On macOS, keep the default --strategy auto: try the current Chrome instance through AppleScript first, then fall back to Playwright if needed.
  5. Return the fetched title, page TOC, metadata, and body to the user.
  6. 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 auto so 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-run as part of the standard workflow.
  • Use --dry-run only for debugging link parsing or browser/profile detection issues.
  • Use --format json when 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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.