Agent Skills
› aresbit/MateBot
› hm-fetch-skill
hm-fetch-skill
GitHub通过华为HarmonyOS开发者文档API获取正文并转为Markdown,维护本地迁移参考文档。优先使用API抓取SPA渲染内容,支持单页或预设批量刷新,确保本地缓存充足后再回答问题。
Trigger Scenarios
需要获取华为HarmonyOS开发者文档正文
通用网页抓取器无法直接读取SPA渲染的华为文档
Install
npx skills add aresbit/MateBot --skill hm-fetch-skill -g -y
SKILL.md
Frontmatter
{
"name": "hm-fetch-skill",
"description": "Fetch Huawei HarmonyOS developer document正文 by calling documentPortal getDocumentById API with slug objectId, convert HTML content to Markdown, and maintain local-first migration references. Use when scraping Huawei HarmonyOS docs that are SPA-rendered and not directly readable by generic web fetchers."
}
HM Fetch Skill
Fetch HarmonyOS docs through API first, then fallback to generic fetch.
API-First Rule
Use API route first for正文:
- Endpoint:
https://svc-drcn.developer.huawei.com/community/servlet/consumer/cn/documentPortal/getDocumentById - Request body:
{"objectId":"<slug>","language":"cn"} - Important:
objectIdis the document slug, notdocId.
Scripts
- Single page by slug:
python3 scripts/fetch_huawei_doc_api.py --slug typescript-to-arkts-migration-guide --out /tmp/doc.md
- Preset migration pages:
python3 scripts/fetch_huawei_doc_api.py --preset migration --out-dir references/huawei-migration
- One-shot refresh (API first, fallback to fetch-skill):
bash scripts/fetch_huawei_migration_refs.sh
Local-First Workflow
- Refresh local cache by
bash scripts/fetch_huawei_migration_refs.sh. - Answer questions from
references/huawei-migration/*.md. - Only if local cache is insufficient, refetch specific slug by API script.
Outputs
references/huawei-migration/01-arkts-migration-background.mdreferences/huawei-migration/02-typescript-to-arkts-migration-guide.mdreferences/huawei-migration/03-arkts-more-cases.md
Version History
- 2328a17 Current 2026-08-20 10:31


