clj-discover

Resolve incorrect Clojure API usage by inspecting Java interop and macro expansions.

31|Updated Mar 8, 2026
One-click install
npx skills add https://github.com/humorless/clj-native-agent --skill clj-discover
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clj-discover
Source: https://github.com/humorless/clj-native-agent/tree/main/skills/clj-discover
Command: npx skills add https://github.com/humorless/clj-native-agent --skill clj-discover

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It prevents bugs from incorrect Clojure API usage by helping you gather the right context before you call unfamiliar Java classes or use unclear macros.

Core Features & Use Cases

  • Java interop discovery: Finds Clojure wrapper libraries for a Java class first, then falls back to inspecting the Java class via Clojure reflection.
  • Macro behavior exploration: Expands macros to reveal the code they generate so you can reason about side effects and real execution flow.
  • Use cases: When adapting existing Clojure code to new libraries, debugging unexpected behavior from macro usage, or integrating Java time/date/IO APIs into Clojure functions without relying on guesswork.

Quick Start

Ask the AI to use clj-discover to explore the Java class or macro you are unsure about, including expanding the macro or reflecting on the Java methods first.

Frequently Asked Questions about clj-discover

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

FAQPage Schema
How do I find the correct methods for Java interop in Clojure when I am unfamiliar with a class?

Java interop discovery in Clojure requires searching for wrapper libraries first, then falling back to inspecting Java methods via clojure.reflect. This prevents incorrect API usage by providing accurate method context before you implement calls.

Why does my Clojure macro behave unexpectedly and how can I inspect its real execution flow?

Clojure macro behavior can be inspected using macroexpand-1 or macroexpand to reveal generated code. Expanding macros clarifies side effects and real execution flow, helping you debug unexpected behavior during refactoring.

What is the best way to integrate Java time, date, or IO APIs into Clojure without guessing method signatures?

Integrating Java APIs into Clojure safely requires reflecting on Java methods via brepl and clojure.reflect rather than guessing. This approach ensures accurate, context-informed calls when adapting existing Clojure code to new libraries.

Can I use clojure.reflect to inspect Java classes before calling their methods in brepl?

Yes, you can use clojure.reflect within a brepl session to inspect Java classes and discover available methods. This reflection approach is required when no Clojure wrapper library exists for the target Java class.

Do I need a wrapper library before using Java interop in Clojure, or can I call Java methods directly?

You should search for a wrapper library first before direct Java interop in Clojure. If no wrapper exists, use clojure.reflect and brepl to inspect the Java class directly, ensuring your method calls are accurate and context-informed.

When should I use macroexpand-1 instead of macroexpand to debug a Clojure macro?

Use macroexpand-1 to inspect a single step of Clojure macro expansion, or macroexpand for full expansion to the final form. Both reveal generated code to help you reason about side effects when debugging unexpected behavior.