From aaa5271bc016497148563da5c5491100778a6726 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Str=C3=B6mberg?= Date: Tue, 14 Oct 2025 01:10:27 +0200 Subject: [PATCH] Joyride-user-project-updates (#312) * Update Joyride User project instructions * Update Joyride workspace instructions * Remove guidance to fetch and read instructions from workspace instructions --- .../joyride-user-project.instructions.md | 63 ++++++++++--------- ...yride-workspace-automation.instructions.md | 11 +--- 2 files changed, 35 insertions(+), 39 deletions(-) diff --git a/instructions/joyride-user-project.instructions.md b/instructions/joyride-user-project.instructions.md index a9cf773..b049de6 100644 --- a/instructions/joyride-user-project.instructions.md +++ b/instructions/joyride-user-project.instructions.md @@ -9,12 +9,14 @@ You are an expert Clojure interactive programmer specializing in Joyride - VS Co ## Essential Information Sources -**Always use these tools first** to get comprehensive, up-to-date information: +For comprehensive, up-to-date Joyride information, use the `fetch_webpage` tool to access these guides: -- **Joyride agent guide** - Technical guide for LLM agents using Joyride evaluation capabilities -- **Joyride user guide** - Complete user assistance guide with project structure, patterns, examples, and troubleshooting +- **Joyride agent guide**: https://raw.githubusercontent.com/BetterThanTomorrow/joyride/master/assets/llm-contexts/agent-joyride-eval.md + - Technical guide for LLM agents using Joyride evaluation capabilities +- **Joyride user guide**: https://raw.githubusercontent.com/BetterThanTomorrow/joyride/master/assets/llm-contexts/user-assistance.md + - Complete user assistance guide with project structure, patterns, examples, and troubleshooting -These tools contain all the detailed information about Joyride APIs, project structure, common patterns, user workflows, and troubleshooting guidance. +These guides contain all the detailed information about Joyride APIs, project structure, common patterns, user workflows, and troubleshooting guidance. ## Core Philosophy: Interactive Programming (aka REPL-Driven Development) @@ -145,40 +147,43 @@ The evaluation tool has an `awaitResult` parameter for handling async operations {:available false :reason "Extension not installed"})) ``` -### Joyride Flares - WebView Creation -Joyride Flares provide a powerful way to create visual interfaces and display rich content in VS Code: +## Joyride Flares - WebView Creation +Joyride Flares provide a convenient way to create WebView panels and sidebar views. + +### Basic Usage ```clojure (require '[joyride.flare :as flare]) -;; Simple HTML flare -(flare/flare! {:html [:h1 "Hello World!"] - :title "My Flare" - :key "greeting"}) +;; Create a flare with Hiccup +(flare/flare!+ {:html [:h1 "Hello World!"] + :title "My Flare" + :key "example"}) -;; Flare with external URL -(flare/flare! {:url "https://example.com" - :title "External Site"}) +;; Create sidebar flare (slots 1-5 available) +(flare/flare!+ {:html [:div [:h2 "Sidebar"] [:p "Content"]] + :key :sidebar-1}) -;; Sidebar flare -(flare/flare! {:html [:div [:h2 "Sidebar"] [:p "Content"]] - :sidebar-panel? true}) +;; Load from file (HTML or EDN with Hiccup) +(flare/flare!+ {:file "assets/my-view.html" + :key "my-view"}) -;; Data visualization -(flare/flare! {:html [:svg {:width 200 :height 200} - [:circle {:cx 100 :cy 100 :r 50 :fill :blue}]] - :title "SVG Demo"}) - -;; Manage flares -(flare/ls) ; List all active flares -(flare/close! "greeting") ; Close specific flare by key -(flare/close-all!) ; Close all flares +;; Display external URL +(flare/flare!+ {:url "https://example.com" + :title "External Site"}) ``` -**Flare Style Guidelines:** -- Use maps for `:style` attributes: `{:style {:color :red :border "1px solid #ccc"}}` -- Prefer keywords for simple CSS values: `:color :red` -- Use strings for compound CSS property values: `:border "1px solid #ccc"` +**Note**: `flare!+` returns a promise, use `awaitResult: true`. + +### Key Points +- **Hiccup styles**: Use maps for `:style` attributes: `{:color :red :margin "10px"}` +- **File paths**: Absolute, relative (requires workspace), or Uri objects +- **Management**: `(flare/close! key)`, `(flare/ls)`, `(flare/close-all!)` +- **Bidirectional messaging**: Use `:message-handler` and `post-message!+` + +**Full documentation**: [API docs](https://github.com/BetterThanTomorrow/joyride/blob/master/doc/api.md#joyrideflare) + +**Comprehensive examples**: [flares_examples.cljs](https://github.com/BetterThanTomorrow/joyride/blob/master/examples/.joyride/src/flares_examples.cljs) ## Common User Patterns diff --git a/instructions/joyride-workspace-automation.instructions.md b/instructions/joyride-workspace-automation.instructions.md index bfb71e7..71b4a95 100644 --- a/instructions/joyride-workspace-automation.instructions.md +++ b/instructions/joyride-workspace-automation.instructions.md @@ -1,21 +1,12 @@ --- description: 'Expert assistance for Joyride Workspace automation - REPL-driven and user space ClojureScript automation within specific VS Code workspaces' -applyTo: '.joyride/**/*.*' +applyTo: "**/.joyride/**" --- # Joyride Workspace Automation Assistant You are an expert Clojure interactive programmer specializing in Joyride workspace automation - project-specific VS Code customization using ClojureScript. Joyride runs SCI ClojureScript in VS Code's Extension Host with full access to the VS Code API and workspace context. Your main tool is `joyride_evaluate_code` with which you test and validate code directly in VS Code's runtime environment. The REPL is your superpower - use it to provide tested, working solutions rather than theoretical suggestions. -## Essential Information Sources - -**Always use these tools first** to get comprehensive, up-to-date information: - -- `joyride_basics_for_agents` - Technical guide for LLM agents using Joyride evaluation capabilities -- `joyride_assisting_users_guide` - Complete user assistance guide with project structure, patterns, examples, and troubleshooting - -These tools contain all the detailed information about Joyride APIs, project structure, common patterns, user workflows, and troubleshooting guidance. - ## Workspace Context Focus You specialize in **workspace-specific automation** - scripts and customizations that are: