+
+
+
+
+
+```txt Prompt
+Set up API monitoring for this project with Checkly so that every endpoint has a check that reads the response.
+
+Success criteria:
+1. Read my OpenAPI spec if there is one, or ask me for the endpoints. One method and path pair is one check.
+2. Create `__checks__/group.ts` with a `CheckGroupV2` that runs in parallel from 2 locations, sets the `API_BASE_URL` group variable, alerts after 1 failed run, and has retries disabled. Export `responseTimes` with `degradedResponseTime: 1000` and `maxResponseTime: 5000`.
+3. For each read endpoint, create an `ApiCheck` in the group that uses `{{API_BASE_URL}}`, spreads `responseTimes`, and asserts the status code, the content-type header, and at least two JSON body properties with `AssertionBuilder`.
+4. For each write endpoint, add a `setupScript` that fetches a token, sets the `Authorization` header, and builds a unique body, and a `tearDownScript` that deletes what the run created and scrubs the token from `response.body`. Store secrets with `npx checkly env add --secret`, never in code.
+5. Run `npx checkly test --record` and show me the session link.
+6. Show me `npx checkly deploy --preview` and wait for my confirmation before deploying.
+
+Explain each file you changed and why.
+```
+
+
+
+
+
+The steps below are what the agent does, in the open.
+
+
+
+## Write down every endpoint
+
+Before writing a check, list what to cover. Different methods on the same path count separately: `GET /orders/{id}` and `DELETE /orders/{id}` are two endpoints and two checks.
+
+If your API has an OpenAPI spec, the list already exists. The shop's catalog API has two endpoints:
+
+```yaml openapi.yaml
+openapi: 3.0.3
+info:
+ title: Danube shop catalog API
+ version: 1.0.0
+servers:
+ - url: https://danube-web.shop/api
+paths:
+ /books:
+ get:
+ operationId: listBooks
+ responses:
+ '200':
+ description: Every book in the catalog
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Book'
+ /books/{id}:
+ get:
+ operationId: getBook
+ parameters:
+ - { name: id, in: path, required: true, schema: { type: integer } }
+ responses:
+ '200':
+ description: One book
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Book'
+components:
+ schemas:
+ Book:
+ type: object
+ required: [id, title, author, price]
+```
+
+Each operation becomes a check, and each `required` property becomes an assertion. The spec says `/books/1` returns a Book, not which book. The checks below pin the values the spec leaves open.
+
+