scope-capture

Capture and inspect Clojure function local scope at runtime.

1|Updated Sep 5, 2025
One-click install
npx skills add https://github.com/Ramblurr/nix-devenv --skill scope-capture
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scope-capture
Source: https://github.com/Ramblurr/nix-devenv/tree/main/prompts/skills/clojure-scope-capture
Command: npx skills add https://github.com/Ramblurr/nix-devenv --skill scope-capture

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps Clojure developers debug functions by capturing and inspecting the local scope of variables at runtime, eliminating the need for manual value fabrication.

Core Features & Use Cases

  • Runtime Scope Capture: Record local variables at any point in your code execution.
  • REPL Re-creation: Recreate the captured scope in your REPL to evaluate expressions with live data.
  • Breakpoint Debugging: Pause execution at specific points to inspect state before continuing.
  • Use Case: When a complex function produces an unexpected result, use spy to capture all intermediate variables and then use defsc to re-evaluate parts of the function in the REPL with those exact values.

Quick Start

Use the scope-capture skill to capture the local scope of the my-fn function and then recreate it using defsc with the execution point ID 1.

Frequently Asked Questions about scope-capture

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

FAQPage Schema
How do I debug a Clojure function by inspecting local variables at runtime?

You can capture local variables at runtime by recording the local scope of your Clojure function during execution. This eliminates the need to manually fabricate intermediate values when debugging unexpected results.

Can I recreate a captured Clojure runtime scope in the REPL?

Yes, you can recreate a captured runtime scope in the REPL. By using `defsc` with an execution point ID, you can evaluate expressions with live data and inspect intermediate values to understand code behavior.

What is the best way to set breakpoints for Clojure debugging?

The best way to set breakpoints is to pause execution at specific points to inspect state before continuing. This approach supports dynamic variable capture to help understand code behavior.

How does `letsc` work for inspecting intermediate values in Clojure?

`letsc` works by recreating runtime contexts for inspecting intermediate values. It allows you to evaluate expressions within the exact captured scope of your function to understand its behavior.

Do I need any dependencies to use scope capture for Clojure debugging?

You do not need any dependencies to use this Skill. It operates independently to capture local scope at runtime, supporting dynamic variable capture, breakpoints, and scope recreation via `defsc` and `letsc`.