Slash Commands and Skills in PS Smart Agent

Slash commands and skills provide quick shortcuts for common tasks. This guide shows you how to use and create them.

Using Slash Commands

Slash commands are shortcuts that trigger specific actions.

Built-in Commands

CommandDescription
/explainExplain selected code
/fixFix issues in code
/improveImprove code quality
/testGenerate tests
/docAdd documentation

How to Use

  1. Type / in the chat input
  2. Select a command from the list
  3. Provide additional context if needed

Creating Custom Slash Commands

1. Open Settings

Settings > Slash Commands > Add New

2. Define the Command

name: /review
description: Review code for best practices
prompt: |
  Review the following code for:
  - Best practices
  - Potential bugs
  - Performance issues
  - Security concerns
  
  Provide actionable suggestions.

Example Commands

Code Review

name: /review
description: Comprehensive code review
prompt: |
  Perform a thorough code review focusing on:
  1. Code quality and readability
  2. Design patterns
  3. Error handling
  4. Test coverage

Refactor

name: /refactor
description: Refactor for cleaner code
prompt: |
  Refactor this code to:
  - Improve readability
  - Apply design patterns
  - Reduce complexity
  - Follow DRY principles

Skills

Skills are reusable workflows that combine multiple tools.

Built-in Skills

SkillDescription
Git OperationsCommit, branch, merge
File OperationsCreate, move, delete
TestingRun tests, generate coverage
DeploymentBuild and deploy

Creating Custom Skills

  1. Settings > Skills > Create New
  2. Define the workflow:
name: Deploy to Staging
description: Deploy current branch to staging
steps:
  - action: run_tests
    command: npm test
  - action: build
    command: npm run build
  - action: deploy
    command: ./deploy.sh staging

Combining Commands and Skills

Use commands within skills for powerful workflows:

name: Full PR Review
steps:
  - command: /review
  - command: /test
  - action: create_pr

Best Practices

  1. Keep commands focused - One task per command
  2. Use descriptive names - /security-check vs /sc
  3. Document your commands - Help others understand usage
  4. Share with team - Export and import commands

Learn more at pyshine.com