Labsco
BetterThanTomorrow logo

Calva Backseat Driver

โ˜… 58

from BetterThanTomorrow

An MCP server for the Calva VS Code extension, allowing AI assistants to interact with a live Clojure REPL.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup

Enabling Native AI Interactive Programming in VS Code

Clojure Tools for VS Code Agent harnesses. (Such as Copilot and Cursor.)

Backseat Driver gives VS Code AI harnesses access to Calva's Clojure tools these ways:

  1. Copilot: Zero config. (Using VS Code LM Tools.).
  2. Cursor, Zero config. (Using Cursor add-MCP-server API).
  3. Other AI harnesses: MCP (Requiring some configuration per project).

Features

  • Tool: Evaluate Code Access to the Clojure REPL to evaluate code at will. All active REPL sessions in Calva are available for targeting (and with shadow-cljs, also builds and runtime).
  • Tool: Create Clojure File Creates Clojure files with automatic bracket balancing
  • Tool: Append Code Appends code to Clojure files with automatic bracket balancing
  • Tool: Replace Top Level Form Structural editing, including formatting, bracket balancing and linting
  • Tool: Insert Top Level Form Structural editing, including formatting, bracket balancing and linting
  • Tool: Bracket Balancer Helps the model get the bracket balance right (powered by Parinfer)
  • Tool: Load File Load/evaluate an entire Clojure file through Calva's connected REPL
  • Tool: Symbol info lookup, the AI can look up symbols it is interested in, and will get doc strings, argument info etcetera
  • Tool: clojuredocs.org lookup, docs, examples, and see also information on Clojure core-ish symbols
  • Resource: Symbol info lookup, (a bit experimental) same as the tool
  • Resource: clojuredocs.org lookup, (a bit experimental) same as the tool
  • Resource: Skills, specialized instructions discoverable via resources/list and readable via resources/read

Please note that for the editing tools there is no UI for reviewing the edits. I suggest using the source control tools, and VS Codes's Timeline view, for this.

Agent Instructions: Leveraging Backseat Driver

Backseat Driver gives the AI agent the tools for Clojure Interactive Programming and the skills for using the tools. To allow you to keep the control of how your agents hold Clojure and the REPL, the extension does not provide much in the way of Clojure knowledge, philosophy, nor for REPL methodology.

For truly effective agent Clojure work to happen, it needs to know how you prefer Clojure to be written and how to use the REPL effectively.

To avoid starting with a blank slate, where bad training data and hallucinations about Clojure ruin the day, consider installing the clojure, and other plugins from the Awesome Backseat Driver repository.

[!NOTE] Awesome Backseat Driver has plugins for Copilot and Cursor (so far). But if you are using some other haress, you can still copy the skills, custom agents, etc from there. (Or ask your agent to do it for you.)

WIP

As we all are, I am learning to use AI and figuring out one thing at a time. All while the whole space is moving faster than I can learn. Backseat Driver is my very best effort to provide Clojure developers with powerful AI tools that can be used with zero configuration.

The basic design of Backseat Driver has proven to work and be useful over time. But I have also been improving it incrementally as I have learnt new things. A lot of these things I have learnt from users.

Please, please let me know how you fare with Backseat Driver, and what features you would like to see. ๐Ÿ™

Please sponsor my open source work โ™ฅ๏ธ

You are welcome to encourage my work, using this link: