Use this skill to turn one-off HTTP checks into reusable .http cases and a runnable verification script.
Required runtime dependencies:
bashcurlpython3Quick self-check:
bash --version
curl --version
python3 --version
Generate two artifacts by default:
.api-tests.http .api-verify.sh The .http file is the source of truth. The shell script executes the cases, prints readable PASS/FAIL/SKIP output, and exits non-zero when any non-skipped case fails.
templates/ for a new endpoint.examples/ when the endpoint looks similar to an existing example.references/complex-scenarios.md for multi-step or advanced validation..api-tests.http .api-verify.sh bash -n './<feature>.api-verify.sh'
bash './<feature>.api-verify.sh'
COOKIE='full Cookie header' AUTH_TOKEN='token value' bash './<feature>.api-verify.sh'
# optional for unstable networks:
MAX_TIME=40 RETRY_COUNT=2 RETRY_DELAY=1 bash './<feature>.api-verify.sh'
See references/debugging-cookbook.md for the failure checklist.
Need a minimal runnable path first: see GET_STARTED.md.
Ask only for fields the user did not already provide.
| Input | Needed for |
|---|---|
| --- | --- |
| Base URL / host | Resolving request targets |
| HTTP method | Building the request |
| Authentication | Cookie, bearer, custom headers, or none |
| Request data | Path params, query params, JSON body, form body |
| Cases | Positive, negative, auth failure, boundary checks |
| Expected results | Status, JSON path, marker text, list membership, error behavior |
| Output preference | Brief summary, key fields, raw response save path |
For cookie-based tests, tell the user to copy the full Cookie: request header from a successful browser Network request. Do not reconstruct cookies from the storage panel.
Generated comments and final usage notes should follow the user's language.
templates/basic.api-tests.txttemplates/basic.api-verify.shexamples/resource-detail/examples/auth-login-required/examples/list-assertions/examples/async-job-polling/Note: publishable skill assets use .api-tests.txt to satisfy upload restrictions, while generated runtime artifacts should still use .api-tests.http.
| Goal | Start with |
|---|---|
| --- | --- |
| Resource detail/config lookup | examples/resource-detail/ |
| Authentication failure checks | examples/auth-login-required/ |
| List membership assertions | examples/list-assertions/ |
| Async submit + poll + verify | examples/async-job-polling/ |
| New endpoint from scratch | templates/basic.api-tests.txt + templates/basic.api-verify.sh |
The generated .http file should:
@host, @cookie, @token, @resourceId### titles for each caseexpect.* commentsThe generated shell script should:
.http file{{variable}} placeholdersPASS/FAIL/SKIP output for each case@cookie = and @token = .SKIP with a clear reason instead of crashing the parser.rg -n "password|secret|session_id|auth_token|access_token|refresh_token" <artifact-dir>
rg -n "Authorization: Bearer [A-Za-z0-9._-]+|C[o]okie: [A-Za-z0-9_%-]+=" <artifact-dir>
GET_STARTED.mdreferences/assertion-cheatsheet.mdreferences/complex-scenarios.mdreferences/debugging-cookbook.mdreferences/faq.mdreferences/http_test_artifact_example.mdAfter generating artifacts, run:
bash -n './<feature>.api-verify.sh'
bash './<feature>.api-verify.sh'
COOKIE='full Cookie header' AUTH_TOKEN='token value' bash './<feature>.api-verify.sh'
Interpretation:
bash -n catches shell syntax errors.SKIP behavior.共 3 个版本