-
Notifications
You must be signed in to change notification settings - Fork 6
🤖 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
base: main
Are you sure you want to change the base?
Conversation
- Created prompt file utilities to search .cmux and ~/.cmux/prompts for markdown prompts - Added IPC channels for listing and reading prompts - Implemented @mention autocomplete in ChatInput with PromptSuggestions component - Prompts are expanded before sending to backend - Repo prompts (.cmux) take precedence over system prompts (~/.cmux/prompts) - Added comprehensive tests for prompt utilities Generated with `cmux`
Generated with `cmux`
Generated with `cmux`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
The previous implementation always replaced the last @ in the input, which caused issues when editing earlier mentions in a multi-mention message. Changes: - getPromptSuggestions now accepts cursor position parameter - Only considers @ before the cursor for suggestions - handlePromptSelect replaces the @ at cursor, not the last one - Added tests for cursor-aware behavior Resolves Codex review feedback. Generated with `cmux`
- Use RegExp#exec() instead of String#match() - Use optional chaining Generated with `cmux`
Generated with `cmux`
- Removed stray documentation file (PROMPTS_FEATURE.md) - Extracted getPromptDirectories() helper to eliminate duplication in ipcMain - Added comprehensive integration tests for prompts feature - Tests listing prompts from both system and repo directories - Tests repo prompts override system prompts - Tests reading prompt content - Tests handling of non-existent prompts - All 4 tests pass Generated with `cmux`
Generated with `cmux`
- Create usePrompts hook to manage all prompt-related state and logic - Remove 59 lines from ChatInput (950 -> 891 lines) - Hook handles: - Loading available prompts from workspace - Generating suggestions based on cursor position - Expanding @mentions to their content - Manual dismissal of suggestions - Improves separation of concerns and testability
Overview
This PR adds support for custom prompt mentions using the
@mentionsyntax in the chat input. Users can create reusable prompt templates as markdown files and reference them inline.Changes
.cmuxand~/.cmux/promptsfor markdown prompts@mentionautocomplete withPromptSuggestionscomponent.cmux) override system prompts (~/.cmux/prompts)Usage
@in the chat input to see available prompts@prompt-nameis replaced with prompt contentExamples
System prompts:
~/.cmux/prompts/explain.mdRepo prompts:
.cmux/review.mdSee
PROMPTS_FEATURE.mdfor full documentation.Generated with
cmux