http-status-codes
Use when choosing, reviewing, or explaining HTTP response codes — in an API, OpenAPI spec, controller, middleware, or client retry logic. Triggers on: "which status code", "400 vs 422", "401 vs 403", "429 vs 503", "409 vs 412", "201 vs 202 vs 204", "303 vs 307 vs 308", or when a handler's status code looks wrong.
- License 许可
- Unlicense
- 最近更新
- 2026-10-28
- Stars
- ★ 4
- Forks
- 0
01 前言 Front Matter
- name
- http-status-codes
- description
- Use when choosing, reviewing, or explaining HTTP response codes — in an API, OpenAPI spec, controller, middleware, or client retry logic. Triggers on: "which status code", "400 vs 422", "401 vs 403", "429 vs 503", "409 vs 412", "201 vs 202 vs 204", "303 vs 307 vs 308", or when a handler's status code looks wrong.
02 资源文件 8
- 参考文档evals/evals.json6.2 KB
- 参考文档evals/trigger-evals.json3.4 KB
- 参考文档references/client-errors.md7.0 KB
- 参考文档references/decision-rules.md9.6 KB
- 参考文档references/rare-and-nonstandard.md5.4 KB
- 参考文档references/REFERENCE.md1.9 KB
- 参考文档references/server-errors.md5.0 KB
- 参考文档references/success-redirects.md5.6 KB
03 SKILL.md 正文
HTTP Status Codes Reference
Use this skill for standards-based HTTP status code selection in API and client design. It exists to stop the lazy pattern where every client mistake becomes 400 and every temporary outage becomes 500. Read only the smallest reference file needed for the task.
Critical Rules
- Prefer the most specific standard code -
400is a fallback, not the default for every client-side failure. - Separate authentication from authorization -
401means missing or invalid credentials and should challenge the client;403means the client is known but not allowed. - Separate malformed from semantically invalid -
400covers malformed syntax/framing;422covers well-formed content that fails validation or instructions. - Use conflict and precondition codes intentionally -
409,412, and428are not interchangeable. - Return the headers that make the code complete -
401needsWWW-Authenticate,405needsAllow, redirects needLocation, andRetry-Afteris strongly recommended for429or503when you know the wait. - Do not lie with
202-202 Acceptedmeans the work is not finished yet. - Do not hide media-type problems inside
400- unsupported request formats often belong in415. - Treat
429and503as different signals - one tells a specific client to slow down; the other says the service is temporarily unavailable. - Keep compatibility explicit - if an existing public API intentionally keeps broader historical codes, call out the deviation instead of pretending it is ideal HTTP semantics.
- Do not design public APIs around vendor/private codes - keep nginx, Cloudflare, IIS, Laravel, and similar private codes out of the core contract.
Reference Map
| File | Domain | Use when you need |
|---|---|---|
decision-rules.md |
High-value choices | Fast answers for confused pairs/triples and a selection rubric |
success-redirects.md |
2xx + 3xx | Creation, async processing, no-content responses, cache-aware responses, redirects, HEAD |
client-errors.md |
4xx | Auth, permissions, validation, conflicts, media type, throttling, operational client errors |
server-errors.md |
5xx | Internal failures, upstream failures, temporary outages, retry behavior, mid-stream failures |
rare-and-nonstandard.md |
Appendix | Rare standards, WebDAV-heavy codes, deprecated or unused codes, vendor/private warnings |
REFERENCE.md |
Index | Cross-file routing for mixed or unclear tasks |
Task Routing
- Choosing between two or three plausible codes ->
references/decision-rules.md - Designing POST, PUT, PATCH, or DELETE success responses ->
references/success-redirects.md - Reviewing auth, validation, or client-error handling ->
references/client-errors.md - Reviewing retry policies, gateway failures, or maintenance behavior ->
references/server-errors.md - Interpreting obscure codes from logs or third-party docs ->
references/rare-and-nonstandard.md - Unsure where to start ->
references/REFERENCE.md
When Not To Use This Skill
- Framework-specific exception wiring - This skill decides what the response should mean; pair it with the relevant stack skill to implement that meaning in middleware or handlers.
- Project-specific compatibility decisions - Whether an existing API may break its historical contract is a project call, not an HTTP-semantics call (Rule 9 only requires naming the deviation).
04 同仓库更多 Skills
wizard
Generate an interactive bash wizard that walks a human through a manual procedure — third-party setup, credential provisioning, a one-off migration — opening URLs, capturing values, confirming each step, and writing .env files and CI secrets (GitHub and Gitea/Forgejo Actions).
restore-test-pyramid
Analyze the project's E2E suite and push every assertion that doesn't need a real browser down to a faster integration or unit test, proving each migration honest before thinning E2E.
ponytail-debt
Harvest SHORTCUT markers from the codebase and report them grouped by file, flagging any missing upgrade paths.
humanify
Repair an inherited or human-blocked ticket for agent implementation, or finish its explicit human-only outcome.
fix-pr
Repair an existing pull request's review findings and target-branch conflicts, verify the result, and update the same open PR.
feature-milestones
Reconstruct a fragmented backlog as finishable feature milestones with explicit delivery boundaries and an approval-gated tracker update.