command-creator

Create custom commands for Pi (prompt templates) or OpenCode. Define command prompts, arguments, shell output injection, file references, and configure agents, models, and descriptions.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "command-creator" with this command: npx skills add devskale/skale-skills/devskale-skale-skills-command-creator

Command Creator

Create custom commands to automate repetitive tasks. This skill supports:

  • Pi prompt templates - Markdown snippets invoked via /name in the editor (simpler, no configuration)
  • OpenCode commands - Custom commands with advanced configuration (agents, models, shell injection)

When asked to create a command, first ask the user which system they're targeting.

Pi Prompt Templates

Pi prompt templates are simple Markdown files that expand in the editor when invoked.

Locations

ScopePath
Global~/.pi/agent/prompts/*.md
Project.pi/prompts/*.md

Format

---
description: Review staged git changes
---
Review the staged changes (`git diff --cached`). Focus on:
- Bugs and logic errors
- Security issues
- Error handling gaps

Key points:

  • Filename becomes command name: review.md/review
  • description in frontmatter is optional (defaults to first line)
  • No special configuration required

Arguments

Supports positional arguments and slicing:

PlaceholderDescription
$1, $2, ...Individual positional arguments
$@, $ARGUMENTSAll arguments joined
${@:N}Args from position N (1-indexed)
${@:N:L}L args starting at position N

Example:

---
description: Create a React component
---
Create a React component named $1 with TypeScript and features: $@

Usage: /component Button "onClick handler" "disabled support"

Loading

  • Discovery is non-recursive (no subdirectory scanning)
  • Add via prompts array in settings if needed
  • Disable with --no-prompt-templates

Example Pi Templates

Git review template (.pi/prompts/review.md):

---
description: Review staged changes
---
Review the staged changes (`git diff --cached`). Check for:
- Bugs and logic errors
- Security vulnerabilities
- Performance issues
- Code style inconsistencies

Component creation (.pi/prompts/component.md):

---
description: Create React component
---
Create a React component named $1 with TypeScript:
- Use functional components with hooks
- Export as default module
- Include PropTypes or TypeScript interface
$@

Usage: /component Button


OpenCode Commands

OpenCode commands are more powerful with JSON configuration, agent/model selection, and shell injection.

Quick Start

Markdown format (.opencode/commands/test.md):

---
description: Run tests with coverage
agent: build
model: anthropic/claude-3-5-sonnet-20241022
---
Run the full test suite with coverage report and show any failures.

JSON format (opencode.jsonc):

{
  "command": {
    "test": {
      "template": "Run the full test suite with coverage report and show any failures.",
      "description": "Run tests with coverage",
      "agent": "build",
      "model": "anthropic/claude-3-5-sonnet-20241022"
    }
  }
}

Locations

ScopePath
Global~/.config/opencode/commands/
Project.opencode/commands/

Arguments

Same placeholders as Pi, plus OpenCode-specific features:

PlaceholderDescription
$ARGUMENTSAll arguments passed to command
$1, $2, $3Individual positional arguments

Shell Output Injection

Use backticks to inject bash command output (OpenCode only):

---
description: Analyze coverage
---
Current test results:
!`npm test`
Suggest improvements based on these results.

File References

Include file contents using @:

---
description: Review component
---
Review @src/components/Button.tsx for performance issues.

Options Reference

OptionTypeRequiredDescription
templatestringYesPrompt sent to LLM
descriptionstringYesShown in TUI command list
agentstringNoAgent to use (defaults to current)
subtaskbooleanNoForce subagent invocation
modelstringNoOverride default model

Built-in Commands

OpenCode includes: /init, /undo, /redo, /share, /help. Custom commands with the same name override built-ins.


Comparison: Pi vs OpenCode

FeaturePi PromptsOpenCode Commands
File formatMarkdownMarkdown or JSON
ConfigurationNoneagent, model, etc.
Shell injection❌ No✅ Yes
File references❌ No✅ Yes
ComplexitySimpleAdvanced
Best forQuick shortcutsComplex workflows

Best Practices

  1. Use descriptive names that don't conflict with built-ins
  2. Keep prompts focused and specific - one task per template/command
  3. Use arguments for reusable templates (Pi) and commands (OpenCode)
  4. Include descriptions for autocomplete suggestions
  5. For Pi: Keep it simple - no shell code or complex logic
  6. For OpenCode: Leverage shell output for dynamic context
  7. Include file references (@) for context-aware commands (OpenCode only)
  8. Test your templates/commands after creating them

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

markdown-converter

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

rodney

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

oebb-scotty

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

improve-skill

No summary provided by upstream source.

Repository SourceNeeds Review