slash-command-encoder
Creates ergonomic slash commands (/command) that provide fast, unambiguous access to micro-skills, cascades, and agents. Enhanced with auto-discovery, intelligent routing, parameter validation, and command chaining. Generates comprehensive command catalogs for all installed skills with multi-model integration.
Best use case
slash-command-encoder is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Creates ergonomic slash commands (/command) that provide fast, unambiguous access to micro-skills, cascades, and agents. Enhanced with auto-discovery, intelligent routing, parameter validation, and command chaining. Generates comprehensive command catalogs for all installed skills with multi-model integration.
Teams using slash-command-encoder should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/slash-command-encoder/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How slash-command-encoder Compares
| Feature / Agent | slash-command-encoder | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Creates ergonomic slash commands (/command) that provide fast, unambiguous access to micro-skills, cascades, and agents. Enhanced with auto-discovery, intelligent routing, parameter validation, and command chaining. Generates comprehensive command catalogs for all installed skills with multi-model integration.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Slash Command Encoder (Enhanced)
## Overview
Creates fast, scriptable `/command` interfaces for micro-skills, cascades, and agents. This enhanced version includes automatic skill discovery, intelligent command generation, parameter validation, multi-model routing, and command chaining patterns.
## Philosophy: Expert Efficiency
**Command Line UX for AI**: Expert users benefit from fast, precise, scriptable interfaces over natural language when performing repeated operations.
**Enhanced Capabilities**:
- **Auto-Discovery**: Scans and catalogs all installed skills automatically
- **Intelligent Routing**: Commands invoke optimal AI/agent for task
- **Parameter Validation**: Type-checked, auto-completed parameters
- **Command Chaining**: Compose commands into pipelines
- **Multi-Model Integration**: Direct access to Gemini/Codex via commands
**Key Principles**:
1. Fast and unambiguous invocation
2. Self-documenting through naming
3. Composable and scriptable
4. Type-safe parameter handling
5. Muscle memory for power users
## When to Create Slash Commands
✅ **Perfect For**:
- Operations performed repeatedly (daily/weekly)
- Workflows that need exact parameters
- Tasks requiring scriptable automation
- Commands that compose into pipelines
- Expert user shortcuts
❌ **Don't Use For**:
- One-off exploratory tasks
- Operations needing natural language nuance
- Tasks better suited to interactive dialogue
## Enhanced Creation Workflow
### Step 1: Auto-Discovery Phase
**Scan Installed Skills**:
```bash
# Discovery algorithm
scan_directories:
- ~/.claude/skills/*/SKILL.md
- .claude/skills/*/SKILL.md
extract_metadata:
- name (command base)
- description (help text)
- inputs (parameters)
- outputs (return types)
- integration_points (routing)
```
**Catalog Generation**:
```yaml
discovered_skills:
micro_skills: [extract-data, validate-api, refactor-code, ...]
cascades: [audit-pipeline, code-quality-swarm, ...]
agents: [root-cause-analyzer, code-reviewer, ...]
multi_model: [gemini-megacontext, codex-auto, ...]
```
### Step 2: Command Design (Enhanced)
#### A. Naming Conventions
**Category Prefixes**:
```bash
# Data operations
/extract-json, /validate-csv, /transform-xml
# Code operations
/lint-python, /test-coverage, /refactor-imports
# Agent invocation
/agent-rca, /agent-reviewer, /agent-architect
# Multi-model
/gemini-search, /codex-auto, /claude-reason
# Workflows
/audit-pipeline, /deploy-prod, /quality-check
```
**Naming Rules**:
- Verb-noun pattern: `/validate-api`, `/extract-data`
- Agent prefix: `/agent-<specialty>`
- Model prefix: `/gemini-*`, `/codex-*`
- Workflow descriptive: `/audit-pipeline`
- Max 3 words, hyphenated
#### B. Parameter Design
**Parameter Types**:
```yaml
positional:
- file_path (required, validated)
- target (required, validated)
flags:
--strict: boolean
--format: enum[json, csv, xml]
--output: file_path
options:
--config: json_object
--schema: file_path
--model: enum[claude, gemini, codex]
```
**Validation Schema**:
```typescript
interface CommandParameter {
name: string
type: 'string' | 'number' | 'boolean' | 'file_path' | 'enum'
required: boolean
default?: any
validation?: RegExp | ((value: any) => boolean)
description: string
completion?: () => string[] // Auto-complete options
}
```
#### C. Multi-Model Routing
**Model Selection Flags**:
```bash
# Explicit model selection
/analyze src/ --model gemini-megacontext # Large context
/prototype feature.spec --model codex-auto # Rapid prototyping
/reason bug-report.md --model codex-reasoning # Alternative view
/review code.js --model claude # Best reasoning (default)
# Auto-select based on task
/analyze-large-codebase # Auto-routes to gemini-megacontext
/rapid-prototype # Auto-routes to codex-auto
/search-current-info # Auto-routes to gemini-search
```
### Step 3: Command Implementation Structure
**Command Definition Template**:
```yaml
command:
name: /command-name
version: 1.0.0
description: |
Brief description of what this command does
category: data | code | agent | workflow | multi-model
parameters:
- name: input
type: file_path
required: true
validation: file_exists
description: Input file to process
- name: --strict
type: boolean
default: false
description: Enable strict validation
- name: --model
type: enum
options: [claude, gemini-megacontext, gemini-search, codex-auto]
default: auto-select
description: AI model to use
routing:
type: micro-skill | cascade | agent | multi-model
target: skill-name | cascade-name | agent-name
model_selection: auto | explicit
binding:
parameter_mapping:
file: ${input}
strictness: ${--strict}
model: ${--model}
output:
format: json | text | file
validation: schema | none
examples:
- command: /command-name input.json --strict
description: Process input.json with strict validation
composition:
chainable: true
pipe_output: stdout
pipe_input: stdin
```
### Step 4: Command Chaining & Composition
**Pipeline Patterns**:
```bash
# Sequential pipeline
/extract data.json | /validate --strict | /transform --format csv > output.csv
# Parallel fan-out
/analyze src/ --parallel [/lint + /security-scan + /test-coverage] | /merge-reports
# Conditional branching
/validate input.json && /deploy-prod || /generate-error-report
# Multi-stage workflow
/audit-pipeline src/ \
--phase theater-detection \
--phase functionality-audit --model codex-auto \
--phase style-audit \
--output report.json
```
**Composition Interface**:
```typescript
interface ChainableCommand {
execute: (input: any) => Promise<CommandResult>
pipe: (next: Command) => ChainableCommand
parallel: (commands: Command[]) => ParallelCommand
conditional: (condition: boolean, ifTrue: Command, ifFalse: Command) => ConditionalCommand
}
```
### Step 5: Auto-Completion & Help
**Completion System**:
```bash
# File path completion
/validate <TAB> # Shows files matching pattern
# Parameter completion
/analyze --<TAB> # Shows available flags
# Model completion
/analyze --model <TAB> # Shows [claude, gemini-megacontext, codex-auto, ...]
# Command discovery
/<TAB> # Shows all available commands by category
```
**Help Generation**:
```markdown
/help command-name
Command: /validate-api
Version: 1.0.0
Category: Data Operations
Description:
Validates API responses against OpenAPI schemas using specialist validation agent
Usage:
/validate-api <file> [--schema <schema_file>] [--strict] [--model <model>]
Parameters:
file Path to API response file (required)
--schema FILE OpenAPI schema file (default: auto-detect)
--strict Enable strict validation mode
--model MODEL AI model [claude|gemini|codex] (default: auto)
Examples:
/validate-api response.json
/validate-api response.json --schema openapi.yaml --strict
/validate-api response.json --model gemini-megacontext
Chains with:
/extract-data → /validate-api → /transform-data
See also:
/validate-csv, /validate-json, /agent-validator
```
## Enhanced Command Templates
### 1. Data Processing Commands
**Template**:
```yaml
command: /process-<datatype>
category: data
routing:
type: micro-skill
target: process-<datatype>
parameters:
- input: file_path (required)
- --format: enum[json, csv, xml]
- --schema: file_path
- --output: file_path
- --model: enum[claude, gemini, codex]
examples:
/extract-json data.json --schema schema.json
/validate-csv data.csv --strict --output report.json
/transform-xml data.xml --format json
```
**Generated Commands**:
- `/extract-json`, `/extract-csv`, `/extract-xml`
- `/validate-json`, `/validate-csv`, `/validate-api`
- `/transform-json`, `/transform-csv`, `/transform-xml`
### 2. Code Operation Commands
**Template**:
```yaml
command: /code-<operation>
category: code
routing:
type: micro-skill | cascade
target: code-<operation>
parameters:
- path: file_path | directory (required)
- --language: enum[python, javascript, typescript, ...]
- --config: file_path
- --fix: boolean (auto-fix issues)
- --model: enum[claude, codex-auto]
examples:
/lint-code src/ --language python --fix
/test-coverage src/ --output coverage-report.json
/refactor-imports src/ --model codex-auto
```
**Generated Commands**:
- `/lint-code`, `/lint-python`, `/lint-javascript`
- `/test-coverage`, `/test-suite`, `/test-watch`
- `/refactor-imports`, `/refactor-di`, `/refactor-patterns`
- `/analyze-complexity`, `/analyze-security`, `/analyze-performance`
### 3. Agent Invocation Commands
**Template**:
```yaml
command: /agent-<specialty>
category: agent
routing:
type: agent
target: <specialty>-agent
model_selection: auto
parameters:
- task: string (required, detailed task description)
- --context: file_path | directory
- --depth: enum[shallow, normal, deep]
- --model: enum[claude, gemini, codex]
examples:
/agent-rca "Debug intermittent timeout in API" --context src/api/
/agent-reviewer src/feature.js --depth deep
/agent-architect "Design user authentication system" --context docs/
```
**Generated Commands**:
- `/agent-rca` → Root Cause Analyzer
- `/agent-reviewer` → Code Reviewer
- `/agent-architect` → System Architect
- `/agent-security` → Security Auditor
- `/agent-performance` → Performance Optimizer
### 4. Multi-Model Commands
**Template**:
```yaml
command: /<model>-<capability>
category: multi-model
routing:
type: multi-model
target: <model>-cli
model: <model>
parameters:
- task: string (required)
- --context: file_path | directory
- --output: file_path
examples:
/gemini-megacontext "Analyze entire 30K line codebase" --context src/
/gemini-search "What are React 19 breaking changes?"
/gemini-media "Generate architecture diagram" --output diagram.png
/codex-auto "Prototype user auth feature" --context spec.md
/codex-reasoning "Alternative algorithm for sorting" --context src/sort.js
```
**Generated Commands**:
- `/gemini-megacontext` → 1M token context analysis
- `/gemini-search` → Real-time web information
- `/gemini-media` → Image/video generation
- `/gemini-extensions` → Figma, Stripe, Postman integration
- `/codex-auto` → Full Auto sandboxed prototyping
- `/codex-reasoning` → GPT-5-Codex alternative reasoning
- `/claude-reason` → Best overall reasoning (default)
### 5. Workflow/Cascade Commands
**Template**:
```yaml
command: /<workflow-name>
category: workflow
routing:
type: cascade
target: <workflow-name>-cascade
parameters:
- target: file_path | directory (required)
- --phase: enum[all, phase1, phase2, phase3]
- --parallel: boolean (enable parallel execution)
- --model: enum[auto, claude, gemini, codex]
- --output: file_path
examples:
/audit-pipeline src/ --output audit-report.json
/quality-check src/ --parallel --model auto
/deploy-prod --phase all --output deployment-log.txt
```
**Generated Commands**:
- `/audit-pipeline` → theater → functionality → style
- `/quality-check` → [lint + security + coverage] → report
- `/deploy-prod` → validate → test → build → deploy
- `/modernize-legacy` → analyze → refactor → test → document
## Integration with Existing Skills
### Command Catalog for Current Skills (14 Total)
**Audit Skills (4 commands)**:
```bash
/theater-detect src/ # Theater detection audit
/functionality-audit src/ # Functionality audit with Codex iteration
/style-audit src/ # Style and quality audit
/audit-pipeline src/ # All 3 phases sequentially
```
**Multi-Model Skills (7 commands)**:
```bash
/gemini-megacontext "task" # 1M token context
/gemini-search "query" # Real-time web info
/gemini-media "description" # Generate images/videos
/gemini-extensions "task" # Figma, Stripe, etc.
/codex-auto "task" # Full Auto prototyping
/codex-reasoning "problem" # GPT-5-Codex alternative view
/multi-model "task" # Intelligent orchestrator
```
**Root Cause Analysis (1 command)**:
```bash
/agent-rca "problem" # Root cause analysis agent
```
**Three-Tier Architecture (2 commands)**:
```bash
/create-micro-skill "task" # Create new micro-skill
/create-cascade "workflow" # Create new cascade
```
### Command Composition Examples
**Example 1: Complete Quality Pipeline**:
```bash
# Sequential quality checks with multi-model routing
/audit-pipeline src/ \
--phase theater-detection \
--phase functionality-audit --model codex-auto \
--phase style-audit --model claude \
--output quality-report.json
```
**Example 2: Root Cause + Fix Workflow**:
```bash
# Analyze problem, then auto-fix with Codex
/agent-rca "Intermittent timeout in API" --context src/api/ | \
/codex-auto "Fix identified root cause" --sandbox true
```
**Example 3: Research + Prototype + Test**:
```bash
# Multi-model cascade
/gemini-search "Best practices for React 19" | \
/codex-auto "Prototype React 19 feature using best practices" | \
/functionality-audit --model codex-auto
```
**Example 4: Parallel Quality Checks**:
```bash
# Fan-out to multiple tools
/quality-check src/ --parallel [
/theater-detect,
/lint-code,
/test-coverage,
/analyze-security
] | /merge-reports --output comprehensive-report.json
```
## Integration with Claude Code Command System
### Command Registration
**Auto-Registration Pattern**:
```bash
# On skill installation, auto-register commands
.claude/skills/*/SKILL.md → parse → generate → .claude/commands/<command>.md
# Command file format
.claude/commands/validate-api.md:
---
name: validate-api
binding: micro-skill:validate-api
---
Validate API responses against OpenAPI schemas.
Usage: /validate-api <file> [--schema <schema>] [--strict]
```
### Command Discovery
**Discovery Mechanism**:
```yaml
on_startup:
- scan ~/.claude/skills/*/SKILL.md
- scan .claude/skills/*/SKILL.md
- parse metadata (name, inputs, category)
- generate command definitions
- register with Claude Code CLI
- build auto-completion index
on_update:
- watch for skill changes
- regenerate affected commands
- update completion index
```
### Parameter Validation
**Validation Pipeline**:
```typescript
interface ValidationPipeline {
// Type checking
validateTypes: (params: any) => ValidationResult
// File existence
validatePaths: (paths: string[]) => ValidationResult
// Enum constraints
validateEnums: (values: any) => ValidationResult
// Custom validators
validateCustom: (value: any, validator: Function) => ValidationResult
// Aggregate results
aggregate: () => ValidationResult
}
// Before command execution
const result = validate(command, parameters)
if (!result.valid) {
throw new ValidationError(result.errors)
}
```
## Command Chaining Patterns
### Pattern 1: Sequential Pipeline
```bash
# Data processing pipeline
/extract-json data.json | \
/validate-api --schema openapi.yaml | \
/transform-json --format csv | \
/generate-report --template summary
```
### Pattern 2: Parallel Fan-Out
```bash
# Parallel quality checks
/analyze src/ --parallel [
/lint-code,
/security-scan --deep,
/test-coverage,
/complexity-analysis
] | /merge-reports --format html
```
### Pattern 3: Conditional Branching
```bash
# Deploy based on quality
/validate-quality src/ && \
/deploy-prod --environment production || \
/generate-quality-report --notify team
```
### Pattern 4: Iterative Refinement
```bash
# Refactor until quality threshold met
while [[ $(quality-score) -lt 85 ]]; do
/refactor-code src/ --model codex-auto
/test-coverage src/
done
```
### Pattern 5: Multi-Model Cascade
```bash
# Research → Design → Implement → Test
/gemini-search "Best practices for feature X" | \
/agent-architect "Design feature X with best practices" | \
/codex-auto "Implement designed feature" | \
/functionality-audit --model codex-auto | \
/style-audit
```
## Best Practices (Enhanced)
### Command Design
1. ✅ Use clear, consistent naming (verb-noun)
2. ✅ Limit positional parameters (max 2-3)
3. ✅ Provide sensible defaults
4. ✅ Enable command chaining
5. ✅ Include comprehensive help
6. ✅ Support model selection for flexibility
### Parameter Design
1. ✅ Type-safe with validation
2. ✅ Auto-completion enabled
3. ✅ Required vs optional clearly marked
4. ✅ Enum constraints for options
5. ✅ File path validation
### Integration Design
1. ✅ Clean routing to skills/agents
2. ✅ Standardized output formats
3. ✅ Composable interfaces
4. ✅ Error handling with clear messages
5. ✅ Progress reporting for long operations
## Working with Slash Command Encoder
**Invocation**:
"Create slash commands for [skill/cascade/agent] with [parameters] that [composition pattern]"
**The encoder will**:
1. Auto-discover all installed skills
2. Design command naming and parameters
3. Create validation schemas
4. Generate command definitions
5. Register with Claude Code CLI
6. Build auto-completion index
7. Produce comprehensive command catalog
**Advanced Features**:
- Automatic skill discovery and catalog generation
- Intelligent multi-model routing
- Type-safe parameter validation
- Command chaining and composition
- Auto-completion for parameters
- Comprehensive help generation
- Integration with Claude Code CLI
**Integration**:
- Works with **micro-skill-creator** for skill-to-command generation
- Works with **cascade-orchestrator** for workflow commands
- Works with **multi-model system** for AI routing
- Works with **audit-pipeline** for quality commands
- Works with **root-cause-analyzer** for debugging commands
---
**Version 2.0 Enhancements**:
- Auto-discovery of all installed skills
- Multi-model intelligent routing
- Command chaining and composition patterns
- Type-safe parameter validation
- Auto-completion system
- Comprehensive command catalog generation
- Integration with Gemini/Codex CLIs
- Enhanced help and documentation generationRelated Skills
linux-commands-guide
Linux Commands Guide - Auto-activating skill for DevOps Basics. Triggers on: linux commands guide, linux commands guide Part of the DevOps Basics skill category.
reviewing-cli-command
Provides checklist for reviewing Typer CLI command implementations. Covers structure, Annotated syntax, error handling, exit codes, display module usage, destructive action patterns, and help text conventions. Use when user asks to review/check/verify a CLI command, wants feedback on implementation, or asks if a command follows best practices.
adding-cli-command
Provides Typer templates, handles registration, and ensures consistency. ALWAYS use this skill when adding or modifying CLI commands. Use when user requests to add/create/implement/build/write a new command (e.g., "add edit command", "create search feature") OR update/modify/change/edit an existing command.
vscode-ext-commands
Guidelines for contributing commands in VS Code extensions. Indicates naming convention, visibility, localization and other relevant attributes, following VS Code extension development guidelines, libraries and good practices
running-dbt-commands
Formats and executes dbt CLI commands, selects the correct dbt executable, and structures command parameters. Use when running models, tests, builds, compiles, or show queries via dbt CLI. Use when unsure which dbt executable to use or how to format command parameters.
../../../engineering-team/incident-commander/SKILL.md
No description provided.
command-creator
This skill should be used when creating a Claude Code slash command. Use when users ask to "create a command", "make a slash command", "add a command", or want to document a workflow as a reusable command. Essential for creating optimized, agent-executable slash commands with proper structure and best practices.
pentest-commands
This skill should be used when the user asks to "run pentest commands", "scan with nmap", "use metasploit exploits", "crack passwords with hydra or john", "scan web vulnerabilities with nikto", "enumerate networks", or needs essential penetration testing command references.
command-management
Use PROACTIVELY this skill when you need to create or update custom commands following best practices
when-creating-slash-commands-use-slash-command-encoder
Create ergonomic slash commands for fast access to micro-skills with auto-discovery and parameter validation
building-commands
Expert at creating and modifying Claude Code slash commands. Auto-invokes when the user wants to create, update, modify, enhance, validate, or standardize slash commands, or when modifying command YAML frontmatter fields (especially 'model', 'allowed-tools', 'description'), needs help designing command workflows, or wants to understand command arguments and parameters. Also auto-invokes proactively when Claude is about to write command files (*/commands/*.md), or implement tasks that involve creating slash command components.
creating-commands
Creates new Claude Code slash commands following best practices. Guides through command structure, naming, arguments, and frontmatter. Use when user wants to create a command, build a slash command, or asks about command best practices.