huaweicloud/huaweicloud-skills/huawei-cloud-cdn-abnormal-status-code-analysis
Claude Code and agent skill by huaweicloud/huaweicloud-skills
- community
Checking that the SKILL.md file is still in the repository.
Diagnose CDN business abnormal HTTP status codes (4xx/5xx) using hcloud CLI. Discover and quantify 4xx/5xx volume, localize the exact status code and time window, fork edge-generated vs origin-generated via back-to-source status statistics, correlate top-N distribution, narrow root cause on CDN edge config or origin side, and取证 per-request access logs. Use this skill when the user wants to: (1) diagnose CDN abnormal 4xx/5xx status codes, (2) root-cause a 403/404/5xx spike on a CDN domain, (3) tell whether abnormal codes are generated by the CDN edge or returned by the origin, (4) troubleshoot CDN business exception status codes during daily inspection or incidents. Triggers include: 状态码异常, 业务异常码, 4xx, 5xx, 403, 404, 502, 503, 504, status code, abnormal status, CDN异常, 边缘/回源, 限流, status code analysis, edge vs origin
Install
npx vskill@latest install huaweicloud/huaweicloud-skills/huawei-cloud-cdn-abnormal-status-code-analysisSKILL.md
The same SKILL.md was published earlier as huaweicloud/huaweicloud-skills/huawei-cloud-cdn-abnormal-status-code-analysis.
CDN Abnormal Status Code Analysis
Overview
This skill diagnoses abnormal HTTP status codes (4xx / 5xx) on a Huawei Cloud CDN accelerated domain. It is read-only end to end: every action is a query (GET statistics / GET config / GET log-download-link / read-only log fetch). It answers four questions for any 4xx/5xx anomaly:
- Is there an anomaly, and how big? — quantify 4xx/5xx volume and ratio over a window.
- Which exact code, when, edge or origin? — drill to the specific code + time bucket, and fork edge-generated vs origin-generated via the back-to-source (
bs_*) status statistics. - Who / where / what path? — top IPs/paths/UA/referer, client IP count (刷量 vs real users).
- Root cause + forensics? — narrow to edge-config rules or origin-side issues, then pin the exact requests via access logs.
Key Features:
- Edge-vs-origin fork driven by one command (
bs_status_code_*):result={}⇒ edge-generated; non-empty ⇒ origin-generated. - Covers the full 4xx/5xx set: 400/401/403/404/405/406/408/410/412/416/429/499/495/496/500/501/502/503/504/505/530….
- Read-only log helper
scripts/fetch_cdn_log.pydownloads + decompresses a CDN log and extracts the abnormal-status rows as JSON. - Structured diagnosis report with a status-code → root-cause decision tree and console/工单 remediation boundary (no CLI write ops).
Tools: hcloud CLI (KooCLI) + Python log helper (scripts/fetch_cdn_log.py). Core Principle: Read-only diagnosis; no configuration changes.
Triggers
Use when the user input matches any of the following (user-phrase level, bilingual):
| Language | Trigger examples (user phrasing) | |
|---|---|---|
| 中文 | 「CDN 域名 403 突然变多,帮我查一下」「为什么最近一直 502」「4xx/5xx 状态码异常分析」「这个问题是边缘还是回源?帮忙区分一下」「业务异常码排查」「CDN 限流/封禁排查」「状态码异常」 | |
| English | "403 spike on my CDN domain" / "root-cause a 5xx burst" / "status code analysis" / "is this edge or origin?" / "abnormal status codes during daily inspection" |
Keyword triggers (also in the frontmatter description): 状态码异常, 业务异常码, 4xx, 5xx, 403, 404, 502, 503, 504, status code, abnormal status, CDN异常, 边缘/回源, 限流, status code analysis, edge vs origin.
Near-miss / Do NOT use
Do NOT use this skill when:
| Scenario | What to do instead | |
|---|---|---|
| The domain is not onboarded to Huawei Cloud CDN | Confirm CDN onboarding / domain existence first; non-CDN HTTP issues are out of scope | |
| The user wants to change CDN config / refresh / preheat / ban URLs / enable-disable domains | Refuse — this skill is read-only; guide to the CDN console or manual hcloud CLI (see Prohibited Operations) | |
| Pure bandwidth / traffic analysis with no status-code focus | Not this skill's scope (no 4xx/5xx anomaly to explain) | |
| User pastes AK/SK or asks to configure credentials in chat | Refuse — see Authentication; emit the secure setup template and wait | |
| Non-CDN business exceptions (ECS / ELB / OBS / application-layer issues unrelated to CDN semantics) | Redirect to the relevant service skill |
⛔ Prohibited Operations (Security Constraints)
This skill strictly prohibits all non-GET (write/modify/delete) CDN operations, even if requested by the user.
Total: 55 prohibited operations (24 POST + 25 PUT + 6 DELETE).
For the complete list of all 55 prohibited non-GET operations with risk descriptions, see references/prohibited-operations.md.
Representative prohibited operations (full list in the reference doc):
| Prohibited Operation | Example CLI | Reason | |
|---|---|---|---|
| ❌ Create domain | CreateDomain (v1/v2), CreateDomainByDuplicate | Write op, creates production resource | |
| ❌ Delete domain | DeleteDomain (v1/v2) | Irreversible | |
| ❌ Modify domain config | hcloud CDN UpdateDomainFullConfig / UpdateBlackWhiteList / UpdateRefer / UpdateResponseHeader / UpdateOriginHost / UpdateCacheRules / UpdateHttpsInfo | Write op, affects production traffic | |
| ❌ Enable / disable domain | EnableDomain (v1/v2), DisableDomain (v1/v2) | Write op, affects production traffic | |
| ❌ Refresh / preheat | hcloud CDN CreateRefreshTasks / CreatePreheatingTasks | Write op, changes cache | |
| ❌ Modify billing mode | SetChargeModes | Financial impact | |
| ❌ Verify domain owner | hcloud CDN VerifyDomainOwner | Write op | |
| ❌ Set stats config / export open | SetStatsConfig / ExportStatsOpen | Write op |
If the user requests a prohibited operation, refuse and inform:"Per security constraints, this skill performs read-only diagnosis only and does not run any write/delete operations.To change CDN configuration, use the Huawei Cloud CDN console or run the relevant hcloud command manually — this skill will not execute it.The complete list of 55 prohibited operations is documented in references/prohibited-operations.md."
Architecture
API Call Budget
| Step | API / Script | Rate Limit | Est. Time | |
|---|---|---|---|---|
| 1 | hcloud CDN ListDomains/v2 --cli-region={region} | — | <2s | |
| 2 | hcloud CDN ShowDomainStats/v2 --cli-region={region} (summary + detail + bs) | 5/s | <3s | |
| 3 | Top-N family + ListDomainClientStats | 2-5/s | <5s | |
| 4 | hcloud CDN ShowDomainFullConfig/v2 --cli-region={region} + Show* config | — | <5s | |
| 5 | hcloud CDN ShowLogs/v2 --cli-region={region} + python scripts/fetch_cdn_log.py | — | ≤ 30s |
Total estimated time: < 45 seconds (log-heavy window may be longer).
KooCLI Command Format Standard
- Service name:
CDN(uppercase). Operation name: PascalCase (e.g.,ShowDomainStats/v2). - Region parameter:
--cli-region=<region>. CDN supportscn-north-1(Beijing) andap-southeast-1(Singapore); results are region-independent.
Recommended: `cn-north-1` uniformly. (cn-north-4 is NOT supported by CDN.)
- Parameter format:
--key=value(equals sign, no spaces). Space-separated form is unsupported. - Output: append
--cli-output=jsonfor machine parsing.
Prerequisites
Pre-check: hcloud (KooCLI) >= 3.2.0 —hcloud version. If missing, see references/cli-installation-guide.md.
Pre-check: Python >= 3.8 —python --version. Required byscripts/fetch_cdn_log.py.
Pre-check: Python `requests >= 2.25` —python -c "import requests; print('ok')". The log helper downloads viarequests.Install if missing:pip install requests>=2.25
Pre-check: hcloud credentials —hcloud configure list. If invalid, stop and guide secure configuration. Never read/echo/print AK/SK; never ask the user to paste AK/SK in chat.
⚠️ hcloud parameter format: all params must use--key=value.
⚠️ CDN region: usecn-north-1uniformly (CDN does not supportcn-north-4).
⚠️ Time / interval rules: time = ms timestamp,[start,end)left-closed right-open;interval=300(≤2d, 5-min points) /3600(≤7d, hour points) /86400(≤31d, CST 0:00 points).status_code_*(edge) andbs_status_code_*(origin) cannot be mixed in one query.
Authentication
- Prohibited: reading/echoing/printing AK/SK; asking users to input AK/SK in chat;
hcloud configure setwith plaintext; accepting AK/SK pasted by the user. - Allowed: read credentials from environment variables or the active CLI profile only.
- If the user pastes AK/SK, stop, refuse, and emit the secure setup template (
export HUAWEICLOUD_SDK_AK=.../HUAWEICLOUD_SDK_SK=...), then wait. - Verify:
hcloud configure list— confirm a valid profile exists; if not, stop.
IAM Permission Policies
See references/iam-policies.md. Minimum: cdn:*:query* (plus cdn:configuration:queryDomains) and cdn:log:* for log forensics. This skill is strictly read-only: no create / update / delete / refresh / ban permission is required or included.
Core Commands
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/edge/cdn/huawei-cloud-cdn-abnormal-status-code-analysis/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/huaweicloud/huaweicloud-skills/huawei-cloud-cdn-abnormal-status-code-analysis)