# Slash-command references

Checkouts live in `references/`. OpenProgram's own design: [Slash commands](https://fzkuji.github.io/OpenProgram/docs/reference/design/cli/slash-commands.html).

## Feature matrix

| Feature | claude-code | opencode | openclaw | hermes | pi-mono |
| --- | --- | --- | --- | --- | --- |
| Filesystem scan | recursive, symlink-safe | glob | none | single directory | none |
| Frontmatter fields | 15+ | 5 | n/a | about 6 | 0 |
| `$ARGUMENTS` | yes | yes | no | yes | no |
| `$0..$9` | yes | yes | no | no | no |
| Named `$name` | yes | no | no | no | no |
| `${ENV_VAR}` | yes | no | no | yes | no |
| `` !`shell` `` | yes | no | no | yes, timeout | no |
| `@file` | no | no | no | no | no |
| Conditional `paths` | yes | no | no | no | no |
| `context: fork` | yes | `subtask` | no | no | no |
| `effort` | yes | no | no | no | no |
| MCP auto-slash | yes | no | no | no | no |
| Embedded hooks | yes | no | no | no | no |
| Multi-directory override | yes | no | no | no | no |
| realpath dedup | yes | no | no | no | no |
| i18n | no | no | yes | no | no |
| Provider routing | no | no | yes | no | no |
| Platform filter | no | no | no | yes | no |
| Dependency check | no | no | `requires`, `install` | no | no |
| Hot reload | yes | no | no | no | no |

All five have a description field. Three or more have name, description and body template, frontmatter parsing, and distinct execution modes.

## What OpenProgram takes

| Project | Taken |
| --- | --- |
| claude-code | Design wholesale: `context: fork`, `paths`, `hooks`, `effort`, realpath dedup, MCP auto-slash |
| opencode | `$0-9` and `arguments[]` |
| openclaw | `requires` as its own field, install hints; descriptions i18n noted as borrowable |
| hermes | Timeout on `!` shell blocks, platform filter idea |
| pi-mono | Hardcoding only for `type: local` builtins; otherwise a counterexample |

## Per project

**claude-code**

[Public skills documentation](https://code.claude.com/docs/en/skills)

| Aspect | Detail |
| --- | --- |
| Locations | Enterprise, personal `~/.claude/skills/`, project `.claude/skills/`, nested, `--add-dir`, plugin |
| On a name clash | Enterprise beats personal, personal beats project; `.claude/commands/` loses to a skill |
| Symlinks, reload | Several locations pointing at one target load once. Skill directories are watched; changes apply in the running session |
| Body | `$ARGUMENTS`, `$N`, `$name`, `${CLAUDE_SKILL_DIR}`, `${CLAUDE_SESSION_ID}`, `${CLAUDE_PROJECT_DIR}`, `${CLAUDE_EFFORT}`, `` !`cmd` `` and ```` ```! ```` blocks. A failing command aborts the invocation |
| Arguments | Quotes keep a multi-word argument whole. Arguments no placeholder receives are appended as `ARGUMENTS: <value>` |
| Modes | Inline; `context: fork` runs in a subagent |
| Frontmatter | `name`, `description`, `when_to_use`, `argument-hint`, `arguments`, `disable-model-invocation`, `user-invocable`, `allowed-tools`, `disallowed-tools`, `model`, `effort`, `context`, `agent`, `background`, `hooks`, `paths`, `shell` |

**opencode**

`references/opencode/packages/opencode/src/config/command.ts`

| Aspect | Detail |
| --- | --- |
| Source | Glob `{command,commands}/**/*.md`, absolute paths. Effect Schema validates and merges with content. No dedup, watch or conditional activation |
| Frontmatter | `template` (required), `description`, `agent`, `model` (ConfigModelID), `subtask` (boolean) |
| Templates | Plain expansion, `$ARGUMENTS`, `$0-9`; `arguments:` declares the list |
| Distinctive | Strongest type safety of the five; `subtask: true` is a simplified fork; MCP skills return a lazy Promise |

**openclaw**

`references/openclaw/src/auto-reply/commands-registry.*`

| Aspect | Detail |
| --- | --- |
| Source | Data-driven hardcoded registry, no filesystem scan, provider-specific mapping (Slack, Mattermost) |
| `ChatCommandDefinition` | `key`, `nativeName`, `nativeAliases?`, `description`, `descriptionLocalizations?`, `scope` (`text` or `native`), `args?`, `acceptsArgs` |
| Distinctive | `resolveNativeName` and the pluginProvider hook; i18n; argument choice menus (`CommandArgChoiceContext`), like a Discord dropdown |
| Skills | `SKILL.md` frontmatter with `emoji`, `requires.anyBins`, `requires.config`, `install[]` |

**hermes-agent**

`references/hermes-agent/tools/skills_tool.py`, `agent/skill_commands.py`, `agent/skill_preprocessing.py`

| Aspect | Detail |
| --- | --- |
| Source | Single `~/.hermes/skills/`: bundled, hub-installed and edited entries coexist; `get_external_skills_dirs()` extends. trusted_roots with traversal protection |
| Frontmatter | `metadata.hermes.config` (variables), `platforms`; `metadata.hermes.*` beats top-level fields |
| Body | `_substitute_template_vars`, `_expand_inline_shell` (timeout), `[Skill config: ...]` injection |
| Distinctive | Platform filter, 134 prompt-injection patterns, `_secret_capture_callback` |

**pi-mono**

`references/pi-ai/packages/coding-agent/src/core/slash-commands.ts`

Hardcoded builtins (settings, model, export, import, fork, clone), no scan. `SlashCommandSource` has extension, prompt and skill, but only builtin is used. The trade-off of no extension mechanism at all.

## Syncing

1. `cd references && git pull`, for example each quarter.
2. Diff each project against the tables above. Decide on new fields, template syntax, modes and security constraints for [Slash commands](https://fzkuji.github.io/OpenProgram/docs/reference/design/cli/slash-commands.html).
3. Update this page.
