audit-api-endpoint
Use when reviewing one HTTP endpoint for production readiness — checks status, Content-Type, body shape, cache headers, and surfaces health-vs-ready confusion. Black-box runtime probe, works on any HTTP server regardless of language (Go, Node, Python, Rust, etc.). Trigger when the user names a single URL to audit, asks about /health or /ready quality, or wants a structured audit report for one endpoint.
- License 许可
- MIT
- 最近更新
- 2026-11-12
- Stars
- ★ 15
- Forks
- 13
01 前言 Front Matter
- name
- audit-api-endpoint
- agent
- Explore
- model
- opus-4-7
- effort
- xhigh
- context
- fork
- description
- Use when reviewing one HTTP endpoint for production readiness — checks status, Content-Type, body shape, cache headers, and surfaces health-vs-ready confusion. Black-box runtime probe, works on any HTTP server regardless of language (Go, Node, Python, Rust, etc.). Trigger when the user names a single URL to audit, asks about /health or /ready quality, or wants a structured audit report for one endpoint.
- allowed-tools
- Bash(uv run *), Bash(curl *), Read, Glob, Grep
- argument-hint
- [url]
- disable-model-invocation
- true
02 资源文件 3
- 参考文档README.md2.3 KB
- 脚本scripts/audit_endpoint.py8.5 KB
- 参考文档templates/audit-report.md1.1 KB
03 SKILL.md 正文
audit-api-endpoint
Goal: produce a structured audit of one HTTP endpoint and surface defects the engineer can fix in the same pass.
Workflow
Use this checklist literally. Mark each step done before moving to the next.
-
[ ] Step 1: Plan. Read
templates/audit-report.mdso you know the output shape. Runuv run ${CLAUDE_SKILL_DIR}/scripts/audit_endpoint.py --helpand confirm the flags exist. -
[ ] Step 2: Verify the URL is reachable. Run
curl -sf -m 5 -o /dev/null -w "%{http_code}\n" "$0" || echo "not reachable". Record the raw status; if the host is unreachable, stop and tell the user (no point auditing a URL nothing answers on). -
[ ] Step 3: Run the probe. Run exactly:
uv run ${CLAUDE_SKILL_DIR}/scripts/audit_endpoint.py --url "$0" --format jsonDo not modify the command. The script returns exit code 0 (no blocking findings) or 1 (findings present). Any other code is a usage error and must be reported as-is.
Loop
- Run the probe (Step 3).
- Parse JSON. If findings is empty - report success.
- If findings present - propose fixes inline (на стороні сервера, поза скілом).
- Після того як користувач задеплоїв fix - re-run probe проти того ж URL.
- Loop until findings is empty or user is satisfied.
- [ ] Step 4: Validate. Parse the JSON. If
findingsis empty, write a short report saying so. Otherwise group findings bycategory. - [ ] Step 5: Render. Use the template in
templates/audit-report.md. Fill every section. Do not invent findings the script did not produce.
Якщо URL не передано
When the user asks "audit my API" without naming a URL, do not guess. Ask one clarifying question — which endpoint? Suggest the typical readiness-related paths first:
/healthand/ready— public outage signals, audit these first.- A read endpoint that returns business data (e.g.
/users/me,/products). - A single-purpose info endpoint like
/version,/metrics,/.
Ask for the full URL (http://localhost:3000/health or https://api.example.com/health), not just a path — the probe runs over the network, it needs a host.
Calling the probe (rigid part)
The script is the source of truth. Run exactly the command in Step 3. Do not add extra flags, do not write your own curl pipeline, do not skip the run because "the URL looks fine". Findings come from the script or they do not exist.
If the endpoint needs an auth header, pass it explicitly: append --header "Authorization: Bearer $TOKEN" to Step 3. The script does not read env vars — the agent supplies the value.
Gotchas
- The script needs
uvon PATH. Ifuv runfails withcommand not found, instruct the user to install uv (https://docs.astral.sh/uv) and stop. - Self-signed certs: the probe verifies TLS by default. If the user audits an internal HTTPS host with a self-signed cert, append
--insecureto Step 3. Only do this if the user explicitly says they trust the host. - Auth-required endpoints: the probe sends no Authorization header by default. A
401or403will be reported as a finding even if the endpoint is healthy. Either probe a public path or pass--header "Authorization: ...". - Non-2xx is not always a defect:
404on/missingis correct behaviour. The script reports findings; you decide which matter for the user's intent. /healthreturning 200 withOKdoes not mean the system is healthy. The script flags this exact uptime-only pattern. Do not wave it off as "the endpoint works".- Output truncation: by default the JSON includes only the first 3 findings plus a
truncated: trueflag. Pass--fullif you need every finding for a long report.
Output format
Use templates/audit-report.md. Keep the structure even if some sections are empty (write "no findings" instead of omitting the section).
When NOT to use this skill
- Multi-endpoint audits across the whole API. Use a higher-level orchestrator that calls this skill per endpoint.
- Performance audits (latency under load, memory, throughput). The probe fires one request — single-shot wall-clock time is reported as info, not a benchmark.
- Endpoints that require non-trivial auth flow (OAuth login dance, request signing, mTLS). The probe accepts a static header at most. For anything beyond that, audit manually.
- Static source review (is this handler logged? is the route registered?). The probe is a black box — it sees only what the wire returns.
04 同仓库更多 Skills
release
Run the whole local release pipeline in order, stopping at each human gate. Triggers on "run the release", "prepare a release", "/release", "зроби реліз", "підготуй реліз". Drives the four stages back to back — bump-version → curate-changelog → release-notes → check-docs-drift — pausing after each so the human reviews the diff before the next stage. Prepares everything in the working tree; never tags, commits, or pushes. The tag push (which fires CI) stays the human's action.
release-notes
Draft partner-facing release notes from the same commits as the changelog. Triggers on "draft release notes", "release notes for the next version", "/release-notes", "нотатки релізу", "release notes партнеру". Same input as curate-changelog, different audience and tone: a short, benefit-first narrative for a user or partner — "what's new for you" — not a categorized engineer's list. Keeps only changes a user actually notices; drops internal refactors and tooling. Prints the notes to the chat to seed a GitHub Release description or a partner announcement. Writes no file.
curate-changelog
Curate the [Unreleased] section of docs/CHANGELOG.md from git history. Triggers on "curate the changelog", "update the changelog", "/curate-changelog", "онови changelog", "курування журналу". Reads git log since the last tag, FILTERS out what a reader never feels (test/ci/chore/merge), GROUPS commits about one feature into one bullet, and REWRITES technical subjects into plain language under the six Keep a Changelog categories (Added/Changed/Deprecated/ Removed/Fixed/Security). The result must have FEWER lines than the raw log — that is the proof of curation, not a dump. Leaves the edit in the working tree; never commits or pushes.
codify-rule
Turn a repeated mistake into a durable, path-scoped rule in .claude/rules/. Triggers on "codify this rule", "make a rule so this doesn't happen again", "/codify-rule", "закодифікуй правило", "петля помилка-правило". Use only when the same mistake showed up TWICE (twice = a pattern, once = noise). Names the wrong shape and the right shape with one short example of each, scopes the rule to the paths that matter, and leaves the edit in the working tree so the next agent on this repo inherits the fix. Edits only .claude/rules/; never commits or pushes.
check-docs-drift
Find and fix where docs/api.md fell behind the code. Triggers on "check for doc drift", "is the API doc up to date", "/check-docs-drift", "перевір дрейф документації", "docs drift". Runs the deterministic scripts/check-docs-drift.py (parses the public NoteBook methods with ast, compares to what docs/api.md documents — NO LLM finds the gap), reports the drift, and PROPOSES the doc edit that closes it. The gap is found by parsing; the agent writes the missing documentation in the doc's existing style. Edits only docs/; never commits or pushes.
bump-version
Decide and apply the next semver for a release. Triggers on "bump the version", "what version is next", "/bump-version", "простав версію", "яка наступна версія". Reads the next number from the deterministic scripts/next-version.sh (NEVER guesses it), explains in plain language WHICH part moved and why (e.g. "MINOR, because a feat landed: filter notes by tag"), edits the version line in pyproject.toml, and proposes the matching `git tag vX.Y.Z`. The number is decided by a rule; the agent explains and applies — the human confirms the tag. Never pushes a tag itself.