# pi-skill-dollar

`pi-skill-dollar` is a small [pi](https://pi.dev) extension that adds a `$` autocomplete shortcut for Agent Skills.

It lets you type `$` anywhere a new token can start and pick from the same skill command list that powers `/skill:<name>`.

## Features

- `$` opens a skill autocomplete picker at prompt start or after whitespace
- `$shi` filters skills as you type
- `Tab` or `Enter` selects the highlighted skill
- `Escape` cancels the picker
- `Space` exits the picker normally unless the typed token is an exact skill match
- `$check ` with an exact skill match rewrites to `/skill:check ` so you can keep typing arguments
- `\$literal` submits as literal `$literal`

## Requirements

- pi 0.73.0 or newer
- Node.js 20.6 or newer when installing from npm/GitHub
- Skill commands enabled in pi (`enableSkillCommands`, enabled by default in recent pi releases)

## Install

Install from npm:

```bash
pi install npm:pi-skill-dollar
```

Install directly from GitHub:

```bash
pi install https://github.com/lhl/pi-skill-dollar
```

Install from a local checkout while developing:

```bash
pi install /home/lhl/github/lhl/pi-skill-dollar
```

Then run `/reload` or restart pi.

## Usage

At the beginning of the input:

```text
$
```

This opens the skill picker. Selecting `check` inserts/submits the native skill command path:

```text
/skill:check
```

Filter by typing:

```text
$shisa
```

When there is an exact skill match, pressing Space accepts it and leaves a trailing space for arguments:

```text
$shisa-kb<space>
# becomes
/skill:shisa-kb 
```

Inline token-boundary usage also works:

```text
Use $shisa-kb to inspect the KB workflow
```

Selecting the skill rewrites just that token:

```text
Use /skill:shisa-kb to inspect the KB workflow
```

Escaping disables the shortcut:

```text
\$not-a-skill
```

## Behavior Notes

`$` only triggers at a token boundary: prompt start or after a space/tab. It does not trigger inside ordinary words.

Examples:

| Input | Behavior |
|---|---|
| `$` | Opens skill picker |
| `$check` | Filters to matching skills |
| `$check<space>` | Exact match: rewrites to `/skill:check ` |
| `$chec<space>` | Not exact: inserts a normal space and closes picker |
| `foo $check` | Opens inline picker |
| `foo$check` | No special handling |
| `\$check` | Literal `$check` |

## Development

```bash
npm install
npm run check
npm test
```

Build artifacts in `dist/` are committed so direct GitHub installs work:

```bash
npm run build
npm pack --dry-run
```

## License

MIT
