What Are the Available Slash Commands in Ponytail and How Are They Defined?

Ponytail exposes six slash commands—/ponytail, /ponytail-review, /ponytail-audit, /ponytail-debt, /ponytail-gain, and /ponytail-help—defined in the SKILL_COMMANDS dictionary in ponytail/main/__init__.py and registered automatically with the Hermes gateway via ctx.register_command.

The DietrichGebert/ponytail repository provides a Hermes plugin that enables lazy senior developer capabilities through intuitive slash commands. These commands allow users to review code, audit repositories for over-engineering, and manage technical debt directly from chat interfaces. Understanding how these slash commands in Ponytail are defined and registered is essential for extending the plugin or integrating it into custom workflows.

Available Slash Commands in Ponytail

Ponytail provides six distinct slash commands that trigger specific skills or configuration changes:

  • /ponytail: Sets the operational mode (lite, full, ultra, or off) for the lazy senior developer assistant.
  • /ponytail-review: Reviews the current diff or a specified target for over-engineering.
  • /ponytail-audit: Audits the entire repository for over-engineering patterns and deletion opportunities.
  • /ponytail-debt: Harvests all ponytail: comments into a tracked technical debt ledger.
  • /ponytail-gain: Displays the measured-impact scoreboard showing metrics for less code, reduced cost, and improved speed.
  • /ponytail-help: Shows the complete Ponytail command reference.

The first command (/ponytail) is handled separately as a mode configuration command, while the remaining five are defined collectively in the SKILL_COMMANDS mapping.

How Slash Commands Are Defined in the Source Code

The definition of slash commands in Ponytail follows a two-part structure: the descriptive mapping and the registration logic.

The SKILL_COMMANDS Dictionary

Command definitions reside in ponytail/main/__init__.py within the SKILL_COMMANDS dictionary (lines 14-20). This mapping associates command names with human-readable descriptions:

SKILL_COMMANDS = {
    "ponytail-review": "Review the current diff or provided target for over-engineering.",
    "ponytail-audit": "Audit the repo for over-engineering and deletion opportunities.",
    "ponytail-debt": "Harvest every `ponytail:` comment into a tracked debt ledger.",
    "ponytail-gain": "Show the measured-impact scoreboard (less code, less cost, more speed).",
    "ponytail-help": "Show the Ponytail command reference.",
}

The /ponytail mode command is excluded from this dictionary because it uses a dedicated handler function rather than the skill-based routing system.

Command Registration and Routing

Registration with the Hermes Gateway

The register() function in ponytail/main/__init__.py (lines 205-218) handles the actual registration of slash commands in Ponytail with the Hermes context:

ctx.register_command(
    "ponytail",
    _handle_mode_command,
    description="Set Ponytail lazy senior dev mode: lite, full, ultra, or off.",
    args_hint="[lite|full|ultra|off]",
)
for command, description in SKILL_COMMANDS.items():
    ctx.register_command(
        command,
        _make_skill_command_handler(ctx, command),
        description=description,
        args_hint="[target or notes]",
    )

This code registers the mode command individually, then iterates through SKILL_COMMANDS to register each skill-based command with _make_skill_command_handler as its callback.

Slash Command Routing Logic

Incoming messages are intercepted by rewrite_gateway_command (lines 55-65), which processes text starting with "/":

if text.startswith("/"):
    head, _, rest = text[1:].partition(" ")
    command = head.replace("_", "-").lower()
    if command not in SKILL_COMMANDS:
        return None
    if _slash_access_denied(event, gateway, command):
        return None
    return {"action": "rewrite", "text": _skill_prompt(command, rest)}

This function normalizes command names (replacing underscores with hyphens), validates against SKILL_COMMANDS, checks access permissions via _slash_access_denied, and rewrites valid commands into standard agent prompts using _skill_prompt.

Practical Usage Examples

Switching Operational Modes

To change the Ponytail analysis intensity:

/ponytail ultra

This triggers _handle_mode_command in ponytail/main/__init__.py, configuring the plugin for maximum analysis depth.

Triggering Code Review

To review current changes for over-engineering:

/ponytail-review

The rewrite_gateway_command function transforms this into a full skill prompt:

Load and follow the Hermes plugin skill `ponytail:ponytail-review`. Review the current diff or provided target for over-engineering.

Passing Arguments to Commands

Slash commands in Ponytail accept optional arguments passed to the underlying skill:

/ponytail-gain my-project

This becomes:

Load and follow the Hermes plugin skill `ponytail:ponytail-gain`. Show the measured-impact scoreboard (less code, less cost, more speed). User arguments: my-project

Summary

  • Six commands are available: /ponytail, /ponytail-review, /ponytail-audit, /ponytail-debt, /ponytail-gain, and /ponytail-help.
  • Definitions are stored in the SKILL_COMMANDS dictionary in ponytail/main/__init__.py.
  • Registration occurs through ctx.register_command in the register() function, with the mode command handled separately from skill commands.
  • Routing is managed by rewrite_gateway_command, which validates commands against the SKILL_COMMANDS keys and rewrites them into agent prompts.
  • Access control is enforced via _slash_access_denied before command execution.

Frequently Asked Questions

How do I add a new slash command to Ponytail?

Add the command name and description to the SKILL_COMMANDS dictionary in ponytail/main/__init__.py (around line 14). The existing registration loop in the register() function will automatically pick up the new entry and register it with the Hermes gateway. Ensure you also create the corresponding skill file in the commands/ directory.

Why is the /ponytail mode command defined separately from other slash commands?

The /ponytail command controls the plugin's operational state (lite, full, ultra, off) and uses _handle_mode_command as its direct handler. Unlike skill-based commands that load external prompt files, this command modifies internal configuration state, requiring a different registration pattern in ponytail/main/__init__.py.

What happens if I try to use a slash command that isn't in SKILL_COMMANDS?

The rewrite_gateway_command function checks if the normalized command name exists in SKILL_COMMANDS. If not found, the function returns None, which prevents the command from being processed. No error message is generated by the routing logic itself; the message simply passes through without trigger.

Can slash commands in Ponytail be restricted based on user permissions?

Yes. The rewrite_gateway_command function calls _slash_access_denied(event, gateway, command) before executing any command. This function checks access controls, and if it returns True, the command is blocked and returns None, preventing unauthorized users from triggering expensive operations like repository audits.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →