agentleFS
DunoDogeDunoDoge/OHOS-Skills/harmony-fetch/SKILL.md

harmony-fetch

Skill1 starsChanged 2 months agoMITView on GitHub

Search and fetch HarmonyOS/HarmonyOS NEXT developer documentation from Huawei developer portal (developer.huawei.com), either via the official HarmonyOS Knowledge MCP service (searchDocuments, getDocumentsById, mcp__harmonyos-developer-knowledge, 开发者知识MCP) or the local REST-API fetch script. Use when local skill docs are insufficient for ArkTS, ArkUI, ArkData, NDK, DevEco Studio, or any HarmonyOS API/feature question. Triggers include HarmonyOS doc lookup, ArkTS API reference, HarmonyOS component usage, DevEco toolchain questions, MCP configuration (鸿蒙开发者知识MCP配置), or when the user explicitly asks to check Huawei official docs.

The file

Show its rules and text

We split this skill into the rules it gives an agent

18 rules. About 0 are common, 7 are distinctive, and 11 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.

  • 11

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not force this skill onto tasks the local offline docs already answer — see the coverage table and boundary below.

    line 19
  2. Distinctive:

    Before calling the online API, check whether the following local skills already cover the needed content.

    line 43
  3. Very specific:

    Preferred - MCP service: If the client exposes HarmonyOS Knowledge MCP tools (tool-name prefix mcp__harmonyos_developer_knowledge__), call …

    line 66
  4. Very specific:

    Fallback - local script + REST API: If the MCP service is not connected, use scripts/fetch_doc.py to call Huawei's documentPortal REST API.

    line 67
  5. Distinctive:

    Add the following remote-server configuration to any MCP-capable AI client (e.g.

    line 73
  6. Distinctive:

    Always search first; never hand-craft document identifiers.

    line 90
  7. Very specific:

    1. Search: - call searchDocuments with a non-empty query (搜索词).

    line 92
  8. Very specific:

    2. Fetch full content (if needed): - only if the fragments are too brief to answer the question, pass the relevant parent values verbatim …

    line 94
  9. Distinctive:

    Use this path only when the MCP service is not connected to the current client.

    line 126
  10. Very specific:

    Option B - Browse catalog tree: Run the fetch script with --catalog to list sections:

    line 136
  11. Very specific:

    Option C - Web search: Use WebSearch tool with site:developer.huawei.com/consumer/cn/doc/ <keywords> to find relevant doc URLs, then …

    line 142
  12. Very specific:

    After adding the server, the client exposes two tools (exact name prefix depends on the client, e.g.

    line 182
  13. Distinctive:

    Local skills first: - before any online fetch, confirm the local offline docs listed above do not already answer the question.

    line 257
  14. Very specific:

    Search before you fetch: - always run searchDocuments first.

    line 258
  15. Very specific:

    Never fabricate identifiers: - every names[] entry must be copied from a previous searchDocuments result.

    line 259
  16. Very specific:

    Quote sources: - when answering with fetched content, cite the page URL built from the result's uri (or document/...

    line 264
  17. Distinctive:

    Use the bare slug (no version suffix) for the latest version

    line 324
  18. Very specific:

    Search APIs (REST) require authentication cookies.

    line 375

≈ “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

Harmony-Fetch

Fetch HarmonyOS developer documentation from Huawei's official portal, via either the official HarmonyOS Knowledge MCP service (preferred) or public REST APIs with a local script.

When to Use

  • ArkTS/ArkUI/ArkData API details not covered by local skills (arkts-helper, arkts-build, etc.)
  • HarmonyOS NEXT feature documentation lookup
  • DevEco Studio IDE, build tools, or command-line tools reference
  • User asks "check Huawei docs" or references developer.huawei.com links
  • Need to verify current API signatures, deprecated features, or new capabilities

Do not force this skill onto tasks the local offline docs already answer — see the coverage table and boundary below.

Boundary with Other Skills

This skill covers "fetching current official documentation online", not "answering from offline docs" or "writing/fixing code":

Issue TypeCross-reference SkillBoundary
ArkTS syntax / migration / style / state managementarkts-helperAnswer from its offline references first; escalate here only when they are insufficient
ArkTS compile errors (arkts-no-* etc.)arkts-debugFix from its offline catalog first; new/uncovered error codes escalate here
Runtime crash / jscrash diagnosisarkts-crash-diagnosisCrash evidence parsing belongs there; fetch API docs here when unfamiliar @ohos.*/@kit.* constraints matter
Command-line build/sign/deployarkts-buildIts 8 offline docs cover the toolchain; new CLI parameters escalate here
NDK / Node-API / C++ interoparkts-ndk-devIts 11 offline docs cover NDK; new NDK interfaces escalate here
HarmonyOS design language / UXharmony-designIts offline snapshot covers design-guides; new-version design docs escalate here (catalogName=design-guides)
Project comprehension / line-by-line explanationunderstand-hmosExplanation with verified citations belongs there; fetch raw docs here for topics its citation map lacks
App icon design / config / compliancecreate-app-iconIcon workflow belongs there; latest icon specs escalate here
Project scaffoldingcreate-hmos-projectTemplate-based creation belongs there; fetch DevEco/SDK docs here
Lite Wearable Simulator (仿真器) run/debuglite-simulator-debugIts 5 offline docs cover Simulator run/debug and FA-model wearable basics; new DevEco simulator features or @system.* interfaces escalate here
Atomic Service (元服务) developmentatomic-service-devIts 13 offline docs cover atomic-service form-level differences and restriction red lines; Kit-level atomic-guides guides (network/account/payment etc.), new 元服务API集 additions, or ASCF docs escalate here
ArkUI-X 跨平台(Android/iOS)开发arkui-x-devIts 17 offline snapshots cover ArkUI-X capability boundaries, restriction red lines, and bridge guidance; ArkUI-X docs are NOT in the Huawei portal nor in this MCP corpus — new ArkUI-X docs must be fetched from GitCode raw per arkui-x-dev's maintenance section
Skill authoring / structural validationskill-author / validate-skillRepo conventions and structure checks belong there

Local Documentation Coverage

Before calling the online API, check whether the following local skills already cover the needed content. Only use this skill to fetch online documentation when local docs are insufficient.

Local SkillOffline DocsTopics Covered
arkts-helper12 docs + state-management overview (13 total)ArkTS language syntax, type system, coding style, TS→ArkTS migration rules and cases, high-performance programming, standard library (XML/Buffer/JSON/containers), concurrency (Promise/TaskPool/Worker/Sendable), ArkUI state management V1/V2 decorators
arkts-debug28 docs + 28 .ets examplesRoot causes and fixes for 28 common ArkTS compilation errors (arkts-no-* rules, ContentType, @StorageLink, LazyForEach, Possibly null, etc.)
arkts-build8 docsFull command-line build/test/sign/deploy workflow: hvigorw, codelinter, hstack, ohpm, hdc, CI pipelines, hap-sign-tool
arkts-ndk-dev11 docsNDK / Node-API / C++ interop: CMake toolchain, napi_wrap, napi_threadsafe_function, Rawfile, NativeBundle, ASan, LLDB, ABI/Neon
harmony-design13 docs (INDEX + 12 references)鸿蒙设计语言:设计理念 / 视觉风格(色彩 token / 鸿蒙黑体 / 字号阶梯 / 圆角 / 间隔 / 沉浸光感 / 应用图标 / HarmonyOS Symbol)/ 布局(8vp 网格 / 断点 / 栅格 / 响应式)/ 动效(时长 / 曲线 / 转场 / 手势)/ 控件(导航 / 操作 / 展示 / 输入 / 选择 / 容器)/ 人机交互 / 系统特性 & 能力 / 多设备适配(折叠屏 / 平板 / 电脑 / 智能座舱 / 穿戴 / 智慧屏)/ UX 体验标准 & 最佳实践 / 设计资源索引
understand-hmos9 docs (INDEX + references) + scan_project.py工程导览 / 逐文件逐行讲解 / 配置字段答疑 / 生命周期 / 启动链路 / HAP-HAR-HSP / 资源 $r / 经核实的官方引用
create-app-icon4 docs (INDEX + references) + 5 templates应用图标设计规范 / 分层图标 SVG 生成 / 项目配置(layered_image.json / app.json5 / module.json5)/ 合规自检 / 多设备适配
arkts-crash-diagnosis9 docs (INDEX + patterns) + 5 Node scripts运行期崩溃诊断:jscrash/faultlog/hilog 采集解析、fault-mode 知识库(TypeError/ReferenceError/BusinessError 等)
create-hmos-projectStage 模板 application/ + 2 Node scripts从零脚手架生成 ArkTS 工程:appName 规则、bundleName 推导、API Level 自动检测、EntryAbility/main_pages 同步约束
lite-simulator-debug5 docs (INDEX + references,2 篇原创整理)轻量级智能穿戴(Lite Wearable)仿真器运行调试:Simulator Run/Debug 与虚拟传感器/电池、@system.* API 映射、FA 模型包结构、安装错误码速查(lite-wearable-guides 目录不在 MCP 语料内,抓取走本技能 REST 脚本)
atomic-service-dev13 docs (INDEX + references,1 篇原创速查)元服务(Atomic Service)形态级差异与开发限制:Stage/ArkTS/元服务API集红线、分包 2MB/10MB、单 Ability、服务卡片约束、更新/拉起/上架合规;Kit 级 atomic-guides 指导与 API 集新增在线拉取
arkui-x-dev17 docs (INDEX + 16 references,1 篇原创矩阵)ArkUI-X 跨平台(鸿蒙+Android/iOS):能力与架构、平台差异化与框架规格红线、平台桥接/平台视图、动态化/N-API、Android/iOS 端集成(Stage↔Activity/ViewController)、API 跨平台支持列表、三端构建与 rom size;上游为 GitCode arkui-x/docs(华为 portal 与 MCP 语料均无 arkuix 目录,本技能两条通道对 ArkUI-X 无效)

Decision flow: user question → check the corresponding skill's offline docs first → if docs are insufficient → use this skill to fetch from the Huawei developer portal.

Workflow (Follow Strictly)

Two retrieval paths are supported. Choose based on whether the AI client has the MCP service connected:

  • Preferred - MCP service: If the client exposes HarmonyOS Knowledge MCP tools (tool-name prefix mcp__harmonyos_developer_knowledge__), call them directly. No script execution, no Windows encoding concerns, content stays in sync with the official site (delay <= 30 min).
  • Fallback - local script + REST API: If the MCP service is not connected, use scripts/fetch_doc.py to call Huawei's documentPortal REST API.

Step 1: Use the MCP Service (Preferred)

MCP configuration

Add the following remote-server configuration to any MCP-capable AI client (e.g. DevEco Studio, ZCode):

{
  "mcpServers": {
    "harmonyos_developer_knowledge": {
      "url": "https://connect-api.cloud.huawei.com/api/developerknowledge/mcp",
      "type": "http"
    }
  }
}

Configuration paths differ across clients - refer to each client's MCP configuration documentation.

Tool call flow

Always search first; never hand-craft document identifiers.

1. Search - call searchDocuments with a non-empty query (搜索词). It returns resultList, where each entry contains exactly two fields: parent (document identifier) and content (matched text fragment). No title or uri is returned - judge relevance by the fragment text and the slug inside parent.

2. Fetch full content (if needed) - only if the fragments are too brief to answer the question, pass the relevant parent values verbatim as the names array of getDocumentsById (up to 10 per call). It returns complete Markdown documents with name, title, uri, and content.

searchDocuments(query="ArkTS 状态管理")
  -> resultList[0].parent = "document/cn/harmonyos-references/js-apis-statemanagement"

getDocumentsById(names=["document/cn/harmonyos-guides/arkts-state-management-overview"])
  -> resultList[0].title    = "状态管理概述"
     resultList[0].content  = "# 状态管理概述\n\n..."   (full Markdown)

Parameter definitions, verified response shapes, and calling rules: see MCP Service Reference.

Verify MCP availability

To confirm the service is reachable and inspect the current tool specifications, run the following curl outside the client:

curl --location 'https://connect-api.cloud.huawei.com/api/developerknowledge/mcp' \
     --header 'content-type: application/json' \
     --header 'accept: application/json, text/event-stream' \
     --data '{
          "method": "tools/list",
          "jsonrpc": "2.0",
          "id": 1
     }'

For the full MCP service reference (endpoint, tools, corpus scope, sync latency), see MCP Service Reference below.

Step 2: Use the Local Script (Fallback when MCP is unavailable)

Use this path only when the MCP service is not connected to the current client. Two-step workflow: Search -> Fetch.

Windows note: the examples below use python3; on Windows the interpreter is usually python (the python3 alias may be a non-functional Store stub). Use whichever python/py exists on the target machine.

Option A - User provides a URL: Parse the URL to extract the document slug.

URL pattern: https://developer.huawei.com/consumer/cn/doc/<catalog>-<version>/<slug>-<version>

Extract slug (without version suffix) as the objectId.

Option B - Browse catalog tree: Run the fetch script with --catalog to list sections:

python3 scripts/fetch_doc.py --catalog harmonyos-guides

Option C - Web search: Use WebSearch tool with site:developer.huawei.com/consumer/cn/doc/ <keywords> to find relevant doc URLs, then extract slugs from results.

Then fetch the document content:

python3 scripts/fetch_doc.py <objectId>

Where objectId is the document slug (e.g., arkts-state-management-overview).

Output is markdown-converted content. For raw HTML, add --html flag.

MCP Service Reference

The HarmonyOS Developer Knowledge MCP service (鸿蒙开发者知识MCP服务) is a remote MCP server based on the standard Model Context Protocol, providing real-time retrieval and full-text fetching of HarmonyOS official developer docs. Upstream doc: https://developer.huawei.com/consumer/cn/doc/start/hosknowledgemcp-0000002664603963

ItemDetail
Service name鸿蒙开发者知识 MCP 服务 (HarmonyOS Developer Knowledge MCP)
Endpointhttps://connect-api.cloud.huawei.com/api/developerknowledge/mcp
ProtocolMCP over HTTP (remote server)
AuthNone required (per upstream doc)
Tool 1searchDocuments - semantic search across the whole corpus; returns matched text chunks plus their parent document identifiers
Tool 2getDocumentsById - fetch full content of one or more documents (up to 10 per call) by their parent identifiers
Corpus scopeRelease notes, API reference, development guides, best practices, industry practices, FAQ, IDE guides, UX design, app publishing & distribution
Sync latencyNear real-time with the official site; delay <= 30 min after a doc is published

Client configuration

{
  "mcpServers": {
    "harmonyos_developer_knowledge": {
      "url": "https://connect-api.cloud.huawei.com/api/developerknowledge/mcp",
      "type": "http"
    }
  }
}

After adding the server, the client exposes two tools (exact name prefix depends on the client, e.g. mcp__harmonyos_developer_knowledge__searchDocuments and mcp__harmonyos_developer_knowledge__getDocumentsById).

Tool specification

The authoritative machine-readable specs come from the JSON-RPC tools/list method (verify availability). The tables below summarize them together with behavior verified against the live service (2026-08-27).

searchDocuments

Searches all HarmonyOS official docs (版本说明、API参考、开发指南、最佳实践、行业实践、FAQ、IDE指南、UX设计、应用上架、应用分发). Returns matched text chunks, not whole documents.

Input parameters:

ParameterTypeRequiredDescription
SearchDocumentsReq.querystringYes (gateway-validated)搜索词 - a natural-language phrase or an exact keyword such as an API / component / error-code name

Success response:

FieldTypeDescription
codeinteger0 = success; non-zero = gateway/parameter error (see Errors)
messagestring"success" or an error description
resultList[].parentstringIdentifier of the document that owns the matched chunk. Format: document/{lang}/{catalog}/{slug}, e.g. document/cn/harmonyos-guides/arkts-state-management-overview. Pass it verbatim to getDocumentsById.
resultList[].contentstringThe matched text fragment. May end mid-sentence - it is a chunk, not the full document.

Verified sample (abbreviated):

{
  "code": 0,
  "message": "success",
  "resultList": [
    {
      "parent": "document/cn/harmonyos-references/js-apis-statemanagement",
      "content": "状态管理模块具备应用数据存储、持久化管理以及UIAbility..."
    }
  ]
}

Note: search results carry no title or uri. Pick relevant entries by reading the content snippet and the slug inside parent.

Note (direct JSON-RPC callers): although inputSchema declares the request wrapped under SearchDocumentsReq, the gateway actually requires flat arguments - {"query": "..."} at the top level of arguments. A nested payload reaches the gateway as a blank query and fails with code 99900001 (verified). MCP clients handle this wrapping internally; only raw tools/call requests need care. Note (WorkBuddy clients, verified 2026-09-09): WorkBuddy 的延迟加载 MCP 工具(mcp__harmonyos_developer_knowledge__searchDocuments / getDocumentsById)把嵌套 wrapper 暴露为真实参数 schema —— 必须按 {"SearchDocumentsReq": {"query": "..."}} / {"GetDocumentsByIdRequest": {"names": [...]}} 嵌套结构传参,平铺的顶层参数会被参数校验直接拒绝。调用前以 ToolSearch 返回的 schema 为准。

getDocumentsById

Fetches complete documents by identifier. One call retrieves one document or up to 10.

Input parameters:

ParameterTypeRequiredDescription
GetDocumentsByIdRequest.namesstring[]Yes文档唯一标识列表 - each entry must be a parent value returned by searchDocuments. Maximum 10 entries per call; batch further calls if needed.

Success response:

FieldTypeDescription
code / messageinteger / stringSame meaning as above
resultList[].namestringEchoes the requested identifier
resultList[].titlestringDocument title (Chinese)
resultList[].uristringCanonical page URL on developer.huawei.com
resultList[].contentstringComplete document body in Markdown

Notes:

  • The identifier mirrors the portal URL: for https://developer.huawei.com/consumer/{lang}/doc/{catalog}/{slug} the equivalent identifier is document/{lang}/{catalog}/{slug} (e.g. URL path harmonyos-guides/arkts-state-management-overview → document/cn/harmonyos-guides/arkts-state-management-overview; verified on guides/references pages). This mapping is handy when the user pastes a portal link and only the body text is needed - otherwise always prefer identifiers from searchDocuments.
  • Bare slugs identify the latest version. Historical-version pages (-V5 suffix etc.) are not targeted through this tool; use the local script path for those.
  • Inline images appear as reference links inside content rather than directly viewable URLs; open the page via uri when the figure itself matters.

Calling conventions

Apply these rules to every MCP call, in order:

  1. Local skills first - before any online fetch, confirm the local offline docs listed above do not already answer the question.
  2. Search before you fetch - always run searchDocuments first; only escalate to getDocumentsById when the fragments cannot answer the question. This is the two-step flow prescribed by the official doc.
  3. Never fabricate identifiers - every names[] entry must be copied from a previous searchDocuments result. Do not guess slugs, reuse remembered IDs across sessions without re-searching, or assemble them from URLs unless applying the verified URL→identifier mapping above.
  4. Respect the batch limit - max 10 identifiers per getDocumentsById call; split into multiple calls beyond that.
  5. Fetch selectively - request full content only for entries whose snippet is relevant to the question, not the entire result list.
  6. Write queries well - the corpus is Chinese-first: prefer Chinese feature terms (「状态管理」,「转场动画」) or exact API/decorator names (@ObservedV2, LazyForEach). If a query returns nothing relevant, retry with different keywords or a narrower phrase instead of giving up.
  7. Mind versions - identifiers without a version suffix resolve to the latest published docs (sync delay <= 30 min). For a specific historical version, fall back to the local script with its -V5-style slug.
  8. Quote sources - when answering with fetched content, cite the page URL built from the result's uri (or document/... identifier) so the user can verify against the official site.

Errors

Gateway errors surface as {"code": 99900001, "message": "..."} in the structured response (structuredContent, mirrored as JSON text inside content[0].text). Verified cases:

MessageCauseFix
query:query cannot be blank;query missing or empty; or (raw calls only) arguments nested under SearchDocumentsReq so the gateway never sees the fieldSend flat arguments and ensure a non-empty query
names:names cannot be empty;names:names cannot be null;names missing, null, an empty array, or containing empty stringsPass a non-empty array of identifiers taken from searchDocuments results
-32700 Parse error (JSON-RPC level)Request body is not valid JSON - typically Chinese characters mangled to GBK when pasted into a Windows shellWrite the payload to a UTF-8 .json file and use curl --data @file.json

API Reference

Catalog Tree API (no auth required)

POST https://developer.huawei.com/consumer/cn/documentPortal/getCatalogTree
Content-Type: application/json

{
  "catalogName": "harmonyos-guides",
  "language": "cn",
  "showHide": 0
}

Parameters:

  • catalogName: catalog identifier (see catalog reference)
  • language: "cn" | "en" | "ru"
  • showHide: 0 (show all) | 1 (show hidden) | 2 (hide)

Returns a tree where each node has:

  • nodeId: unique identifier
  • nodeName: display title (Chinese)
  • relateDocument: the slug used as objectId (leaf nodes only)
  • isLeaf: whether it's a document page
  • children: child nodes

Document Content API (no auth required)

POST https://developer.huawei.com/consumer/cn/documentPortal/getDocumentById
Content-Type: application/json

{
  "language": "cn",
  "objectId": "arkts-state-management-overview"
}

Returns:

  • value.docId: internal ID
  • value.title: document title
  • value.version: document version (e.g., V85, V219)
  • value.content.content: full HTML content
  • value.anchorList: heading anchors with hierarchy
  • value.businessName: product name (HarmonyOS)

objectId rules:

  • Use the bare slug (no version suffix) for the latest version
  • Append -V5 for the HarmonyOS NEXT DP1 version specifically
  • Both forms work; prefer bare slug unless user asks for a specific version

Search (requires auth — use WebSearch instead)

The official search API requires login tokens. Always use WebSearch with site filter:

site:developer.huawei.com/consumer/cn/doc/ ArkTS Navigation

Catalog Quick Reference

Primary catalogs for HarmonyOS app development:

CatalogContent
harmonyos-guidesMain development guides (ArkTS, ArkUI, Kits)
harmonyos-referencesAPI reference docs
harmonyos-faqsFAQ collection
harmonyos-releasesRelease notes
design-guidesUI/UX design guidelines
best-practicesBest practices and patterns
architecture-guidesSystem architecture docs

For full catalog list and doc tree structure, see doc-structure.md.

URL Parsing Examples

URLobjectId
.../doc/harmonyos-guides-V5/arkts-state-management-overview-V5arkts-state-management-overview
.../doc/harmonyos-references-V5/js-apis-display-V5js-apis-display
.../doc/best-practices/bpta-smart-reachbpta-smart-reach

Error Handling

  • "document not found" → objectId slug is wrong; try browsing the catalog tree
  • "主仓不存在" → the center API catalog doesn't exist; use the standard API
  • Empty response → network issue or rate limiting; retry after a short wait Garbled Chinese text or UnicodeEncodeError → Windows terminal uses GBK encoding by default; the script includes an automatic UTF-8 fix in main(). If it still fails, use the import mode described in Windows Environment Notes.

Pitfalls

  • The documentation site is an Angular SPA - direct WebFetch on page URLs returns empty shells. Always use the MCP tools or the REST API endpoints, never try to scrape the HTML page directly.
  • MCP tool names are client-specific: the prefix differs across clients (e.g. mcp__harmonyos_developer_knowledge__searchDocuments in ZCode). Call the tool by whatever name the client actually exposes.
  • getDocumentsById accepts at most 10 document identifiers per call; batch the calls if more are needed.
  • The parent field returned by MCP searchDocuments is the document's unique identifier - pass it directly as the names array element to getDocumentsById.
  • searchDocuments results carry only parent and content - no title/URI. Estimate relevance from the fragment text and the slug inside parent; titles arrive only from getDocumentsById.
  • For raw JSON-RPC tools/call requests against the MCP endpoint, send flat arguments (e.g. {"query": "..."} / {"names": [...]}). Despite inputSchema showing nested request wrappers (SearchDocumentsReq, GetDocumentsByIdRequest), a nested payload reaches the gateway as a blank parameter (99900001).
  • Search APIs (REST) require authentication cookies. Use WebSearch with site: filter, or the MCP searchDocuments tool, as the search alternative.
  • Image URLs in document content are CDN-hosted with time-limited signatures; they expire after 24 hours.
  • The -V5 suffix on catalog names and document slugs refers to a specific version; the bare name fetches the latest version.

Windows Environment Notes

Windows terminals default to GBK encoding (CP936). Running fetch_doc.py directly may produce garbled Chinese output or throw a UnicodeEncodeError when encountering special Unicode characters (e.g., U+200C zero-width non-joiner). The script includes an automatic fix via sys.stdout.reconfigure(encoding='utf-8') in main(), but if issues persist (e.g., in certain terminal emulators or piped environments), use the Python import mode:

import sys, os
sys.path.insert(0, r'<skill-dir>/scripts')
from fetch_doc import fetch_document, html_to_markdown

result = fetch_document('some-doc-slug')
value = result.get('value', {})
title = value.get('title', 'Untitled')
html = value.get('content', {}).get('content', '')
md = html_to_markdown(html)

with open('output.md', 'w', encoding='utf-8') as f:
    f.write(f'# {title}\n\n{md}')

This bypasses terminal encoding issues by writing directly to a UTF-8 file, making it the most reliable approach on Windows. This mode is also recommended for batch-fetching multiple documents.

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.