- 
                Notifications
    
You must be signed in to change notification settings  - Fork 11
 
🤖 Add custom prompt mentions (@) feature #404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Open
      
      
            ammar-agent
  wants to merge
  9
  commits into
  main
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
prompts
  
      
      
   
  
    
  
  
  
 
  
      
    base: main
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
  
     Open
                    Changes from 2 commits
      Commits
    
    
            Show all changes
          
          
            9 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      3dca4f6
              
                🤖 Add custom prompt mentions feature
              
              
                ammar-agent 05beb4d
              
                🤖 Add documentation for custom prompt mentions feature
              
              
                ammar-agent 2e02241
              
                🤖 Fix formatting issues
              
              
                ammar-agent bcac7c8
              
                🤖 Fix prompt mention autocomplete to use cursor position
              
              
                ammar-agent b9ad06a
              
                🤖 Fix linting issues
              
              
                ammar-agent e8f5097
              
                🤖 Fix formatting
              
              
                ammar-agent 96a74dd
              
                🤖 Clean up prompts feature
              
              
                ammar-agent 4b591ad
              
                🤖 Fix formatting in prompts test
              
              
                ammar-agent 4433dd1
              
                🤖 refactor: extract prompts logic from ChatInput into custom hook
              
              
                ammar-agent File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # Custom Prompt Mentions (@) | ||
| 
     | 
||
| ## Overview | ||
| You can now reference reusable prompt templates using `@mention` syntax in the chat input. These prompts are expanded before being sent to the AI. | ||
| 
     | 
||
| ## How to Use | ||
| 
     | 
||
| 1. **Type `@` in the chat input** - An autocomplete menu will appear showing available prompts | ||
| 2. **Start typing a prompt name** - The list will filter to matching prompts | ||
| 3. **Select a prompt** - Use Tab, arrow keys, or click to insert the prompt name | ||
| 4. **Send your message** - The `@prompt-name` will be automatically replaced with the prompt's content | ||
| 
     | 
||
| ## Example | ||
| ``` | ||
| @explain React hooks | ||
| ``` | ||
| 
     | 
||
| When sent, this becomes: | ||
| ``` | ||
| Please provide a clear, comprehensive explanation of the topic. | ||
| 
     | 
||
| Include: | ||
| - Key concepts | ||
| - Examples where applicable | ||
| - Common pitfalls or misunderstandings | ||
| 
     | 
||
| React hooks | ||
| ``` | ||
| 
     | 
||
| ## Creating Prompts | ||
| 
     | 
||
| ### System-wide prompts | ||
| Create `.md` files in `~/.cmux/prompts/`: | ||
| ```bash | ||
| echo "Your prompt content here" > ~/.cmux/prompts/my-prompt.md | ||
| ``` | ||
| 
     | 
||
| ### Repository-specific prompts | ||
| Create `.md` files in your project's `.cmux/` directory: | ||
| ```bash | ||
| mkdir -p .cmux | ||
| echo "Your repo-specific prompt" > .cmux/review.md | ||
| ``` | ||
| 
     | 
||
| ## Prompt Priority | ||
| - Repository prompts (`.cmux/`) override system prompts (`~/.cmux/prompts/`) | ||
| - This allows per-project customization | ||
| 
     | 
||
| ## Features | ||
| - **Autocomplete**: Shows all available prompts with filtering | ||
| - **Keyboard navigation**: Tab to complete, arrow keys to navigate, Esc to dismiss | ||
| - **Visual indicators**: 📁 for repo prompts, 🏠 for system prompts | ||
| - **Multiple mentions**: Use multiple `@prompts` in a single message | ||
| - **Markdown support**: Prompts can contain any markdown content | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
      
      Oops, something went wrong.
        
    
  
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.