Skip to content
Back to skills

993 Workspace Scope Prompts Fix Cc7b15f1

ASecurity

**Version:** 0.229.058

  • 9 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 11, 2026
designtestingapiperformance

Works with

  • cli
  • api

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 993-workspace_scope_prompts_fix_cc7b15f1 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 993 Workspace Scope Prompts Fix Cc7b15f1?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 993 Workspace Scope Prompts Fix Cc7b15f1
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-993-workspace-scope-prompts-fix-cc7b15f1/badge)](https://www.skillsdirectory.com/skills/tools-only-993-workspace-scope-prompts-fix-cc7b15f1)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
# WORKSPACE_SCOPE_PROMPTS_FIX

**Version:** 0.229.058

## Issue Description
The workspace scope selector in the chat interface was only affecting document filtering but not prompt filtering. When users selected different scopes (All, Personal, Group, Public), the prompts dropdown would continue to show all prompts regardless of the selected scope, creating an inconsistent user experience.

## Root Cause Analysis
The prompt loading and filtering logic in `chat-prompts.js` was not integrated with the workspace scope selector (`doc-scope-select`). The prompts were loaded using separate functions (`loadUserPrompts()` and `loadGroupPrompts()`) but were combined without considering the current scope selection, unlike the document filtering system which properly responded to scope changes.

## Technical Details

### Files Modified
1. **`static/js/chat/chat-global.js`**
   - Added `publicPrompts = []` variable to store public prompts

2. **`static/js/chat/chat-prompts.js`**
   - Added import for `docScopeSelect` from chat-documents.js
   - Implemented `loadPublicPrompts()` function to fetch public prompts from `/api/public_prompts`
   - Created `populatePromptSelectScope()` function with scope-aware filtering logic
   - Added `loadAllPrompts()` function to load all prompt types
   - Updated `initializePromptInteractions()` to:
     - Use `loadAllPrompts()` when prompts button is clicked
     - Add event listener for scope changes to repopulate prompts
   - Maintained backward compatibility by keeping original `populatePromptSelect()`

3. **`config.py`**
   - Updated VERSION from "0.229.041" to "0.229.042"

### Code Changes Summary

#### Scope Filtering Logic
- **All**: Shows Personal + Group + Public prompts
- **Personal**: Shows only Personal prompts  
- **Group**: Shows only Group prompts
- **Public**: Shows only Public prompts

#### Event Handling
- Scope selector changes automatically trigger prompt list updates
- Prompts are only repopulated when the prompt selection container is visible
- Previous prompt selection is preserved when possible during scope changes

### Testing Approach
- Created comprehensive functional test (`test_workspace_scope_prompts_fix.py`)
- Verified all required functions and event listeners are implemented
- Confirmed proper API endpoint usage
- Validated scope filtering conditions and labels
- Tested backward compatibility

## Impact Analysis
- **User Experience**: Consistent behavior between document and prompt filtering
- **Performance**: Minimal impact - prompts are only reloaded when scope changes while prompt selector is active
- **Compatibility**: Backward compatible - existing functionality preserved
- **Maintainability**: Follows existing patterns from document scope filtering

## Validation

### Test Results
✅ All workspace scope prompts functionality tests passed  
✅ All required API endpoints exist for public prompts  
✅ Version properly updated to 0.229.042

### User Experience Improvements
- Workspace scope selection now consistently affects both documents and prompts
- Users can focus on prompts from specific workspaces (personal, group, or public)
- Reduced cognitive load by showing only relevant prompts based on current scope
- Improved workflow efficiency for users working within specific workspace contexts

## Fixed/Implemented in version: **0.229.042**

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.