scratchpad

Extracts the nearest JSDoc example from a TypeScript source file into a scratchpad file.

6|6|Updated Aug 7, 2026
One-click install
npx skills add https://github.com/NateBJones-Projects/unlock-ai-workbench --skill scratchpad-natebjones-projects
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scratchpad
Source: https://github.com/NateBJones-Projects/unlock-ai-workbench/tree/main/.repos/effect-smol/.agents/skills/scratchpad
Command: npx skills add https://github.com/NateBJones-Projects/unlock-ai-workbench --skill scratchpad-natebjones-projects

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Copying JSDoc examples out of Effect source files by hand is tedious and error-prone. This Skill locates the Example block nearest your cursor or selection and writes it to a ready-to-open TypeScript file in ./scratchpad. ## Core Features & Use Cases - Nearest-example selection: Picks the example containing the cursor line, otherwise the next following or nearest previous example. - Automatic runner handling: Appends Effect.runPromise(program) when a top-level program binding exists, preserves existing runners, or asks how to proceed when no runner is obvious. - Safe output: Generates slugged filenames from the source file and example title, never overwriting existing scratchpad files. - Use Case: While reading packages/effect/src/Schedule.ts, ask to dump the retrying example into scratchpad and open it instantly in the code pane. ## Quick Start Use the scratchpad skill to extract the JSDoc example at my current cursor position in Schedule.ts into a scratchpad file.

Frequently Asked Questions about scratchpad

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

FAQPage Schema
How do I extract a JSDoc example from a TypeScript file into scratchpad?

Run the extract-example.mjs script with the source path and line number, or invoke the skill from your IDE with an active selection. The script finds the nearest **Example** block and writes it as a .ts file in ./scratchpad.

How does the scratchpad script choose which example to extract?

It first picks the example whose section contains the given line. If none contains it, it selects the first following example, and otherwise falls back to the nearest previous example in the file.

What happens when an extracted example has no Effect runner?

In auto mode the script exits with code 2 and reports a needs-runner status. You can rerun with --mode preserve to copy the example exactly, or --runner <identifier> to append Effect.runPromise for a named value.

Does extracting examples overwrite existing scratchpad files?

No. The script generates filenames from the source file and example title, and appends a numeric suffix when a file with the same name already exists, so previous scratchpad files are preserved.

What are the limitations of JSDoc example extraction?

The script only detects fenced code blocks following **Example** headings inside JSDoc comments. Examples in other formats or without code fences are skipped, and the skill does not run the extracted file unless explicitly asked.