prompts/skills/clojure-ring-spec/SKILL.md
Ring specification for HTTP server applications in Clojure. Use when working with: (1) Ring handlers (sync or async), (2) Ring request maps and their keys, (3) Ring response maps and their keys, (4) Ring middleware, (5) Ring adapters, (6) WebSocket responses and listeners, or when questions mention Ring spec, handler signatures, request/response map structure, or Ring protocols.
npx skillsauth add ramblurr/nix-devenv clojure-ring-specInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Ring is an abstraction layer for building HTTP server applications in Clojure. Defines synchronous and asynchronous APIs.
Synchronous handler (1 arg):
(fn [request] response)
Asynchronous handler (3 args):
(fn [request respond raise]
(respond response)) ; or (raise exception)
Dual-arity handler:
(fn
([request] response)
([request respond raise] (respond response)))
Higher-order functions that augment handlers:
(fn [handler & config-options] enhanced-handler)
Start HTTP server with handler and options:
(run-adapter handler options)
(run-adapter handler {:async? true}) ; for async handlers
| Key | Type | Required | Notes |
| ------------------- | ---------------------------------- | -------- | ----- |
|:body |java.io.InputStream | | Request body |
|:character-encoding|String | | DEPRECATED |
|:content-length |String | | DEPRECATED |
|:content-type |String | | DEPRECATED |
|:headers |{String String} | Yes | Lowercase keys; multi-value concat with ,; cookie uses ; |
|:protocol |String | Yes | e.g. "HTTP/1.1" |
|:query-string |String | | After ?, excludes ? |
|:remote-addr |String | Yes | Client or last proxy IP |
|:request-method |Keyword | Yes | :get, :post, etc. |
|:scheme |Keyword | Yes | :http, :https, :ws, :wss |
|:server-name |String | Yes | Server name or IP |
|:server-port |Integer | Yes | Port |
|:ssl-client-cert |java.security.cert.X509Certificate| | SSL cert if provided |
|:uri |String | Yes | Absolute path, starts with / |
| Key | Type | Required |
| -------- | ------------------------------------------ | -------- |
|:body |ring.core.protocols/StreamableResponseBody| |
|:headers|{String String} or {String [String]} | Yes |
|:status |Integer | Yes |
Response body satisfies StreamableResponseBody protocol:
(defprotocol StreamableResponseBody
(write-body-to-stream [body response output-stream]))
Default implementations: byte[], String, clojure.lang.ISeq, java.io.InputStream, java.io.File, nil
WebSocket response (returned from handler):
(fn [request]
#:ring.websocket{:listener websocket-listener
:protocol "optional-subprotocol"})
Or from async handler:
(fn [request respond raise]
(respond #:ring.websocket{:listener websocket-listener}))
(defprotocol Listener
(on-open [listener socket])
(on-message [listener socket message]) ; message: CharSequence or ByteBuffer
(on-pong [listener socket data]) ; data: ByteBuffer
(on-error [listener socket throwable])
(on-close [listener socket code reason])) ; code: int, reason: String
Optional ping handler:
(defprotocol PingListener
(on-ping [listener socket data])) ; If not implemented, adapter auto-responds to pings
(defprotocol Socket
(-open? [socket]) ; Returns truthy if connected
(-send [socket message]) ; message: CharSequence or ByteBuffer
(-ping [socket data]) ; data: ByteBuffer
(-pong [socket data]) ; data: ByteBuffer (unsolicited)
(-close [socket code reason])) ; code: int, reason: String
Optional async send:
(defprotocol AsyncSocket
(-send-async [socket message succeed fail])) ; succeed: (fn []), fail: (fn [throwable])
testing
Use this OCP when executing or preparing to execute commands that change a live or important system, service reloads/restarts, package changes, deployments, migrations, firewall/network/access changes, credential rotation, NixOS switch/test/boot/deploy, or incident mitigation. It guides safe operations with a persisted ledger for scope, preflight, baseline, rollback, validation, and evidence.
development
Create new agent skills with proper structure, progressive disclosure, and bundled resources. Use when user wants to create, write, or build a new skill.
documentation
Naming conventions for workflow documents in prompts/. Use when creating plans, PRDs, research reports, idea capture or other workflow documents. Triggers on (1) creating new planning documents, (2) naming PRDs or research reports, (3) questions about document organization in prompts/.
testing
Grilling session that challenges your plan against the existing domain model, sharpens terminology, and updates documentation (CONTEXT.md, ADRs) inline as decisions crystallise. Use when user wants to stress-test a plan against their project's language and documented decisions.