Skip to content

DTeam-Top/my-prompts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My Prompts VSCode Extension

A VSCode extension that helps you manage and organize your prompts for use with GitHub Copilot Chat and other AI tools.

Features

  • Prompt Management: Store, organize, and manage your frequently used prompts
  • GitHub Copilot Integration: Load prompts directly into Copilot Chat with one click
  • Chat Participant: Use @my-prompts directly in Copilot Chat like @terminal
  • Flexible Storage: Choose between workspace-specific or global prompt storage
  • Easy Access: Tree view in the Explorer panel for quick access to all your prompts
  • Search & Filter: Find prompts by name, content, or tags
  • Import/Export: Backup and share your prompt collections

Installation

From Source

  1. Clone or download this repository
  2. Open the folder in VSCode
  3. Run npm install to install dependencies
  4. Run npm run compile to build the extension
  5. Press F5 to launch Extension Development Host
  6. The extension will be loaded in the new VSCode window

From VSIX (Future)

  1. Download the .vsix file from releases
  2. In VSCode, go to Extensions view (Ctrl+Shift+X)
  3. Click the ... menu and select "Install from VSIX..."
  4. Select the downloaded .vsix file

Usage

Getting Started

  1. After installation, you'll see a "My Prompts" section in the Explorer panel
  2. Click the + button to add your first prompt
  3. Enter a name and content for your prompt
  4. Your prompt will appear in the tree view

Managing Prompts

Adding a New Prompt

  • Click the + button in the My Prompts panel
  • Or use Command Palette (Ctrl+Shift+P) → "My Prompts: Add New Prompt"
  • Enter a descriptive name and the prompt content

Editing a Prompt

  • Right-click on a prompt in the tree view → "Edit Prompt"
  • Or select a prompt and use Command Palette → "My Prompts: Edit Prompt"

Deleting a Prompt

  • Right-click on a prompt → "Delete Prompt"
  • Confirm the deletion in the warning dialog

Loading to Copilot Chat

Add to Current Chat (Default)

  • Click on any prompt in the tree view
  • The prompt will be added to your current Copilot Chat conversation

Start New Chat

  • Right-click on a prompt → "Load to New Chat"
  • Creates a fresh Copilot Chat session with the prompt

Using Quick Pick Menu (Recommended)

Command Palette Access:

  1. Press Ctrl+Shift+P to open Command Palette
  2. Type "My Prompts: Select Prompt" and press Enter
  3. Quick Pick dialog opens with all your prompts
  4. Type to search/filter, use arrow keys to navigate
  5. Press Enter to select - prompt is copied to clipboard
  6. Paste (Ctrl+V) in chat and press Enter

Optional Keyboard Shortcut: You can add a custom keyboard shortcut for faster access:

  1. File → Preferences → Keyboard Shortcuts
  2. Search for "My Prompts: Select Prompt (Quick Pick)"
  3. Click the + icon and assign a key (e.g., Ctrl+Alt+P)

Using Chat Participant (@my-prompts)

In Copilot Chat, type:

  • @my-prompts - Shows help and available access methods
  • @my-prompts /[prompt-name] - Copy a specific prompt to clipboard for pasting
  • @my-prompts / - List all available prompts with their command names

Example:

@my-prompts                    → Shows help and instructions
@my-prompts /                  → Lists all prompts with commands  
@my-prompts /hi               → Copies "hi" prompt to clipboard
[Ctrl+V] + [Enter]            → Sends prompt to Copilot for processing

Commands

Access these commands via Command Palette (Ctrl+Shift+P):

  • My Prompts: Select Prompt (Quick Pick) - Open Quick Pick menu to select and copy prompts
  • My Prompts: List All Prompts - Show count of stored prompts
  • My Prompts: Add New Prompt - Create a new prompt
  • My Prompts: Edit Prompt - Modify an existing prompt
  • My Prompts: Delete Prompt - Remove a prompt
  • My Prompts: Add to Current Chat - Add prompt to current Copilot conversation
  • My Prompts: Load to New Chat - Send prompt to new Copilot Chat session
  • My Prompts: Refresh - Refresh the prompt list

Configuration

Configure the extension via VSCode Settings (Ctrl+,):

Storage Location

  • Setting: myPrompts.storageLocation
  • Options:
    • workspace (default) - Store prompts per workspace
    • global - Store prompts globally across all workspaces
  • Description: Choose where to store your prompts

Example Prompts

Here are some useful prompts to get you started:

Code Review Helper

Please review this code for:
- Best practices and coding standards
- Potential bugs or issues
- Performance optimizations
- Security vulnerabilities
- Readability and maintainability

Documentation Generator

Generate comprehensive documentation for this code including:
- Purpose and functionality
- Parameters and return values
- Usage examples
- Edge cases and error handling

Test Case Creator

Create comprehensive unit tests for this function/class including:
- Happy path scenarios
- Edge cases
- Error conditions
- Mock requirements
- Test data setup

Refactoring Assistant

Help me refactor this code to:
- Improve readability and maintainability
- Follow SOLID principles
- Reduce code duplication
- Optimize performance
- Add proper error handling

Copilot Chat Integration

The extension integrates seamlessly with GitHub Copilot Chat in multiple ways:

Tree View Integration

  1. Add to Current Chat: Click any prompt to add it to your ongoing conversation (default behavior)
  2. Start New Chat: Right-click and select "Load to New Chat" for fresh conversations
  3. Smart Integration: Preserves your chat context when adding prompts to current conversations
  4. Fallback to Clipboard: If direct loading fails, the prompt is copied to clipboard

Quick Pick Menu

  1. Native VSCode UI: Uses VSCode's Quick Pick dialog for intuitive prompt selection
  2. Searchable Interface: Type to filter prompts by name or content
  3. Keyboard Navigation: Arrow keys + Enter for fast selection
  4. Command Palette Access: Ctrl+Shift+P → "My Prompts: Select Prompt"

Chat Participant (@my-prompts)

  1. Native Chat Experience: Use @my-prompts directly in Copilot Chat like @terminal
  2. Direct Access: Use /prompt-name format to quickly access specific prompts
  3. Help and Discovery: Shows available prompts and usage instructions
  4. Seamless Workflow: Copy-paste workflow integrates smoothly with Copilot Chat

Usage Examples

Ctrl+Shift+P → "My Prompts"    → Quick Pick dialog opens
@my-prompts                    → Shows help and available access methods
@my-prompts /                  → Lists all available prompts
@my-prompts /hi               → Copies "hi" prompt to clipboard

Troubleshooting Copilot Integration

For Tree View Integration:

  • Ensure GitHub Copilot extension is installed and active
  • Check that Copilot Chat panel is accessible
  • The extension will automatically copy prompts to clipboard as a fallback

For Chat Participant (@my-prompts):

  • Make sure you're using the correct command format: @my-prompts /prompt-name
  • Command names are shown when you type @my-prompts without any parameters
  • If a prompt isn't found, check the exact command name in the prompt list

Tips and Best Practices

  1. Organize with Names: Use descriptive names like "Code Review - Security Focus" or "Generate Tests - React Components"

  2. Use Placeholders: Include placeholders in your prompts:

    Explain this [LANGUAGE] code and suggest improvements for [SPECIFIC_AREA]
    
  3. Create Templates: Build reusable templates for common tasks:

    • Code reviews
    • Documentation
    • Test generation
    • Debugging assistance
  4. Use Quick Pick Menu: Ctrl+Shift+P → "My Prompts: Select Prompt" for the fastest prompt access

  5. Add Keyboard Shortcut: Assign a custom shortcut (e.g., Ctrl+Alt+P) for even faster access

  6. Efficient Workflow: Quick Pick → Select → Ctrl+V → Enter for rapid prompt usage

  7. Use Current Chat: Most of the time, click prompts to add to your current conversation for better context

  8. Start Fresh When Needed: Use "Load to New Chat" for completely different topics or when you want a clean slate

  9. Backup Your Prompts: Export your prompts periodically to avoid losing your collection

Development

Building from Source

git clone <repository-url>
cd my-prompts
npm install
npm run compile

Project Structure

├── src/
│   ├── extension.ts           # Main extension entry point
│   ├── promptManager.ts       # Prompt storage and management
│   ├── copilotChatIntegration.ts # Copilot Chat integration
│   ├── promptsTreeProvider.ts # Tree view UI provider
│   └── chatParticipant.ts     # @my-prompts chat participant
├── package.json              # Extension manifest
├── tsconfig.json            # TypeScript configuration
└── README.md               # This file

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

MIT License - see LICENSE file for details

Support

If you encounter issues or have suggestions:

  1. Check existing issues in the repository
  2. Create a new issue with detailed description
  3. Include VSCode version and extension version

Changelog

0.0.1

  • Initial release
  • Basic prompt management
  • Copilot Chat integration (tree view)
  • Chat participant (@my-prompts) for native chat experience
  • Tree view UI in Explorer panel
  • Workspace/global storage options
  • Interactive search and prompt insertion

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published