Agent skill

command-creator

Authoritative templates and scaffolding for creating slash commands. This skill should be used when creating new commands, reviewing existing commands for template compliance, or understanding command structure. Contains YAML templates with section instructions and scaffolding scripts for generating command skeleton files.

Stars 18
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/malhashemi/dotfiles/tree/main/dot_config/opencode/skill/prompter/command-creator

SKILL.md

Command Creator

This skill provides authoritative templates and tools for creating slash commands.

When to Use This Skill

  • Creating new slash commands
  • Reviewing existing commands for template compliance
  • Understanding command structure and patterns

What Commands Are

Commands are task instructions that tell agents WHAT to do. They are:

  • Declarative - Specify the task, not the implementation
  • Agent-executed - Run by a specific agent (defined in frontmatter)
  • User-invoked - Triggered via /command-name syntax
  • Parameterized - Can accept arguments via $ARGUMENTS

Commands live in .opencode/command/ (local) or ~/.config/opencode/command/ (global).

Command Structure

Commands are simpler than agents. A minimal command needs only:

  • Frontmatter: description and agent
  • Instructions: What the agent should do

Optional sections add power when needed:

  • Variables: Reusable values and argument handling
  • Context: Runtime file/command injection
  • Workflow: Multi-phase execution
  • Output Template: Structured output generation

Scripts

Execute scaffolding via justfile or directly with uv:

Via Justfile (Recommended)

bash
just -f {base_dir}/justfile <recipe> [args...]
Recipe Arguments Description
scaffold name path agent Create command skeleton

Direct Execution

bash
uv run {base_dir}/scripts/scaffold_command.py <name> --path <path> --agent <agent>

Examples

bash
# Create a command for the build agent
just -f {base_dir}/justfile scaffold run-tests .opencode/command build

# Create a command for prompter
just -f {base_dir}/justfile scaffold review-code .opencode/command/prompter prompter

# Direct execution
uv run {base_dir}/scripts/scaffold_command.py my-command --path .opencode/command --agent build

Domain Patterns

Argument Handling Pattern

Commands accept user input via $ARGUMENTS. Handle based on usage:

Single-use (argument referenced once):

yaml
## Variables
### Dynamic Variables
FILE_PATH: $ARGUMENTS

## Instructions
Process the file at {{FILE_PATH}}.

Or use {{ARGUMENTS}} directly if simpler.

Multi-use (argument referenced 2+ times):

yaml
## Variables
### Dynamic Variables
FILE_PATH: $ARGUMENTS

## Instructions
Read {{FILE_PATH}}, analyze it, and save results to {{FILE_PATH}}.output.

Why? Only the first $ARGUMENTS gets programmatically swapped. Extract to semantic variable for clarity.

Multiple arguments:

yaml
## Variables
### Dynamic Variables
- ARGUMENTS = $ARGUMENTS
  argument-hint: "[component-name] [optional-variant]"

COMPONENT: [component-name]
VARIANT: [optional-variant]

## Instructions
Generate {{COMPONENT}} with {{VARIANT}} styling.

Freeform Input Pattern

For commands accepting either structured IDs OR freeform text:

yaml
## Variables
### Dynamic Variables
USER_INPUT: $ARGUMENTS

## Instructions
**If {{USER_INPUT}} matches pattern (e.g., ENG-1234)**:
- Execute structured workflow with ID

**If {{USER_INPUT}} provided but doesn't match**:
- Treat as context/filtering criteria

**If no {{USER_INPUT}}**:
- Default behavior (e.g., list recent items)

Benefits: Single variable, maximum flexibility, elegant branching.

Context Injection Pattern

Gather runtime information before execution:

yaml
## Context
Current git status:
!`git status --short`

Project configuration:
@package.json

## Instructions
Based on the current state, ...
  • @file - Inject file contents
  • !command`` - Inject command output

Template Reference

The YAML template in references/command.yaml is the authoritative source for command structure.

Each section contains:

  • id: Unique section identifier
  • title: Section heading
  • type: Content type
  • instruction: Detailed guidance
  • template: Example format
  • optional: Whether section can be omitted

Workflow Integration

When Prompter creates a command:

  1. Understand the task - What should the command accomplish?
  2. Identify the agent - Which agent executes this? (build, prompter, etc.)
  3. Scaffold - Run scaffolding script to create skeleton
  4. Reference template - Read YAML for section instructions
  5. Fill sections - Add only needed sections (keep commands minimal)
  6. Handle arguments - Apply appropriate argument pattern if needed

Expand your agent's capabilities with these related and highly-rated skills.

malhashemi/dotfiles

phase-execution

Your bulletproof guide to executing implementation phases! Handles commits, detects when phases are too big, and knows when to bail cleanly. Load this whenever you're implementing a phase - it provides clean commit protocol and signals the orchestrator when things go sideways.

18 0
Explore
malhashemi/dotfiles

parallel-research

Research scope too big? This skill decomposes large questions into independent parts, spawns parallel researchers, and synthesizes findings. Essential when comprehensive research would overflow a single context window.

18 0
Explore
malhashemi/dotfiles

plan-review

Catch oversized phases BEFORE implementation begins! This skill reviews plans for sizing, dependencies, and completeness - flagging phases that need decomposition before a single line of code is written. Load this when validating plans pre-implementation.

18 0
Explore
malhashemi/dotfiles

brand-palette

Brand color discovery and palette generation skill. This skill should be used when helping users create brand color palettes, design systems, or Tailwind color configs. It guides through hue selection (RYB color wheel), chroma/tone decisions, and generates Obsidian-compatible palette reports with APCA accessibility validation. Supports starting from hex color or OKLCH values for refinement workflows. Triggers: "brand colors", "palette", "color scheme", "design system colors", "Tailwind colors", "generate palette from hex", "generate palette from OKLCH", or when users describe brand values that imply color decisions.

18 0
Explore
malhashemi/dotfiles

pr-review-orchestration

Automated PR review cycle for RPIV orchestration. Waits for Gemini reviews, assesses feedback, implements fixes, and manages the review loop. Used by Planner agent after RPIV opens PRs. This skill is triggered automatically by RPIV when entering the PR Review phase.

18 0
Explore
malhashemi/dotfiles

pr-review

This skill provides a complete workflow for handling GitHub Pull Request reviews, specifically optimized for @gemini-code-assist automated reviews. This skill should be used when addressing PR review comments, responding to reviewers, resolving threads, requesting re-reviews, or merging PRs after feedback is addressed. Triggers include: /pr-review command, "address PR feedback", "handle review comments", "respond to gemini", or any PR review lifecycle management request.

18 0
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results