Loading...
Loading...
Define custom Claude Code slash commands for agents in the Traycer enforcement framework. This skill should be used when creating or updating agents and needing to specify reusable prompts that agents can execute as slash commands. Commands are Markdown files stored in .claude/commands/ and referenced in agent config.yaml files. This is for Claude Code slash commands (/command-name), not bash/CLI commands.
npx skill4agent add auldsyababua/instructor-workflow command-creator.claude/commands/~/.claude/commands//command-name@| Element | Purpose | Example | Invocation |
|---|---|---|---|
| Commands | Quick, reusable prompts | | Explicit: |
| Skills | Complex workflows with multiple files | | Automatic based on context |
| System Prompt | Agent personality and core behavior | Agent role, coordination logic | Always active |
.claude/commands/optimize.mdAnalyze this code for performance issues and suggest optimizations:/optimize.claude/commands/git-commit.md---
tools:
argument-hint: [message]
description: Create a git commit
model: haiku
---
Create a git commit with message: $ARGUMENTS/git-commit "fix: resolve login bug"| Field | Purpose | Default | Example |
|---|---|---|---|
| Tools command can use | Inherits from conversation | |
| Expected arguments | None | |
| Brief description | First line | |
| Specific model | Inherits from conversation | |
| Prevent SlashCommand tool | false | |
$ARGUMENTS---
description: Fix a GitHub issue
---
Fix issue #$ARGUMENTS following our coding standards:
1. Understand the issue
2. Locate relevant code
3. Implement solution
4. Add tests
5. Prepare PR description/fix-issue 123 high-priority$ARGUMENTS"123 high-priority"$1$2$3---
argument-hint: [pr-number] [priority] [assignee]
description: Review pull request
---
Review PR #$1 with priority $2 and assign to $3.
Focus on security, performance, and code style./review-pr 456 high alice$1"456"$2"high"$3"alice"!---
tools: Bash(git status:*), Bash(git diff:*), Bash(git log:*)
description: Create a git commit based on current changes
---
## Context
- Current git status: !`git status`
- Staged and unstaged changes: !`git diff HEAD`
- Current branch: !`git branch --show-current`
- Recent commits: !`git log --oneline -10`
## Your task
Based on the above changes, create a single git commit with an appropriate message.allowed-toolsBash@---
description: Review specific file implementation
---
Review the implementation in @src/utils/helpers.js and suggest improvements.Compare @src/old-version.js with @src/new-version.js and highlight differences..claude/commands/
├── git-commit.md # /git-commit (project)
├── frontend/
│ └── component.md # /component (project:frontend)
└── qa/
└── review.md # /review (project:qa)~/.claude/commands/
├── security-review.md # /security-review (user)
└── templates/
└── pr-template.md # /pr-template (user:templates).claude/commands//help~/.claude/commands//helpgit-commitreview-prfix-issueGitCommitreview_prfixIssue$ARGUMENTS$1$2$3!@mkdir -p .claude/commands
cat > .claude/commands/review-pr.md << 'EOF'
---
argument-hint: [pr-number]
description: Review pull request for code quality
---
Review pull request #$ARGUMENTS:
1. Check for security vulnerabilities
2. Verify test coverage
3. Assess code quality and style
4. Suggest improvements
Provide summary in Markdown format.
EOFmkdir -p ~/.claude/commands
cat > ~/.claude/commands/security-scan.md << 'EOF'
---
description: Scan code for security issues
---
Scan this code for security vulnerabilities:
- Hardcoded secrets
- Insecure dependencies
- Authentication issues
- Input validation problems
EOF---
# Brief description shown in /help
description: Create a git commit
# Hint shown during autocomplete
argument-hint: [message]
# Tools the command can use
tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*)
# Specific model (optional)
model: haiku
# Prevent SlashCommand tool from invoking (optional)
disable-model-invocation: false
---
Your command prompt here with $ARGUMENTS> /help
# Verify command appears in list
> /command-name arg1 arg2
# Test execution with argumentsdocs/agents/tracking-agent/config.yamlname: tracking-agent
commands:
- git-commit # References .claude/commands/git-commit.md
- linear-update # References .claude/commands/linear-update.md
- review-pr # References .claude/commands/review-pr.md.md.claude/commands/optimize.mdAnalyze the performance of this code and suggest three specific optimizations:/optimize.claude/commands/fix-issue.md---
argument-hint: [issue-number]
description: Fix a GitHub issue following project standards
---
Fix issue #$ARGUMENTS following these steps:
1. **Understand**: Read issue description and requirements
2. **Locate**: Find relevant code in codebase
3. **Implement**: Create solution addressing root cause
4. **Test**: Add appropriate tests
5. **Document**: Prepare concise PR description
Follow project coding standards and conventions./fix-issue 123.claude/commands/git-commit.md---
tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*), Bash(git diff:*), Bash(git log:*)
description: Create a git commit based on current changes
---
## Context
- Current git status: !`git status`
- Staged and unstaged changes: !`git diff HEAD`
- Current branch: !`git branch --show-current`
- Recent 10 commits: !`git log --oneline -10`
## Your Task
Based on the above git context, create a single git commit:
1. **Analyze changes**: Review the git diff
2. **Choose files**: Select relevant files to stage
3. **Write message**: Create commit message following format:
- Type: `feat|fix|docs|refactor|test|chore`
- Format: `<type>: <description>`
- Example: `feat: add user authentication`
4. **Create commit**: Execute git commands to stage and commit
**Important**: Follow this repository's commit message style (see recent commits)./git-commit.claude/commands/review-pr.md---
argument-hint: [pr-number] [priority] [assignee]
description: Review pull request with priority and assignment
---
Review pull request #$1:
**Priority**: $2
**Assign to**: $3
**Review checklist**:
1. Security vulnerabilities
2. Performance issues
3. Code style violations
4. Test coverage
5. Documentation completeness
Provide detailed review comments with severity levels./review-pr 456 high alice.claude/commands/explain-file.md---
argument-hint: <file-path>
description: Explain implementation of a specific file
---
Explain the implementation in @$ARGUMENTS:
1. **Purpose**: What does this file do?
2. **Structure**: How is the code organized?
3. **Key functions**: What are the main functions/classes?
4. **Dependencies**: What does it depend on?
5. **Usage**: How is it used elsewhere?
Provide clear, beginner-friendly explanation./explain-file src/utils/helpers.jsdocs/agents/qa-agent/config.yamlname: qa-agent
description: Quality assurance and validation agent
# Skills for complex workflows
skills:
- security-validation
- test-standards
- code-quality-standards
# Commands for explicit invocations
commands:
- review-pr # Quick PR review
- security-scan # Security check
- test-coverage # Coverage analysis
ref_docs:
- test-audit-protocol.md
- traycer-coordination-guide.md/review-pr 456SlashCommanddescriptiondisable-model-invocation: true.claude/commands/<command-name>.md.claude/commands/
├── git-commit.md
├── review-pr.md
└── your-new-command.mddocs/agents/<agent-name>/config.yamlcommands:commands:
- existing-command-1
- existing-command-2
- your-new-command # Add here (no .md extension).claude/commands/<command-name>.md/command-name argsReview this code for security vulnerabilitiesReview code for security, performance, style, tests, documentation, and deployment issuesreview-prgit-commitfix-issuergcfix- Current branch: !`git branch --show-current`
- Recent commits: !`git log --oneline -5`Create a commit---
argument-hint: [pr-number] [priority] [assignee]
------
description: Review pull request
argument-hint: [pr-number]
tools: Bash(gh pr view:*)
---.claude/commands/
├── git/
│ ├── commit.md
│ ├── branch.md
│ └── push.md
├── qa/
│ ├── review.md
│ └── test.md---
tools: Bash(git status:*), Bash(git diff:*)
---
## Context
- Git status: !`git status --short`
- Changes: !`git diff --stat`
## Task
[Your instructions based on context]---
argument-hint: [component] [action] [target]
---
$1: Component name
$2: Action to perform
$3: Target file/directory
Execute $2 on $1 targeting $3.Review @$ARGUMENTS for:
1. Code quality
2. Security issues
3. Performance concerns/review src/auth.jsExecute deployment workflow for $ARGUMENTS:
**Phase 1: Pre-deployment**
- [ ] Run tests
- [ ] Security scan
- [ ] Build artifacts
**Phase 2: Deployment**
- [ ] Deploy to staging
- [ ] Verify health checks
- [ ] Deploy to production
**Phase 3: Post-deployment**
- [ ] Monitor metrics
- [ ] Verify functionality
- [ ] Document deployment.claude/commands/config.yaml/command-name argsgit-commitreview-prfix-issueGitCommitreview_prfixIssue.claude/commands/command-name.md~/.claude/commands/command-name.mdcommands:
- command-name # No .md extensionreferences/command-examples.md