# Provider Prompt-File Slash Shortcuts

## Scope

P033 exposes provider-owned Markdown prompt files in the Route C slash panel.
The panel is a composer convenience layer. It does not execute provider-native
commands.

The current live Host session is authoritative for both provider and folder:

```text
Claude -> <session.cwd>/.claude/commands/**/*.md
Codex  -> <session.cwd>/.codex/prompts/**/*.md
```

The Host endpoint is:

```text
GET /agent/prompt-shortcuts?agent_id=<agent-id>&session_id=<session-id>
```

The Host verifies that the session belongs to the requested agent and then
reads only that session's `cwd`. It does not infer the folder from Browser Root
state or another session.

## Discovery

Discovery is an explicit recursive filesystem walk. It includes direct and
nested `.md` files:

```text
.claude/commands/report.md
.claude/commands/reports/daily.md
.codex/prompts/report.md
.codex/prompts/reports/daily.md
```

Non-Markdown files are ignored. Symlink files and symlink directories are
skipped so recursion cannot loop or escape through a symlink.

The extensionless relative path is the slash shortcut name:

```text
report.md               -> /report
reports/daily.md         -> /reports/daily
```

Rows are sorted by relative path. Case-insensitive duplicate names are
resolved deterministically and reported as conflicts.

## Composer Behavior

Selecting a shortcut replaces only the active slash token:

```text
Claude /report
  -> @.claude/commands/report.md

Claude /reports/daily
  -> @.claude/commands/reports/daily.md

Codex /report
  -> @.codex/prompts/report.md

Codex /reports/daily
  -> @.codex/prompts/reports/daily.md
```

One trailing space is inserted after the path. Text outside the active token is
preserved and the caret is placed after the inserted space.

Mouse, Enter, and Tab use the same insertion transaction. Selection does not:

- submit the composer;
- send a Matrix message;
- call a provider command endpoint;
- translate the path into provider-native slash syntax.

Oysterun built-in slash names remain reserved. A conflicting provider prompt
shortcut is omitted from the visible list.

## Prompt Shortcuts Versus Native Commands

Provider registry fields retain their narrow meanings:

```text
capabilities.nativeCommands
  The provider adapter can execute a provider-native command contract.

controls.nativeCommands
  Oysterun exposes a first-party UI control for that native capability.
```

P033 implements neither behavior. Claude and Codex therefore both use:

```text
capabilities.nativeCommands = false
controls.nativeCommands = false
```

Prompt roots use separate registry metadata:

```text
promptShortcuts.directory
promptShortcuts.extension
promptShortcuts.recursive
```

`.claude/commands` is retained as Claude's prompt-file source, but it is not
represented as `nativeConfig.sessionCommandDir`.

## Product Skills And Runtime Capabilities

Provider prompt files are independent of the Oysterun product skill.

Product skill installation checks:

```text
<agent-folder>/.claude/skills/Oysterun
<agent-folder>/.codex/skills/Oysterun
```

That status controls Oysterun skill helper rows and Install/Update actions. It
does not control provider prompt-file rows.

`runtime_capabilities` is another independent contract. It grants an active
agent/session access to Host-backed Oysterun scopes such as Scheduler, Website,
Telegram, Mail, Notifications, and Session operations. Installing a skill,
discovering a prompt file, and receiving a runtime capability grant are three
different operations.

## Failure Behavior

A missing provider prompt directory is a valid empty result.

The Host fails explicitly for:

- a missing or unknown `session_id`;
- an agent/session mismatch;
- an unauthorized session;
- a missing session working directory;
- an existing prompt root that cannot be read;
- a prompt root that resolves outside the agent folder.

The frontend loads prompt shortcuts and Oysterun product skill status
independently. Failure of one source does not remove valid rows from the other
source.
