Community程式設計與開發github.com

getedgehq/http-error-triage

在對第三方API的HTTP錯誤下結論之前先執行此技能。它能區分真正的憑證/權限問題與CDN或WAF封鎖、錯誤端點或客戶端簽名禁令。每當API返回401/403/402/429,且您正準備說「金鑰失效」、「額度用盡」、「方案無權限」或「被限速」時,請使用此技能。

http-error-triage 是什麼?

此技能幫助開發者與AI代理系統性地排除HTTP錯誤,避免因誤解狀態碼而導致錯誤的診斷與昂貴的權宜之計。它基於真實事件開發:一個第三方API連續六天返回403,被誤判為金鑰問題,促使建立一個756行的瀏覽器自動化解決方案,但實際原因只是缺少`User-Agent`標頭,被CDN阻擋。 技能提供三個關鍵控制項:1) 無效憑證控制:使用真實、垃圾與空憑證發送相同請求,若結果相同則錯誤與憑證無關;2) 無意義路徑控制:請求不存在路徑與網站根目錄,若API錯誤也來自行銷網站,則表示在原點之前被阻擋;3) 檢查回應標頭:如`server: cloudflare`或`cf-ray`表示基礎設施層阻擋,而非API。 技能還包含已知簽名表(如403加`error code: 1010`與cloudflare標頭表示客戶端簽名禁令)、預設標頭建議(使用真實瀏覽器User-Agent避免WAF阻擋),以及成本測量方法(呼叫前後讀取使用量與計費字段)。支援所有使用HTTP API的平台,如Claude Code、Cursor、Codex等自主代理。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/getedgehq/skills/tree/main/http-error-triage

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

HTTP 錯誤排查

HTTP 錯誤告訴你請求失敗,但通常不告訴你原因。從 403 就推斷「金鑰失效」只是一個披著數字的猜測。

源於真實事件(2026-07-30):一個第三方聯絡人資料豐富化 API 連續六天對每個呼叫返回 403 error code: 1010。這被解讀為「金鑰無權限」、「額度用盡」、「每月配額已達」。基於這個信念,建立了一個 756 行的瀏覽器自動化解決方案,並差點要求客戶檢查實際上正常的方案。真正原因是缺少 User-Agent,因此 CDN 在邊緣封鎖了客戶端。加上一個標頭就解決了:200 OK,完整資料,且信用額度一直都在。

在診斷前先執行這三個控制項

1. 無效憑證控制。 使用刻意偽造的憑證,以及完全沒有憑證,發送相同的請求。

for label, key in [("real", REAL_KEY), ("garbage", "0"*36), ("empty", "")]:
    ...  # 相同URL、相同方法、相同標頭

如果三者返回相同的狀態碼和內容,則錯誤與你的憑證無關。它對權限、配額或有效性不提供任何資訊。停止推理關於金鑰的問題。

2. 無意義路徑控制。 請求一個肯定不存在的路徑,以及網站根目錄。

GET https://api.example.com/definitely-not-a-real-path-12345
GET https://api.example.com/
GET https://www.example.com/          # 他們的行銷網站

如果 API 錯誤也從行銷網站返回,則你被阻擋在原點之前。API 呼叫的相關內容無法幫助解決問題。

3. 讀取回應標頭,而不僅是內容。

except urllib.error.HTTPError as e:
    print(e.code, e.headers.get("server"), e.read()[:200])

server: cloudflare 出現在「驗證」錯誤上就是一個明顯跡象。cf-ray、x-amzn-waf、akamai 也是。這些是基礎設施,不是 API。

已知特徵

症狀真實原因修正方法
403 + 內容 error code: 1010、server: cloudflareCloudflare 封鎖了客戶端簽名發送真實瀏覽器的 User-Agent
相同錯誤出現在所有路徑(包括 /)邊緣/WAF 封鎖或 IP 封鎖更換 UA,然後更換 IP/代理
402真正用完額度:請求已通過驗證充值;金鑰沒問題
成功後立即出現 429真正的速率限制調整請求間隔,添加退避策略
帶有字段訊息的 400你已到達 API 且驗證通過修正酬載;這是好消息

400 驗證錯誤對於排查來說是成功信號:它證明驗證已被接受。

任何伺服器端 API 呼叫的預設標頭

Python 的 urllib 發送 User-Agent: Python-urllib/3.x,許多 WAF 會直接封鎖它。務必設定:

headers = {
    "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) "
                  "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0 Safari/537.36",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

在進行大量呼叫前先量測成本

當 API 開始正常運作後,不要估算花費。在呼叫前後讀取使用量,並讀取提供者自己回應中的計費字段。

before = usage(); result = call(); after = usage()
print("charged:", result.get("billing"), "| measured:", before - after)

如何回報

說明你測試了什麼以及還有什麼未知。「兩個金鑰都返回 403」如果空白金鑰也返回相同的 403,就不是一個發現。應該這樣說:「這裡的 403 不具資訊價值,空憑證也會返回它;原因在驗證之前。」

Individual skills in this repo

This repo contains 18 individual skills — each has its own dedicated page.

getedgehq/agent-evals

Build evals for an AI agent that already does real work. Use when someone asks "how do I know my agent is right", wants to test an agent before trusting it, compare models on cost versus quality, or turn production failures into tests. Walks from first tasks and yes/no verifiers, to isolated environments, to a trace-driven improvement loop.

getedgehq/cli-ux-review

Audit a command-line tool for user-friendliness — clear situation / next-step / options in every output, colour-highlighted runnable commands, no raw jargon, no silent hangs. Invoke for "CLI UX audit", "review my CLI", "is this CLI intuitive", or before any CLI release.

getedgehq/generate-image

Generate images with OpenAI GPT Image 2 via the Codex CLI, billed through the user's ChatGPT Plus subscription (no OpenAI API key, no per-image API cost). Use when the user asks to create, generate, or make an image, picture, illustration, icon, hero graphic, or concept art from a text prompt.

getedgehq/harness-first

Diagnose and fix an unreliable, expensive, or unsafe LLM agent by auditing its harness (golden set, judge, cost caps, data layer, action approvals, tracing) before blaming or swapping the model. Use when someone says an agent is "burning tokens", "hallucinating", "brittle", gives inconsistent answers, asks whether to switch to a cheaper/better model, or wants to ship an agent or prompt change to customers.

getedgehq/linkedin-media-prep

Convert, crop, resize, and compress images and videos for optimal LinkedIn upload quality and file size. Use when the user wants to prepare a photo, image, or video for LinkedIn (profile picture, cover photo, post image, article featured image, post video, or video ad), optimize file size for LinkedIn, crop and resize for LinkedIn dimensions, convert HEIC/RAW/PNG/MOV to LinkedIn-ready JPEG or MP4, or mentions LinkedIn media requirements, specs, or limits.

getedgehq/monid

>-

getedgehq/opendraft

An 18-agent pipeline that turns one topic line into a drafted

getedgehq/people-search

Find and rank professional people for recruiting, partnerships, sales, or research from user-provided data, public web sources, an authenticated search session, or a connected provider. Use for people discovery, LinkedIn or Sales Navigator search design, profile-list ranking, or provider filter translation.

getedgehq/rocketlist

Turn a CV into a shortlist of live startup roles from Rocketlist's public job board, including adjacent job titles the person would never have searched for, each with its published salary, the evidence for the fit, and a direct apply link. Use for "find roles I would be a strong fit for", career pivots, remote or VC-backed job hunts, and salary-visible role discovery.

getedgehq/security-audit-checklist

Run a comprehensive security audit across application code, cloud infrastructure, containers, CI/CD pipelines, and infrastructure-as-code. Covers privacy compliance, OWASP basics, secret leakage, API security, IAM misconfigurations, storage exposure, Kubernetes hardening, and network security. Use when the user asks to audit, review, or harden app or cloud security, check for secrets, scan for XSS/SQLi, verify security headers, review Terraform/CloudFormation, audit AWS/GCP/Azure configs, or perform any security-focused review.

getedgehq/shadcn-first

>-

getedgehq/skills

Develop or review a branded long-form YouTube channel using Simon Kaiser's public creator-led approach: audience fit, recurring formats, natural brand integration, Time with Brand, and an organic, paid, and Shorts strategy. Use for channel strategy, format briefs, and pilots.

getedgehq/skills

Build a YouTube strategy, evidence-backed idea slate, and title plus thumbnail package using Paddy Galloway's public method. Use when planning a channel, choosing concepts, or preparing a video before filming.

getedgehq/skills

Build or review a buyer-centered strategic narrative using Andy Raskin's public method. Use for sales or investor deck stories, homepage positioning, keynotes, launch narratives, and why-now messaging.

getedgehq/skills

Turn a product URL, launch brief, or approved script into a production-ready launch video. Use for product reveals, feature announcements, SaaS launches, and narrated product films; not for generic explainers or editing existing footage.

getedgehq/strip-image-ai-metadata

Strip C2PA and AI-generation metadata from images (PNG, JPEG, WebP) to remove "Generated by AI" / "ChatGPT" / "DALL-E" labels that platforms like LinkedIn, Instagram, and X display. Use when the user wants to clean AI-generated images before posting, remove AI attribution from photos, strip C2PA manifests, sanitize image metadata for professional use, or verify whether an image contains C2PA data.

getedgehq/top-down-comms

>-

getedgehq/workplan

Create, update, or close work plans for multi-step tasks. Use when starting refactors, bug lists, feature work, migrations, or any task with 2+ steps. Also use after auto-compaction to re-orient. Triggers: "workplan", "work plan", "create a plan", "what's the plan", "where was I", or when Claude detects

相關技能