connekt-script-writer

Generate Kotlin-based .connekt.kts scripts for HTTP API automation and testing.

Updated May 4, 2026
One-click install
npx skills add https://github.com/studenkov/FinanceTracker --skill connekt-script-writer-studenkov
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: connekt-script-writer
Source: https://github.com/studenkov/FinanceTracker/tree/main/.agents/skills/connekt-script-writer
Command: npx skills add https://github.com/studenkov/FinanceTracker --skill connekt-script-writer-studenkov

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing HTTP automation and API test scripts requires knowing the Connekt DSL's execution model, where scripts register requests rather than executing imperatively. This Skill produces correct .connekt.kts scripts that follow the DSL's conventions, avoiding common mistakes like interpolating request results into URLs or placing assertions outside then blocks. ## Core Features & Use Cases - Request Generation: Create GET, POST, PUT, PATCH, DELETE and other HTTP requests with headers, query params, path params, JSON bodies, form data, and multipart uploads. - Response Handling: Chain then blocks with assertions, typed decode<T>() deserialization via JSONPath, and soft assertions for multi-field validation. - Workflow Composition: Group multi-step business scenarios into useCase blocks, pass results between requests via pathParam, and configure OAuth2, Basic, or Bearer authentication. - Use Case: You need to test a REST API's CRUD flow. Describe the endpoints and the Skill generates a .connekt.kts script that creates a resource, verifies it, updates it, and deletes it, reading the base URL from connekt.env.json. ## Quick Start Write a Connekt script that sends a POST request to create a pet at the host defined in connekt.env.json and asserts the response status is 201.

Frequently Asked Questions about connekt-script-writer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a Connekt script to test a REST API?

Create a .connekt.kts file, read the base URL with val host: String by env, then declare requests like GET("$host/api/pets") then { assert(code == 200) }. The script registers requests and the runner executes them, so no imperative code goes between requests.

How do I pass a response value from one HTTP request to another in Kotlin scripting?

Capture the value in a then block with decode, for example val petId by POST(...) then { decode<Long>("$.id") }, then reference it in the next request using a {petId} URL placeholder with pathParam("petId", petId). Never interpolate the value directly into the URL string.

When should I use a useCase block in a Connekt script?

Use useCase only when a scenario involves multiple requests passing results between each other, such as creating a resource and then verifying it. A single HTTP request, even with a then block, should never be wrapped in useCase.

Does Connekt support OAuth2 authentication for API requests?

Yes, declare val auth by oauth(...) with authorize and token endpoints, client credentials, scope, and a redirect URI. It opens a browser for login and starts a local callback server, then you use bearerAuth(auth.accessToken) on protected requests. A Keycloak shorthand via KeycloakOAuthParameters is also available.

Why can't I put assertions or println between requests in a .connekt.kts script?

A Connekt script only registers requests; the runner decides what to execute, so top-level imperative code does not run as expected. Assertions and logic must live inside then or useCase blocks, with only declarations like env vals, data classes, and request definitions allowed at the top level.

How do I manage environment variables and secrets in Connekt scripts?

Store values in connekt.env.json under an env object and read them with property delegation, such as val host: String by env. Supported types are String, Int, Long, Double, and Boolean, and missing keys throw an error.