SuperAPI AI Directory

harmonyos-official-docs

Writing & research

View repository

Updated 10-16 05:48

About this skill

HarmonyOS official documentation API retrieval

The documentation site is an Angular SPA, and the page HTML does not contain the body text. ProxyDo not preset any URL, you must search and locate the documentation yourself through the API. For technical details, see reference.md。

Workflow

1. Analyze the question

Extract from the user's question:Keywords、Content type(concepts/steps → guides, interfaces/components → API references, version changes → release notes).

2. Select a catalog

Content type catalogName
Development guides, scenario guides harmonyos-guides
API / component / Kit interfaces harmonyos-references
Version additions and changes harmonyos-releases

When uncertain, query in parallel harmonyos-guides and harmonyos-references。

3. Get the directory tree

For the selected catalog, call getCatalogTree(catalogName and objectId are both set to the catalog root name), see reference.md § getCatalogTree。

4. Search in the directory tree

Use search_nodes to match nodes by keyword against their nodeName and relateDocument, see reference.md § Directory tree search。

  • No match: switch catalog, split or loosen keywords and retry
  • Multiple matches: prefer those with higher title match; for conceptual questions prefer guides, for interface questions prefer references
  • Directory node hit(including children): first fetch the document of that node as an index, then continue searching or fetching its child nodes

5. Fetch the body text

For the target node's relateDocument call getDocumentById, use extract_html to parse content, see reference.md § getDocumentById。

  • content is empty: the node may be a pure directory, fetch its child nodes instead
  • Insufficient information: additionally fetch related sibling nodes or parent nodes

6. Answer

Attach the retrieved source links:{DOC}/{catalogName}/{relateDocument}。

When the user provides a documentation URL

According to reference.md § URL resolution extract catalogName and slug, then skip to step 5.

Proxy constraints

  • Forbiddento use WebFetch or directly curl HTML for documentation page URLs
  • On 403/429 follow reference.md § Error handling to slow down and retry
  • The interface is not officially public; if it cannot be confirmed, inform the user