-
Notifications
You must be signed in to change notification settings - Fork 11
feat: Add comprehensive Claude slash command support with new features #232
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
fe5bcb4
feat: Add comprehensive Claude slash command support with new features
khaliqgant 40c1ceb
docs: Add comprehensive slash commands comparison blog post
khaliqgant d6025bf
feat: add missing skills to prpm.json (#246)
khaliqgant 9214296
Merge branch 'main' of github.com:pr-pm/prpm into slash-commands-enha…
khaliqgant 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
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,155 @@ | ||
| --- | ||
| description: Create a new Claude Code slash command with best practices | ||
| argument-hint: <command-name> [description] | ||
| allowed-tools: Write, Read, Bash | ||
| model: sonnet | ||
| commandType: slash-command | ||
| --- | ||
|
|
||
| # 🔨 Slash Command Generator | ||
|
|
||
| Create a new Claude Code slash command following best practices and latest features. | ||
|
|
||
| ## Command to Create | ||
|
|
||
| **Name:** $1 | ||
| **Description:** $2 (or $ARGUMENTS if multi-word) | ||
|
|
||
| ## Requirements | ||
|
|
||
| 1. **Location:** Create in `.claude/commands/$1.md` | ||
| 2. **Structure:** Include proper frontmatter with: | ||
| - `description` - Clear, actionable description | ||
| - `allowed-tools` - Minimal required tools | ||
| - `argument-hint` - If command takes arguments | ||
| - `model` - Appropriate model selection | ||
| - `commandType: slash-command` - For PRPM compatibility | ||
|
|
||
| 3. **Features to Consider:** | ||
| - **Arguments:** Use `$ARGUMENTS`, `$1`, `$2`, etc. for user input | ||
| - **File References:** Use `@filepath` to reference files | ||
| - **Bash Execution:** Use `!`command`` for inline bash (requires `Bash` in allowed-tools) | ||
| - **Namespacing:** Use subdirectories for organization (`.claude/commands/category/name.md`) | ||
|
|
||
| ## Template Structure | ||
|
|
||
| ```markdown | ||
| --- | ||
| description: [Brief, actionable description] | ||
| allowed-tools: [Minimal list: Read, Write, Edit, Bash, etc.] | ||
| argument-hint: [Expected arguments format] | ||
| model: [sonnet|haiku|opus|inherit] | ||
| commandType: slash-command | ||
| --- | ||
|
|
||
| # [Icon] [Title] | ||
|
|
||
| [Clear description of what this command does] | ||
|
|
||
| ## Instructions | ||
|
|
||
| - [Specific, actionable steps] | ||
| - [What the command should analyze/generate/modify] | ||
|
|
||
| ## Output Format | ||
|
|
||
| [Describe expected output format, with examples if helpful] | ||
| ``` | ||
|
|
||
| ## Validation Checklist | ||
|
|
||
| Before creating, verify: | ||
| - [ ] Command name is clear and follows kebab-case | ||
| - [ ] Description is specific and actionable (not generic) | ||
| - [ ] Tool permissions are minimal and necessary | ||
| - [ ] Argument hints provided if arguments expected | ||
| - [ ] Model selection appropriate for task complexity | ||
| - [ ] Includes helpful examples or output format guidance | ||
| - [ ] Uses special features where appropriate (@, !, $ARGUMENTS) | ||
|
|
||
| ## Examples | ||
|
|
||
| ### Simple Command (no arguments) | ||
| ```markdown | ||
| --- | ||
| description: Review current file for security issues | ||
| allowed-tools: Read, Grep | ||
| --- | ||
|
|
||
| # 🔒 Security Review | ||
|
|
||
| Review the current file for common security vulnerabilities: | ||
| - SQL injection | ||
| - XSS vulnerabilities | ||
| - Authentication issues | ||
| - Insecure dependencies | ||
| ``` | ||
|
|
||
| ### With Arguments | ||
| ```markdown | ||
| --- | ||
| description: Generate test file for specified source file | ||
| argument-hint: <source-file-path> | ||
| allowed-tools: Read, Write | ||
| --- | ||
|
|
||
| # 🧪 Test Generator | ||
|
|
||
| Generate comprehensive test file for @$1 | ||
|
|
||
| Include: | ||
| - Unit tests for all exported functions | ||
| - Edge cases | ||
| - Error handling | ||
| - Mocking where needed | ||
| ``` | ||
|
|
||
| ### With Bash Execution | ||
| ```markdown | ||
| --- | ||
| description: Show git status with context | ||
| allowed-tools: Bash(git *) | ||
| --- | ||
|
|
||
| # 📊 Git Context | ||
|
|
||
| Current Status: | ||
| !`git status --short` | ||
|
|
||
| Recent Commits: | ||
| !`git log --oneline -5` | ||
|
|
||
| Current Branch: | ||
| !`git branch --show-current` | ||
| ``` | ||
|
|
||
| ### Namespaced Command | ||
| File: `.claude/commands/db/migrate.md` | ||
| ```markdown | ||
| --- | ||
| description: Create new database migration | ||
| argument-hint: <migration-name> | ||
| allowed-tools: Write, Bash | ||
| --- | ||
|
|
||
| # 🗄️ Database Migration | ||
|
|
||
| Create migration: $1 | ||
|
|
||
| Timestamp: !`date +%Y%m%d%H%M%S` | ||
|
|
||
| Generate migration file with: | ||
| - Up migration | ||
| - Down migration | ||
| - Type-safe schema changes | ||
| ``` | ||
|
|
||
| ## Action | ||
|
|
||
| Create the slash command file for "$1" with: | ||
| 1. Proper frontmatter and structure | ||
| 2. Clear instructions | ||
| 3. Appropriate use of special features | ||
| 4. Examples if command is complex | ||
|
|
||
| Save to `.claude/commands/$1.md` (or appropriate subdirectory if namespaced). | ||
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.
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.
P2: Malformed markdown backticks - this will render incorrectly. To show backticks inside inline code, use double backticks with spaces:
`` !`command` ``.Prompt for AI agents