Slash Command Framework
Relevant source files
The following files were used as context for generating this wiki page:
- CLAUDE.md
- setup/components/commands.py (Referenced via architectural descriptions in CLAUDE.md)
- claudedocs/CSI_WF.md
- Docs/Getting-Started/quick-start.md
- SuperGemini/Commands/index.toml
- Docs/Reference/README.md
The Slash Command Framework is a core component of the SuperGemini ecosystem designed to enhance the Gemini CLI through behavioral instruction injection. It provides a structured set of 18 systematic commands—prefixed with /sg:—that automate complex software development workflows such as analysis, implementation, and testing. Unlike traditional CLI tools that execute binary code at runtime, this framework operates as a configuration distribution system, installing instruction files that modify the AI's behavior directly within the Gemini interface.
Sources: CLAUDE.md:8-13, README.md:16-20, Docs/Getting-Started/quick-start.md:46-51
Framework Architecture
The framework utilizes a dual-layered architecture involving a Python-based installation engine and a Markdown/TOML-based payload. This system ensures that complex behavioral instructions are properly formatted and placed where the Gemini CLI can ingest them.
Injection Mechanism
The lifecycle of a slash command begins as a Markdown file containing structured front matter and instructional content. During the installation process, the Python engine converts these Markdown files into TOML configuration files. These TOML files are then deployed to the user's local directory at ~/.gemini/commands/sg/. When a user types a command (e.g., /sg:analyze) in the Gemini CLI, the CLI reads the corresponding TOML file and injects the predefined prompt into the session context.
Sources: CLAUDE.md:120-134, CLAUDE.md:144-156
Component Structure
The following diagram illustrates the transformation and flow of a slash command from source to the Gemini environment:
The framework separates the "payload" (the .md files in SuperGemini/Commands/) from the "installer" (the Python code in setup/).
Sources: CLAUDE.md:113-125, CLAUDE.md:144-150
Command Syntax and Standards
To maintain consistency across the ecosystem and avoid confusion with related projects (like SuperClaude), the framework enforces strict syntax standards.
Syntax Definitions
| Context | Standard Pattern | Example |
|---|---|---|
| Terminal Commands | Capitalized SuperGemini | SuperGemini install |
| Slash Commands | Lowercase /sg: prefix | /sg:analyze |
| Namespace | Colon-terminated | /sg:[command] |
Sources: claudedocs/CSI_WF.md:65-98, CLAUDE.md:330-345
Prohibited Patterns
The framework explicitly deprecates legacy or cross-project prefixes to ensure user intent is captured correctly within the Gemini environment:
- ❌
/sc:(Reserved for SuperClaude) - ❌
/SG:(Incorrect casing) - ❌
/supergemini:(Full name is not used in the slash prefix)
Sources: claudedocs/CSI_WF.md:88-98, CLAUDE.md:341-344
Core Workflow Commands
The framework provides 18 specialized commands categorized by their role in the development lifecycle. Each command coordinates specific AI agents and Model Context Protocol (MCP) servers.
Primary Workflow Flow
Key Command Descriptions
| Command | Primary Agents | Purpose |
|---|---|---|
/sg:analyze | system-architect, requirements-analyst | Requirements discovery and codebase analysis. |
/sg:implement | backend-architect, security-engineer | Generates feature code with built-in quality gates. |
/sg:workflow | system-architect | Orchestrates multi-step development plans. |
/sg:index | technical-writer, quality-engineer | Generates comprehensive project documentation. |
/sg:test | quality-engineer | Validates code coverage and runs test suites. |
Sources: Docs/Getting-Started/quick-start.md:55-65, SuperGemini/Commands/index.toml:1-10, CLAUDE.md:162-178
Configuration Data Model
Commands are defined using a structured TOML schema that Gemini CLI interprets. This schema includes metadata for agent activation and tool permissions.
TOML Schema Fields
- prompt: The actual instruction string injected into the AI context.
- description: A brief summary of the command's function.
- category: Groups the command (e.g., "special", "workflow").
- mcp_servers: A list of required MCP servers (e.g.,
["sequential", "context7"]). - agents: Specifies which AI personas to activate (e.g.,
["quality-engineer"]).
Sources: CLAUDE.md:151-160, SuperGemini/Commands/index.toml:1-10
Example Configuration Snippet
# SuperGemini/Commands/index.toml (Partial)
name = "index"
description = "Generate comprehensive project documentation"
category = "special"
mcp_servers = ["sequential", "context7", "superagent:gemini"]
agents = ["system-architect", "technical-writer", "quality-engineer"]
Sources: SuperGemini/Commands/index.toml:1-7
Summary
The Slash Command Framework transforms the Gemini CLI into a structured development platform through its specialized /sg: namespace. By leveraging a configuration-based injection system, it enables complex multi-agent orchestration and MCP tool coordination without modifying the underlying CLI source code. This architecture ensures that SuperGemini can provide consistent, high-quality development workflows across different environments by simply distributing behavioral instruction files.
Sources: CLAUDE.md:8-13, README.md:16-20, Docs/Getting-Started/quick-start.md:95-105