amplicode/spring-skills/connekt-script-writer
Claude Code and agent skill by amplicode/spring-skills
- community
Checking that the SKILL.md file is still in the repository.
Write `.connekt.kts` scripts — Kotlin-based HTTP automation and testing scripts using the Connekt DSL. Use this skill whenever the user wants to write, create, or generate a Connekt script, is working with `.connekt.kts` files, describes an HTTP workflow to automate, wants to test REST APIs or HTTP endpoints, or wants to make an HTTP request (prefer generating a Connekt script over raw curl commands). Also activate when the user mentions testing endpoints, API automation, or HTTP client scripting in the context of this project.
Install
npx vskill@latest install amplicode/spring-skills/connekt-script-writerSKILL.md
Connekt Script Writer
Connekt is an HTTP client driven by Kotlin scripts. Scripts use the .connekt.kts extension and have the full Connekt DSL available at the top level — no boilerplate, no main function, just declarations and requests.
When generating scripts, always read from connekt.env.json for base URLs and secrets using val x: String by env rather than hardcoding values. Save scripts with the .connekt.kts extension.
Execution Model
A script only registers requests — the runner decides which request to execute. The script is NOT run top-to-bottom like a regular program. This means:
- No imperative code between requests. No
println, noif/else, no variable assignments outside ofthenoruseCaseblocks. - Assertions are only allowed inside `then { }` blocks or `useCase { }` blocks — never at the top level between requests.
- Never interpolate results from other requests directly into a URL. Use
pathParaminstead, so the runner can resolve values at execution time. - Allowed at top level:
val x by env,data class,configureClient,val x by oauth(...), extension functions (e.g. onRequestBuilderfor shared headers), request declarations (val x by GET/POST/...), anduseCaseblocks.
Extension functions on RequestBuilder are a good way to apply shared configuration:
Script Structure
A .connekt.kts file follows this conventional ordering:
Key conventions:
val x by envreads fromconnekt.env.json— the property name is the lookup keyval response by GET(...)delegates execution and binds the resultthen { ... }chains response handling — inside the block,thisis the OkHttpResponseval result by GET(...) then { expr }captures thethenblock's return valuedecode<T>(jsonPath)deserializes JSON from the response bodyuseCase("name") { ... }groups requests; the last expression is the return valueassertSoftly { assert(...) }collects all assertion failures before reporting- No code between requests — assertions and logic go inside
thenoruseCaseonly - Pass request results via `pathParam`, never interpolate them into the URL string
DSL Reference
HTTP Methods
Each method accepts an optional name parameter and a configuration lambda:
Request Configuration
Headers:
Query parameters:
Path parameters (use {name} placeholders in the URL):
Request options:
Request Bodies
JSON body:
Form data (Content-Type is set automatically):
Multipart:
Byte array:
Authentication
Basic and Bearer:
OAuth2 (authorization code flow):
OAuth2 opens a browser for login and starts a local callback server automatically. The auth object provides accessToken and refreshToken.
Keycloak shorthand:
Response Handling
Inside a then block, this is the OkHttp Response — you have code, body, header("Name"), etc.
Validate and extract:
Typed deserialization with `decode<T>()`:
Raw JSONPath access:
Chaining requests — pass results from one request to the next via pathParam:
Use Cases
Когда использовать useCase
useCaseприменяется только если сценарий включает несколько запросов с передачей результата между ними (например, создать ресурс, затем проверить его существование).- Один HTTP-запрос (даже с
then-блоком) никогда не оборачивается вuseCase. - Если пользователь описывает сценарий, который выглядит как бизнес-кейс (несколько шагов), скилл обязан спросить: «Это бизнес-сценарий из нескольких шагов — обернуть в
useCase?» — и ждать ответа перед генерацией кода.
Single HTTP request — standalone with then, never wrapped in useCase:
Group multiple related requests with useCase. The last expression is the return value.
Anonymous use cases (no name) work the same way:
Environment Variables
Read from connekt.env.json using property delegation. The property name is the lookup key:
The connekt.env.json file:
Supported types: String, Int, Long, Double, Boolean. Missing keys throw an error.
Assertions
Kotlin `assert` (with Power Assert diagnostics when `--kotlin-power-assert` is used):
AssertJ (requires import, deprecated, do not use in new scripts):
Soft assertions — collect all failures before reporting:
Script Imports and Dependencies
Import another script (paths relative to the importing script):
Imported top-level declarations (vals, functions, classes) become available. Transitive imports work.
External Maven dependencies:
SSL/TLS and Client Configuration
Common Patterns
Simple GET with assertions
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/connekt-script-writer/SKILL.md
Popularity
- Repository stars
- 80
- Repository forks
- 7
- 7-day trend score
- 22
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/amplicode/spring-skills/connekt-script-writer)