clojurescript-cross-platform-code

Create cross-platform ClojureScript code for JVM and browser execution.

Updated Mar 16, 2026
One-click install
npx skills add https://github.com/pyze/claude-plugin --skill clojurescript-cross-platform-code
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clojurescript-cross-platform-code
Source: https://github.com/pyze/claude-plugin/tree/main/skills/clojurescript-cross-platform-code
Command: npx skills add https://github.com/pyze/claude-plugin --skill clojurescript-cross-platform-code

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the complexity of writing ClojureScript code that needs to run seamlessly on both the JVM and in the browser, ensuring consistency and testability across platforms.

Core Features & Use Cases

  • Cross-Platform Development: Write code that functions identically whether compiled for the JVM or JavaScript environments.
  • File Extension Guidance: Provides a clear decision tree for choosing between .clj, .cljs, and .cljc file extensions.
  • Reader Conditionals: Demonstrates best practices for using #?(:cljs ...) and #?(:clj ...) for platform-specific code blocks.
  • JVM Testing: Enables robust unit testing of frontend logic on the JVM, leveraging faster execution and standard tooling.
  • Use Case: Develop a shared library of data transformation functions that can be used both in your backend Clojure API and your frontend ClojureScript application without duplication.

Quick Start

Use the clojurescript-cross-platform-code skill to write a function that logs a message to the console in ClojureScript and to standard output in Clojure.

Frequently Asked Questions about clojurescript-cross-platform-code

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

FAQPage Schema
How do I write cross-platform ClojureScript code that runs on both the JVM and browser?

To write cross-platform ClojureScript code, use `.cljc` files combined with reader conditionals like `#?(:cljs ...)` and `#?(:clj ...)` to handle platform-specific logic. This allows identical execution on both the JVM and JavaScript environments.

When should I use .cljc file extensions instead of .clj or .cljs?

Use the `.cljc` file extension when you need cross-platform ClojureScript code that runs on both the JVM and browser. Files with `.clj` are for JVM-only, while `.cljs` is for browser-only execution.

Can I run frontend ClojureScript unit tests on the JVM?

Yes, you can run frontend ClojureScript unit tests on the JVM. This approach leverages faster execution and standard tooling, enabling a JVM TDD workflow for business logic, state management, views, and actions.

What is the best way to share data transformation logic between Clojure and ClojureScript?

The best way to share logic is writing universal ClojureScript code in `.cljc` files. This creates a shared library that both backend Clojure APIs and frontend ClojureScript applications can use without duplication.

How do reader conditionals work for ClojureScript platform-specific code?

Reader conditionals use `#?(:cljs ...)` and `#?(:clj ...)` syntax within `.cljc` files to evaluate platform-specific code blocks. This mechanism ensures the compiler only processes the code relevant to the targeted JVM or JavaScript environment.

Does a JVM TDD approach work for testing ClojureScript views and actions?

Yes, a JVM TDD approach works for testing views and actions. It enhances testability and development speed by allowing you to unit test frontend business logic and state management directly on the JVM.