huaweicloud/huaweicloud-skills/huawei-cloud-cdn-abnormal-status-code-analysis

Claude Code and agent skill by huaweicloud/huaweicloud-skills

Trust tier 3
  • community
Source check pending

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-analysis

SKILL.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:

  1. Is there an anomaly, and how big? — quantify 4xx/5xx volume and ratio over a window.
  2. 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.
  3. Who / where / what path? — top IPs/paths/UA/referer, client IP count (刷量 vs real users).
  4. 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.py downloads + 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):

LanguageTrigger 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:

ScenarioWhat to do instead
The domain is not onboarded to Huawei Cloud CDNConfirm 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 domainsRefuse — 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 focusNot this skill's scope (no 4xx/5xx anomaly to explain)
User pastes AK/SK or asks to configure credentials in chatRefuse — 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 OperationExample CLIReason
❌ Create domainCreateDomain (v1/v2), CreateDomainByDuplicateWrite op, creates production resource
❌ Delete domainDeleteDomain (v1/v2)Irreversible
❌ Modify domain confighcloud CDN UpdateDomainFullConfig / UpdateBlackWhiteList / UpdateRefer / UpdateResponseHeader / UpdateOriginHost / UpdateCacheRules / UpdateHttpsInfoWrite op, affects production traffic
❌ Enable / disable domainEnableDomain (v1/v2), DisableDomain (v1/v2)Write op, affects production traffic
❌ Refresh / preheathcloud CDN CreateRefreshTasks / CreatePreheatingTasksWrite op, changes cache
❌ Modify billing modeSetChargeModesFinancial impact
❌ Verify domain ownerhcloud CDN VerifyDomainOwnerWrite op
❌ Set stats config / export openSetStatsConfig / ExportStatsOpenWrite 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

CDN Abnormal Status Code Analysis (read-only)
├── ListDomains/v2 (target domain → domain_id)
├── ShowDomainStats/v2
│ ├── summary http_code_2xx..5xx + req_num → quantify 4xx/5xx volume + ratio
│ └── detail status_code_4xx/5xx → exact code + time array
├── ShowDomainStats/v2 bs_status_code_4xx/5xx → ★ edge vs origin fork ★
├── ShowBandwidthCalc / ListDomainClientStats → traffic-spike / 刷量 correlation
├── Top-N family → who / where / what path
├── Root cause fork
│ ├── origin side: ShowOriginHost / ShowDomainDetail / ShowHistoryTasks / TopOriginUrl
│ └── edge side: ShowDomainFullConfig / ShowRefer / ShowBlackWhiteList /
│ ListRuleDetails / ListBanUrl / ListAccessControlTask /
│ ShowResponseHeader / ShowCertificatesHttpsInfo
├── ShowLogs/v2 + python scripts/fetch_cdn_log.py → per-request forensics (JSON)
├── ShowIpInfo/v2 → client/edge IP attribution
└── generate diagnosis report
API Call Budget
StepAPI / ScriptRate LimitEst. Time
1hcloud CDN ListDomains/v2 --cli-region={region}—<2s
2hcloud CDN ShowDomainStats/v2 --cli-region={region} (summary + detail + bs)5/s<3s
3Top-N family + ListDomainClientStats2-5/s<5s
4hcloud CDN ShowDomainFullConfig/v2 --cli-region={region} + Show* config—<5s
5hcloud 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

bash
hcloud CDN <Operation> --cli-region=<region> [--key=value ...]
  • Service name: CDN (uppercase). Operation name: PascalCase (e.g., ShowDomainStats/v2).
  • Region parameter: --cli-region=<region>. CDN supports cn-north-1 (Beijing) and ap-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=json for 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 by scripts/fetch_cdn_log.py.
Pre-check: Python `requests >= 2.25` — python -c "import requests; print('ok')". The log helper downloads via requests.
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: use cn-north-1 uniformly (CDN does not support cn-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) and bs_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 set with 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

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/huaweicloud/huaweicloud-skills/huawei-cloud-cdn-abnormal-status-code-analysis/badge)](https://verified-skill.com/skills/huaweicloud/huaweicloud-skills/huawei-cloud-cdn-abnormal-status-code-analysis)

Something wrong with this skill or its page? Tell us.