Community编程与开发github.com

getedgehq/http-error-triage

在针对第三方API的HTTP错误下结论前运行此技能。它能够将真实的凭证/授权问题与CDN或WAF拦截、错误的端点或客户端签名封禁区分开。当API返回401/403/402/429错误,而您正准备说“密钥失效”、“积分耗尽”、“套餐无权限”或“我们被限速”时,请使用此技能。

http-error-triage 是什么?

此技能提供了一套系统性的HTTP错误排查方法,旨在防止开发者在分析第三方API返回的错误(如401、403、402、429)时做出误导性结论。它源于一次真实事件:一个403错误被误认为是密钥权限不足,导致团队构建了756行的浏览器自动化变通方案,而实际原因是User-Agent缺失导致CDN封禁。技能包括三个核心检查:无效凭证控制测试(区分凭证问题与非凭证问题)、无意义路径控制测试(判断错误来自原始服务器还是边缘层)、响应头读取(识别Cloudflare、AWS WAF等基础设施标头)。它还提供了常见错误签名映射表、推荐默认请求头(防止WAF误杀)以及成本计算指导。支持所有使用HTTP请求的第三方API集成场景,尤其适用于AI Agent工具(如Claude Code、Cursor)或任何需要通过用户侧代码消费第三方API的开发环境。

兼容平台~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",
}

然后在进行任何全面操作之前先测量成本

一旦它正常工作,不要估算花费。在单次调用前后分别读取使用量,并读取提供商的账单字段(位于响应体中)。

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

相关技能